K
kb33
Guest
Hi,
I have the following piece of code which is probably too complicated
for the simulation tool. It just hangs:
`define INDEX_SZ 3
`define NUM_ELEMENTS 8
reg [`INDEX_SZ-1:0] var_b_comb,
var_c_comb;
reg [`INDEX_SZ*`NUM_ELEMENTS/2 - 1:0] var_c_vector_comb,
var_bxorc_vector_comb;
for (var_c_comb = 0; var_c_comb < `NUM_ELEMENTS; var_c_comb
= var_c_comb +1)
if ((var_c_comb ^ var_b_comb) > 1)
begin
var_c_vector_comb <= ((var_c_vector_comb <<
`INDEX_SZ) | var_c_comb);
var_bxorc_vector_comb <= ((var_bxorc_vector_comb <<
`INDEX_SZ) | (var_c_comb ^ var_b_comb));
end
//End of code..
What I would like to do is update the var_c_vector_comb and the
var_bxorc_vector_comb whenever the IF condition is satisfied. At the
same time, I need to preserve the previously stored values hence the
left shift operation. Also, the reason I have chosen NUM_ELEMENTS/2 in
the size of the two vectors is because I expect the IF condition to be
true for only half the number of elements. Any suggestions would be
appreciated.
Thanks
Kanchan
I have the following piece of code which is probably too complicated
for the simulation tool. It just hangs:
`define INDEX_SZ 3
`define NUM_ELEMENTS 8
reg [`INDEX_SZ-1:0] var_b_comb,
var_c_comb;
reg [`INDEX_SZ*`NUM_ELEMENTS/2 - 1:0] var_c_vector_comb,
var_bxorc_vector_comb;
for (var_c_comb = 0; var_c_comb < `NUM_ELEMENTS; var_c_comb
= var_c_comb +1)
if ((var_c_comb ^ var_b_comb) > 1)
begin
var_c_vector_comb <= ((var_c_vector_comb <<
`INDEX_SZ) | var_c_comb);
var_bxorc_vector_comb <= ((var_bxorc_vector_comb <<
`INDEX_SZ) | (var_c_comb ^ var_b_comb));
end
//End of code..
What I would like to do is update the var_c_vector_comb and the
var_bxorc_vector_comb whenever the IF condition is satisfied. At the
same time, I need to preserve the previously stored values hence the
left shift operation. Also, the reason I have chosen NUM_ELEMENTS/2 in
the size of the two vectors is because I expect the IF condition to be
true for only half the number of elements. Any suggestions would be
appreciated.
Thanks
Kanchan