what does queue[$] in the following code mean ?

On Mon, 26 Nov 2007 22:43:57 -0800 (PST), very_very_log
<sgiitnewid@gmail.com> wrote:

module queueTestPackage;
int queue [$];
endmodule
It's a kind of array in SystemVerilog, known as
a queue (yes, I know that the programmer used the name
"queue" for the variable; that's OK, but he could have
called it "elephant" if he preferred!). The [$]
subscript range indicates that the queue is unbounded
(there is no limit to its length). You can, if you
prefer, set an upper bound on the length of the queue,
like this:

int queue_of_no_more_than_10_ints[$:10];

Both kinds of queue have subscripts 0 to size-1.
You can find out about the queue's size using
its size method:

int n;
...
n = queue.size;

This will initially be zero - the queue starts life empty.

The neat thing about queues is that they can grow and
shrink dynamically. In particular they're good for
implementing FIFO and LIFO stacks, but there are
many other things you can do with them.

Read any book on SystemVerilog verification for more
information on queues.

You won't be able to compile this code unless you
have SystemVerilog features enabled in your simulator.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

Welcome to EDABoard.com

Sponsor

Back
Top