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 174 simlib.v
2820module \$mem (RD_CLK, RD_EN, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA);
2821
2822    parameter MEMID = "";
2823    parameter signed SIZE = 4;
2824    parameter signed OFFSET = 0;
2825    parameter signed ABITS = 2;
2826    parameter signed WIDTH = 8;
2827    parameter signed INIT = 1'bx;
2828
2829    parameter signed RD_PORTS = 1;
2830    parameter RD_CLK_ENABLE = 1'b1;
2831    parameter RD_CLK_POLARITY = 1'b1;
2832    parameter RD_TRANSPARENT = 1'b1;
2833
2834    parameter signed WR_PORTS = 1;
2835    parameter WR_CLK_ENABLE = 1'b1;
2836    parameter WR_CLK_POLARITY = 1'b1;
2837
2838    input [RD_PORTS-1:0] RD_CLK;
2839    input [RD_PORTS-1:0] RD_EN;
2840    input [RD_PORTS*ABITS-1:0] RD_ADDR;
2841    output reg [RD_PORTS*WIDTH-1:0] RD_DATA;
2842
2843    input [WR_PORTS-1:0] WR_CLK;
2844    input [WR_PORTS*WIDTH-1:0] WR_EN;
2845    input [WR_PORTS*ABITS-1:0] WR_ADDR;
2846    input [WR_PORTS*WIDTH-1:0] WR_DATA;
2847
2848    reg [WIDTH-1:0] memory [SIZE-1:0];
2849
2850    integer i, j;
2851    reg [WR_PORTS-1:0] LAST_WR_CLK;
2852    reg [RD_PORTS-1:0] LAST_RD_CLK;
2853
2854    function port_active;
2855        input clk_enable;
2856        input clk_polarity;
2857        input last_clk;
2858        input this_clk;
2859        begin
2860            casez ({clk_enable, clk_polarity, last_clk, this_clk})
2861                4'b0???: port_active = 1;
2862                4'b1101: port_active = 1;
2863                4'b1010: port_active = 1;
2864                default: port_active = 0;
2865            endcase
2866        end
2867    endfunction
2868
2869    initial begin
2870        for (i = 0; i < SIZE; i = i+1)
2871            memory[i] = INIT >>> (i*WIDTH);
2872    end
2873
2874    always @(RD_CLK, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA) begin
2875    `ifdef SIMLIB_MEMDELAY
2876        #`SIMLIB_MEMDELAY;
2877    `endif
2878        for (i = 0; i < RD_PORTS; i = i+1) begin
2879            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
2880                // $display("Read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
2881                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
2882            end
2883        end
2884
2885        for (i = 0; i < WR_PORTS; i = i+1) begin
2886            if (port_active(WR_CLK_ENABLE[i], WR_CLK_POLARITY[i], LAST_WR_CLK[i], WR_CLK[i]))
2887                for (j = 0; j < WIDTH; j = j+1)
2888                    if (WR_EN[i*WIDTH+j]) begin
2889                        // $display("Write to %s: addr=%b data=%b", MEMID, WR_ADDR[i*ABITS +: ABITS], WR_DATA[i*WIDTH+j]);
2890                        memory[WR_ADDR[i*ABITS +: ABITS] - OFFSET][j] = WR_DATA[i*WIDTH+j];
2891                    end
2892        end
2893
2894        for (i = 0; i < RD_PORTS; i = i+1) begin
2895            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
2896                // $display("Transparent read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
2897                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
2898            end
2899        end
2900
2901        LAST_RD_CLK <= RD_CLK;
2902        LAST_WR_CLK <= WR_CLK;
2903    end
2904
2905endmodule
yosys> help $mem_v2
Simulation model (verilog)
Listing 175 simlib.v
2909module \$mem_v2 (RD_CLK, RD_EN, RD_ARST, RD_SRST, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA);
2910
2911    parameter MEMID = "";
2912    parameter signed SIZE = 4;
2913    parameter signed OFFSET = 0;
2914    parameter signed ABITS = 2;
2915    parameter signed WIDTH = 8;
2916    parameter signed INIT = 1'bx;
2917
2918    parameter signed RD_PORTS = 1;
2919    parameter RD_CLK_ENABLE = 1'b1;
2920    parameter RD_CLK_POLARITY = 1'b1;
2921    parameter RD_TRANSPARENCY_MASK = 1'b0;
2922    parameter RD_COLLISION_X_MASK = 1'b0;
2923    parameter RD_WIDE_CONTINUATION = 1'b0;
2924    parameter RD_CE_OVER_SRST = 1'b0;
2925    parameter RD_ARST_VALUE = 1'b0;
2926    parameter RD_SRST_VALUE = 1'b0;
2927    parameter RD_INIT_VALUE = 1'b0;
2928
2929    parameter signed WR_PORTS = 1;
2930    parameter WR_CLK_ENABLE = 1'b1;
2931    parameter WR_CLK_POLARITY = 1'b1;
2932    parameter WR_PRIORITY_MASK = 1'b0;
2933    parameter WR_WIDE_CONTINUATION = 1'b0;
2934
2935    input [RD_PORTS-1:0] RD_CLK;
2936    input [RD_PORTS-1:0] RD_EN;
2937    input [RD_PORTS-1:0] RD_ARST;
2938    input [RD_PORTS-1:0] RD_SRST;
2939    input [RD_PORTS*ABITS-1:0] RD_ADDR;
2940    output reg [RD_PORTS*WIDTH-1:0] RD_DATA;
2941
2942    input [WR_PORTS-1:0] WR_CLK;
2943    input [WR_PORTS*WIDTH-1:0] WR_EN;
2944    input [WR_PORTS*ABITS-1:0] WR_ADDR;
2945    input [WR_PORTS*WIDTH-1:0] WR_DATA;
2946
2947    reg [WIDTH-1:0] memory [SIZE-1:0];
2948
2949    integer i, j, k;
2950    reg [WR_PORTS-1:0] LAST_WR_CLK;
2951    reg [RD_PORTS-1:0] LAST_RD_CLK;
2952
2953    function port_active;
2954        input clk_enable;
2955        input clk_polarity;
2956        input last_clk;
2957        input this_clk;
2958        begin
2959            casez ({clk_enable, clk_polarity, last_clk, this_clk})
2960                4'b0???: port_active = 1;
2961                4'b1101: port_active = 1;
2962                4'b1010: port_active = 1;
2963                default: port_active = 0;
2964            endcase
2965        end
2966    endfunction
2967
2968    initial begin
2969        for (i = 0; i < SIZE; i = i+1)
2970            memory[i] = INIT >>> (i*WIDTH);
2971        RD_DATA = RD_INIT_VALUE;
2972    end
2973
2974    always @(RD_CLK, RD_ARST, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA) begin
2975    `ifdef SIMLIB_MEMDELAY
2976        #`SIMLIB_MEMDELAY;
2977    `endif
2978        for (i = 0; i < RD_PORTS; i = i+1) begin
2979            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
2980                // $display("Read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
2981                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
2982
2983                for (j = 0; j < WR_PORTS; j = j+1) begin
2984                    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])
2985                        for (k = 0; k < WIDTH; k = k+1)
2986                            if (WR_EN[j*WIDTH+k])
2987                                RD_DATA[i*WIDTH+k] <= WR_DATA[j*WIDTH+k];
2988                    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])
2989                        for (k = 0; k < WIDTH; k = k+1)
2990                            if (WR_EN[j*WIDTH+k])
2991                                RD_DATA[i*WIDTH+k] <= 1'bx;
2992                end
2993            end
2994        end
2995
2996        for (i = 0; i < WR_PORTS; i = i+1) begin
2997            if (port_active(WR_CLK_ENABLE[i], WR_CLK_POLARITY[i], LAST_WR_CLK[i], WR_CLK[i]))
2998                for (j = 0; j < WIDTH; j = j+1)
2999                    if (WR_EN[i*WIDTH+j]) begin
3000                        // $display("Write to %s: addr=%b data=%b", MEMID, WR_ADDR[i*ABITS +: ABITS], WR_DATA[i*WIDTH+j]);
3001                        memory[WR_ADDR[i*ABITS +: ABITS] - OFFSET][j] = WR_DATA[i*WIDTH+j];
3002                    end
3003        end
3004
3005        for (i = 0; i < RD_PORTS; i = i+1) begin
3006            if (!RD_CLK_ENABLE[i]) begin
3007                // $display("Combinatorial read from %s: addr=%b data=%b", MEMID, RD_ADDR[i*ABITS +: ABITS],  memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET]);
3008                RD_DATA[i*WIDTH +: WIDTH] <= memory[RD_ADDR[i*ABITS +: ABITS] - OFFSET];
3009            end
3010        end
3011
3012        for (i = 0; i < RD_PORTS; i = i+1) begin
3013            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]))
3014                RD_DATA[i*WIDTH +: WIDTH] <= RD_SRST_VALUE[i*WIDTH +: WIDTH];
3015            if (RD_ARST[i])
3016                RD_DATA[i*WIDTH +: WIDTH] <= RD_ARST_VALUE[i*WIDTH +: WIDTH];
3017        end
3018
3019        LAST_RD_CLK <= RD_CLK;
3020        LAST_WR_CLK <= WR_CLK;
3021    end
3022
3023endmodule
yosys> help $meminit
Simulation model (verilog)
Listing 176 simlib.v
2771module \$meminit (ADDR, DATA);
2772
2773    parameter MEMID = "";
2774    parameter ABITS = 8;
2775    parameter WIDTH = 8;
2776    parameter WORDS = 1;
2777
2778    parameter PRIORITY = 0;
2779
2780    input [ABITS-1:0] ADDR;
2781    input [WORDS*WIDTH-1:0] DATA;
2782
2783    initial begin
2784        if (MEMID != "") begin
2785            $display("ERROR: Found non-simulatable instance of $meminit!");
2786            $finish;
2787        end
2788    end
2789
2790endmodule
yosys> help $meminit_v2
Simulation model (verilog)
Listing 177 simlib.v
2795module \$meminit_v2 (ADDR, DATA, EN);
2796
2797    parameter MEMID = "";
2798    parameter ABITS = 8;
2799    parameter WIDTH = 8;
2800    parameter WORDS = 1;
2801
2802    parameter PRIORITY = 0;
2803
2804    input [ABITS-1:0] ADDR;
2805    input [WORDS*WIDTH-1:0] DATA;
2806    input [WIDTH-1:0] EN;
2807
2808    initial begin
2809        if (MEMID != "") begin
2810            $display("ERROR: Found non-simulatable instance of $meminit_v2!");
2811            $finish;
2812        end
2813    end
2814
2815endmodule
yosys> help $memrd
Simulation model (verilog)
Listing 178 simlib.v
2662module \$memrd (CLK, EN, ADDR, DATA);
2663
2664    parameter MEMID = "";
2665    parameter ABITS = 8;
2666    parameter WIDTH = 8;
2667
2668    parameter CLK_ENABLE = 0;
2669    parameter CLK_POLARITY = 0;
2670    parameter TRANSPARENT = 0;
2671
2672    input CLK, EN;
2673    input [ABITS-1:0] ADDR;
2674    output [WIDTH-1:0] DATA;
2675
2676    initial begin
2677        if (MEMID != "") begin
2678            $display("ERROR: Found non-simulatable instance of $memrd!");
2679            $finish;
2680        end
2681    end
2682
2683endmodule
yosys> help $memrd_v2
Simulation model (verilog)
Listing 179 simlib.v
2687module \$memrd_v2 (CLK, EN, ARST, SRST, ADDR, DATA);
2688
2689    parameter MEMID = "";
2690    parameter ABITS = 8;
2691    parameter WIDTH = 8;
2692
2693    parameter CLK_ENABLE = 0;
2694    parameter CLK_POLARITY = 0;
2695    parameter TRANSPARENCY_MASK = 0;
2696    parameter COLLISION_X_MASK = 0;
2697    parameter ARST_VALUE = 0;
2698    parameter SRST_VALUE = 0;
2699    parameter INIT_VALUE = 0;
2700    parameter CE_OVER_SRST = 0;
2701
2702    input CLK, EN, ARST, SRST;
2703    input [ABITS-1:0] ADDR;
2704    output [WIDTH-1:0] DATA;
2705
2706    initial begin
2707        if (MEMID != "") begin
2708            $display("ERROR: Found non-simulatable instance of $memrd_v2!");
2709            $finish;
2710        end
2711    end
2712
2713endmodule
yosys> help $memwr
Simulation model (verilog)
Listing 180 simlib.v
2718module \$memwr (CLK, EN, ADDR, DATA);
2719
2720    parameter MEMID = "";
2721    parameter ABITS = 8;
2722    parameter WIDTH = 8;
2723
2724    parameter CLK_ENABLE = 0;
2725    parameter CLK_POLARITY = 0;
2726    parameter PRIORITY = 0;
2727
2728    input CLK;
2729    input [WIDTH-1:0] EN;
2730    input [ABITS-1:0] ADDR;
2731    input [WIDTH-1:0] DATA;
2732
2733    initial begin
2734        if (MEMID != "") begin
2735            $display("ERROR: Found non-simulatable instance of $memwr!");
2736            $finish;
2737        end
2738    end
2739
2740endmodule
yosys> help $memwr_v2
Simulation model (verilog)
Listing 181 simlib.v
2743module \$memwr_v2 (CLK, EN, ADDR, DATA);
2744
2745    parameter MEMID = "";
2746    parameter ABITS = 8;
2747    parameter WIDTH = 8;
2748
2749    parameter CLK_ENABLE = 0;
2750    parameter CLK_POLARITY = 0;
2751    parameter PORTID = 0;
2752    parameter PRIORITY_MASK = 0;
2753
2754    input CLK;
2755    input [WIDTH-1:0] EN;
2756    input [ABITS-1:0] ADDR;
2757    input [WIDTH-1:0] DATA;
2758
2759    initial begin
2760        if (MEMID != "") begin
2761            $display("ERROR: Found non-simulatable instance of $memwr_v2!");
2762            $finish;
2763        end
2764    end
2765
2766endmodule