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