mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-25 23:19:35 +00:00
tests/memfile: Test dump_meminit
Change tests/memfile to a mktest, moving the prior run-test.sh contents into a new read_dir.sh. Add dump.ys (and friends) for testing dump_meminit.
This commit is contained in:
parent
7d79c11ca9
commit
3787ea19cd
7 changed files with 152 additions and 49 deletions
19
tests/memfile/dump_gate.v
Normal file
19
tests/memfile/dump_gate.v
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module gate (
|
||||
input clk, wen,
|
||||
input [2:0] addr,
|
||||
input [3:0] wdata,
|
||||
output [3:0] rdata
|
||||
);
|
||||
|
||||
reg [3:0] m [7:0];
|
||||
initial
|
||||
$readmemh("gold.m.mem", m);
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (wen)
|
||||
m[addr] <= wdata;
|
||||
else
|
||||
rdata <= m[addr];
|
||||
end
|
||||
|
||||
endmodule
|
||||
Loading…
Add table
Add a link
Reference in a new issue