Skip to main content

Posts

Showing posts from July, 2014

Queue of arrays and Array of Queues

1 2 module test ; 3 4 int a [ $ ][]; 5 int b []; 6 int c []; 7 8 int aa [][ $ ]; 9 int bb [ $ ]; 10 int cc [ $ ]; 11 12 initial 13 begin 14 b = new [ 10 ]; 15 b [ 0 ] = 100 ; 16 a .push_back ( b ); 17 c = a .pop_back (); 18 $display ( "Read back value is: %0d \n " , c [ 0 ]); 19 20 aa = new [ 10 ]; //Make 10 wide queues. 21 bb .push_back ( 1000 ); 22 aa [ 0 ] = bb ; 23 cc = aa [ 0 ]; 24 $display ( "Read back value from que is: %0d \n " , cc .pop_back ()); 25 26 end 27 28 endmodule