Revision 1,
1.8 KB
checked in by ttvmrc00, 14 years ago
(diff) |
upload iniziale
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[1] | 1 | //`timescale 10ns/100ps |
---|
| 2 | module test_benchLBMEM_4; |
---|
| 3 | |
---|
| 4 | wire m8,m1,m2,m3,m4,m5,m6,m7,z; |
---|
| 5 | reg x,y,nodefake, nodefake2, nodefake3; |
---|
| 6 | reg [1:0] zone1,zone2,zone3; |
---|
| 7 | parameter [1:0] |
---|
| 8 | switch=1, |
---|
| 9 | hold=2, |
---|
| 10 | rele=3, |
---|
| 11 | relax=0; |
---|
| 12 | assign m8= nodefake; |
---|
| 13 | assign z= nodefake2; |
---|
| 14 | assign out= nodefake2; |
---|
| 15 | assign m3 = nodefake2; |
---|
| 16 | assign m4 = nodefake2; |
---|
| 17 | assign m1 = nodefake2; |
---|
| 18 | |
---|
| 19 | Wire_4 W1 ( |
---|
| 20 | .A(x), |
---|
| 21 | .B(m1), |
---|
| 22 | .status(zone1) |
---|
| 23 | ); |
---|
| 24 | |
---|
| 25 | Wire_4 W2 ( |
---|
| 26 | .A(y), |
---|
| 27 | .B(m7), |
---|
| 28 | .status(zone1) |
---|
| 29 | ); |
---|
| 30 | |
---|
| 31 | Wire_bi5 WBI1 ( |
---|
| 32 | .A(z), |
---|
| 33 | .B(m3), |
---|
| 34 | .status(zone1) |
---|
| 35 | ); |
---|
| 36 | |
---|
| 37 | MajorityVoter_bi4 MV1 ( |
---|
| 38 | .A(m1), |
---|
| 39 | .B(m5), |
---|
| 40 | .Zp(m4), |
---|
| 41 | .Z(m2), |
---|
| 42 | .status(zone2), |
---|
| 43 | .fault1(1'b0), |
---|
| 44 | .fault0(1'b0) |
---|
| 45 | ); |
---|
| 46 | |
---|
| 47 | Wire_bi5 W4 ( |
---|
| 48 | .A(m4), |
---|
| 49 | .B(m8), |
---|
| 50 | .status(zone2) |
---|
| 51 | ); |
---|
| 52 | |
---|
| 53 | Wire_bi5 W5 ( |
---|
| 54 | .A(m8), |
---|
| 55 | .B(out), |
---|
| 56 | .status(zone3) |
---|
| 57 | ); |
---|
| 58 | |
---|
| 59 | LShapedWire_bi4 LSBI1( |
---|
| 60 | .A(m2), |
---|
| 61 | .B(m3), |
---|
| 62 | .fault(1'b0), |
---|
| 63 | .status(zone2) |
---|
| 64 | ); |
---|
| 65 | |
---|
| 66 | LShapedWire_4 LS1 ( |
---|
| 67 | .A(m7), |
---|
| 68 | .B(m5), |
---|
| 69 | .status(zone2), |
---|
| 70 | .fault(1'b0) |
---|
| 71 | ); |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | initial |
---|
| 75 | begin |
---|
| 76 | x =0; |
---|
| 77 | y =0; |
---|
| 78 | zone1<=2; |
---|
| 79 | zone2<=2; |
---|
| 80 | zone3<=3; |
---|
| 81 | nodefake <=0; |
---|
| 82 | nodefake3 <=1'bz; |
---|
| 83 | nodefake2 <=1'bz; |
---|
| 84 | #110 nodefake <=1'bz; |
---|
| 85 | end |
---|
| 86 | always |
---|
| 87 | begin |
---|
| 88 | #50 x <=1; |
---|
| 89 | #0 y <=1; |
---|
| 90 | #200 x <=0; |
---|
| 91 | #0 y <=1; |
---|
| 92 | #200 x <=0; |
---|
| 93 | #0 y <=0; |
---|
| 94 | #200 x <=1; |
---|
| 95 | #0 y <=0; |
---|
| 96 | #200 x <=0; |
---|
| 97 | #0 y<=1; |
---|
| 98 | end |
---|
| 99 | //period=200 |
---|
| 100 | always@(zone1) |
---|
| 101 | begin |
---|
| 102 | case (zone1) |
---|
| 103 | hold : #100 zone1 <= zone1 +1; |
---|
| 104 | rele : #25 zone1 <= zone1 +1 ; |
---|
| 105 | relax : #50 zone1 <= zone1 +1; |
---|
| 106 | switch : #25 zone1 <= zone1 +1 ; |
---|
| 107 | endcase |
---|
| 108 | end |
---|
| 109 | |
---|
| 110 | always@(zone2) |
---|
| 111 | begin |
---|
| 112 | #25 zone2 <= zone2 +1 ; |
---|
| 113 | end |
---|
| 114 | |
---|
| 115 | always@(zone3) |
---|
| 116 | begin |
---|
| 117 | case (zone3) |
---|
| 118 | hold : #75 zone3 <= zone3 +1; |
---|
| 119 | rele : #25 zone3 <= zone3 +1; |
---|
| 120 | relax : #75 zone3 <= zone3 +1; |
---|
| 121 | switch : #25 zone3 <= zone3 +1; |
---|
| 122 | endcase |
---|
| 123 | end |
---|
| 124 | |
---|
| 125 | endmodule |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | |
---|
Note: See
TracBrowser
for help on using the repository browser.