This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Dual Port RAM System, Simple Dual Port RAM System, Single Port RAM System

RAM blocks based on the hdl.RAM system object with ability to provide initial value

  • Library:
  • 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, or Single port. In terms of simulation behavior, the Dual Port RAM System block behaves similar to the Dual Port RAM, the Single Port RAM System behaves similar to the Single Port RAM, and so on. With the MATLAB System blocks, 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.

Limitations

  • The block does not support boolean inputs. Cast any boolean types to ufix1 for input to the block.

Ports

Input

expand all

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

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

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

Dependencies

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

Data Types: uint8 | uint16 | fixed point

RAM address that you write the data into. This value can be either fixed-point (fi) or integer, and must be real and unsigned.

Dependencies

To enable this port, set the Specify the type of RAM parameter to Simple dual port or Dual port.

Data Types: uint8 | uint16 | fixed point

When wrEn 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 wrEn is false.

Data Types: Boolean

Address that you read the data from the RAM. This value can be either fixed-point (fi) or integer, and must be real and unsigned.

Dependencies

To enable this port, set the Specify the type of RAM parameter to Simple dual port or Dual port.

Data Types: uint8 | uint16 | fixed point

Output

expand all

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

Dependencies

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

Old output data that the RAM reads from the memory location rd_addr.

Dependencies

To enable this port, set the Specify the type of RAM parameter to Simple dual port or Dual port.

New or old output data that the RAM reads from the memory location wr_addr.

Dependencies

To enable this port, set the Specify the type of RAM parameter to Dual 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.

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

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™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

Introduced in R2017b