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