Main Content

Map Matrices to ROM

To map a matrix constant to ROM:

  • Read one matrix element at a time.

  • The matrix size must be greater than or equal to the RAM Mapping Threshold value.

    To learn how to set the RAM mapping threshold in Simulink®, see the RAM mapping threshold (bits) section in RAM Mapping Parameters. To learn how to set the RAM mapping threshold in MATLAB, see Enable RAM Mapping.

  • Read accesses to the matrix must not be within a feedback loop.

If your MATLAB® code meets these requirements, HDL Coder™ inserts a no-reset register at the output of the matrix in the generated code. Many synthesis tools infer a ROM from this code pattern.