Main Content

Single Port RAM System

Single Port RAM block based on hdl.RAM system object with ability to provide initial value

  • Single Port RAM System block

Libraries:
HDL Coder / HDL RAMs

Description

The blocks are MATLAB System blocks that use the hdl.RAM System object™. You can specify the RAM type as Dual port, Simple dual port, Single port, True dual port, or Simple tri port. In terms of simulation behavior, the Single Port RAM System block behaves similar to the Single Port RAM.

By using the MATLAB System block implementation, you can:

  • Specify an initial value for the RAM. In the Block Parameters dialog box, enter a value for Specify the RAM initial value.

  • Obtain faster simulation results when you use these blocks in your Simulink® model.

  • Create parallel RAM banks when you use vector data by leveraging the hdl.RAM System object functionality.

  • Obtain higher performance and support for large data memories.

Limitations

  • When you build the FPGA bitstream for the RAM, the global reset logic does not reset the RAM contents. To reset the RAM, make sure that you implement the reset logic.

  • The RAM address can be either fixed-point (fi) or integer, must be unsigned, and must be between 2 and 31 bits long.

Ports

Input

expand all

Data that you write into the RAM memory location when we is true. This value can be double, single, half, integer, Boolean or a fixed-point (fi) object, and can be real or complex.

Bus Support:

You can use non-virtual bus and array of buses at the data port for HDL code generation.

Data Types: single | double | half | int8 | int16 | uint8 | uint16 | Boolean | fixed point

Address that you write the data into when we is true. The RAM reads the value in memory location addr when we is false. This value can be either fixed-point (fi) or integer, must be unsigned, and must be between 2 and 31 bits long.

Dependencies

To enable this port, set the Specify the type of RAM parameter to Single port.

Data Types: uint8 | uint16 | fixed point

When we is true, the RAM writes the data into the memory location that you specify. If you set the Specify the type of RAM to Single port, the RAM reads the value in the memory location addr when we is false.

Data Types: Boolean

Output

expand all

Output data that the RAM reads from the memory location addr when we is false.

Dependencies

To enable this port, set the Specify the type of RAM parameter to Single port.

Parameters

expand all

Type of RAM, specified as either:

  • Single port — Create a single port RAM with Write data, Address, and Write enable as inputs and Read data as the output.

  • Simple dual port — Create a simple dual port RAM with Write data, Write address, Write enable, and Read address as inputs and data from read address as the output.

  • Dual port — Create a dual port RAM with Write data, Write address, Write enable, and Read address as inputs and data from read address and write address as the outputs.

  • True dual port — Create a true dual port RAM with Write data a and b, Write/Read address a and b, and Write enable a and b as inputs and data from write address a and b as the outputs.

  • Simple tri port — Create a simple tri port RAM with Write data, Write address, Write enable, and Read address a and b as inputs and data from read address a and b as the outputs.

The code generator dynamically configures the input and output ports of the block based on the RAM type that you specify.

Use the asynchronous read feature in your target hardware, specified as a check box. Boards that support asynchronous read allow the hardware to execute a read instruction immediately instead of waiting one cycle.

Data Types: Boolean

Behavior for Write output, specified as either:

  • 'New data' — Send out new data at the address to the output.

  • Old data' — Send out old data at the address to the output.

Initial simulation output of the System object, specified as either:

  • A scalar value.

  • A vector with one-to-one mapping between the initial value and the RAM words.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2017b

expand all