<@U01819B63HP> I am facing issue in simulating DFF...
# xschem
v
@Stefan Schippers I am facing issue in simulating DFF cell from sky130 standard cell library in xschem. Can you please suggest what might be wrong in this testbench.
s
You need to add a VCC supply and assign VCC and GND as supplies to the flip flop. This is done via attributes. Click the dff and do a 'q' and assign GND and VCC to ground and supply rails as well as p and n wells. Modified circuit attached. The .include line is not needed.
👍 1
v
Thanks Stefan, I am getting message
xterm: Can't execvp 'ngspice': No such file or directory
while doing
Netlist -> Simulate
for updated D flip-flop schematic in interactive mode. Why this error is coming ?
s
This means ngspice is not found. FInd the exact location of the
ngspice
executable in your system and replace
ngspice
with
/full/path/to/ngspice
in xschem
simulation->Configure simulators and tools
👍 1
v
Ngspice simulation was functioning correctly initially. I could execute the simulation and observe the plots within the internal xschem viewer. However, after making some modifications to the schematic, the viewer failed to display the plots. Additionally, the
.raw
file isn't being generated in the
.xschem/simulations
directory. I'm using ngspice in interactive mode. Please suggest what could be the issue here ?
s
I don't know. Your schematic works perfectly here.
if you run ngspice in interactive mode read the ngspice messages.
v
Sorry, I shared the schematic which was working fine. Schematic having issue after update to measure VCC current after adding
ammeter.sym
is attached now. No
.raw
file is getting generated with this schematic.
getting this ngspice message
s
ok the solution is simple: add a
remzerovec
command before
write
v
Adding
remzerovec
worked for current through
ammeter.sym
only but node voltages were missing. To plot those I added
save all
before
tran
and then the whole testbench is working fine. Thanks for your help.
s
Yes this is correct. Ammeters by default add a
.save
in the netlist for automatically saving their currents. So you need an explicit
save all
for plotting all other nodes.
v
@Stefan Schippers Trying to build div-by-8 frequency divider using
DFFIQ
flip-flop from sky130 std. cell library. But it seems spice model for this cell is not available in following spice file:
/usr/local/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice
Can you please confirm if my interpretation is correct or not ? If yes, what is the alternate way to build D-FF based frequency divider in sky130?
s
@vks you need to use cells from library sky130_stdcells, use
sky130_stdcells/dfxbp_2.sym
v
Thanks @Stefan Schippers. Is there any documentation or resource available to know about features of std. cells like port functionality, current drive, timing etc. ?
s
I think the .lib file has all the details. In general the _n suffix of the cells indicates the driving strength, _1: 1 standard loads, _2: 2 standard loads. How this is exactly defined I don't know. For sky130 Look at .../pdk/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__tt_025C_1v80.lib
v
I do not see
lib
directory in installed pdk path at my end. Can you please suggest why is it so ?
s
This is strange. Hopefully @Tim Edwards knows why the
lib/
directory is not installed in your system...
t
My suspicion is that this problem is caused by switching some of the repositories from the github/google originals to the github/efabless forks. The repository was probably cloned into sources/ and the update routine isn't smart enough to figure out that the repository changed locations. One major difference in the repositories is that instead of building the .lib files from bits and pieces, I pre-built them and then put them in the repository as split files to avoid the github file size limit. I think that's why the whole lib/ section is missing. If my guess is correct, then you should cd to open_pdks/sources/ and delete everything there, then rebuild open_pdks so that it will clone all the sources from the correct repositories.
👍 1
And I need to make the open_pdks Makefile check the repository .git/config file and make sure that the repository is coming from the correct source.
👍 1
a
@Stefan Schippers is am getting this xterm: can’t execvp : no file or directory after updating ngspice from 40 to 42.
s
You need to ensure the ngspice executable exists. Try to start xschem from a terminal:
$ ngspice
If the executable is not found try to locate it"
$ find / -type f  -name ngspice 2>&1 |grep -v 'Permission denied'
If you find the location of the executable go in xschem,
Simulation->Configure Simulators and tools
and set the path accordingly and click
Accept,Save and Close
.
another possibiity is that the default terminal for xschem,
xterm
is not installed. You can install xterm (
sudo apt install xterm
) or define another terminal in xschemrc:
set terminal gnome-terminal
👍 1
a
I tried all three paths. But still issue is same
How i can clean and reinstall ngspice maybe that resolve my issue
s
install xterm:
sudo apt install xterm
the first path for ngspice is correct so the tool is correctly installed.
the command above should contain
2>&1
, not
2>71
. you probably have a file named
71
that you can delete.
to see if ngspice is corectly installed launch it from a terminal:
$ ngspice
and see if it shows up.
a
I have changed later to &
Ngspice do open.
From terminal but when I simulate grt above error.
s
do you have xterm installed? type xterm on the terminal, does it open an xterm window?
also what is the xschem version installed ? type
xschem -v
in a terminal
Ah I also saw: in above
configure simulators and tools
you need to set the actual path for ngspice: I wrote
/path/to/ngspice
to indicate the ACTUAL path of ngspice on your system, so use
/usr/local/bin/ngspice
a
IMG_3371.jpg
Xschem version is 3.4.5
s
@Atif Khan Bring up the
Simulation->Configure simulators and tools
, try these options in the "Ngspice interactive" text box: •
xterm -e {ngspice -i "$N" -a || sh}
xterm -e {/usr/local/bin/ngspice -i "$N" -a}
xterm -e /usr/local/bin/ngspice -i "$N" -a
gnome-terminal e /usr/local/bin/ngspice -i "$N" -a