Single, simple dual, or dual-port RAM for memory read/write access
hdl.RAM
reads from and writes to memory locations for a single, simple
dual, or dual-port RAM. The output data is delayed one step. If your input data is scalar, the
address and write enable inputs must be scalar, andHDL Coder™ infers a single RAM block. If your data is a vector, HDL Coder infers an array of parallel RAM banks. With vector data input, the address and
write enable inputs can be both scalars or vectors. When you specify scalar inputs for the
write enable and address ports, the system object applies the same operation to each RAM
bank.
The hdl.RAM
System object™ can have 231
bytes of internal
storage. The RAM size takes into account the address width, the number of bytes that are used
to store each word, and the number of RAM banks.
To read from or write to memory locations in the RAM:
Create the hdl.RAM
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
returns a single port RAM
System object that you can write to or read from a memory location.ram
= hdl.RAM
returns a single, simple dual, or dual port RAM System object with properties set using one or more name-value pairs. Enclose each
property name in single quotes.ram
= hdl.RAM(Name
,Value
)
[
writes the value wrDataOut
,rdDataOut
] = ram(wrData
,wrAddress
,wrEn
,rdAddress
)wrData
into the memory location
wrAddress
when wrEn
is true.
wrDataOut
is the new or old data at memory location
wrAddress
. rdDataOut
is the old data at the
address location rdAddress
. Use this syntax when you create a dual
port RAM System object.
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)