3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-07 19:51:23 +00:00

sv: Add support for memories of a typedef

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2019-09-20 11:46:37 +01:00
parent 30d2326030
commit af25585170
2 changed files with 30 additions and 6 deletions

View file

@ -0,0 +1,10 @@
module top(input [3:0] addr, wdata, input clk, wen, output reg [3:0] rdata);
typedef logic [3:0] nibble;
nibble mem[0:15];
always @(posedge clk) begin
if (wen) mem[addr] <= wdata;
rdata <= mem[addr];
end
endmodule