Memories

Memories are either represented using RTLIL::Memory objects, $memrd_v2, $memwr_v2, and $meminit_v2 cells, or by $mem_v2 cells alone.

In the first alternative the RTLIL::Memory objects hold the general metadata for the memory (bit width, size in number of words, etc.) and for each port a $memrd_v2 (read port) or $memwr_v2 (write port) cell is created. Having individual cells for read and write ports has the advantage that they can be consolidated using resource sharing passes. In some cases this drastically reduces the number of required ports on the memory cell. In this alternative, memory initialization data is represented by $meminit_v2 cells, which allow delaying constant folding for initialization addresses and data until after the frontend finishes.

The $memrd_v2 cells have a clock input CLK, an enable input EN, an address input ADDR, a data output DATA, an asynchronous reset input ARST, and a synchronous reset input SRST. They also have the following parameters:

MEMID

The name of the RTLIL::Memory object that is associated with this read port.

ABITS

The number of address bits (width of the ADDR input port).

WIDTH

The number of data bits (width of the DATA output port). Note that this may be a power-of-two multiple of the underlying memory’s width – such ports are called wide ports and access an aligned group of cells at once. In this case, the corresponding low bits of ADDR must be tied to 0.

CLK_ENABLE

When this parameter is non-zero, the clock is used. Otherwise this read port is asynchronous and the CLK input is not used.

CLK_POLARITY

Clock is active on the positive edge if this parameter has the value 1'b1 and on the negative edge if this parameter is 1'b0.

TRANSPARENCY_MASK

This parameter is a bitmask of write ports that this read port is transparent with. The bits of this parameter are indexed by the write port’s PORTID parameter. Transparency can only be enabled between synchronous ports sharing a clock domain. When transparency is enabled for a given port pair, a read and write to the same address in the same cycle will return the new value. Otherwise the old value is returned.

COLLISION_X_MASK

This parameter is a bitmask of write ports that have undefined collision behavior with this port. The bits of this parameter are indexed by the write port’s PORTID parameter. This behavior can only be enabled between synchronous ports sharing a clock domain. When undefined collision is enabled for a given port pair, a read and write to the same address in the same cycle will return the undefined (all-X) value.This option is exclusive (for a given port pair) with the transparency option.

ARST_VALUE

Whenever the ARST input is asserted, the data output will be reset to this value. Only used for synchronous ports.

SRST_VALUE

Whenever the SRST input is synchronously asserted, the data output will be reset to this value. Only used for synchronous ports.

INIT_VALUE

The initial value of the data output, for synchronous ports.

CE_OVER_SRST

If this parameter is non-zero, the SRST input is only recognized when EN is true. Otherwise, SRST is recognized regardless of EN.

The $memwr_v2 cells have a clock input CLK, an enable input EN (one enable bit for each data bit), an address input ADDR and a data input DATA. They also have the following parameters:

MEMID

The name of the RTLIL::Memory object that is associated with this write port.

ABITS

The number of address bits (width of the ADDR input port).

WIDTH

The number of data bits (width of the DATA output port). Like with $memrd_v2 cells, the width is allowed to be any power-of-two multiple of memory width, with the corresponding restriction on address.

CLK_ENABLE

When this parameter is non-zero, the clock is used. Otherwise this write port is asynchronous and the CLK input is not used.

CLK_POLARITY

Clock is active on positive edge if this parameter has the value 1'b1 and on the negative edge if this parameter is 1'b0.

PORTID

An identifier for this write port, used to index write port bit mask parameters.

PRIORITY_MASK

This parameter is a bitmask of write ports that this write port has priority over in case of writing to the same address. The bits of this parameter are indexed by the other write port’s PORTID parameter. Write ports can only have priority over write ports with lower port ID. When two ports write to the same address and neither has priority over the other, the result is undefined. Priority can only be set between two synchronous ports sharing the same clock domain.

The $meminit_v2 cells have an address input ADDR, a data input DATA, with the width of the DATA port equal to WIDTH parameter times WORDS parameter, and a bit enable mask input EN with width equal to WIDTH parameter. All three of the inputs must resolve to a constant for synthesis to succeed.

