rocking
Newbie level 2
verilog variable part select
Hi!
I'm trying to execute the following statement:
var[119-i:112-i] <= temp;
I get an error that says non-constant part select index.
What I am trying to do is that I have a 120 bit register called var. I'm getting an 8 bit value called temp from combinational logic and I want to assign it to the 1st 8 MSBs of var i.e. from var[119:112]. Then for the second value of temp, I want to assign it to var[111:104] and so on till var is filled.
any help would be greatly appreciated!
Thanks
Hi!
I'm trying to execute the following statement:
var[119-i:112-i] <= temp;
I get an error that says non-constant part select index.
What I am trying to do is that I have a 120 bit register called var. I'm getting an 8 bit value called temp from combinational logic and I want to assign it to the 1st 8 MSBs of var i.e. from var[119:112]. Then for the second value of temp, I want to assign it to var[111:104] and so on till var is filled.
any help would be greatly appreciated!
Thanks