Revision 1,
1.8 KB
checked in by ttvmrc00, 14 years ago
(diff) |
upload iniziale
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[1] | 1 | module test_bench_MUX; |
---|
| 2 | reg A,B,sel; |
---|
| 3 | reg f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15; |
---|
| 4 | wire w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,w13,w14,out; |
---|
| 5 | |
---|
| 6 | Fanout Fanout1 ( |
---|
| 7 | .in (sel), |
---|
| 8 | .out1(w6), |
---|
| 9 | .out2(w7), |
---|
| 10 | .fault(f5) |
---|
| 11 | ); |
---|
| 12 | LShapedWire LS1 ( |
---|
| 13 | .in (A), |
---|
| 14 | .out(w1), |
---|
| 15 | .fault(f1) |
---|
| 16 | ); |
---|
| 17 | LShapedWire LS4 ( |
---|
| 18 | .in (B), |
---|
| 19 | .out(w12), |
---|
| 20 | .fault(f13) |
---|
| 21 | ); |
---|
| 22 | LShapedWire LS3 ( |
---|
| 23 | .in (w8), |
---|
| 24 | .out(w9), |
---|
| 25 | .fault(f14) |
---|
| 26 | ); |
---|
| 27 | LShapedWire LS2 ( |
---|
| 28 | .in (w7), |
---|
| 29 | .out(w8), |
---|
| 30 | .fault(f15) |
---|
| 31 | ); |
---|
| 32 | LShapedWire LS5 ( |
---|
| 33 | .in (w5), |
---|
| 34 | .out(w4), |
---|
| 35 | .fault(f7) |
---|
| 36 | ); |
---|
| 37 | LShapedWire LS6 ( |
---|
| 38 | .in (w10), |
---|
| 39 | .out(w11), |
---|
| 40 | .fault(f10) |
---|
| 41 | ); |
---|
| 42 | LShapedWire LS7 ( |
---|
| 43 | .in (w2), |
---|
| 44 | .out(w3), |
---|
| 45 | .fault(f4) |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | Inverter INV1 ( |
---|
| 49 | .in (w6), |
---|
| 50 | .out(w5), |
---|
| 51 | .fault(f6) |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | MajorityVoter MV1 ( |
---|
| 55 | .A (w1), |
---|
| 56 | .B (0), |
---|
| 57 | .C (w4), |
---|
| 58 | .out (w2), |
---|
| 59 | .fault1 (f3), |
---|
| 60 | .fault0 (f2) |
---|
| 61 | ); |
---|
| 62 | |
---|
| 63 | MajorityVoter MV2 ( |
---|
| 64 | .A (w9), |
---|
| 65 | .B (0), |
---|
| 66 | .C (w12), |
---|
| 67 | .out (w10), |
---|
| 68 | .fault1(f12), |
---|
| 69 | .fault0 (f11) |
---|
| 70 | ); |
---|
| 71 | |
---|
| 72 | MajorityVoter MV3 ( |
---|
| 73 | .A (w3), |
---|
| 74 | .B (1), |
---|
| 75 | .C (w11), |
---|
| 76 | .out (out), |
---|
| 77 | .fault1 (f9), |
---|
| 78 | .fault0 (f8) |
---|
| 79 | ); |
---|
| 80 | or (outFaultFree, w13,w14); |
---|
| 81 | and (w13, A,~sel); |
---|
| 82 | and (w14, B,sel); |
---|
| 83 | |
---|
| 84 | initial |
---|
| 85 | begin |
---|
| 86 | A = 0; |
---|
| 87 | B = 0; |
---|
| 88 | sel = 0; |
---|
| 89 | f1 = 0; |
---|
| 90 | f2 = 0; |
---|
| 91 | f3 = 0; |
---|
| 92 | f4 = 0; |
---|
| 93 | f5 = 0; |
---|
| 94 | f6 = 0; |
---|
| 95 | f7 = 0; |
---|
| 96 | f8 = 0; |
---|
| 97 | f9 = 0; |
---|
| 98 | f10 = 0; |
---|
| 99 | f11 = 0; |
---|
| 100 | f12 = 0; |
---|
| 101 | f13 = 0; |
---|
| 102 | f14 = 0; |
---|
| 103 | f15 = 0; |
---|
| 104 | end |
---|
| 105 | |
---|
| 106 | always |
---|
| 107 | #5 A = !A; |
---|
| 108 | always |
---|
| 109 | #10 B = !B; |
---|
| 110 | |
---|
| 111 | always |
---|
| 112 | #20 sel = !sel; |
---|
| 113 | always |
---|
| 114 | #40 f1 = !f1; |
---|
| 115 | always |
---|
| 116 | #80 f2 = !f2; |
---|
| 117 | always |
---|
| 118 | #160 f3 = !f3; |
---|
| 119 | always |
---|
| 120 | #320 f4 = !f4; |
---|
| 121 | always |
---|
| 122 | #640 f5 = !f5; |
---|
| 123 | always |
---|
| 124 | #1280 f6 = !f6; |
---|
| 125 | always |
---|
| 126 | #2560 f7 = !f7; |
---|
| 127 | always |
---|
| 128 | #5120 f8 = !f8; |
---|
| 129 | always |
---|
| 130 | #10240 f9 = !f9; |
---|
| 131 | always |
---|
| 132 | #20480 f10 = !f10; |
---|
| 133 | always |
---|
| 134 | #40960 f11 = !f11; |
---|
| 135 | always |
---|
| 136 | #81920 f12 = !f12; |
---|
| 137 | always |
---|
| 138 | #163840 f13 = !f13; |
---|
| 139 | always |
---|
| 140 | #327680 f14 = !f14; |
---|
| 141 | always |
---|
| 142 | #655360 f15 = !f15; |
---|
| 143 | |
---|
| 144 | endmodule |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | |
---|
| 153 | |
---|
Note: See
TracBrowser
for help on using the repository browser.