source: HDLQ/TestBenches/TBpermanent.v @ 1

Revision 1, 4.3 KB checked in by ttvmrc00, 13 years ago (diff)

upload iniziale

  • Property svn:executable set to *
Line 
1//`timescale 10ns/100ps
2module test_benchpermanent;
3
4reg d_in1, d_in2;
5reg fault_1,fault_2,fault_3,fault_4,fault_5,fault_6;
6reg [1:0] zone1,zone2,zone3,zone4;
7parameter [1:0]
8        switch=1,
9        hold=2,
10        rele=3,
11        relax=0;
12
13assign x=d_in1;
14assign y=d_in2;
15//assign m20 = 1'b0;
16//assign m10 = 1'b0;
17assign fakenode =1'bz;
18//assign m16=fakenode;
19//assign m17=fakenode;
20//assign z1=fakenode;
21//assign m1=fakenode;
22//assign m2=fakenode;
23//assign m3=fakenode;
24//assign m4=fakenode;
25//assign m5=fakenode;
26//assign m6=fakenode;
27Wire_bi6 W1 (
28           .A(x), 
29           .B(m1),
30           .fault(1'b0), 
31           .status(zone1)
32           );
33Fanout_A4 FO1(
34            .A(m1), 
35            .B(m4),
36            .C(m2),
37            .fault(1'b0), 
38            .status(zone2)
39          );
40
41Wire_bi6 W2 (
42            .A(m4), 
43            .B(m5),
44            .fault(1'b0), 
45            .status(zone2)
46          );
47         
48Wire_bi6 W3 (
49            .A(m2), 
50            .B(m3),
51            .fault(1'b0), 
52            .status(zone2)
53          );
54         
55//Wire_bi6 prova2 (
56         //   .A(m3),
57          //  .B(m24),
58        //    .fault(1'b0),
59        //    .status(zone3)
60        //  );
61Inverter_new IN1 (
62            .A(m3), 
63            .B(m24), 
64            .status(zone3), 
65             .fault(1'b0));
66                 
67Wire_bi6 W4 (
68            .A(m24), 
69            .B(m23),
70            .fault(1'b0), 
71            .status(zone4)
72          );
73         
74LShapedWire_4 LSW1(
75                .A(m5), 
76                .B(m6), 
77                .fault(1'b0), 
78                .status(zone3)
79          );
80
81
82Wire_bi6 W5 (
83            .A(m6), 
84            .B(m7),
85            .fault(1'b0), 
86            .status(zone3)
87          );
88
89Wire_bi6 W6 (
90            .A(y), 
91            .B(m26),
92            .fault(1'b0), 
93            .status(zone1)
94          );
95         
96       
97Fanout_A4 FO2(
98            .A(m26), 
99            .B(m25),
100            .C(m28),
101            .fault(1'b0), 
102            .status(zone2)
103          );
104
105Wire_bi6 W7 (
106            .A(m28), 
107            .B(m29),
108            .fault(1'b0), 
109            .status(zone2)
110          );
111         
112LShapedWire_4 LSW4(
113                .A(m29), 
114                .B(m30), 
115                .fault(1'b0), 
116                .status(zone2)
117          );
118
119Wire_bi6 W8 (
120            .A(m25), 
121            .B(m22),
122            .fault(1'b0), 
123            .status(zone3)
124          );
125
126Inverter_new IN2 (
127             .A(m30), 
128           .B(m31), 
129          .status(zone3), 
130           .fault(1'b0)
131            );
132//Wire_bi6 prova1 (
133         //   .A(m30),
134         //   .B(m31),
135        //    .fault(1'b0),
136         //   .status(zone3)
137        //  );
138         
139Wire_bi6 W9 (
140            .A(m31), 
141            .B(m32),
142            .fault(1'b0), 
143            .status(zone4)
144          );         
145             
146Wire_bi6 W10 (
147            .A(m7), 
148            .B(m8),
149            .fault(1'b0), 
150            .status(zone4)
151          );         
152                     
153LShapedWire_4 LSW2(
154                .A(m8), 
155                .B(m9), 
156                .fault(1'b0), 
157                .status(zone4)
158          );
159
160LShapedWire_4 LSW3(
161                .A(m22), 
162                .B(m21), 
163                .fault(1'b0), 
164                .status(zone4)
165          );
166         
167Wire_4 Wm10(
168                .A(1'b0),
169                .B(m10),
170                .status(zone4)
171                );
172               
173MajorityVoter_bi4 MV1 (
174                         .A(m23),
175                         .B(1'b0), 
176                         .Zp(m19),
177                         .Z(m21),
178                         .status(zone1), 
179                         .fault1(1'b0), 
180                         .fault0(1'b0)
181                         );
182
183Wire_4 Wm20(
184                .A(1'b0),
185                .B(m20),
186                .status(zone4)
187                );
188MajorityVoter_bi4 MV2 (
189                         .A(m32),
190                         .B(1'b0), 
191                         .Zp(m11),
192                         .Z(m9),
193                         .status(zone1), 
194                         .fault1(1'b0), 
195                         .fault0(1'b0)
196                         );
197
198LShapedWire_4 LSW5(
199                .A(m12), 
200                .B(m13), 
201                .fault(1'b0), 
202                .status(zone2)
203          );
204
205
206Wire_bi6 W11 (
207            .A(m11), 
208            .B(m12),
209            .fault(1'b0), 
210            .status(zone2)
211          );
212         
213Wire_bi6 W12 (
214            .A(m13), 
215            .B(m14),
216            .fault(1'b0), 
217            .status(zone2)
218          );
219         
220Wire_4 Wm50(
221                .A(1'b1),
222                .B(m50),
223                .status(zone2)
224                );
225               
226MajorityVoter_bi4 MV3 (
227                         .A(1'b1),
228                         .B(m14), 
229                         .Zp(m17),
230                         .Z(m16),
231                         .status(zone3), 
232                         .fault1(1'b0), 
233                         .fault0(1'b0)
234                         );
235
236LShapedWire_4 LSW6(
237                .A(m18), 
238                .B(m16), 
239                .fault(1'b0), 
240                .status(zone2)
241          );
242
243
244Wire_bi6 W13 (
245                .A(m19),
246                .B(m18),
247                .fault(1'b0), 
248                .status(zone2)
249);
250
251Wire_bi6 W14 (
252            .A(m17), 
253            .B(m33),
254            .fault(1'b0), 
255            .status(zone4)
256          );     
257
258Wire_bi6 W15 (
259            .A(m33), 
260            .B(m34),
261            .fault(1'b0), 
262            .status(zone1)
263          );
264initial 
265begin     
266        d_in1<=1;     
267        d_in2 <=0;
268        zone1 <=relax;
269        zone2 <=rele;
270        zone3 <=hold;
271        zone4 <=switch;
272        fault_1 <=0;
273        fault_2 <=0;
274        fault_3 <=0;
275        fault_4 <=0;
276        fault_5 <=0;
277        fault_6 <=0;
278end     
279
280always
281   begin
282        #350  d_in1 <=~d_in1;
283        //#0   y <=1;
284        #200 d_in2 <=~d_in2;
285//      #0   x <=1;
286        //#200 x <=0;
287//      #0  y <=0;
288//      #200 w <=1;
289//      #0   y <=1;
290//      #200 x <=0;
291//      #0   y<=1;
292 end
293//always
294  //   begin
295    //   #230   fault_4 <= ~fault_4;
296   //    #150 fault_4 <= ~fault_4;
297  //   end 
298//period=200
299
300always@(zone1)
301        begin
302        #25  zone1 <= zone1 +1 ;
303        end                             
304always@(zone2)
305        begin
306        #25  zone2 <= zone2 +1 ;
307        end     
308always@(zone3)
309        begin
310        #25  zone3 <= zone3 +1 ;
311        end
312always@(zone4)
313        begin
314        #25  zone4 <= zone4 +1 ;
315        end
316endmodule
317
318
319
320
Note: See TracBrowser for help on using the repository browser.