QUEUE of QUEUES

module queue_queue; 
  typedef int qint_t[$]; 
   qint_t Qq[$]; // same as int Qq[$][$];
  initial begin
    Qq={{1,2},{3,4,5}}; 
 Qq.push_back(qint_t'{6,7});  
 Qq[2].push_back(1); 
$display("%p",Qq); 
  end 

endmodule


after simulation

Error-[ICTA] Incompatible complex type
testbench.sv, 7
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 ‘int$[][]’, while the type of
the source is ‘bit[95:0]’.
Source Expression: {3, 4, 5}

2 errors

can anybody please give the reason why it is so

In reply to suresh M:

You are not allowed to nest unpacked array concatenations - the inner {}'s will be treated as regular integral concatenation. You should be able to write

 Qq={qint_'{1,2},qint_t'{3,4,5}}; 

or

 Qq='{'{1,2},'{3,4,5}};

In reply to dave_59:

thank you so much

In reply to suresh M:

Hey Dave, what would i need to do if i wanted to remove say one element of {3,4,5} in Qq

In reply to manchali:

Qq[1].delete(1) would remove the 4 from {3,4,5}

In reply to dave_59:

THis gives me an error as

** Error (suppressible): q1.sv(5): (qverilog-13174) Illegal assignment pattern. The number of elements (3) doesn’t match with the type’s width (32).

In reply to sravanm_tc:

In questasim you need to declare it as Qq[][];