Transistor operating point printer: Difference between revisions

From ift
(Added sed command to convert transistors.csv)
Line 1: Line 1:
= DC operating parameters from simulation =
This script can be used to print the operating point parameters of all transistors in your design.  
This script can be used to print the operating point parameters of all transistors in your design.  


Line 34: Line 35:


[[File:Csv_import_libreoffice.png | 500px]]
[[File:Csv_import_libreoffice.png | 500px]]
== Importing the data into LibreOffice ==
To use transistors.csv one has to get rid of the postfixes for the SI units generated from Virtuoso (m, f, K etc). To do this navigate to the folder with the transistors.csv and type this command:
sed -e 's/\([0-9]\+\)m/\1E-3/g' -e 's/\([0-9]\+\)u/\1E-6/g' -e 's/\([0-9]\+\)n/\1E-9/g' -e 's/\([0-9]\+\)p/\1E-12/g' -e 's/\([0-9]\+\)f/\1E-15/g' -e 's/\([0-9]\+\)a/\1E-18/g' -e 's/\([0-9]\+\)z/\1E-21/g' -e 's/\([0-9]\+\)y/\1E-24/g' -e 's/\([0-9]\+\)K/\1E+3/g' -e 's/\([0-9]\+\)M/\1E+6/g' -e 's/\([0-9]\+\)G/\1E+9/g' -e 's/\([0-9]\+\)T/\1E+12/g' transistors.csv > transistors_fixed.csv
That converts transitors.csv to transistors_fixed.csv where all the SI-symbols has been replaced with E-3, E-15, E+3 etc, so the values are useable in LibreOffice


[[Category:Mikroelektronikk]] [[Category:Integrated_Circuts]]
[[Category:Mikroelektronikk]] [[Category:Integrated_Circuts]]

Revision as of 14:53, 23 October 2017

DC operating parameters from simulation

This script can be used to print the operating point parameters of all transistors in your design.


Navigate to the folder you want to save the script in (this tutorial uses the home (./) directory) and create a new file in the terminal by entering touch transistors.ocn . Open the file by writing gedit transistors.ocn & and copy the following script into the document. Change ./transistors.csv in the script if you want another output file name and/or location. Save the file.

selectResult('dcOpInfo)
report(?output "./transistors.csv" ?param list("gm" "gmb" "gmoverid" "gds" "id" "idsat" "vth" "region" "cgs" "cgd" "self_gain" "type" "vds" "vdsat" "vgs") ?format "spice" ?maxLineWidth 1000)

file = outfile("./transistors.csv" "a")
fprintf(file "\n\nRegion 0 is cutoff.\nRegion 1 is linear.\nRegion 2 is saturation .\nRegion 3 is subthreshold.\nRegion 4 is breakdown.\n\nType 0 is nMOS. \nType 1 is pMOS.")
close(file)

For the IHP design kit use:

selectResult('dcOpInfo)
report(?output "./transistors.csv" ?param list("model" "gm" "gmb" "gds" "ids" "idsat" "vth" "region" "cgs" "cgd" "vds" "vsat" "vgs") ?format "spice" ?maxLineWidth 1000)

file = outfile("./transistors.csv" "a")
fprintf(file "\n\nRegion 0 is cutoff.\nRegion 1 is linear.\nRegion 2 is saturation .\nRegion 3 is subthreshold.\nRegion 4 is breakdown.\n\nType 0 is nMOS. \nType 1 is pMOS.")
close(file)

This script uses the results from the previous Debug Test (from ADE XL Test Editor). Before running the script, run a Debug Test with DC analysis:

Run debug simulation.png


After running DC analysis, run the script by entering the following into the Virtuoso Log Window (with file name and location as mentioned above): load("./transistors.ocn")

Run transistors script.png


After running the script, you can open the results file from the terminal using for example: gedit transistors.csv &


The results file can also be imported into LibreOffice Calc (similar to Microsoft Excel) using File->Open, then choose the .csv file and enter the settings as in the following image:

Csv import libreoffice.png

Importing the data into LibreOffice

To use transistors.csv one has to get rid of the postfixes for the SI units generated from Virtuoso (m, f, K etc). To do this navigate to the folder with the transistors.csv and type this command:

sed -e 's/\([0-9]\+\)m/\1E-3/g' -e 's/\([0-9]\+\)u/\1E-6/g' -e 's/\([0-9]\+\)n/\1E-9/g' -e 's/\([0-9]\+\)p/\1E-12/g' -e 's/\([0-9]\+\)f/\1E-15/g' -e 's/\([0-9]\+\)a/\1E-18/g' -e 's/\([0-9]\+\)z/\1E-21/g' -e 's/\([0-9]\+\)y/\1E-24/g' -e 's/\([0-9]\+\)K/\1E+3/g' -e 's/\([0-9]\+\)M/\1E+6/g' -e 's/\([0-9]\+\)G/\1E+9/g' -e 's/\([0-9]\+\)T/\1E+12/g' transistors.csv > transistors_fixed.csv

That converts transitors.csv to transistors_fixed.csv where all the SI-symbols has been replaced with E-3, E-15, E+3 etc, so the values are useable in LibreOffice