In reply to dave_59:
Hi Dave,
there is a queue which has entries depending upon a scenario(say scenario 1) being hit everytime, the max-m length of this queue could be 32. depending upon the length of the queue, we check for other scenario(say scenario 2). Now everytime scenario 2 hits I update the nth bit of a the variable “test”.
rg_q_len = rg_hit_queue.size();
for(ii=0; ii< rg_q_len; ii++) begin
test[ii] = scenario 2
once the iteration reaches the final value ii=rg_q_len,
I want to return &(test[rg_q_len-1:0]). so say rg_q_len is 5. I want &(test[4:0]).
I learnt that we cannot use constant for a range expression.
I am now using the following logic:
declaring a bit variable grant.
bit grant =1;
inside the for loop*
test[ii] = scenario 2;
grant &= test[ii];
return(grant)
this is working fine. you could suggest me any other method though.