K
Kevin Neilson
Guest
Here's an interesting synthesis result. I synthesized this with Vivado for Virtex-7:
reg [68:0] x;
reg x_neq_0;
always@(posedge clk) x_neq_0 <= x!=0; // version 1
Then I rephrased the logic:
reg [68:0] x;
reg x_neq_0;
always@(posedge clk) x_neq_0 <= |x; // version 2
These should be the same, right?
Version 1 uses 23 3-input LUTs on the first level followed by a 23-long carry chain (6 CARRY4 blocks). This is twice as big as it should be.
Version 2 is 3 levels of LUTs, 12 6-input LUTs on the first level, 15 total.
Neither is optimal. What I really want is a combination, 12 6-input LUTs followed by 3 CARRY4s.
This is supposed to be the era of high-level synthesis...
reg [68:0] x;
reg x_neq_0;
always@(posedge clk) x_neq_0 <= x!=0; // version 1
Then I rephrased the logic:
reg [68:0] x;
reg x_neq_0;
always@(posedge clk) x_neq_0 <= |x; // version 2
These should be the same, right?
Version 1 uses 23 3-input LUTs on the first level followed by a 23-long carry chain (6 CARRY4 blocks). This is twice as big as it should be.
Version 2 is 3 levels of LUTs, 12 6-input LUTs on the first level, 15 total.
Neither is optimal. What I really want is a combination, 12 6-input LUTs followed by 3 CARRY4s.
This is supposed to be the era of high-level synthesis...