Poor font rendering
I have just tried to run this on both my pc (arch linux) running ngspice 44.2 and another (ubuntu) running ngspice 42. In both of them, it just hangs. Could this be a linux this ? Also, my version does not print the time (Device Setup finished after 42.166 seconds.) like yours.
Thanks, but can you test on the current stable version ?
Alter command hangs forever on large netlist
I just checked. ngspice is already running on all cores. So, it makes no sense to use multiprocessing in this case. Setting the number of processes in the python code to 4 or more almost slows things down to a complete crawl. Probably, it's because of the resource contention and context swithcing happening. Seems that there's nothing to do from my end. Thanks.
Not that much. I have 32GB installed. When building the lookup table, the total system usage including all opened directory is less than 7GB. There is a sample file, which you can run on your computer if you have python (+ ngspice, matplotlib, and scipy). Change the n_process to a number other than 1 and you will notice the slow down.
I am the author of a tool called mosplot that uses ngspice to create a lookup table of all the mosfet parameters to be used in offline optimization of analog circuits. To speed up the generation of the lookup table, I am using multiporcessing in python to launch several instances of ngspice. This is the snippet of the code that I am using to call ngspice. cmd = f"{self.simulator_path} -b -o {self.log_file_path} {self.input_file_path}" result = subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL,...
I am the author of a tool called mosplot that uses ngspice to create a lookup table of all the mosfet parameters to be used in offline optimization of analog circuits. To speed up the generation of the lookup table, I am using multiporcessing in python to launch several instances of ngspice. This is the snippet of the code that I am using to call ngspice. cmd = f"{self.simulator_path} -b -o {self.log_file_path} {self.input_file_path}" result = subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL,...
I am the author of a tool called mosplot that uses ngspice to create a lookup table of all the mosfet parameters to be used in offline optimization of analog circuits. To speed up the generation of the lookup table, I am using multiporcessing in python to launch several instances of ngspice. This is the snippet of the code that I am using to call ngspice. cmd = f"{self.simulator_path} -b -o {self.log_file_path} {self.input_file_path}" result = subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL,...
I am the author of a tool called mosplot that uses ngspice to create a lookup table of all the mosfet parameters to be used in offline optimization of analog circuits. To speed up the generation of the lookup table, I am using multiporcessing it python to launch several instances of ngspice. This is the snippet of the code that I am using to call ngspice. cmd = f"{self.simulator_path} -b -o {self.log_file_path} {self.input_file_path}" result = subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL,...
I am the author of a tool called (mosplot that uses ngspice to create a lookup table of all the mosfet parameters to be used in offline optimization of analog circuits. To speed up the generation of the lookup table, I am using multiporcessing it python to launch several instances of ngspice. This is the snippet of the code that I am using to call ngspice. cmd = f"{self.simulator_path} -b -o {self.log_file_path} {self.input_file_path}" result = subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL,...
@h_vogt, thanks. This fixed the issue. Can't believe I missed it. For some reason, it worked fine on Linux, but not on Windows. Why so?
I have written a python wrapper that uses the ngspice shared library. I have tested it on Linux and it works great. I thought I should make it work on Windows just in case. I downloaded the ngspice shared library for Windows (ngspice-43_dll_64.7z) and added the folder dll-vs to the path variable. The script runs but as soon as it hits the section where it needs to initalize ngSpice (below) with the callbacks, the program just exists. self.libngspice.ngSpice_Init( self.callbacks.SendChar, self.callbacks.SendStat,...
I have written a python wrapper that uses the ngspice shared library. I have tested it on Linux and it works great. I thought I should make it work on Windows just in case. I downloaded the ngspice shared library for Windows (ngspice-43_dll_64.7z) and added the folder dll-vs to the path variable. The script runs but as soon as it hits the section where it needs to initalize ngSpice (below) with the callbacks, the program just exists. self.libngspice.ngSpice_Init( self.callbacks.SendChar, self.callbacks.SendStat,...
I have written a python wrapper that uses the ngspice shared library. I have tested it in Linux and it works great. I thought I should make it work on Windows just in case. I downloaded the ngspice shared library for Windows (ngspice-43_dll_64.7z) and added the folder dll-vs to the path variable. The script runs but as soon as it hits the section where it needs to initalize ngSpice (below) with the callbacks, the program just exists. self.libngspice.ngSpice_Init( self.callbacks.SendChar, self.callbacks.SendStat,...
I am using the C api to interract with ngspice. Sometimes, I have an interest in seeting the matrix that gets simulated. The mdump and mrdump commands can be used to do so. However, this requires first dumping to a file, which requires parsing afterwards. Is it possible to get the matrix values directly without dumping to a file?
Thanks.
I am using the C api to interract with ngspice. After loading the netlist, I passed the byte-string pre_osdi path to the ngSpice_Command method. I get the error message stderr pre_osdi: no such command available in ngspice. Sending other commands like op works fine. Also, executing the netlist in batch mode works fine. For some reason, the C api does not recongnize the pre_osdi command or I need to send it with something other than ngSpice_Command?
Thanks for the response. This fixed the issue for me. I have one more question if you don't mind. Let's say I want to change the value of the current through 5 current sources. What's the fastest way to do it? Do I just send one alter command after the other, or is there some other more efficient way to do this?
.subckt c1 out1 out2 out3 I1 0 out1 DC 1mA I2 0 out2 DC 1mA I3 0 out3 DC 1mA .ends c1 Xc1 out1 out2 out3 SUBCKT1, .op .end Consider the simple circuit above. Assume that the circuit has been properly formatted to type char**. Using the C interface, we first need to load the circuit into the simulator using ngSpice_Circ, after which we can use the run commnd to run the simulation. # define circuit elsewhere ngSpice_Circ(circuit) ngSpice_Command("run"); Suppose after I have run the circuit, I want...
@dwarning, thanks for reply. The issue was due to me using @m1[id]. Using i(vds) fixed the issue.
* Test * .include '/home/medwatt/models/NMOS_VTH.lib' VGS NG 0 DC=0 VBS NB 0 DC=0 VDS ND 0 DC=0 M1 ND NG 0 NB NMOS_VTH l=6.4e-06 w=1e-05 .options TEMP = 27 .options TNOM = 27 .control save @m1[id] dc VDS 0.0 1.0 0.01 VGS 0.0 1.0 0.01 write /tmp/tmps74832zi all .endc .end
* Test * .include '/home/medwatt/models/NMOS_VTH.lib' .include '/home/medwatt/models/PMOS_VTH.lib' VGS NG 0 DC=0 VBS NB 0 DC=0 VDS ND 0 DC=0 M1 ND NG 0 NB NMOS_VTH l=6.4e-06 w=1e-05 .options TEMP = 27 .options TNOM = 27 .control save @m1[id] dc VDS 0.0 1.0 0.01 VGS 0.0 1.0 0.01 write /tmp/tmps74832zi all .endc .end
Discrepancy between ngspice and hspice in current for low vgs