When I hit the simulation button in xschem I get t...
# xschem
m
When I hit the simulation button in xschem I get the following message on the terminal stating that it has started the simulation, but it stays there and does not complete the simulation, on the other hand, in the same directory if I run ngspice separately on the terminal with my generated netlist from xschem then it works fine. And yes I have .spiceinit in the same directory in which I am running ngspice.
s
go to menu
SImulation->Configure Simulators and tools
, go to the first ngspice row and check
Status
checkbutton, then click '`Accept and close`'. It will tell you the reason for the failure after pressing Simulation button. It is probably because you don't have the xterm terminal installed. to fix:
sudo apt install xterm
You can use another terminal program if you want by changing the definition of variable
terminal
in your xschemrc.
m
Yes that was the problem, thanks for the help. Just two other things, (1)To measure current through the transistor terminals do we have to add a zero-valued voltage source in series to probe the current or is there a way I can probe the terminals for the current directly.(2) How to configure xschem to use its waveform viewer instead of ngspice's waveform viewer.
s
You can add command .option savecurrents, all drain currents will be saved. Adding an ammeter.sym (or a 0V vsource, the ammeter is indeed a 0V voltage source) is also veri useful. To use xschem internal viewer ensure you save the simulation in a raw file. use write file.raw command after the tran command:
Copy code
.option savecurrents
.control
  ...
  save all
  tran 1n 2u
  write circuit.raw
  ...
.endc
Use for the raw filename the same name of the circuit. If you are simulating
opamp.sch
save into
opamp.raw
. Then follow this manual page.
m
I just did what you said, but for some odd reason, ngspice is not writing the .raw file in the directory, and yes I have made sure that the name of the .sch and the .raw files are the same.
s
The raw file is written in the simulation directory, in the same directory where the .spice file is generated. By default in
~/.xschem/simulations
. If it is not there, you can discover where it is by typing in the xschem terminal:
puts $netlist_dir