source: vis_dev/vis-2.1/examples/counter/counter.mv @ 16

Last change on this file since 16 was 11, checked in by cecile, 13 years ago

Add vis

File size: 1.8 KB
Line 
1# vl2mv counter.v
2# version: 0.2
3# date:    11:12:24 12/11/95 (PST)
4.model counter
5# I/O ports
6
7.names _n0
81
9.subckt counter_cell bit0 carry_in=_n0 carry_out=out0 
10.subckt counter_cell bit1 carry_in=out0  carry_out=out1 
11.subckt counter_cell bit2 carry_in=out1  carry_out=out2 
12# conflict arbitrators
13# non-blocking assignments
14# latches
15# quasi-continuous assignment
16.end
17
18
19.model counter_cell
20# I/O ports
21.inputs carry_in
22.outputs carry_out
23
24# assign carry_out  = value  & carry_in
25# value  & carry_in
26.names value carry_in _n2
27.def 0
281 1 1
29.names _n2 carry_out$raw_n1
30- =_n2
31# value  = 0
32.names value$raw_n3
330
34# non-blocking assignments for initial
35.names _n6
360
37.names value _n6 _n7
38.def 0
390 1 1
401 0 1
41.names _n7 _n5
420 1 
431 0 
44.names _n5  _n4
451 1
460 0
47# value  = carry_in
48.names carry_in value$_n4_n9$true
49- =carry_in
50.names _nc
511
52.names value _nc _nd
53.def 0
540 1 1
551 0 1
56.names _nd _nb
570 1 
581 0 
59.names _nb  _na
601 1
610 0
62.names _n10
630
64# carry_in  == 0
65.names carry_in _n10 _n11
66.def 0
670 1 1
681 0 1
69.names _n11 _nf
700 1 
711 0 
72.names _nf _n13
73- =_nf
74# value  = 1
75.names value$_nf_n14$true
761
77# value  = 0
78.names value$_nf_n15$false
790
80# if/else (carry_in  == 0)
81.names value$_nf_n14$true value$_nf_n15$false _nf value$_nf$raw_n17
820 - 1 0
831 - 1 1
84- 0 0 0
85- 1 0 1
86# case (value )
87.names value$_nf$raw_n17 value _na value$_na$raw_n1d
880 - 1 0
891 - 1 1
90- 0 0 0
91- 1 0 1
92.names value$_n4_n9$true value$_na$raw_n1d _n4 value$_n4$raw_n1f
930 - 1 0
941 - 1 1
95- 0 0 0
96- 1 0 1
97# conflict arbitrators
98.names _n4 _na _n13 _n24
99.def 0
100 1 - - 1
101 0 1 1 1
102 0 1 0 1
103.names _n24 value$_n4$raw_n1f value _n25
1041 0 - 0
1051 1 - 1
1060 - 0 0
1070 - 1 1
108.names carry_out$raw_n1  carry_out
1090 0
1101 1
111# non-blocking assignments
112# latches
113.r value$raw_n3 value
1140 0
1151 1
116.latch _n25 value
117# quasi-continuous assignment
118.end
119
120
Note: See TracBrowser for help on using the repository browser.