Revision 1,
1.3 KB
checked in by ttvmrc00, 14 years ago
(diff) |
upload iniziale
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | //`timescale 10ns/100ps |
---|
2 | module test_benchLBMEM; |
---|
3 | reg al,bl,fault1,fault0,x, Zpexl,clk1,clk2,clk3,cl,xl,y,yl,Zpi; |
---|
4 | wor Z,Zp; |
---|
5 | reg c,d; |
---|
6 | |
---|
7 | MajorityVoter_bi MV ( |
---|
8 | .forward(nforward), |
---|
9 | .A(al), |
---|
10 | .B(bl), |
---|
11 | .Z(Z), |
---|
12 | .Zp(Zp), |
---|
13 | .fault1(fault1), |
---|
14 | .fault0(fault0) |
---|
15 | ); |
---|
16 | Wire_bi wire_1( |
---|
17 | .A(c), |
---|
18 | .B(xx), |
---|
19 | .bi(Z), |
---|
20 | .forward(forward) ) ; |
---|
21 | //assign Z= forward? c : 1'bz; |
---|
22 | assign nforward=(clk2 && clk1); |
---|
23 | assign forward = ~nforward; |
---|
24 | Wire_bi wire_2( |
---|
25 | .A(Zpi), |
---|
26 | .B(Zpex), |
---|
27 | .bi(Zp), |
---|
28 | .forward(nforward) ) ; |
---|
29 | //assign Zp= forward? 1'bz:d; |
---|
30 | assign a= xl; |
---|
31 | assign b= yl; |
---|
32 | initial |
---|
33 | begin |
---|
34 | x =0; |
---|
35 | y =0; |
---|
36 | xl=0; |
---|
37 | yl=0;//try with zs |
---|
38 | Zpexl=0; |
---|
39 | Zpi=0; |
---|
40 | al=0; |
---|
41 | bl=0; |
---|
42 | c=0; |
---|
43 | d=1; |
---|
44 | fault1 = 0; |
---|
45 | fault0 = 0; |
---|
46 | clk1 <= #125 0; |
---|
47 | clk2=1; |
---|
48 | clk3=1; |
---|
49 | end |
---|
50 | |
---|
51 | always |
---|
52 | |
---|
53 | begin |
---|
54 | #3000 x = ~x; |
---|
55 | end |
---|
56 | |
---|
57 | always |
---|
58 | #5000 y = ~y; |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | always@(posedge clk1) |
---|
63 | //violet! |
---|
64 | begin |
---|
65 | clk1 <= #1000 ~clk1; |
---|
66 | Zpi<=Zpexl ; |
---|
67 | xl <= x; |
---|
68 | yl <= y; |
---|
69 | end |
---|
70 | always@(negedge clk1) |
---|
71 | begin |
---|
72 | yl=1'bZ; |
---|
73 | Zpi=1'bz; |
---|
74 | xl=1'bZ; |
---|
75 | clk1 <= #1000 ~clk1; |
---|
76 | end |
---|
77 | |
---|
78 | always@(posedge clk2) |
---|
79 | //blue |
---|
80 | begin |
---|
81 | cl=c; |
---|
82 | al=a; |
---|
83 | bl=b; |
---|
84 | clk2 <= #1250 ~clk2; |
---|
85 | end |
---|
86 | |
---|
87 | always@(negedge clk2) |
---|
88 | begin |
---|
89 | al=1'bZ; |
---|
90 | bl=1'bZ; |
---|
91 | cl=1'bZ; |
---|
92 | clk2 <= #750 ~clk2; |
---|
93 | end |
---|
94 | |
---|
95 | always@(posedge clk3) |
---|
96 | //white |
---|
97 | begin |
---|
98 | c <= xx; |
---|
99 | Zpexl<=Zpex; |
---|
100 | clk3 <= #500 ~clk3; |
---|
101 | end |
---|
102 | |
---|
103 | always@(negedge clk3) |
---|
104 | begin |
---|
105 | c<= 1'bz; |
---|
106 | Zpexl <=1'bz; |
---|
107 | clk3 <= #500 ~clk3; |
---|
108 | end |
---|
109 | |
---|
110 | endmodule |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | |
---|
Note: See
TracBrowser
for help on using the repository browser.