Megafunction

altdpram (Dual-Port RAM) Megafunction



Parameterized dual-port RAM megafunction. This megafunction is provided only for backward compatibility in Cyclone, Stratix, and Stratix GX designs; instead, Altera® recommends using the altsyncram megafunction. The altdpram function uses Embedded System Blocks (ESB) in APEX 20K, APEX II, ARM®-based Excalibur, and Mercury devices, Embedded Array Blocks (EAB) in ACEX® 1K and FLEX 10KE devices, or DFFE primitives or latch arrays in FLEX® 6000, MAX® 3000, and MAX 7000 devices, or if the USE_EAB parameter is set to "OFF". Altera strongly recommends using synchronous rather than asynchronous RAM functions. You can use the altdpram function to access ACEX 1K, APEX 20K, APEX II, ARM-based Excalibur, FLEX 10KE, and Mercury dual-port RAM hardware features that are not available in lpm_ram_dp, such as asynchronous clear of registers.

NOTE The Quartus® II Compiler automatically implements suitable portions of this function in ESBs in APEX 20K, APEX II, ARM-based Excalibur, and Mercury devices, and in EABs in ACEX 1K and FLEX 10KE devices. The Compiler automatically implements this function in logic cells in FLEX 6000, MAX 3000, and MAX 7000 devices. The altdpram function is not available for VHDL designs.

Altera also recommends instantiating this function as described in Using the MegaWizard® Plug-In Manager.

This topic contains the following information:

 

AHDL Function Prototype (port name and order also apply to Verilog HDL):

FUNCTION altdpram (data[WIDTH-1..0], rdaddress[WIDTHAD-1..0],
      wraddress[WIDTHAD-1..0], wren, inclock, inclocken, rden,
      outclock, outclocken, aclr)
	WITH (WIDTH, WIDTHAD, NUMWORDS, FILE, INDATA_REG, INDATA_ACLR,
      WRADDRESS_REG, WRADDRESS_ACLR, WRCONTROL_REG, WRCONTROL_ACLR,
      RDADDRESS_REG, RDADDRESS_ACLR, RDCONTROL_REG, RDCONTROL_ACLR,
      OUTDATA_REG, OUTDATA_ACLR, USE_EAB)
   RETURNS (q[WIDTH-1..0]);

 

VHDL Component Declaration:

COMPONENT altdpram
   GENERIC
      ( WIDTH          : NATURAL;
        WIDTHAD        : NATURAL;
        NUMWORDS       : NATURAL;
        LPM_FILE       : STRING := "UNUSED";
        LPM_HINT       : STRING := "USE_EAB=ON";
        INDATA_REG     : STRING := "UNREGISTERED";
        INDATA_ACLR    : STRING := "OFF";
        WRADDRESS_REG  : STRING := "UNREGISTERED";
        WRADDRESS_ACLR : STRING := "OFF";
        WRCONTROL_REG  : STRING := "UNREGISTERED";
        WRCONTROL_ACLR : STRING := "OFF";
        RDADDRESS_REG  : STRING := "UNREGISTERED";
        RDADDRESS_ACLR : STRING := "OFF";
        RDCONTROL_REG  : STRING := "UNREGISTERED";
        RDCONTROL_ACLR : STRING := "OFF";
        OUTDATA_REG    : STRING := "UNREGISTERED";
        OUTDATA_ACLR   : STRING := "OFF");

    PORT (wren, inclock, outclock, aclr, outclocken: IN STD_LOGIC := '0';
        data: IN STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0);
        wraddress, rdaddress: IN STD_LOGIC_VECTOR(WIDTHAD-1 DOWNTO 0);
        inclocken, rden: IN STD_LOGIC := '1';
        q: OUT STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0) );
END COMPONENT;

 

VHDL LIBRARY-USE Declaration

LIBRARY altera_mf
USE altera_mf.altera_mf_components.all;

 

Port Descriptions:

INPUT PORTS

Port Name Required Description Comments
data Yes Data input to the memory. Input port WIDTH wide.
rdaddress[] Yes Read address input to the memory. Input port WIDTHAD wide.
wraddress[] Yes Write address input to the memory. Input port WIDTHAD wide.
wren Yes Write enable input.  
inclock No Positive-edge-triggered clock. Used for registered write ports, for example, data, wraddress, and wren. May also be used for registered read ports, for example, rdaddress and rden.
inclocken No Clock enable for inclock.  
rden No Read enable input. Disables reading when low (0). In ACEX 1K, APEX 20KC, APEX 20KE, APEX II, ARM-based Excalibur, FLEX 6000, FLEX 10KE, and Mercury devices, the rden port controls a latch that remembers the value last read while the rden port was high. In APEX 20K devices, the rden port becomes a power down signal.
outclock No Positive-edge-triggered clock. Used for the registered q[] port. May also be used for registered read ports, for example, rdaddress and rden.
outclocken No Clock enable for outclock.  
aclr No Asynchronous clear input. Affects registered inputs and outputs.

