Queues of Dynamic Arrays

In reply to jin17:

That works. Thank you very much!

Hi Dave,

Now I’m running into an issue trying to assign a slice of the array above. Instead of

logic [7:0] DA;

I had:

logic [15:0] DA2;

But the following assignment would generate a compile error:

DA2[11:0] = Qda.pop_front();

Error- Incompatible complex type

Incompatible complex type assignment
Type of source expression is incompatible with type of target expression.
Mismatching types cannot be used in assignments, initializations and
instantiations. The type of the target is ‘logic[15:0][]', while the type of the source is 'logic[7:0]’.
Source Expression: this.Qda.pop_front


My intention is to pop the first dynamic array off Qda, and assign it to DA2. But since the packed dimensions are different, I want to put each byte of Qda’s lowest-indexed dynamic array into the LSB’s of each word of DA2. What’s the best way to accomplish this? Thanks again in advance.