SV: Can I have array of Queues?

R

Ravi S Gowda

Guest
How do I declare 1000 Queues in SV?
Is an array of Queues possible in SV?
Solution I have right now is to encapsulate a Queue inside a class,
and declare an array of the class.
Any other method in SV?

Thanks
Ravi
 
1. As you have suggested, you can create a class and make an array
of object instances of that class.

2. Use regular Verilog $q_initialize task. For declaring N queues,
simply
create a for loop:

for (i=1; i<=100; i=i+1)
$q_initialize(i, ...);

You can do everything that an array will do by using the q_id
associated with all $q_* tasks in Verilog.

- Swapnajit
______________________________­­_____________________________­_­_________


SystemVerilog, DPI, Verilog PLI and all other good stuffs.
Project VeriPage: http://www.project-veripage.com
For subscribing to the mailing list:
<URL: http://www.project-veripage.com/list/?p=subscribe&id=1>
 

Welcome to EDABoard.com

Sponsor

Back
Top