1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| module RO_S(input en, output wire clk);
wire out0,out1,out2,out3,out4/* synthesis keep = 1 */;
//and U0 (out0,en,clk);
//not U1 (out1,out0);
//not U2 (out2,out1);
//not U3 (out3,out2);
//not U4 (out4,out3);
//not U5 (clk,out4);
and U0 (clk,en,out0);
not U1 (out0,out1);
not U2 (out1,out2);
not U3 (out2,out3);
not U4 (out3,out4);
not U5 (out4, clk);
endmodule
module ro_25(input en, output wire clk);
wire [24:0] clk_temp;
genvar i;
generate
for (i =0;i<25;i=i+1) begin :tmp
RO_S U_roi(.en(en),.clk(clk_temp[i]));
end
endgenerate
assign clk = &clk_temp;
endmodule
module main(input wire [3:0] i0, input wire [3:0] i1, input wire [3:0] i2, input wire [3:0] i3,
input wire [3:0] i4, input wire [3:0] i5, input wire [3:0] i6, input wire [3:0] i7,
input wire [2:0] sel, output wire clk0, output wire clk1, output wire clk2, output wire clk3);
reg [3:0] mux_out;
ro_25 U_ro25_0(.en(mux_out[0]),.clk(clk0));
ro_25 U_ro25_1(.en(mux_out[1]),.clk(clk1));
ro_25 U_ro25_2(.en(mux_out[2]),.clk(clk2));
ro_25 U_ro25_3(.en(mux_out[3]),.clk(clk3));
always @(*) begin
case(sel)
0: mux_out=i0;
1: mux_out=i1;
2: mux_out=i2;
3: mux_out=i3;
4: mux_out=i4;
5: mux_out=i5;
6: mux_out=i6;
7: mux_out=i7;
default: mux_out=i0;
endcase
end
endmodule
//how is Wire 'clk' and wire 'clk0/1/2/3' linked?
//clk_temp=1 for all the 25 ROs in one row.....we have to AND these...instead clk0/1/2/3 are being ANDed??!! |