Megafunction

alt3pram (Triple-Port RAM) Megafunction



Parameterized triple-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.

NOTE The Quartus® II Compiler automatically implements suitable portions of this function in Embedded System Blocks (ESBs) in APEX 20K, APEX II, ARM®-based Excalibur, and Mercury devices, and in Embedded Array Blocks (EAB) 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.

Altera 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 alt3pram (data[WIDTH-1..0], rdaddress_a[WIDTHAD-1..0],
      rdaddress_b[WIDTHAD-1..0], wraddress[WIDTHAD-1..0], wren,
      inclock, inclocken, rden_a, rden_b, outclock, outclocken, aclr)
   WITH (WIDTH, WIDTHAD, NUMWORDS, LPM_FILE, INDATA_REG, INDATA_ACLR,
      WRITE_REG, WRITE_ACLR, RDADDRESS_REG_A, RDADDRESS_REG_B, 
      RDADDRESS_ACLR_A, RDADDRESS_ACLR_B, RDCONTROL_REG_A, RDCONTROL_REG_B,
      RDCONTROL_ACLR_A, RDCONTROL_ACLR_B, OUTDATA_REG_A, OUTDATA_REG_B,
      OUTDATA_ACLR_A, OUTDATA_ACLR_B, USE_EAB)
   RETURNS (qa[WIDTH-1..0], qb[WIDTH-1..0]);

 

VHDL Component Declaration:

COMPONENT alt3pram
   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";
      WRITE_REG        : STRING := "UNREGISTERED";
      WRITE_ACLR       : STRING := "OFF";
      RDADDRESS_REG_A  : STRING := "UNREGISTERED";
      RDADDRESS_ACLR_A : STRING := "OFF";
      RDADDRESS_REG_B  : STRING := "UNREGISTERED";
      RDADDRESS_ACLR_B : STRING := "OFF";		
      RDCONTROL_REG_A  : STRING := "UNREGISTERED";
      RDCONTROL_ACLR_A : STRING := "OFF";
      RDCONTROL_REG_B  : STRING := "UNREGISTERED";
      RDCONTROL_ACLR_B : STRING := "OFF";		
      OUTDATA_REG_A    : STRING := "UNREGISTERED";
      OUTDATA_ACLR_A   : STRING := "OFF"
      OUTDATA_REG_B    : STRING := "UNREGISTERED";
      OUTDATA_ACLR_B   : STRING := "OFF");

    PORT (wren, inclock, outclock, aclr: IN STD_LOGIC := '0';
        data: IN STD_LOGIC_VECTOR(WIDTH-1 DOWNTO 0);
        wraddress, rdaddress_a, rdaddress_b: IN STD_LOGIC_VECTOR(WIDTHAD-1 DOWNTO 0);
        inclocken, rden_a, rden_b, outclocken: IN STD_LOGIC := '1';
        q_a, q_b: 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_a[] Yes Read address input to the memory. Input port WIDTHAD wide.
rdaddress_b[] 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_a[], rdaddress_b[], rden_a, and rden_b.
inclocken No Clock enable for inclock.  
rden_a Yes 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_a port controls a latch that remembers the value last read while the rden_a port was high. In APEX 20K devices, the rden_a port becomes a power down signal.
rden_b Yes 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_b port controls a latch that remembers the value last read while the rden_b port was high. In APEX 20K devices, the rden_b port becomes a power down signal.
outclock No Positive-edge-triggered clock. Used for the registered q_a[] or q_b[] port. May also be used for registered read ports, for example, rdaddress_a[], rdaddress_b[], rden_a, and rden_b.
outclocken No Clock enable for outclock.  
aclr Yes Asynchronous clear input. Affects registered inputs and outputs.

OUTPUT PORTS

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

 

Parameter Descriptions:

Parameter Type Required Description
WIDTH Integer Yes Width of data[], q[]_a, and q[]_b ports.
WIDTHAD Integer Yes Width of the rdaddress_a[], rdaddress_b[], 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.
WRITE_REG String No Determines the clock used by the wraddress[] and wren ports. Values are "UNREGISTERED" and "INCLOCK". The default is "INCLOCK".
WRITE_ACLR String No Defines whether aclr affects the wraddress[] port register. Values are "ON" and "OFF". The default is "ON".
RDADDRESS_REG_A String No Determines the clock used by the rdaddress_a[] port. Values are "UNREGISTERED", "INCLOCK", and "OUTCLOCK". The default is "INCLOCK".
RDADDRESS_REG_B String No Determines the clock used by the rdaddress_b[] port. Values are "UNREGISTERED", "INCLOCK", and "OUTCLOCK". The default is "INCLOCK".
RDADDRESS_ACLR_A String No Defines whether aclr affects the rdaddress_a[] port. Values are "ON" and "OFF". The default is "ON".
RDADDRESS_ACLR_B String No Defines whether aclr affects the rdaddress_b[] port. Values are "ON" and "OFF". The default is "ON".
RDCONTROL_REG_A String No Determines the clock used by the rden_a port. Values are "UNREGISTERED", "INCLOCK", and "OUTCLOCK". The default is "INCLOCK".
RDCONTROL_REG_B String No Determines the clock used by the rden_b port. Values are "UNREGISTERED", "INCLOCK", and "OUTCLOCK". The default is "INCLOCK".
RDCONTROL_ACLR_A String No Defines whether aclr affects the rden_a port register. Values are "ON" and "OFF". The default is "ON".
RDCONTROL_ACLR_B String No Defines whether aclr affects the rden_b 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_A String No Determines the clock used by the q_a[] port. Values are "UNREGISTERED" and "OUTCLOCK". The default is "OUTCLOCK".
OUTDATA_REG_B String No Determines the clock used by the q_b[] port. Values are "UNREGISTERED" and "OUTCLOCK". The default is "OUTCLOCK".
OUTDATA_ACLR_A String No Defines whether aclr affects the q_a[] port register. Values are "ON" and "OFF". The default is "ON".
OUTDATA_ACLR_B String No Defines whether aclr affects the q_b[] 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 alt3pram 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_a/rden_b Function 
X L L No change.
notRising Edge H H No change.
Rising Edge L X No change.
Rising Edge H H The q_a[]/q_b[]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_a[] is asynchronous and reflects the memory location pointed to by rdaddress_a[].

 

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.