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:
parent
30d2326030
commit
af25585170
2 changed files with 30 additions and 6 deletions
10
tests/svtypes/typedef_memory_2.sv
Normal file
10
tests/svtypes/typedef_memory_2.sv
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue