Transistor operating point printer: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 31: | Line 31: | ||
== Copy the file to your computer and convert the values == | == Copy the file to your computer and convert the values == | ||
After running the script, you can open the results file from the terminal using for example: <code> gedit transistors.csv & </code> or alternatively to get the file out from mikroserver | After running the script, you can open the results file from the terminal using for example: <code> gedit transistors.csv & </code> or alternatively to get the file out from the mikroserver you use to another computer try this: | ||
to another computer try this: | |||
Create a file named "Makefile" and put this into it: | Create a file named "Makefile" and put this into it: | ||
Line 40: | Line 38: | ||
all: get fix clean | all: get fix clean | ||
# gets the file from | # gets the file from your mikroserver and copies it to your computer in the root of your homefolder | ||
get : | get : | ||
scp my_user_name@mikroserver:~/tsmc/transistors.csv ~/transistors_raw.csv | scp my_user_name@mikroserver:~/tsmc/transistors.csv ~/transistors_raw.csv | ||
Line 53: | Line 51: | ||
Modify the scp-command to use | Modify the scp-command to use | ||
* The username and the correct | * The username and the correct mikroserver in the scp-command | ||
* change the folder on mikroserver where the transistors.csv is created, default is /home/$user/tsmc/ | * change the folder on mikroserver where the transistors.csv is created, default is /home/$user/tsmc/ | ||
* change the local folder where you want your copy to be placed, default is /home/$user/ | * change the local folder where you want your copy to be placed, default is /home/$user/ |
Latest revision as of 11:56, 30 May 2024
DC operating parameters from simulation
This script can be used to print the operating point parameters of all transistors in your design and save them to a file.
If you just want to view them in Virtusoso have a look at this guide instead: DCoperatingparameters
Get the DC operating points from a previous simulation
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 test with DC analysis, and remember to check the box with "Save DC Operating Point" :
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")
Copy the file to your computer and convert the values
After running the script, you can open the results file from the terminal using for example: gedit transistors.csv &
or alternatively to get the file out from the mikroserver you use to another computer try this:
Create a file named "Makefile" and put this into it:
# target that is the first (and default) and does all the stuff below all: get fix clean # gets the file from your mikroserver and copies it to your computer in the root of your homefolder get : scp my_user_name@mikroserver:~/tsmc/transistors.csv ~/transistors_raw.csv # converts transitors.csv to a copy where all the postfixes for the SI units generated from Virtuoso (m, f, K etc), has been replaced with E-3, E-15, E+3 etc, so the values are useable in LibreOffice fix : 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_raw.csv > transistors.csv # removes the not-fixed copy clean: rm transistors_raw.csv
Modify the scp-command to use
- The username and the correct mikroserver in the scp-command
- change the folder on mikroserver where the transistors.csv is created, default is /home/$user/tsmc/
- change the local folder where you want your copy to be placed, default is /home/$user/
Now you can type make
in the folder you created the Makefile and the latestst simulation data will appear in your homefolder.
Open the file in Libre Office
The resulting transistors.csv can then 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:
Troubleshooting
For the scp-command to work without password you have to set up your connection as described in MikroserverSetup