source: vis_dev/vis-2.3/models/counter/counter.mv @ 56

Last change on this file since 56 was 28, checked in by cecile, 13 years ago

exemples de test

File size: 1.7 KB
Line 
1# vl2mv counter.v
2# version: 2.1
3# date:    14:50:04 01/27/2010 (CET)
4.model counter
5# I/O ports
6.names _n0
71
8.subckt counter_cell bit0 carry_in=_n0 carry_out=out0 
9.subckt counter_cell bit1 carry_in=out0  carry_out=out1 
10.subckt counter_cell bit2 carry_in=out1  carry_out=out2 
11# conflict arbitrators
12# non-blocking assignments
13# latches
14# quasi-continuous assignment
15.end
16.model counter_cell
17# I/O ports
18.inputs carry_in
19.outputs carry_out
20# assign carry_out  = value  & carry_in
21# value  & carry_in
22.names value carry_in _n2
23.def 0
241 1 1
25.names _n2 carry_out$raw_n1
26- =_n2
27# value  = 0
28.names value$raw_n3
290
30# non-blocking assignments for initial
31.names _n6
320
33.names value _n6 _n7
34.def 0
350 1 1
361 0 1
37.names _n7 _n5
380 1 
391 0 
40.names _n5  _n4
41.def 1
420 0
43# value  = carry_in
44.names carry_in value$_n4_n9$true
45- =carry_in
46.names _nc
471
48.names value _nc _nd
49.def 0
500 1 1
511 0 1
52.names _nd _nb
530 1 
541 0 
55.names _nb  _na
56.def 1
570 0
58.names _n10
590
60# carry_in  == 0
61.names carry_in _n10 _n11
62.def 0
630 1 1
641 0 1
65.names _n11 _nf
660 1 
671 0 
68.names _nf _n13
69- =_nf
70# value  = 1
71.names value$_nf_n14$true
721
73# value  = 0
74.names value$_nf_n15$false
750
76# if/else (carry_in  == 0)
77.names _nf value$_nf_n14$true value$_nf_n15$false value$_nf$raw_n17
78.def 0
791 1 - 1
800 - 1 1
81# case (value )
82.names _na value$_nf$raw_n17 value value$_na$raw_n1d
83.def 0
841 1 - 1
850 - 1 1
86.names _n4 value$_n4_n9$true value$_na$raw_n1d value$_n4$raw_n1f
87.def 0
881 1 - 1
890 - 1 1
90# conflict arbitrators
91.names _n4 _na _n13 _n24
92.def 0
93 1 - - 1
94 0 1 1 1
95 0 1 0 1
96.names _n24 value$_n4$raw_n1f value _n25
971 0 - 0
981 1 - 1
990 - 0 0
1000 - 1 1
101.names carry_out$raw_n1  carry_out
1020 0
1031 1
104# non-blocking assignments
105# latches
106.r value$raw_n3 value
1070 0
1081 1
109.latch _n25 value
110# quasi-continuous assignment
111.end
Note: See TracBrowser for help on using the repository browser.