|
| 1 | +design -reset |
| 2 | +read_verilog <<EOT |
| 3 | +module cascade(input clk, input [4:0] a, input [4:0] b, output reg [9:0] o); |
| 4 | +reg [4:0] ar1, ar2, ar3, br1, br2, br3; |
| 5 | +reg [9:0] m, n; |
| 6 | +always @(posedge clk) begin |
| 7 | +ar1 <= a; |
| 8 | +ar2 <= ar1; |
| 9 | +ar3 <= ar2; |
| 10 | +br1 <= b; |
| 11 | +br2 <= br1; |
| 12 | +br3 <= br2; |
| 13 | +m <= ar1 * br1; |
| 14 | +n <= ar2 * br2 + m; |
| 15 | +o <= ar3 * br3 + n; |
| 16 | +end |
| 17 | +endmodule |
| 18 | +EOT |
| 19 | +proc |
| 20 | +design -save read |
| 21 | + |
| 22 | +equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx |
| 23 | +design -load postopt |
| 24 | +cd cascade |
| 25 | +select -assert-count 3 t:DSP48E1 |
| 26 | +select -assert-none t:DSP48E1 t:BUFG %% t:* %D |
| 27 | +# Very crude method of checking that DSP48E1.PCOUT -> DSP48E1.PCIN |
| 28 | +# (i.e. Take all DSP48E1s, expand to find all wires connected |
| 29 | +# to its PCOUT port, then remove all DSP48E1s from this |
| 30 | +# selection, then expand again to find all cells where |
| 31 | +# those wires are connected to the PCIN port, then remove |
| 32 | +# all wires from this selection, and lastly intersect |
| 33 | +# this selection with all DSP48E1 cells (to check that |
| 34 | +# the connected cells are indeed DSPs) |
| 35 | +select -assert-count 2 t:DSP48E1 %co:+[PCOUT] t:DSP48E1 %d %co:+[PCIN] w:* %d t:DSP48E1 %i |
| 36 | + |
| 37 | +design -load read |
| 38 | +equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx -family xc6s |
| 39 | +design -load postopt |
| 40 | +cd cascade |
| 41 | +select -assert-count 3 t:DSP48A1 |
| 42 | +select -assert-count 5 t:FDRE # No cascade for A input |
| 43 | +select -assert-none t:DSP48A1 t:BUFG t:FDRE %% t:* %D |
| 44 | +# Very crude method of checking that DSP48E1.PCOUT -> DSP48E1.PCIN |
| 45 | +# (see above for explanation) |
| 46 | +select -assert-count 2 t:DSP48A1 %co:+[PCOUT] t:DSP48A1 %d %co:+[PCIN] w:* %d t:DSP48A1 %i |
| 47 | + |
| 48 | +design -reset |
| 49 | +read_verilog <<EOT |
| 50 | +module cascade(input clk, input [4:0] a, input [4:0] b, output reg [9:0] o); |
| 51 | +reg [4:0] ar1, ar2, ar3, br1, br2, br3; |
| 52 | +reg [9:0] m; |
| 53 | +always @(posedge clk) begin |
| 54 | +ar1 <= a; |
| 55 | +ar2 <= ar1; |
| 56 | +ar3 <= ar2; |
| 57 | +br1 <= b; |
| 58 | +br2 <= br1; |
| 59 | +br3 <= br2; |
| 60 | +m <= ar2 * br2; |
| 61 | +o <= ar3 * br3 + m; |
| 62 | +end |
| 63 | +endmodule |
| 64 | +EOT |
| 65 | +proc |
| 66 | +design -save read |
| 67 | + |
| 68 | +equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx |
| 69 | +design -load postopt |
| 70 | +cd cascade |
| 71 | +select -assert-count 2 t:DSP48E1 |
| 72 | +select -assert-none t:DSP48E1 t:BUFG %% t:* %D |
| 73 | +# Very crude method of checking that DSP48E1.PCOUT -> DSP48E1.PCIN |
| 74 | +# (see above for explanation) |
| 75 | +select -assert-count 1 t:DSP48E1 %co:+[PCOUT] t:DSP48E1 %d %co:+[PCIN] w:* %d t:DSP48E1 %i |
| 76 | + |
| 77 | +design -load read |
| 78 | +equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx -family xc6s |
| 79 | +design -load postopt |
| 80 | +cd cascade |
| 81 | +select -assert-count 2 t:DSP48A1 |
| 82 | +select -assert-count 10 t:FDRE # Cannot cascade because first 'm' DSP |
| 83 | + # uses both B0REG and B1REG, whereas 'o' |
| 84 | + # only requires 1 |
| 85 | +select -assert-none t:DSP48A1 t:BUFG t:FDRE %% t:* %D |
| 86 | +# Very crude method of checking that DSP48E1.PCOUT -> DSP48E1.PCIN |
| 87 | +# (see above for explanation) |
| 88 | +select -assert-count 1 t:DSP48A1 %co:+[PCOUT] t:DSP48A1 %d %co:+[PCIN] w:* %d t:DSP48A1 %i |
| 89 | + |
0 commit comments