cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Anonymous
Not applicable
6,919 Views

Error!!!!!!

Jump to solution

 reg [87:0]Partial1; 

reg [21:0]Partial2; 

reg [127:0]X; 

reg [127:0]Y;

integer i;

always@*

begin

X[87:0]<=Partial1;

for(i=0;i<=21;i=i+1)

begin

Y[4*i]<=Partial2[i];

Y[(4*i+3):(4*i+1)]<=3'b0;

end

Y[127:88]<=0;

end

 

 

Errors:

ERROR:HDLCompilers:109 - "Top_Level_Put_Together.v" line 69 Most significant bit operand in part-select of vector reg 'Y' is illegal

ERROR:HDLCompilers:110 - "Top_Level_Put_Together.v" line 69 Least significant bit operand in part-select of vector reg 'Y' is illegal

ERROR:HDLCompilers:106 - "Top_Level_Put_Together.v" line 69 Illegal left hand side of nonblocking assignment

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
8,692 Views
Registered: ‎09-16-2009

Digimax,

 

Well first of all, you don't want to use non-blocking assignments here.  Change them to

blocking assignments.

 

Second (Decipering the forums messing up your posting) what you're trying to do in this line:

 

Y[ (4*i+3) : ( 4*i+1)] = 3'b0;

 

Isn't legal verilog.  Although you can see that this range is always 3 bits, this

wasn't readily apparant in the original Verilog-XL tools, thus was made illegal.

 

So, in verilog-2k, you've got new range operators to make these types of things work:

 

Y[  (4*i+3) -: 3 ] = 3'b0;

  or

Y[  (4*i+1) +: 3 ] = 3'b0;

 

The key to making this work is that the left side range operator can be variable.

The right side operator - the width - must be constant.

 

Give this a try, and you should be good to go.

View solution in original post

4 Replies
Highlighted
Anonymous
Not applicable
6,900 Views

help!!!

0 Kudos
Highlighted
Participant
Participant
6,879 Views
Registered: ‎05-11-2010
I'm not familiar with Verilog syntax but did you try Y[127:88] <= 40'b0;
You're assigning a single bit value to a vector !
0 Kudos
Highlighted
Scholar
Scholar
8,693 Views
Registered: ‎09-16-2009

Digimax,

 

Well first of all, you don't want to use non-blocking assignments here.  Change them to

blocking assignments.

 

Second (Decipering the forums messing up your posting) what you're trying to do in this line:

 

Y[ (4*i+3) : ( 4*i+1)] = 3'b0;

 

Isn't legal verilog.  Although you can see that this range is always 3 bits, this

wasn't readily apparant in the original Verilog-XL tools, thus was made illegal.

 

So, in verilog-2k, you've got new range operators to make these types of things work:

 

Y[  (4*i+3) -: 3 ] = 3'b0;

  or

Y[  (4*i+1) +: 3 ] = 3'b0;

 

The key to making this work is that the left side range operator can be variable.

The right side operator - the width - must be constant.

 

Give this a try, and you should be good to go.

View solution in original post

Highlighted
Anonymous
Not applicable
6,858 Views

your comments are quite helpful, thank you!

0 Kudos