MEMID

The name of the RTLIL::Memory object that is associated with this initialization cell.

ABITS

The number of address bits (width of the ADDR input port).

WIDTH

The number of data bits per memory location.

WORDS

The number of consecutive memory locations initialized by this cell.

PRIORITY

The cell with the higher integer value in this parameter wins an initialization conflict.

The HDL frontend models a memory using RTLIL::Memory objects and asynchronous $memrd_v2 and $memwr_v2 cells. The memory pass (i.e. its various sub-passes) migrates $dff cells into the $memrd_v2 and $memwr_v2 cells making them synchronous, then converts them to a single $mem_v2 cell and (optionally) maps this cell type to $dff cells for the individual words and multiplexer-based address decoders for the read and write interfaces. When the last step is disabled or not possible, a $mem_v2 cell is left in the design.

The $mem_v2 cell provides the following parameters:

MEMID

The name of the original RTLIL::Memory object that became this $mem_v2 cell.

SIZE

The number of words in the memory.

ABITS

The number of address bits.

WIDTH

The number of data bits per word.

INIT

The initial memory contents.

RD_PORTS

The number of read ports on this memory cell.

RD_WIDE_CONTINUATION

This parameter is RD_PORTS bits wide, containing a bitmask of “wide continuation” read ports. Such ports are used to represent the extra data bits of wide ports in the combined cell, and must have all control signals identical with the preceding port, except for address, which must have the proper sub-cell address encoded in the low bits.

RD_CLK_ENABLE

This parameter is RD_PORTS bits wide, containing a clock enable bit for each read port.

RD_CLK_POLARITY

This parameter is RD_PORTS bits wide, containing a clock polarity bit for each read port.

RD_TRANSPARENCY_MASK

This parameter is RD_PORTS*WR_PORTS bits wide, containing a concatenation of all TRANSPARENCY_MASK values of the original $memrd_v2 cells.

RD_COLLISION_X_MASK

This parameter is RD_PORTS*WR_PORTS bits wide, containing a concatenation of all COLLISION_X_MASK values of the original $memrd_v2 cells.

RD_CE_OVER_SRST

This parameter is RD_PORTS bits wide, determining relative synchronous reset and enable priority for each read port.

RD_INIT_VALUE

This parameter is RD_PORTS*WIDTH bits wide, containing the initial value for each synchronous read port.

RD_ARST_VALUE

This parameter is RD_PORTS*WIDTH bits wide, containing the asynchronous reset value for each synchronous read port.

RD_SRST_VALUE

This parameter is RD_PORTS*WIDTH bits wide, containing the synchronous reset value for each synchronous read port.

WR_PORTS

The number of write ports on this memory cell.

WR_WIDE_CONTINUATION

This parameter is WR_PORTS bits wide, containing a bitmask of “wide continuation” write ports.

WR_CLK_ENABLE

This parameter is WR_PORTS bits wide, containing a clock enable bit for each write port.

WR_CLK_POLARITY

This parameter is WR_PORTS bits wide, containing a clock polarity bit for each write port.

WR_PRIORITY_MASK

This parameter is WR_PORTS*WR_PORTS bits wide, containing a concatenation of all PRIORITY_MASK values of the original $memwr_v2 cells.

The $mem_v2 cell has the following ports:

RD_CLK

This input is RD_PORTS bits wide, containing all clock signals for the read ports.

RD_EN

This input is RD_PORTS bits wide, containing all enable signals for the read ports.

RD_ADDR

This input is RD_PORTS*ABITS bits wide, containing all address signals for the read ports.

RD_DATA

This output is RD_PORTS*WIDTH bits wide, containing all data signals for the read ports.

RD_ARST

This input is RD_PORTS bits wide, containing all asynchronous reset signals for the read ports.

RD_SRST

This input is RD_PORTS bits wide, containing all synchronous reset signals for the read ports.

WR_CLK

This input is WR_PORTS bits wide, containing all clock signals for the write ports.

WR_EN

This input is WR_PORTS*WIDTH bits wide, containing all enable signals for the write ports.

WR_ADDR

This input is WR_PORTS*ABITS bits wide, containing all address signals for the write ports.

