From 2a622e0eefd3ff1e9d070ab6d8c68d6d7d8b78de Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Sun, 26 Jan 2025 11:52:11 -0800 Subject: [PATCH] Fix d_process named pipes example. Use the correct gtkwave command for MacOS. The following is also required: commit 527b8378e867c76d857678e612b7b68a539c7397 Author: Brian Taylor Date: Wed Apr 10 13:24:48 2024 -0700 Fix circuits so that gtkwave tests run on MacOS. Add encoder/decoder example. --- examples/digital/compare/adder_Xspice.cir | 6 +----- examples/digital/digital_devices/clean.sh | 3 +++ examples/digital/digital_devices/runtests.sh | 16 ++++++++++++++++ examples/xspice/d_process/prog-pipes.cir | 2 +- examples/xspice/d_process/prog1-4.cir | 6 +----- examples/xspice/state/state-machine.cir | 7 +++++-- 6 files changed, 27 insertions(+), 13 deletions(-) create mode 100755 examples/digital/digital_devices/clean.sh create mode 100755 examples/digital/digital_devices/runtests.sh diff --git a/examples/digital/compare/adder_Xspice.cir b/examples/digital/compare/adder_Xspice.cir index 3461ff99d..5954088d6 100644 --- a/examples/digital/compare/adder_Xspice.cir +++ b/examples/digital/compare/adder_Xspice.cir @@ -76,11 +76,7 @@ eprvcd 1 2 3 4 5 6 7 8 s0 s1 s2 s3 c3 > adder_x.vcd if $oscompiled = 1 | $oscompiled = 8 ; MS Windows shell start gtkwave adder_x.vcd --script nggtk.tcl else - if $oscompiled = 7 ; macOS, manual tweaking required (mark, insert, Zoom Fit) - shell open -a gtkwave adder_x.vcd - else ; Linux and others - shell gtkwave adder_x.vcd --script nggtk.tcl & - end + shell gtkwave adder_x.vcd --script nggtk.tcl & end .endc diff --git a/examples/digital/digital_devices/clean.sh b/examples/digital/digital_devices/clean.sh new file mode 100755 index 000000000..5c94ff0c5 --- /dev/null +++ b/examples/digital/digital_devices/clean.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -x +rm -v *.vcd diff --git a/examples/digital/digital_devices/runtests.sh b/examples/digital/digital_devices/runtests.sh new file mode 100755 index 000000000..0e4d78989 --- /dev/null +++ b/examples/digital/digital_devices/runtests.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +ngspice -b 7490a.cir +ngspice -b 74f524.cir +ngspice -b behav-283-1.cir +ngspice -b behav-283.cir +ngspice -b behav-568.cir +ngspice -b behav-tristate-pulse.cir +ngspice -b behav-tristate.cir +ngspice -b counter.cir +ngspice -b decoder.cir +ngspice -b encoder.cir +ngspice -b ex283.cir +ngspice -b ex4.cir +ngspice -b ex5.cir +ngspice -b xspice_c4.cir diff --git a/examples/xspice/d_process/prog-pipes.cir b/examples/xspice/d_process/prog-pipes.cir index cffeb352a..95bf8091a 100644 --- a/examples/xspice/d_process/prog-pipes.cir +++ b/examples/xspice/d_process/prog-pipes.cir @@ -13,7 +13,7 @@ a1 1 clk1 d_osc1 a2 2 clk2 d_osc1 ap0_4 null clk1 null [q1 q2 q3 q4] proc0 -.model proc0 d_process (process_file="graycode|" process_params=["--pipe"]) +.model proc0 d_process (process_file="graycode|") ap1_4 [clk2] clk1 null [o1 o2 o3 o4] proc1 .model proc1 d_process (process_file="prog1in4out" process_params=["opt1", "qwerty"]) diff --git a/examples/xspice/d_process/prog1-4.cir b/examples/xspice/d_process/prog1-4.cir index 7f3a8ca91..fd7e2d9e0 100644 --- a/examples/xspice/d_process/prog1-4.cir +++ b/examples/xspice/d_process/prog1-4.cir @@ -37,11 +37,7 @@ eprvcd clk1 clk2 o1 o2 o3 o4 q1 q2 q3 q4 b1 b2 b3 b4 zeros qzeros reseto > prog if $oscompiled = 1 | $oscompiled = 8 ; MS Windows shell start gtkwave prog1-4.vcd --script nggtk.tcl else - if $oscompiled = 7 ; macOS, manual tweaking required (mark, insert, Zoom Fit) - shell open -a gtkwave prog1-4.vcd - else ; Linux and others - shell gtkwave prog1-4.vcd --script nggtk.tcl & - end + shell gtkwave prog1-4.vcd --script nggtk.tcl & end quit .endc diff --git a/examples/xspice/state/state-machine.cir b/examples/xspice/state/state-machine.cir index 663f14fee..2184b477e 100644 --- a/examples/xspice/state/state-machine.cir +++ b/examples/xspice/state/state-machine.cir @@ -34,10 +34,13 @@ write spifsim.raw plot cntl out_msb+2 out_lsb+8 eprvcd n_one clk n_zero msb lsb > spifsim.vcd * plotting the vcd file (e.g. with GTKWave) +if $oscompiled = 1 | $oscompiled = 8 ; MS Windows * For Windows: returns control to ngspice -shell start gtkwave spifsim.vcd --script $inputdir/nggtk.tcl + shell start gtkwave spifsim.vcd --script $inputdir/nggtk.tcl +else * Others -*shell gtkwave spifsim.vcd --script nggtk.tcl & + shell gtkwave spifsim.vcd --script nggtk.tcl & +end .endc .end