curious_engineer said:your LSB is bit 11 and MSB is bit 0 (it's flipped, no big deal).
curious_engineer said:Hi all,
I am trying to simulate a 12-bit DAC in Cadence, specifically, the output voltage at every digital input combination. I want to input all digitial input combinations from 000000000000 to 111111111111 (0 to 4096), incrementing by 1 each time. I would then be able to use the output values to calculate dnl,inl, etc.
The problem is that is it not very feasible to set these inputs using 12 vpulse or pwl components.
Don't know how it would work with ocean, but in any case Spectre provides an option for its transient analysis called strobing, which should do exactly what you want. The method is explained in Ken Kundert's book "The Designer's Guide to SPICE & SPECTRE", Chap. 4.4.10 Strobing. Or may be you can find out about strobing in Cadence workshops.curious_engineer said:Anyways, now I am wondering how I can easily extract Vout data at each relevant time increment to capture the output voltage for each input combination. So say I want to record the output value at every 48us, store the values to a table, and somehow have the file saved as a text file.
I tried manually simulating this, but it takes forever. I would like to simply run the simulation and have it automatically create a text file with these Vout values stored. Is this possible by perhaps adding some lines in the ocean script?
openResults( <your_result_dir> )
selectResults( 'tran )
fid = outfile( "<your_data_file>" "w")
tsample_list = cross( VT( "/clk" <your_result_dir> ), 0.55, 0, "rising" )
foreach( tsample tsample_list
dac_out = value( VT("/dac_out" <your_result_dir> ), tsample )
fprintf( fid "%g\t%g\n" tsample dac_out )
drain( fid )
)
close( fid )
curious_engineer said:for(x 1 3
time = x*0.000001 - 1*0.000001
fprintf(out "%5.3f " time)
fprintf(out "%1.6e \n" value(VT("/dacout"), time))
)
close(out)
The time was not incrementing, so it just listed the same line 3 times. It looked like:
0.0000 value
0.0000 value
0.0000 value
I wasn't able to figure out the problem with that. I guess I will try the foreach method.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?