WR_DATA

This input is WR_PORTS*WIDTH bits wide, containing all data signals for the write ports.

The memory_collect pass can be used to convert discrete $memrd_v2, $memwr_v2, and $meminit_v2 cells belonging to the same memory to a single $mem_v2 cell, whereas the memory_unpack pass performs the inverse operation. The memory_dff pass can combine asynchronous memory ports that are fed by or feeding registers into synchronous memory ports. The memory_bram pass can be used to recognize $mem_v2 cells that can be implemented with a block RAM resource on an FPGA. The memory_map pass can be used to implement $mem_v2 cells as basic logic: word-wide DFFs and address decoders.

yosys> help $mem
Simulation model (verilog)
Listing 206 simlib.v
2942module \$mem (RD_CLK, RD_EN, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA);
2943
2944    parameter MEMID = "";
2945    parameter signed SIZE = 4;
2946    parameter signed OFFSET = 0;
2947    parameter signed ABITS = 2;
2948    parameter signed WIDTH = 8;
2949    parameter signed INIT = 1'bx;
2950
2951    parameter signed RD_PORTS = 1;
2952    parameter RD_CLK_ENABLE = 1'b1;
2953    parameter RD_CLK_POLARITY = 1'b1;
2954    parameter RD_TRANSPARENT = 1'b1;
2955
2956    parameter signed WR_PORTS = 1;
2957    parameter WR_CLK_ENABLE = 1'b1;
2958    parameter WR_CLK_POLARITY = 1'b1;
2959
2960    input [RD_PORTS-1:0] RD_CLK;
2961    input [RD_PORTS-1:0] RD_EN;
2962    input [RD_PORTS*ABITS-1:0] RD_ADDR;
2963    output reg [RD_PORTS*WIDTH-1:0] RD_DATA;
2964
2965    input [WR_PORTS-1:0] WR_CLK;
2966    input [WR_PORTS*WIDTH-1:0] WR_EN;
2967    input [WR_PORTS*ABITS-1:0] WR_ADDR;
2968    input [WR_PORTS*WIDTH-1:0] WR_DATA;
2969
2970    reg [WIDTH-1:0] memory [SIZE-1:0];
2971
2972    integer i, j;
2973    reg [WR_PORTS-1:0] LAST_WR_CLK;
2974    reg [RD_PORTS-1:0] LAST_RD_CLK;
2975
2976    function port_active;
2977        input clk_enable;
2978        input clk_polarity;
2979        input last_clk;
2980        input this_clk;
2981        begin
2982            casez ({clk_enable, clk_polarity, last_clk, this_clk})
2983                4'b0???: port_active = 1;
2984                4'b1101: port_active = 1;
2985                4'b1010: port_active = 1;
2986                default: port_active = 0;
2987            endcase
2988        end
2989    endfunction
2990
2991    initial begin
2992        for (i = 0; i < SIZE; i = i+1)
2993            memory[i] = INIT >>> (i*WIDTH);
2994    end
2995
2996    always @(RD_CLK, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA) begin
2997    `ifdef SIMLIB_MEMDELAY
2998        #`SIMLIB_MEMDELAY;
2999    `endif
3000        for (i = 0; i < RD_PORTS; i = i+1) begin
3001            if (!RD_TRANSPARENT[i] && RD_CLK_ENABLE[i] && RD_EN[i] && port_active(RD_CLK_ENABLE[i], RD_CLK_POLARITY[i], LAST_RD_CLK[i], RD_CLK[i])) begin
3002                // $display("Read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
3003                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
3004            end
3005        end
3006
3007        for (i = 0; i < WR_PORTS; i = i+1) begin
3008            if (port_active(WR_CLK_ENABLE[i], WR_CLK_POLARITY[i], LAST_WR_CLK[i], WR_CLK[i]))
3009                for (j = 0; j < WIDTH; j = j+1)
3010                    if (WR_EN[i*WIDTH+j]) begin
3011                        // $display("Write to %s: addr=%b data=%b", MEMID, WR_ADDR[i*ABITS +: ABITS], WR_DATA[i*WIDTH+j]);
3012                        memory[WR_ADDR[i*ABITS +: ABITS] - OFFSET][j] = WR_DATA[i*WIDTH+j];
3013                    end
3014        end
3015
3016        for (i = 0; i < RD_PORTS; i = i+1) begin
3017            if ((RD_TRANSPARENT[i] || !RD_CLK_ENABLE[i]) && port_active(RD_CLK_ENABLE[i], RD_CLK_POLARITY[i], LAST_RD_CLK[i], RD_CLK[i])) begin
3018                // $display("Transparent read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
3019                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
3020            end
3021        end
3022
3023        LAST_RD_CLK <= RD_CLK;
3024        LAST_WR_CLK <= WR_CLK;
3025    end
3026
3027endmodule
yosys> help $mem_v2
Simulation model (verilog)
Listing 207 simlib.v
3031module \$mem_v2 (RD_CLK, RD_EN, RD_ARST, RD_SRST, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA);
3032
3033    parameter MEMID = "";
3034    parameter signed SIZE = 4;
3035    parameter signed OFFSET = 0;
3036    parameter signed ABITS = 2;
3037    parameter signed WIDTH = 8;
3038    parameter signed INIT = 1'bx;
3039
3040    parameter signed RD_PORTS = 1;
3041    parameter RD_CLK_ENABLE = 1'b1;
3042    parameter RD_CLK_POLARITY = 1'b1;
3043    parameter RD_TRANSPARENCY_MASK = 1'b0;
3044    parameter RD_COLLISION_X_MASK = 1'b0;
3045    parameter RD_WIDE_CONTINUATION = 1'b0;
3046    parameter RD_CE_OVER_SRST = 1'b0;
3047    parameter RD_ARST_VALUE = 1'b0;
3048    parameter RD_SRST_VALUE = 1'b0;
3049    parameter RD_INIT_VALUE = 1'b0;
3050
3051    parameter signed WR_PORTS = 1;
3052    parameter WR_CLK_ENABLE = 1'b1;
3053    parameter WR_CLK_POLARITY = 1'b1;
3054    parameter WR_PRIORITY_MASK = 1'b0;
3055    parameter WR_WIDE_CONTINUATION = 1'b0;
3056
3057    input [RD_PORTS-1:0] RD_CLK;
3058    input [RD_PORTS-1:0] RD_EN;
3059    input [RD_PORTS-1:0] RD_ARST;
3060    input [RD_PORTS-1:0] RD_SRST;
3061    input [RD_PORTS*ABITS-1:0] RD_ADDR;
3062    output reg [RD_PORTS*WIDTH-1:0] RD_DATA;
3063
3064    input [WR_PORTS-1:0] WR_CLK;
3065    input [WR_PORTS*WIDTH-1:0] WR_EN;
3066    input [WR_PORTS*ABITS-1:0] WR_ADDR;
3067    input [WR_PORTS*WIDTH-1:0] WR_DATA;
3068
3069    reg [WIDTH-1:0] memory [SIZE-1:0];
3070
3071    integer i, j, k;
3072    reg [WR_PORTS-1:0] LAST_WR_CLK;
3073    reg [RD_PORTS-1:0] LAST_RD_CLK;
3074
3075    function port_active;
3076        input clk_enable;
3077        input clk_polarity;
3078        input last_clk;
3079        input this_clk;
3080        begin
3081            casez ({clk_enable, clk_polarity, last_clk, this_clk})
3082                4'b0???: port_active = 1;
3083                4'b1101: port_active = 1;
3084                4'b1010: port_active = 1;
3085                default: port_active = 0;
3086            endcase
3087        end
3088    endfunction
3089
3090    initial begin
3091        for (i = 0; i < SIZE; i = i+1)
3092            memory[i] = INIT >>> (i*WIDTH);
3093        RD_DATA = RD_INIT_VALUE;
3094    end
3095
3096    always @(RD_CLK, RD_ARST, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA) begin
3097    `ifdef SIMLIB_MEMDELAY
3098        #`SIMLIB_MEMDELAY;
3099    `endif
3100        for (i = 0; i < RD_PORTS; i = i+1) begin
3101            if (RD_CLK_ENABLE[i] && RD_EN[i] && port_active(RD_CLK_ENABLE[i], RD_CLK_POLARITY[i], LAST_RD_CLK[i], RD_CLK[i])) begin
3102                // $display("Read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
3103                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
3104
3105                for (j = 0; j < WR_PORTS; j = j+1) begin
3106                    if (RD_TRANSPARENCY_MASK[i*WR_PORTS + j] && port_active(WR_CLK_ENABLE[j], WR_CLK_POLARITY[j], LAST_WR_CLK[j], WR_CLK[j]) && RD_ADDR[i*ABITS +: ABITS] == WR_ADDR[j*ABITS +: ABITS])
3107                        for (k = 0; k < WIDTH; k = k+1)
3108                            if (WR_EN[j*WIDTH+k])
3109                                RD_DATA[i*WIDTH+k] <= WR_DATA[j*WIDTH+k];
3110                    if (RD_COLLISION_X_MASK[i*WR_PORTS + j] && port_active(WR_CLK_ENABLE[j], WR_CLK_POLARITY[j], LAST_WR_CLK[j], WR_CLK[j]) && RD_ADDR[i*ABITS +: ABITS] == WR_ADDR[j*ABITS +: ABITS])
3111                        for (k = 0; k < WIDTH; k = k+1)
3112                            if (WR_EN[j*WIDTH+k])
3113                                RD_DATA[i*WIDTH+k] <= 1'bx;
3114                end
3115            end
3116        end
3117
3118        for (i = 0; i < WR_PORTS; i = i+1) begin
3119            if (port_active(WR_CLK_ENABLE[i], WR_CLK_POLARITY[i], LAST_WR_CLK[i], WR_CLK[i]))
3120                for (j = 0; j < WIDTH; j = j+1)
3121                    if (WR_EN[i*WIDTH+j]) begin
3122                        // $display("Write to %s: addr=%b data=%b", MEMID, WR_ADDR[i*ABITS +: ABITS], WR_DATA[i*WIDTH+j]);
3123                        memory[WR_ADDR[i*ABITS +: ABITS] - OFFSET][j] = WR_DATA[i*WIDTH+j];
3124                    end
3125        end
3126
3127        for (i = 0; i < RD_PORTS; i = i+1) begin
3128            if (!RD_CLK_ENABLE[i]) begin
3129                // $display("Combinatorial read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
3130                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
3131            end
3132        end
3133
3134        for (i = 0; i < RD_PORTS; i = i+1) begin
3135            if (RD_SRST[i] && port_active(RD_CLK_ENABLE[i], RD_CLK_POLARITY[i], LAST_RD_CLK[i], RD_CLK[i]) && (RD_EN[i] || !RD_CE_OVER_SRST[i]))
3136                RD_DATA[i*WIDTH +: WIDTH] <= RD_SRST_VALUE[i*WIDTH +: WIDTH];
3137            if (RD_ARST[i])
3138                RD_DATA[i*WIDTH +: WIDTH] <= RD_ARST_VALUE[i*WIDTH +: WIDTH];
3139        end
3140
3141        LAST_RD_CLK <= RD_CLK;
3142        LAST_WR_CLK <= WR_CLK;
3143    end
3144
3145endmodule
yosys> help $meminit
Simulation model (verilog)
Listing 208 simlib.v
2893module \$meminit (ADDR, DATA);
2894
2895    parameter MEMID = "";
2896    parameter ABITS = 8;
2897    parameter WIDTH = 8;
2898    parameter WORDS = 1;
2899
2900    parameter PRIORITY = 0;
2901
2902    input [ABITS-1:0] ADDR;
2903    input [WORDS*WIDTH-1:0] DATA;
2904
2905    initial begin
2906        if (MEMID != "") begin
2907            $display("ERROR: Found non-simulatable instance of $meminit!");
2908            $finish;
2909        end
2910    end
2911
2912endmodule
yosys> help $meminit_v2
Simulation model (verilog)
Listing 209 simlib.v
2917module \$meminit_v2 (ADDR, DATA, EN);
2918
2919    parameter MEMID = "";
2920    parameter ABITS = 8;
2921    parameter WIDTH = 8;
2922    parameter WORDS = 1;
2923
2924    parameter PRIORITY = 0;
2925
2926    input [ABITS-1:0] ADDR;
2927    input [WORDS*WIDTH-1:0] DATA;
2928    input [WIDTH-1:0] EN;
2929
2930    initial begin
2931        if (MEMID != "") begin
2932            $display("ERROR: Found non-simulatable instance of $meminit_v2!");
2933            $finish;
2934        end
2935    end
2936
2937endmodule
yosys> help $memrd
Simulation model (verilog)
Listing 210 simlib.v
2784module \$memrd (CLK, EN, ADDR, DATA);
2785
2786    parameter MEMID = "";
2787    parameter ABITS = 8;
2788    parameter WIDTH = 8;
2789
2790    parameter CLK_ENABLE = 0;
2791    parameter CLK_POLARITY = 0;
2792    parameter TRANSPARENT = 0;
2793
2794    input CLK, EN;
2795    input [ABITS-1:0] ADDR;
2796    output [WIDTH-1:0] DATA;
2797
2798    initial begin
2799        if (MEMID != "") begin
2800            $display("ERROR: Found non-simulatable instance of $memrd!");
2801            $finish;
2802        end
2803    end
2804
2805endmodule
yosys> help $memrd_v2
Simulation model (verilog)
Listing 211 simlib.v
2809module \$memrd_v2 (CLK, EN, ARST, SRST, ADDR, DATA);
2810
2811    parameter MEMID = "";
2812    parameter ABITS = 8;
2813    parameter WIDTH = 8;
2814
2815    parameter CLK_ENABLE = 0;
2816    parameter CLK_POLARITY = 0;
2817    parameter TRANSPARENCY_MASK = 0;
2818    parameter COLLISION_X_MASK = 0;
2819    parameter ARST_VALUE = 0;
2820    parameter SRST_VALUE = 0;
2821    parameter INIT_VALUE = 0;
2822    parameter CE_OVER_SRST = 0;
2823
2824    input CLK, EN, ARST, SRST;
2825    input [ABITS-1:0] ADDR;
2826    output [WIDTH-1:0] DATA;
2827
2828    initial begin
2829        if (MEMID != "") begin
2830            $display("ERROR: Found non-simulatable instance of $memrd_v2!");
2831            $finish;
2832        end
2833    end
2834
2835endmodule
yosys> help $memwr
Simulation model (verilog)
Listing 212 simlib.v
2840module \$memwr (CLK, EN, ADDR, DATA);
2841
2842    parameter MEMID = "";
2843    parameter ABITS = 8;
2844    parameter WIDTH = 8;
2845
2846    parameter CLK_ENABLE = 0;
2847    parameter CLK_POLARITY = 0;
2848    parameter PRIORITY = 0;
2849
2850    input CLK;
2851    input [WIDTH-1:0] EN;
2852    input [ABITS-1:0] ADDR;
2853    input [WIDTH-1:0] DATA;
2854
2855    initial begin
2856        if (MEMID != "") begin
2857            $display("ERROR: Found non-simulatable instance of $memwr!");
2858            $finish;
2859        end
2860    end
2861
2862endmodule
yosys> help $memwr_v2
Simulation model (verilog)
Listing 213 simlib.v
2865module \$memwr_v2 (CLK, EN, ADDR, DATA);
2866
2867    parameter MEMID = "";
2868    parameter ABITS = 8;
2869    parameter WIDTH = 8;
2870
2871    parameter CLK_ENABLE = 0;
2872    parameter CLK_POLARITY = 0;
2873    parameter PORTID = 0;
2874    parameter PRIORITY_MASK = 0;
2875
2876    input CLK;
2877    input [WIDTH-1:0] EN;
2878    input [ABITS-1:0] ADDR;
2879    input [WIDTH-1:0] DATA;
2880
2881    initial begin
2882        if (MEMID != "") begin
2883            $display("ERROR: Found non-simulatable instance of $memwr_v2!");
2884            $finish;
2885        end
2886    end
2887
2888endmodule