3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-12 14:11:00 +00:00

Fix #938 - Crash occurs in case when use write_firrtl command

Add missing memory initialization.
Sanity-check memory parameters.
Add Cell pointer to memory object (for error reporting).
This commit is contained in:
Jim Lawson 2019-05-01 13:16:01 -07:00
parent e35fe1344d
commit 38f5424f92
3 changed files with 64 additions and 4 deletions

View file

@ -0,0 +1,22 @@
module top
(
input [7:0] data_a,
input [6:1] addr_a,
input we_a, clk,
output reg [7:0] q_a
);
// Declare the RAM variable
reg [7:0] ram[63:0];
// Port A
always @ (posedge clk)
begin
if (we_a)
begin
ram[addr_a] <= data_a;
q_a <= data_a;
end
q_a <= ram[addr_a];
end
endmodule