T
Thomas Womack
Guest
This ought to be a polynomial multiplier:
reg [15:0] a;
reg [15:0] b;
reg [30:0] c;
integer i;
always @(negedge Clk)
begin
c[15:0] = a[15:0]& {16{b[0]}};
for (i=1; i<=15; i=i+1)
begin
c[15+i : i] = c[15+i : i] ^ ({16{b}} & a[15:0]);
end
end
I'm expecting it to synthesise to a large blob of LUTs with a rather
long critical path -- IE I'm not expecting it to be an efficient polynomial
multiplier, but I've got a few ideas to get that working better.
But I want to get this one to compile before I go to anything more elaborate.
When I feed it through XST, I get a load of error messages
I just don't understand:
ERROR:HDLCompilers:109 - polymul.v line 132 Most significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:110 - polymul.v line 132 Least significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:44 - polymul.v line 132 Illegal left hand side of blocking assignment
ERROR:HDLCompilers:109 - polymul.v line 132 Most significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:110 - polymul.v line 132 Least significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:45 - polymul.v line 132 Illegal right hand side of blocking assignment
What confuses me is that lines of the form
c[16:1] = c[16:1] ^ ({16{b[1]}} & a[15:0]);
compile just fine. For the moment I'll expand the loop manually, but
that seems really to defeat the point of writing in a hardware design
language!
Please help an ignorant fool,
Tom
reg [15:0] a;
reg [15:0] b;
reg [30:0] c;
integer i;
always @(negedge Clk)
begin
c[15:0] = a[15:0]& {16{b[0]}};
for (i=1; i<=15; i=i+1)
begin
c[15+i : i] = c[15+i : i] ^ ({16{b}} & a[15:0]);
end
end
I'm expecting it to synthesise to a large blob of LUTs with a rather
long critical path -- IE I'm not expecting it to be an efficient polynomial
multiplier, but I've got a few ideas to get that working better.
But I want to get this one to compile before I go to anything more elaborate.
When I feed it through XST, I get a load of error messages
I just don't understand:
ERROR:HDLCompilers:109 - polymul.v line 132 Most significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:110 - polymul.v line 132 Least significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:44 - polymul.v line 132 Illegal left hand side of blocking assignment
ERROR:HDLCompilers:109 - polymul.v line 132 Most significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:110 - polymul.v line 132 Least significant bit operand in part-select of vector reg 'c' is illegal
ERROR:HDLCompilers:45 - polymul.v line 132 Illegal right hand side of blocking assignment
What confuses me is that lines of the form
c[16:1] = c[16:1] ^ ({16{b[1]}} & a[15:0]);
compile just fine. For the moment I'll expand the loop manually, but
that seems really to defeat the point of writing in a hardware design
language!
Please help an ignorant fool,
Tom