Parameterized Macro: Single Port ROM
- MACRO_GROUP: XPM
- MACRO_SUBGROUP: XPM_MEMORY
Introduction
This macro instantiates Single Port ROM. Port A performs read operations from the memory.
The following describes the basic read and write port usage of an XPM_MEMORY instance.
- All synchronous signals are sensitive to the rising edge of clka, assumed to be a buffered and toggling clock signal that behaves according to target device and memory primitive requirements.
- A read operation is performed implicitly on address addra combinatorially. The data output registers on each clka cycle when ena is asserted.
- Read data appears on the douta port READ_LATENCY_A CLKA cycles after the associated read operation.
- The value of ena gates all read operations on the initiating clka cycle, regardless of input or output latencies.
- When rsta is asserted on a clka cycle, the final output register resets immediately but synchronously to READ_RESET_VALUE_A, irrespective of READ_LATENCY_A.
- For each clka cycle that regcea is asserted and rsta is deasserted, the final output register captures and outputs the value from the previous pipeline register.
- Undriven or unknown values provided on module inputs produce undefined memory array and output port behavior.
- Using MEMORY INIT PARAM limits the maximum supported memory size to 4K bits.
- WRITE_MODE_A must be set to “read_first” in Single Port ROM configurations. Violating this results in a DRC error.
- For better timing performance in larger memories (> 1 Mb), use CASCADE_HEIGHT of 1 with sufficient read latencies.
Timing Diagrams
Port Descriptions
| Port | Direction | Width | Domain | Sense | Handling if Unused | Function |
|---|---|---|---|---|---|---|
| addra | Input | ADDR_WIDTH_A | clka | NA | Active | Address for port A read operations. |
| clka | Input | 1 | NA | EDGE_RISING | Active | Clock signal for port A. |
| dbiterra | Output | 1 | clka | LEVEL_HIGH | DoNotCare | Leave open. |
| douta | Output | READ_DATA_WIDTH_A | clka | NA | Active | Data output for port A read operations. |
| ena | Input | 1 | clka | LEVEL_HIGH | Active |
Memory enable signal for port A. Must be high on the clock cycles when you initiate read operations. Pipelined internally. |
| injectdbiterra | Input | 1 | clka | LEVEL_HIGH | 0 | Do not change from the provided value. |
| injectsbiterra | Input | 1 | clka | LEVEL_HIGH | 0 | Do not change from the provided value. |
| regcea | Input | 1 | clka | LEVEL_HIGH | 1 |
Do not change from the provided value. |
| rsta | Input | 1 | clka | LEVEL_HIGH | Active | Reset signal for the final port A output register stage. Synchronously resets output port douta to the value specified by parameter READ_RESET_VALUE_A. |
| sbiterra | Output | 1 | clka | LEVEL_HIGH | DoNotCare | Leave open. |
| sleep | Input | 1 | NA | LEVEL_HIGH | 0 |
Sleep signal to enable the dynamic power saving feature. |
Design Entry Method
| Instantiation | Yes |
| Inference | No |
| IP and IP Integrator Catalog | No |
Available Attributes
| Attribute | Type | Allowed Values | Default | Description |
|---|---|---|---|---|
| ADDR_WIDTH_A | DECIMAL | 1 to 20 | 6 | Specify the width of the port A address port addra, in bits. Must be large enough to access the entire memory from port A, that is, >= $clog2(MEMORY_SIZE/READ_DATA_WIDTH_A). |
| AUTO_SLEEP_TIME | DECIMAL | 0 to 15 | 0 | You must set this parameter to 0. 0: Disable auto sleep feature |
| CASCADE_HEIGHT | DECIMAL | 0 to 64 | 0 |
0: No Cascade Height: Enables Vivado Synthesis to choose. 1 or more: Vivado Synthesis sets the specified value as Cascade Height. |
| ECC_BIT_RANGE | STRING | String | "7:0" |
This parameter is only used by synthesis. Specify the ECC bit range on the provided data. "7:0": Specifies lower 8 bits are ECC bits. |
| ECC_MODE | STRING | "no_ecc", "both_encode_and_decode", "decode_only", "encode_only" | "no_ecc" |
|
| ECC_TYPE | STRING | "none", "ECCHSIAO32-7", "ECCHSIAO64-8", "ECCHSIAO128-9", "ECCH32-7", "ECCH64-8" | "none" |
This parameter is only used by synthesis. Specify the algorithm used to generate the ecc bits outside the XPM Memory. XPM Memory does not perform ECC operation with this parameter. When ECC_MODE is not equal to no_ecc, the macro ignores the ECC_TYPE parameter and sets its value to none.
|
| IGNORE_INIT_SYNTH | DECIMAL | 0 to 1 | 0 |
0: If specified, the initialization file applies to both simulation and synthesis. 1: If specified, the initialization file applies to only simulation and ignores synthesis. |
| MEMORY_INIT_FILE | STRING | String | "none" | Specify "none" (including quotes) for no memory initialization, or specify the name of a memory initialization file- Enter only the name of the file with .mem extension, including quotes but without path (for example, "my_file.mem"). File format must be ASCII and consist of only hexadecimal values organized into the specified depth by narrowest data width generic value of the memory. Initialization of memory happens through the file name specified only when parameter MEMORY_INIT_PARAM value is equal to "". When using XPM_MEMORY in a project, add the specified file to the Vivado project as a design source. |
| MEMORY_INIT_PARAM | STRING | String | "0" |
Specify "" or "0" (including quotes) for no memory initialization through parameter, or specify the string containing the hex characters. Enter only hex characters with each location separated by delimiter (,). Parameter format must be ASCII and consist of only hexadecimal values organized into the specified depth by narrowest data width generic value of the memory. For example, if the narrowest data width is 8, and the depth of memory is 8 locations, then pass the parameter value as follows. parameter MEMORY_INIT_PARAM = "AB,CD,EF,1,2,34,56,78" Where "AB" is the 0th location and "78" is the 7th location. |
| MEMORY_OPTIMIZATION | STRING | "true", "false" | "true" | Specify "true" to enable the optimization of unused memory or bits in the memory structure. Specify "false" to disable the optimization of unused memory or bits in the memory structure |
| MEMORY_PRIMITIVE | STRING | "auto", "block", "distributed", "ultra" | "auto" | Specifies the memory primitive (resource type) to use- "auto": Enables Vivado Synthesis to choose "distributed": Distributed memory "block": Block memory |
| MEMORY_SIZE | DECIMAL | 2 to 150994944 | 2048 | Specify the total memory array size, in bits. For example, enter 65536 for a 2kx32 ROM. |
| MESSAGE_CONTROL | DECIMAL | 0 to 1 | 0 | Specify 1 to enable the dynamic message reporting such as collision warnings, and 0 to disable the message reporting |
| RAM_DECOMP | STRING | "auto", "area", "power" | "auto" |
Specifies the decomposition of the memory. "auto": Synthesis selects default. "power": Synthesis selects a strategy to reduce switching activity of RAMs and maps using widest configuration possible. "area": Synthesis selects a strategy to reduce RAM resource count. |
| READ_DATA_WIDTH_A | DECIMAL | 1 to 4608 | 32 | Specify the width of the port A read data output port douta, in bits. |
| READ_LATENCY_A | DECIMAL | 0 to 100 | 2 | Specify the number of register stages in the port A read data pipeline. Read data output to port douta takes this number of clka cycles. Targeting block memory requires a value of 1 or larger. 1 causes use of memory latch only; 2 causes use of output register. Targeting distributed memory requires a value of 0 or larger. 0 indicates combinatorial output. Values larger than 2 synthesize additional flip-flops that are not retimed into memory primitives. |
| READ_RESET_VALUE_A | STRING | String | "0" | Specify the reset value of the port A final output register stage in response to rsta input port assertion. For example, to reset the value of port douta to all 0s when READ_DATA_WIDTH_A is 32, specify 32HHHHh0. |
| RST_MODE_A | STRING | "SYNC", "ASYNC" | "SYNC" |
Describes the behavior of the reset
|
| SIM_ASSERT_CHK | DECIMAL | 0 to 1 | 0 |
0: Disable simulation message reporting. This does not report messages related to potential misuse. 1: Enable simulation message reporting. This reports messages related to potential misuse. |
| USE_MEM_INIT | DECIMAL | 0 to 1 | 1 |
Specify 1 to enable the generation of the following message and 0 to disable generation of the following message completely. "INFO - MEMORY_INIT_FILE and MEMORY_INIT_PARAM together specifies no memory initialization. Initial memory contents will be all 0s." NOTE: The tool generates this message only when there is no Memory Initialization specified either through file or Parameter. |
| USE_MEM_INIT_MMI | DECIMAL | 0 to 1 | 0 |
Specify 1 to expose this memory information for writing to the MMI file. |
| WAKEUP_TIME | STRING | "disable_sleep", "use_sleep_pin" | "disable_sleep" | Specify "disable_sleep" to disable dynamic power saving option, and specify "use_sleep_pin" to enable the dynamic power saving option |
VHDL Instantiation Template
Library xpm;
use xpm.vcomponents.all;
-- xpm_memory_sprom: Single Port ROM
-- Xilinx Parameterized Macro, version 2026.1
xpm_memory_sprom_inst : xpm_memory_sprom
generic map (
ADDR_WIDTH_A => 6, -- DECIMAL
AUTO_SLEEP_TIME => 0, -- DECIMAL
CASCADE_HEIGHT => 0, -- DECIMAL
ECC_BIT_RANGE => "7:0", -- String
ECC_MODE => "no_ecc", -- String
ECC_TYPE => "none", -- String
IGNORE_INIT_SYNTH => 0, -- DECIMAL
MEMORY_INIT_FILE => "none", -- String
MEMORY_INIT_PARAM => "0", -- String
MEMORY_OPTIMIZATION => "true", -- String
MEMORY_PRIMITIVE => "auto", -- String
MEMORY_SIZE => 2048, -- DECIMAL
MESSAGE_CONTROL => 0, -- DECIMAL
RAM_DECOMP => "auto", -- String
READ_DATA_WIDTH_A => 32, -- DECIMAL
READ_LATENCY_A => 2, -- DECIMAL
READ_RESET_VALUE_A => "0", -- String
RST_MODE_A => "SYNC", -- String
SIM_ASSERT_CHK => 0, -- DECIMAL; 0=disable simulation messages, 1=enable simulation messages
USE_MEM_INIT => 1, -- DECIMAL
USE_MEM_INIT_MMI => 0, -- DECIMAL
WAKEUP_TIME => "disable_sleep" -- String
)
port map (
sleep => sleep, -- 1-bit input: Sleep signal to enable the dynamic power saving feature.
clka => clka, -- 1-bit input: Clock signal for port A.
rsta => rsta, -- 1-bit input: Reset signal for the final port A output register stage. Synchronously resets output port
-- douta to the value specified by parameter READ_RESET_VALUE_A.
ena => ena, -- 1-bit input: Memory enable signal for port A. Must be high on the clock cycles when you initiate read
-- operations. Pipelined internally.
regcea => regcea, -- 1-bit input: Do not change from the provided value.
addra => addra, -- ADDR_WIDTH_A-bit input: Address for port A read operations.
injectsbiterra => injectsbiterra, -- 1-bit input: Do not change from the provided value.
injectdbiterra => injectdbiterra, -- 1-bit input: Do not change from the provided value.
douta => douta, -- READ_DATA_WIDTH_A-bit output: Data output for port A read operations.
sbiterra => sbiterra, -- 1-bit output: Leave open.
dbiterra => dbiterra -- 1-bit output: Leave open.
);
-- End of xpm_memory_sprom_inst instantiation
Verilog Instantiation Template
// xpm_memory_sprom: Single Port ROM
// Xilinx Parameterized Macro, version 2026.1
xpm_memory_sprom #(
.ADDR_WIDTH_A(6), // DECIMAL
.AUTO_SLEEP_TIME(0), // DECIMAL
.CASCADE_HEIGHT(0), // DECIMAL
.ECC_BIT_RANGE("7:0"), // String
.ECC_MODE("no_ecc"), // String
.ECC_TYPE("none"), // String
.IGNORE_INIT_SYNTH(0), // DECIMAL
.MEMORY_INIT_FILE("none"), // String
.MEMORY_INIT_PARAM("0"), // String
.MEMORY_OPTIMIZATION("true"), // String
.MEMORY_PRIMITIVE("auto"), // String
.MEMORY_SIZE(2048), // DECIMAL
.MESSAGE_CONTROL(0), // DECIMAL
.RAM_DECOMP("auto"), // String
.READ_DATA_WIDTH_A(32), // DECIMAL
.READ_LATENCY_A(2), // DECIMAL
.READ_RESET_VALUE_A("0"), // String
.RST_MODE_A("SYNC"), // String
.SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
.USE_MEM_INIT(1), // DECIMAL
.USE_MEM_INIT_MMI(0), // DECIMAL
.WAKEUP_TIME("disable_sleep") // String
)
xpm_memory_sprom_inst (
.sleep(sleep), // 1-bit input: Sleep signal to enable the dynamic power saving feature.
.clka(clka), // 1-bit input: Clock signal for port A.
.rsta(rsta), // 1-bit input: Reset signal for the final port A output register stage. Synchronously resets output port
// douta to the value specified by parameter READ_RESET_VALUE_A.
.ena(ena), // 1-bit input: Memory enable signal for port A. Must be high on the clock cycles when you initiate read
// operations. Pipelined internally.
.regcea(regcea), // 1-bit input: Do not change from the provided value.
.addra(addra), // ADDR_WIDTH_A-bit input: Address for port A read operations.
.injectsbiterra(injectsbiterra), // 1-bit input: Do not change from the provided value.
.injectdbiterra(injectdbiterra), // 1-bit input: Do not change from the provided value.
.douta(douta), // READ_DATA_WIDTH_A-bit output: Data output for port A read operations.
.sbiterra(sbiterra), // 1-bit output: Leave open.
.dbiterra(dbiterra) // 1-bit output: Leave open.
);
// End of xpm_memory_sprom_inst instantiation