Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module sparseMemory();
- typedef enum {false, true} boolean;
- bit[31:0] highestIndex;
- bit[31:0] lowestIndex;
- boolean bigMemory[bit[31:0]];
- initial begin
- for(int i = 0; i < 25; i++) begin
- bigMemory[$urandom] = true;
- end
- bigMemory.first(lowestIndex);
- bigMemory.last(highestIndex);
- $display("bigMemory has %0d inputs", bigMemory.size());
- $display("The lowest index is %0d", lowestIndex);
- $display("The highest index is %0d", highestIndex);
- $display("Here are the addresses");
- foreach(bigMemory[i])
- $display(i);
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement