Rev | Line | |
---|
[28] | 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 |
---|
| 7 | 1 |
---|
| 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 |
---|
| 24 | 1 1 1 |
---|
| 25 | .names _n2 carry_out$raw_n1 |
---|
| 26 | - =_n2 |
---|
| 27 | # value = 0 |
---|
| 28 | .names value$raw_n3 |
---|
| 29 | 0 |
---|
| 30 | # non-blocking assignments for initial |
---|
| 31 | .names _n6 |
---|
| 32 | 0 |
---|
| 33 | .names value _n6 _n7 |
---|
| 34 | .def 0 |
---|
| 35 | 0 1 1 |
---|
| 36 | 1 0 1 |
---|
| 37 | .names _n7 _n5 |
---|
| 38 | 0 1 |
---|
| 39 | 1 0 |
---|
| 40 | .names _n5 _n4 |
---|
| 41 | .def 1 |
---|
| 42 | 0 0 |
---|
| 43 | # value = carry_in |
---|
| 44 | .names carry_in value$_n4_n9$true |
---|
| 45 | - =carry_in |
---|
| 46 | .names _nc |
---|
| 47 | 1 |
---|
| 48 | .names value _nc _nd |
---|
| 49 | .def 0 |
---|
| 50 | 0 1 1 |
---|
| 51 | 1 0 1 |
---|
| 52 | .names _nd _nb |
---|
| 53 | 0 1 |
---|
| 54 | 1 0 |
---|
| 55 | .names _nb _na |
---|
| 56 | .def 1 |
---|
| 57 | 0 0 |
---|
| 58 | .names _n10 |
---|
| 59 | 0 |
---|
| 60 | # carry_in == 0 |
---|
| 61 | .names carry_in _n10 _n11 |
---|
| 62 | .def 0 |
---|
| 63 | 0 1 1 |
---|
| 64 | 1 0 1 |
---|
| 65 | .names _n11 _nf |
---|
| 66 | 0 1 |
---|
| 67 | 1 0 |
---|
| 68 | .names _nf _n13 |
---|
| 69 | - =_nf |
---|
| 70 | # value = 1 |
---|
| 71 | .names value$_nf_n14$true |
---|
| 72 | 1 |
---|
| 73 | # value = 0 |
---|
| 74 | .names value$_nf_n15$false |
---|
| 75 | 0 |
---|
| 76 | # if/else (carry_in == 0) |
---|
| 77 | .names _nf value$_nf_n14$true value$_nf_n15$false value$_nf$raw_n17 |
---|
| 78 | .def 0 |
---|
| 79 | 1 1 - 1 |
---|
| 80 | 0 - 1 1 |
---|
| 81 | # case (value ) |
---|
| 82 | .names _na value$_nf$raw_n17 value value$_na$raw_n1d |
---|
| 83 | .def 0 |
---|
| 84 | 1 1 - 1 |
---|
| 85 | 0 - 1 1 |
---|
| 86 | .names _n4 value$_n4_n9$true value$_na$raw_n1d value$_n4$raw_n1f |
---|
| 87 | .def 0 |
---|
| 88 | 1 1 - 1 |
---|
| 89 | 0 - 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 |
---|
| 97 | 1 0 - 0 |
---|
| 98 | 1 1 - 1 |
---|
| 99 | 0 - 0 0 |
---|
| 100 | 0 - 1 1 |
---|
| 101 | .names carry_out$raw_n1 carry_out |
---|
| 102 | 0 0 |
---|
| 103 | 1 1 |
---|
| 104 | # non-blocking assignments |
---|
| 105 | # latches |
---|
| 106 | .r value$raw_n3 value |
---|
| 107 | 0 0 |
---|
| 108 | 1 1 |
---|
| 109 | .latch _n25 value |
---|
| 110 | # quasi-continuous assignment |
---|
| 111 | .end |
---|
Note: See
TracBrowser
for help on using the repository browser.