updated greycnt.sch example

This commit is contained in:
stefan schippers 2024-12-18 14:01:50 +01:00
parent 7402385a82
commit a66b4bb39b
3 changed files with 2090 additions and 2005 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,53 +19,39 @@ v {xschem version=3.4.6 file_version=1.2
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
} }
G {process G {}
begin
if now = 0 ns then
A <= "00000000";
elsif A = "00000000" and now > 100 ns then
wait;
end if;
wait for 100 ns;
A <= A + 1;
end process;}
K {} K {}
V {initial begin V {}
$dumpfile("dumpfile.vcd"); S {}
$dumpvars(0, greycnt);
A=0;
end
always begin
#100000;
$display("%08b %08b %08b", A, B, C);
A=A + 1;
if(A==0) $finish;
end
}
S {
.tran 1n 2000n
* to generate following file copy .../share/doc/xschem/examples/stimuli.greycnt
* to the simulation directory and run simulation -> Utile Stimuli Editor (GUI),
* and press 'Translate'
.include stimuli_greycnt.cir
.model nmos NMOS
+ LEVEL=1
+ LMIN=0.5e-6 LMAX=50e-6 WMIN=0.9e-6 WMAX=1
+ VTO=0.7 GAMMA=0.45 PHI=0.9
+ NSUB=9e14 LD=0.08e-6 UO=350 LAMBDA=0.1
+ TOX=9e-9 PB=0.9 CJ=0.56e-3 CJSW=0.35e-11
+ MJ=0.45 MJSW=0.2 CGDO=0.4e-9 JS=1.0e-8
.model pmos PMOS
+ LEVEL=1
+ LMIN=0.5e-6 LMAX=50e-6 WMIN=0.9e-6 WMAX=1
+ VTO=-0.8 GAMMA=0.4 PHI=0.8
+ NSUB=5e14 LD=0.09e-6 UO=100 LAMBDA=0.2
+ TOX=9e-9 PB=0.9 CJ=0.94e-3 CJSW=0.32e-11
+ MJ=0.5 MJSW=0.3 CGDO=0.3e-9 JS=0.5e-8}
E {} E {}
B 2 0 -670 530 -450 {flags=graph
y1=0
y2=3
ypos1=0.13175071
ypos2=2.0823094
divy=5
subdivy=1
unity=1
x1=0
x2=1.2u
subdivx=4
xlabmag=1.2
ylabmag=1.0
node="A;a[7],a[6],a[5],a[4],a[3],a[2],a[1],a[0]
B;b[7],b[6],b[5],b[4],b[3],b[2],b[1],b[0]
C;c[7],c[6],c[5],c[4],c[3],c[2],c[1],c[0]
a[0]
b[0]
c[0]"
dataset=-1
unitx=1
logx=0
logy=0
digital=1
color="4 4 4 4 4 4"
divx=4}
T {BINARY} 500 -780 0 0 0.4 0.4 {} T {BINARY} 500 -780 0 0 0.4 0.4 {}
T {GRAY} 830 -780 0 0 0.4 0.4 {} T {GRAY} 830 -780 0 0 0.4 0.4 {}
T {BINARY} 1210 -780 0 0 0.4 0.4 {} T {BINARY} 1210 -780 0 0 0.4 0.4 {}
@ -185,7 +171,7 @@ C {xnor.sym} 1060 -310 0 0 {name=x11}
C {xnor.sym} 1060 -390 0 0 {name=x12} C {xnor.sym} 1060 -390 0 0 {name=x12}
C {xnor.sym} 1060 -150 0 0 {name=x13} C {xnor.sym} 1060 -150 0 0 {name=x13}
C {lab_pin.sym} 150 -190 0 1 { name=l26 lab=C[7:0] } C {lab_pin.sym} 150 -190 0 1 { name=l26 lab=C[7:0] }
C {use.sym} 60 -650 0 0 {library ieee; C {use.sym} 60 -770 0 0 {library ieee;
use std.TEXTIO.all; use std.TEXTIO.all;
use ieee.std_logic_1164.all; use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all; use ieee.std_logic_arith.all;
@ -212,3 +198,83 @@ C {bus_tap.sym} 560 -520 1 1 {name=l18 lab=[5]}
C {bus_tap.sym} 560 -600 1 1 {name=l19 lab=[6]} C {bus_tap.sym} 560 -600 1 1 {name=l19 lab=[6]}
C {bus_tap.sym} 560 -680 1 1 {name=l20 lab=[7]} C {bus_tap.sym} 560 -680 1 1 {name=l20 lab=[7]}
C {lab_pin.sym} 520 -80 0 0 {name=p1 lab=A[7:0]} C {lab_pin.sym} 520 -80 0 0 {name=p1 lab=A[7:0]}
C {launcher.sym} 130 -430 0 0 {name=h5
descr="load waves"
tclcommand="xschem raw_read $netlist_dir/greycnt.raw tran"
}
C {simulator_commands.sym} 240 -210 0 0 {name=COMMANDS
verilog_ignore=1
vhdl_ignore=1
spice_ignore="tcleval([regexp -nocase \{xyce\} $sim(spice,$sim(spice,default),name)])"
simulator=ngspice
only_toplevel=false
value="
* ngspice commands
.options save all
.control
tran 1n 2000n
remzerovec
write greycnt.raw
.endc
* to generate following file copy .../share/doc/xschem/examples/stimuli.greycnt
* to the simulation directory and run simulation -> Utile Stimuli Editor (GUI),
* and press 'Translate'
.include stimuli_greycnt.cir
.model nmos nmos level=49 version=3.3.0 vth0=0.8
.model pmos pmos level=49 version=3.3.0 vth0=-0.8
"}
C {simulator_commands.sym} 370 -210 0 0 {name=COMMANDS1
verilog_ignore=1
vhdl_ignore=1
spice_ignore="tcleval([regexp -nocase \{ngspice\} $sim(spice,$sim(spice,default),name)])"
simulator=xyce
only_toplevel=false
value="
* Xyce commands
VGND GND 0 0
.tran 0.1n 2000n
.print tran format=raw
+ file=greycnt.raw v(*) i(*)
* to generate following file copy .../share/doc/xschem/examples/stimuli.greycnt
* to the simulation directory and run simulation -> Utile Stimuli Editor (GUI),
* and press 'Translate'
.include stimuli_greycnt.cir
.model nmos nmos level=49 version=3.3.0 vth0=0.8
.model pmos pmos level=49 version=3.3.0 vth0=-0.8
"}
C {code.sym} 240 -380 0 0 {name=VHDL
only_toplevel=false
spice_ignore=1
verilog_ignore=1
value="process
begin
if now = 0 ns then
A <= \\"00000000\\";
elsif A = \\"00000000\\" and now > 100 ns then
wait;
end if;
wait for 100 ns;
A <= A + 1;
end process;"}
C {code.sym} 370 -380 0 0 {name=Verilog
only_toplevel=false
vhdl_ignore=1
spice_ignore=1
value="initial begin
$dumpfile(\\"dumpfile.vcd\\");
$dumpvars(0, greycnt);
A=0;
end
always begin
#100000;
$display(\\"%08b %08b %08b\\", A, B, C);
A=A + 1;
if(A==0) $finish;
end"}

View File

@ -1,13 +1,13 @@
unit n unit n
voltage 5 voltage 3
slope 1 slope 1
format hspice_simple format hspice_simple
buswidth A 8 [ ] buswidth A 8 [ ]
beginfile stimuli_greycnt.cir beginfile stimuli_greycnt.cir
set VDD 5 set VDD 3
; set GND 0 ; set GND 0
s 100 s 100
set A 00 set A 00
@ -26,9 +26,28 @@ set A 06
s 100 s 100
set A 07 set A 07
s 100 s 100
set A 08
s 100
set A 09
s 100
set A 0A
s 100
set A 0B
s 100
set A 0C
s 100
set A 0D
s 100
set A 0E
s 100
set A 0F
s 100
set A 10
s 100
set A 11
s 100
set A 12
s 100
endfile endfile