mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-24 21:27:00 +00:00
sv: Add support for memory typedefs
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
e70e4afb60
commit
30d2326030
3 changed files with 44 additions and 3 deletions
10
tests/svtypes/typedef_memory.sv
Normal file
10
tests/svtypes/typedef_memory.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] ram16x4_t[0:15];
|
||||
|
||||
ram16x4_t mem;
|
||||
|
||||
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