K
Kevin Neilson
Guest
It's 2016 and I still have to write out most of my code at very low levels of abstraction like I did ten years ago. Whenever I hear about a new tool that supposedly converts C to gates, I don't even look into it, because I can't even get Verilog to synth properly.
My latest example: I needed to reduce an 12-bit number, mod-24.
input [11:0] x;
always@(posedge clk) xmod24 <= x%24;
When I put this in Vivado, what do I get? 40 LUTs (plus some carry chains) and 10 levels of logic. TEN. Needless to say, that won't meet timing at 350MHz, especially when it involves getting on and off a bunch of little carry chains.
So then I have to go down a level of abstraction:
input [11:0];
// x%24 = 8*(floor(x/8)%3) + x%8
always@(posedge clk)
xmod24 <= {x[11:3]%3, x[2:0]};
Now I get 4 LUTs and TWO levels of logic. TWO. At least I didn't have to instantiate primitives, like I still often do, even though it's 2016.
Needless to say, I am not about to waste a bunch of time trying out any new "high-level synthesis" tools.
My latest example: I needed to reduce an 12-bit number, mod-24.
input [11:0] x;
always@(posedge clk) xmod24 <= x%24;
When I put this in Vivado, what do I get? 40 LUTs (plus some carry chains) and 10 levels of logic. TEN. Needless to say, that won't meet timing at 350MHz, especially when it involves getting on and off a bunch of little carry chains.
So then I have to go down a level of abstraction:
input [11:0];
// x%24 = 8*(floor(x/8)%3) + x%8
always@(posedge clk)
xmod24 <= {x[11:3]%3, x[2:0]};
Now I get 4 LUTs and TWO levels of logic. TWO. At least I didn't have to instantiate primitives, like I still often do, even though it's 2016.
Needless to say, I am not about to waste a bunch of time trying out any new "high-level synthesis" tools.