0

I have declared a unbounded queue of 2-D associative array as below :

 static bit [15:0] array[4][*][$]; 

I intend to access the array using bit vector, as follows :

array[0][4'b{info[31:28]}].push_back(info[18:6]);

I get the below compile error :

** Error: (vlog-13057) driver.sv(95): Expecting numeric digits.

Whats wrong here ?

2
  • what is this 4'b{info[31:28]} supposed to mean? Just info[31:28] should be sufficient. Commented May 16, 2020 at 14:23
  • I thought explicit typecast was needed, i was wrong, it works when i remove the 4'b Commented May 16, 2020 at 14:46

1 Answer 1

1

I think you meant to write 4'(info[31:28]) as a cast to 4 bits, but there is no need to do that as info[31:28] is already 4 bits.

Also, do not use the wildcard [*] index in your declaration. It prevents you from using other features you might want to use later, like foreach loops and find array methods. Use [bit [3:0]] instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.