In reply to cgales:
Also note that
- you should be using $urandom instead of $random to take advantage of SystemVerilog’s random stability and seeding functionality.
- Associative arrays should have a declared index type and not use a wildcard index. This let you use a number of other SystemVerilog features like foreach loops.