3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-22 05:36:43 +00:00
yosys/tests/memfile/dump_gate.v
Krystine Sherwin 3787ea19cd
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.
2025-11-14 11:47:40 +13:00

19 lines
No EOL
282 B
Verilog

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