OUTPUT PORTS

Port Name Required Description Comments
q[] Yes Data output from the memory. Output port WIDTH wide.

 

Parameter Descriptions:

NOTE When the altdpram megafunction is used with the APEX 20K family, and both the WRADDRESS_REG and WRCONTROL_REG parameters are set to "INCLOCK", the value of the WRADDRESS_ACLR and WRCONTROL_ACLR parameters must be the same.

Parameter Type Required Description
WIDTH Integer Yes Width of data[] and q[] ports.
WIDTHAD Integer Yes Width of the rdaddress[] and wraddress[] ports.
NUMWORDS Integer No Number of words stored in memory. This value must be within the range 2 ^ WIDTHAD-1 < NUMWORDS <= 2 ^ WIDTHAD. If omitted, the default is 2 ^ WIDTHAD.
LPM_FILE String No Name of the Memory Initialization File (.mif) or Hexadecimal (Intel-Format) Output File (.hexout) containing RAM initialization data ("<file name>"), or "UNUSED". The default is "UNUSED". If omitted, contents default to all 0s. The wren port must be registered to support memory initialization.
WRADDRESS_REG String No Determines the clock used by the wraddress[] port. Values are "UNREGISTERED" and "INCLOCK". The default is "INCLOCK".
WRADDRESS_ACLR String No Defines whether aclr affects the wraddress[] port register. Values are "ON" and "OFF". The default is "ON".
WRCONTROL_REG String No Determines the clock used by the wren port. Values are "UNREGISTERED" and "INCLOCK". The default is "INCLOCK".
WRCONTROL_ACLR String No Defines whether aclr affects the wren port register. Values are "ON" and "OFF". The default is "ON".
RDADDRESS_REG String No Determines the clock used by the rdaddress[] port. Values are "UNREGISTERED", "INCLOCK", and "OUTCLOCK". The default is "OUTCLOCK".
RDADDRESS_ACLR String No Defines whether aclr affects the rdaddress[] port. Values are "ON" and "OFF". The default is "ON".
RDCONTROL_REG String No Determines the clock used by the rden port. Values are "UNREGISTERED", "INCLOCK", and "OUTCLOCK". The default is "OUTCLOCK".
RDCONTROL_ACLR String No Defines whether aclr affects the rden port register. Values are "ON" and "OFF". The default is "ON".
INDATA_REG String No Determines the clock used by the data port. Values are "UNREGISTERED" and "INCLOCK". The default is "INCLOCK".
INDATA_ACLR String No Defines whether aclr affects the data[] port register. Values are "ON" and "OFF". The default is "ON".
OUTDATA_REG String No Determines the clock used by the q[] port. Values are "UNREGISTERED" and "OUTCLOCK". The default is "UNREGISTERED".
OUTDATA_ACLR String No Defines whether aclr affects the q[] port register. Values are "ON" and "OFF". The default is "ON".
USE_EAB String No Altera-specific parameter. Values are "ON", "OFF", and "UNUSED". Setting the USE_EAB parameter to "OFF" prevents the Quartus II software from using ESBs to implement the logic in APEX 20K, APEX II, ARM-based Excalibur, and Mercury devices, or EABs in ACEX 1K and FLEX 10KE devices; it can only use flipflops or latches. (The "ON" setting is not useful in memory functions: the Quartus II software automatically implements memory functions in ESBs or EABs by default.) This parameter is not available for simulation with other EDA simulators and for FLEX 6000, MAX 3000, and MAX 7000 devices.
LPM_HINT String No Altera-specific parameter. Values are "USE_EAB=ON", "USE_EAB=OFF", and "UNUSED".

 

Truth Table/Functionality:

The altdpram function represents asynchronous memory or memory with synchronous inputs and/or outputs.

Synchronous Write to Memory (all inputs registered)
inclock inclocken wren Function  
X L L No change.
not H H No change.
Rising Edge L X No change.
Rising Edge H H The memory location pointed to by wraddress[] is loaded with data[].

 

Synchronous Read from Memory
inclock inclocken rden Function 
X L L No change.
notRising Edge H H No change.
Rising Edge L X No change.
Rising Edge H H The q[] port outputs the contents of the memory location.

Totally asynchronous memory operations occur when neither inclock nor outclock is connected.

Asynchronous Memory Operations
wren Function 
L No change.
H The memory location pointed to by wraddress[] is loaded with data[] and controlled by wren.
The output q[] is asynchronous and reflects the memory location pointed to by rdaddress.

 

Resource Usage:

Uses one embedded cell per data output bit for ACEX 1K, APEX 20K, APEX II, ARM-based Excalibur, FLEX 10KE, and Mercury devices; however, in FLEX 6000, MAX 3000, and MAX 7000 devices, or if the USE_EAB paramter is set to "OFF", uses one logic cell per memory bit.

NOTE This topic prints best in Landscape orientation.


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.