Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOS Devices Tests Aren't Working. #158

Open
AhmedLilah opened this issue Jul 14, 2024 · 9 comments
Open

MOS Devices Tests Aren't Working. #158

AhmedLilah opened this issue Jul 14, 2024 · 9 comments

Comments

@AhmedLilah
Copy link

Environment

  • Klayout Version: N/A
  • OS/Platform: Ubuntu

Expected Behavior

provided MOS tests to run.

Actual Behavior

when I run any of the tests in xschem for the most devices I get an error while running ngspice saying

Error on line: 
< the instance line>
unknown device type - error
        Simulation interrupted due to error!

this is not the case with passives and BJTs it only happens with most devices the rest are working fine.

Steps to Reproduce the Problem

  1. install the ihp-sg13g2 PDK using the make files and the python script in the xschem folder.
  2. copy the ihp-sg13g2 PDK to the PDK_ROOT directory ( in my case /usr/local/share/pdk/)
  3. copy the xschemrc file in xschme to my test directory
  4. run xschem
  5. open the test mos test.
  6. netlist and run.
@KrzysztofHerman
Copy link
Contributor

@AhmedLilah thank you for reporting this issue.
Our MOS devices use PSP103 model, which is included in ngspice control section as a binary file using the following command: 'pre_osdi ./psp103_nq.osdi' Because of the license agreement we can not distribute the osdi binary but we do redistribute source code of the PSP103 model. The Verilog-A code can be compiled using opencaf (the install.py script does it). The potential issue is that since your PDK_ROOT points to the /usr/local/share/pdk running install.py does not take effect. Try first export the PDK_ROOT to point to the actual place where you clone it, execute install.py. It is mandatory to have openvaf installed.

@KrzysztofHerman
Copy link
Contributor

@AhmedLilah was the above comment helpful ?

@AhmedLilah
Copy link
Author

Unfortunately no, I installed it according to what you said and it still doesn't work.

@KrzysztofHerman
Copy link
Contributor

Did you try our latest updates, where .spiceinit is used to let the simulator know about the models and the osdi file ?
If no try to update the dev branch and run install.py once more.

@AhmedLilah
Copy link
Author

AhmedLilah commented Aug 5, 2024

@KrzysztofHerman

I did pull the dev branch and run the python script and opened xschem in the pdk example file and ran the moslv test and got this

image

@KrzysztofHerman
Copy link
Contributor

  1. Make sure that you have exported the env variables
export PDK_ROOT=/home/$USER/your_directory/IHP-Open-PDK
export PDK=ihp-sg13g2 
export KLAYOUT_PATH="/home/$USER/.klayout:$PDK_ROOT/$PDK/libs.tech/klayout"
export KLAYOUT_HOME=/home/$USER/.klayout 

Note that the klayout related stuff is not used in the simulation but you will need this when making layout.

  1. after running $PDK_ROOT/$PDK/libs.tech/xschem/install.py make sure that .spiceinit symbolic link is created in /home/$USER and it points to the $PDK_ROOT/$PDK/libs.tech/ngspice/.spiceinitfile
  2. make sure that the file $PDK_ROOT/$PDK/libs.tech/ngspice/openvaf/psp103_nqs.osdi exists
  3. run xschem in $PDK_ROOT/$PDK/libs.tech/xschem directory

Alternatively you can run this netlist directly in ngspice

*
.lib cornerMOSlv.lib mos_tt
Vgs net1 GND 0.4
Vds net3 GND 1.0
Vd net3 net2 0
.param temp=27
XM1 net2 net1 GND GND sg13_lv_nmos w=1.0u l=0.13u ng=1 m=1
.control
save all
op
let Id = @n.xm1.nsg13_lv_nmos[ids] 
print Id
.endc
.GLOBAL GND
.end

@KrzysztofHerman
Copy link
Contributor

Can we close the issue ?

@sergeiandreyev
Copy link
Contributor

Hi @AhmedLilah, do you have some feedback or additional questions on this item? Otherwise we are going to close the issue as solved.

@AhmedLilah
Copy link
Author

AhmedLilah commented Sep 11, 2024

@sergeiandreyev

I will revisit the problem once again and get back if anything changed.

But based on the past comment it didn't get solved after setting the enviroment variables and compiling the files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants