mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-22 05:36:43 +00:00
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.
19 lines
No EOL
282 B
Verilog
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 |