|
| 1 | +module generated_clock ( |
| 2 | + |
| 3 | + // Test basic test cases |
| 4 | + input wire CLK_IN_1, |
| 5 | + output wire slow_clk_int, |
| 6 | + output wire fast_clk_int, |
| 7 | + output wire slow_clk_out2, |
| 8 | + output wire fast_clk_out2, |
| 9 | + |
| 10 | + // Test liberty-defined nested clock output |
| 11 | + output wire slow_clk_out3, |
| 12 | + output wire fast_clk_out3, |
| 13 | + |
| 14 | + // Test edges/shifts (shifts not supported) |
| 15 | + input wire CLK_IN_2, |
| 16 | + output wire CLK_OUT_2 |
| 17 | +); |
| 18 | + |
| 19 | + // Give one more level of hierarchy to test names |
| 20 | + second_hierarchy u_second_hierarchy ( |
| 21 | + .clk_in(CLK_IN_1), |
| 22 | + .slow_clk_out(slow_clk_int), |
| 23 | + .fast_clk_out(fast_clk_int), |
| 24 | + .slow_clk_out2(slow_clk_out2), |
| 25 | + .fast_clk_out2(fast_clk_out2), |
| 26 | + .slow_clk_out3(slow_clk_out3), |
| 27 | + .fast_clk_out3(fast_clk_out3) |
| 28 | + ); |
| 29 | + |
| 30 | + CLK_EDGE_SHIFT clk_edge_shift ( |
| 31 | + .CLK_IN(CLK_IN_2), |
| 32 | + .CLK_OUT(CLK_OUT_2) |
| 33 | + ); |
| 34 | + |
| 35 | +endmodule |
| 36 | + |
| 37 | +module second_hierarchy ( |
| 38 | + input wire clk_in, |
| 39 | + output wire slow_clk_out, |
| 40 | + output wire fast_clk_out, |
| 41 | + output wire slow_clk_out2, |
| 42 | + output wire fast_clk_out2, |
| 43 | + output wire slow_clk_out3, |
| 44 | + output wire fast_clk_out3 |
| 45 | +); |
| 46 | + |
| 47 | + CLK_GEN clk_gen ( |
| 48 | + .CLK_IN(clk_in), |
| 49 | + .CLK_OUT_DIV(slow_clk_out), |
| 50 | + .CLK_OUT_MUL(fast_clk_out) |
| 51 | + ); |
| 52 | + |
| 53 | + CLK_GEN clk_gen2 ( |
| 54 | + .CLK_IN(slow_clk_out), |
| 55 | + .CLK_OUT_DIV(slow_clk_out2), |
| 56 | + .CLK_OUT_MUL(fast_clk_out2) |
| 57 | + ); |
| 58 | + |
| 59 | + CLK_GEN clk_gen3 ( |
| 60 | + .CLK_IN(slow_clk_out2), |
| 61 | + .CLK_OUT_DIV(slow_clk_out3), |
| 62 | + .CLK_OUT_MUL(fast_clk_out3) |
| 63 | + ); |
| 64 | + |
| 65 | +endmodule |
0 commit comments