Created
July 10, 2019 14:27
-
-
Save osamaadam/ff485d9f38965dd3c1bff8744bb07593 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment