Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all articles
Browse latest Browse all 5066

Plotting stb/xf simulation results coming from different result folders via SKILL

$
0
0

IC6.1.7-64b.500.13

Hi all,

I have some Monte Carlo simulation results distributed in several folders and I want to recursively go through them and plot in ViVA. For this I have created the ocean script below. It allows me to access most of the simulation results the way I intend to, however, it does not work for stb (gain, phase) or for xf results. Could you point me to what I'm doing wrong or a workaround to my approach?

list_of_folders = pcreMatchList("MC" getDirFiles(root_folder)); root_folder has previously being defined

;for creating histograms is necessary to artificially generate a waveform and use histogram2D function. vectors to
;store measurement data or dcOp points are needed within the for loop for later processing.

;definition of vectors to be used

xaxis = drCreateVec('double 300) ; vector containing the sample number

dc_vref_lownoise_1v2 = drCreateVec('double 300)
dc_ibias1uA = drCreateVec('double 300)
ppm_vref_lownoise_1v2 = drCreateVec('double 300)
ppm_ibias1uA = drCreateVec('double 300)
dcGain = drCreateVec('double 300)
pm = drCreateVec('double 300)
gm = drCreateVec('double 300)
ugf = drCreateVec('double 300)
widebandNoise = drCreateVec('double 300)


for(i 0 9
mc_folder = strcat(root_folder "/" nth(i list_of_folders) "/psf")
resultsDir(mc_folder); Define the directory where to check for results

;extract the data to be presented as a family of plots. This data can be directly obtained from the results folder

tran_vref_lownoise_1v2 = v("a_vref_lownoise_1v2" ?result 'tran ?resultsDir mc_folder)
plot(tran_vref_lownoise_1v2)

temp_vref_lownoise_1v2 = v("a_vref_lownoise_1v2" ?result 'dc ?resultsDir mc_folder)
plot(temp_vref_lownoise_1v2)

tran_ibias1uA = i("/IPRB1/PLUS" ?result "tran" ?resultsDir mc_folder)
plot(tran_ibias1uA)

temp_ibias1uA = i("/IPRB1/PLUS" ?result "dc" ?resultsDir mc_folder)
plot(temp_ibias1uA)

tran_vrefhdreg_1v2 = v("/a_vref_hd_hdreghv_1v2" ?result "tran" ?resultsDir mc_folder)
plot(tran_vrefhdreg_1v2)

temp_vrefhdreg_1v2 = v("/a_vref_hd_hdregflash_1v2" ?result "dc" ?resultsDir mc_folder)
plot(temp_vrefhdreg_1v2)

dB20 = dB20(mag(getData("loopGain" ?result "stb" ?resultsDir mc_folder))) ;doesn't work
plot(dB20)

phase = phaseDegUnwrapped(getData("loopGain" ?result "stb" ?resultsDir mc_folder)) ;doesn't work
plot(phase)

outputNoise = getData("out" ?result "noise" ?resultsDir mc_folder) ;WORKS! :)
plot(outputNoise)

psrr = db(getData("/V0" ?result "xf")) ;doesn't work
plot(psrr)

;HISTOGRAM VECTORS
drSetElem(xaxis i i)
; low noise 1.2V reference
yaxis = value(v("a_vref_lownoise_1v2" ?result 'dcOp ?resultsDir mc_folder) 0)
drSetElem(dc_vref_lownoise_1v2 i yaxis)

; 1.0 uA bias current
yaxis = value(i("/IPRB1/PLUS" ?result "dcOp" ?resultsDir mc_folder) 0)
drSetElem(dc_ibias1uA i yaxis)
)
;CREATE AND PLOT THE HISTOGRAMS

newWindow()
theWave=drCreateWaveform(xaxis dc_vref_lownoise_1v2)
theHistogram = histogram2D(theWave 10 "standard" t t)
plot(theHistogram)

newWindow()
theWave=drCreateWaveform(xaxis dc_ibias1uA)
theHistogram = histogram2D(theWave 10 "standard" t t)
plot(theHistogram)

Thanks in advance,


Viewing all articles
Browse latest Browse all 5066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>