Skip to content

Instantly share code, notes, and snippets.

@brianhill11
Created February 4, 2016 03:51
Show Gist options
  • Save brianhill11/399213bbe843c54085f1 to your computer and use it in GitHub Desktop.
Save brianhill11/399213bbe843c54085f1 to your computer and use it in GitHub Desktop.
module read_file_test_top();
parameter NUM_TESTS = 10000;
parameter NUM_COLS = 3;
parameter MEM_SIZE = NUM_TESTS*NUM_COLS;
reg [31:0] mem [MEM_SIZE];
int i;
initial begin
$readmemh("/home/b/quartus_test_data.hex", mem);
for (i = 0; i < MEM_SIZE; i=i+NUM_COLS) begin
assert( mem[i] * mem[i+1] == mem[i+2] );
end
$display("Finished all tests.. No errors");
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment