Megafunctions

altqpram (Quad-Port RAM) Megafunction



Parameterized quad-port RAM megafunction. The Quartus® II software does not provide a paramterized Block Symbol File (.bsf) for the altqpram megafunction, however the MegaWizard® Plug-In Manager (Tools menu) can create a customized BSF for you. The altqpram megafunction is available for APEX II and Mercury devices only. This megafunction is provided only for backward compatibility in Cyclone, Stratix, and Stratix GX designs; instead, Altera® recommends using the altsyncram megafunction.

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 altdpram(wren, data[WIDTH-1..0], wraddress[WIDTHAD-1..0], inclock, inclocken, rden, 
                  rdaddress[WIDTHAD-1..0], 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 ALTQPRAM
    GENERIC
      ( OPERATION_MODE            : STRING := "QUAD_PORT";

        WIDTH_WRITE_A             : NATURAL := 1;
        WIDTHAD_WRITE_A           : NATURAL := 1;
        NUMWORDS_WRITE_A          : NATURAL := 2;  -- DEFAULT = 2^WIDTHAD_WRITE_A
        INDATA_REG_A              : STRING := "INCLOCK_A";
        INDATA_ACLR_A             : STRING := "ON";
        WRCONTROL_WRADDRESS_REG_A : STRING := "INCLOCK_A";
        WRCONTROL_ACLR_A          : STRING := "ON";
        WRADDRESS_ACLR_A          : STRING := "ON";

        WIDTH_WRITE_B             : NATURAL := 1;  -- DEFAULT = WIDTH_WRITE_A
        WIDTHAD_WRITE_B           : NATURAL := 1;  -- DEFAULT = WIDTHAD_WRITE_A
        NUMWORDS_WRITE_B          : NATURAL := 2;  -- DEFAULT = 2^WIDTHAD_WRITE_B
        INDATA_REG_B              : STRING := "INCLOCK_B";
        INDATA_ACLR_B             : STRING := "ON";
        WRCONTROL_WRADDRESS_REG_B : STRING := "INCLOCK_B";
        WRCONTROL_ACLR_B          : STRING := "ON";
        WRADDRESS_ACLR_B          : STRING := "ON";

        WIDTH_READ_A              : NATURAL := 1;
        WIDTHAD_READ_A            : NATURAL := 1;
        NUMWORDS_READ_A           : NATURAL := 2;  -- DEFAULT = 2^WIDTHAD_READ_A
        RDCONTROL_REG_A           : STRING := "OUTCLOCK_A";
        RDCONTROL_ACLR_A          : STRING := "ON";
        RDADDRESS_REG_A           : STRING := "OUTCLOCK_A";
        RDADDRESS_ACLR_A          : STRING := "ON";
        OUTDATA_REG_A             : STRING := "UNREGISTERED";
        OUTDATA_ACLR_A            : STRING := "ON";

        WIDTH_READ_B              : NATURAL := 1;  -- DEFAULT = WIDTH_READ_A
        WIDTHAD_READ_B            : NATURAL := 1;  -- DEFAULT = WIDTHAD_READ_A
        NUMWORDS_READ_B           : NATURAL := 2;  -- DEFAULT = 2^WIDTHAD_READ_B
        RDCONTROL_REG_B           : STRING := "OUTCLOCK_B";
        RDCONTROL_ACLR_B          : STRING := "ON";
        RDADDRESS_REG_B           : STRING := "OUTCLOCK_B";
        RDADDRESS_ACLR_B          : STRING := "ON";
        OUTDATA_REG_B             : STRING := "UNREGISTERED";
        OUTDATA_ACLR_B            : STRING := "ON";

        INIT_FILE                 : STRING := "UNUSED";
        MAXIMUM_DEPTH             : NATURAL := 0;  -- DEFAULT = FLOOR(BITS_PER_ESB / MIN _DATA_WIDTH);
     PORT(wren_a, wren_b, inclock_a, inclock_b, 
         outclock_a, outclock_b, inaclr_a, inaclr_b, 
         outaclr_a, outaclr_b	: IN STD_LOGIC := '0';
         data_a       : IN STD_LOGIC_VECTOR(WIDTH_WRITE_A-1 DOWNTO 0) := (OTHERS => '0');
         data_b       : IN STD_LOGIC_VECTOR(WIDTH_WRITE_B-1 WIDTH_READ 0) := (OTHERS => '0');
         wraddress_a  : IN STD_LOGIC_VECTOR(WIDTHAD_WRITE_A-1 WIDTH_READ 0) := (OTHERS => '0');
         wraddress_b  : IN STD_LOGIC_VECTOR(WIDTHAD_WRITE_B-1 WIDTH_READ 0) := (OTHERS => '0');
         inclocken_a, inclocken_b, rden_a, rden_b, 
         outclocken_a, outclocken_b    : IN STD_LOGIC := '1';
         rdaddress_a  : IN STD_LOGIC_VECTOR(WIDTHAD_READ_A-1 WIDTH_READ 0) := (OTHERS => '0');
         rdaddress_b  : IN STD_LOGIC_VECTOR(WIDTHAD_READ_B-1 WIDTH_READ 0) := (OTHERS => '0');
         q_a          : OUT STD_LOGIC_VECTOR(WIDTH_READ_A-1 WIDTH_READ 0);
         q_b          : OUT STD_LOGIC_VECTOR(WIDTH_READ_B-1 WIDTH_READ 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_a[] Yes Data input to the memory. Input port WIDTH_WRITE_A wide.
data_b[] No Data input to the memory. Input port WIDTH_WRITE_B wide.
rdaddress_a[] Yes Read address input to the memory. Input port WIDTHAD_READ_A wide.
rdaddress_b[] No Read address input to the memory. Input port WIDTHAD_READ_B wide.
wraddress_a[] Yes Write address input to the memory. Input port WIDTHAD_WRITE_A wide.
wraddress_b[] No Write address input to the memory. Input port WIDTHAD_WRITE_B wide.
wren_a Yes Write enable input.  
wren_b No Write enable input.  
inclock_a No Positive-edge-triggered clock. Used for registered write ports, for example, data_a[], wraddress_a[], and wren_a. May also be used for registered read ports, for example, rdaddress_a[] and rden_a.
inclock_b No Positive-edge-triggered clock. Used for registered write ports, for example, data_b[], wraddress_b[], and wren_b. May also be used for registered read ports, for example, rdaddress_b[] and rden_b.
inclocken_a No Clock enable for inclock_a.  
inclocken_b No Clock enable for inclock_b.  
rden_a No Read enable input. Disables reading when low (0). The rden_a port controls a latch that remembers the value last read while the rden_a port was high.
rden_b No Read enable input. Disables reading when low (0). The rden_b port controls a latch that remembers the value last read while the rden_b port was high.
outclock_a No Positive-edge-triggered clock. Used for the registered q_a[] port. May also be used for registered read ports, for example, rdaddress_a[] and rden_a.
outclock_b No Positive-edge-triggered clock. Used for the registered q_b[] port. May also be used for registered read ports, for example, rdaddress_b[] and rden_b.
outclocken_a No Clock enable for outclock_a.  
outclocken_b No Clock enable for outclock_b.  
inaclr_a No Asynchronous clear input. The inaclr_a port can be configured to clear the data_a[], wren_a, wraddress_a[], rden_a, rdaddress_a[], and q_a[] ports.
inaclr_b No Asynchronous clear input. The inaclr_b port can be configured to clear the data_b[], wren_b, wraddress_b[], rden_b, rdaddress_b[], and q_b[] ports.
outaclr_a No Asynchronous clear input. The outaclr_a port can be configured to clear the rden_a, rdaddress_a[], q_a[] ports.
outaclr_b No Asynchronous clear input. The outaclr_b port can be configured to clear the rden_b, rdaddress_b[], q_b[] ports.

OUTPUT PORTS

Port Name Required Description Comments
q_a[] Yes Data output from the memory. Output port WIDTH_READ_A or WIDTH_WRITE_A wide.
q_b[] No Data output from the memory. Output port WIDTH_READ_B or WIDTH_WRITE_B wide.


Parameter Descriptions:

Parameter Type Required Comments
OPERATION_MODE String Yes Values are "SINGLE_PORT", "DUAL_PORT", "BIDIR_DUAL_PORT", "QUAD_PORT", and "ROM". If omitted, the default is "QUAD_PORT". For APEX II devices, if the OPERATION_MODE parameter is set to "BIDIR_DUAL_PORT" the width of the data_a[], rdaddress_a[], and wraddress_a[] ports must be equal to the width of the data_b[], rdaddress_b[], and wraddress_b[] ports.
INIT_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". When using more than one port or using mixed data widths, the INIT_FILE parameter corresponds to the WIDTH_READ_A parameter. The wren_a port must be registered to support memory initialization.
WIDTHAD_WRITE_A Integer Yes Specifies the address width of the wraddress_a[] port.
WIDTHAD_WRITE_B Integer No Specifies the address width of the wraddress_b[] port.
WIDTH_WRITE_A Integer Yes Specifies the width of the data_a[] port. If the OPERATION_MODE parameter is set to "BIDIR_DUAL_PORT" or "SINGLE_PORT", this parameter also specifies the width of the q_a[] port.
WIDTH_WRITE_B Integer No Specifies the width of the data_b[] port. If the OPERATION_MODE parameter is set to "BIDIR_DUAL_PORT" this parameter also specifies the width of the q_b[] port.
NUMWORDS_WRITE_A Integer Yes Number of words stored in memory. Indicates the width of the wraddress_a[] port. If omitted, the default is 2 ^ WIDTHAD_WRITE_A.
NUMWORDS_WRITE_B Integer No Number of words stored in memory. Indicates the width of the wraddress_b[] port. If omitted, the default is 2 ^ WIDTHAD_WRITE_B.
WIDTHAD_READ_A Integer Yes Specifies the address width for the rdaddress_a[] port.
WIDTHAD_READ_B Integer No Specifies the address width for the rdaddress_b[] port.
WIDTH_READ_A Integer Yes Specifies the width for the q_a[] port.
WIDTH_READ_B Integer No Specifies the width for the q_b[] port.
NUMWORDS_READ_A Integer Yes Number of words stored in memory. Indicates the width of the rdaddress_a[] port. If omitted, the default is 2 ^ WIDTHAD_READ_A.
NUMWORDS_READ_B Integer No Number of words stored in memory. Indicates the width of the rdaddress_b[] port. If omitted, the default is 2 ^ WIDTHAD_READ_B.
INDATA_REG_A String No Specifies the clock for the data_a[] port. Values are "INCLOCK_A" and "UNREGISTERED". The default is "UNREGISTERED".
INDATA_REG_B String No Specifies the clock for the data_b[] port. Values are "INCLOCK_B" and "UNREGISTERED". The default is "UNREGISTERED".
INDATA_ACLR_A String No Specifies the asynchronous clear for the data_a[] port. Values are "INACLR_A" and "NONE". The default is "NONE".
INDATA_ACLR_B String No Specifies the asynchronous clear for the data_b[] port. Values are "INACLR_B" and "NONE". The default is "NONE".
WRCONTROL_WRADDRESS_REG_A String No Specifies the clock for the wren_a port and the wraddress_a[] port. Values are "INCLOCK_A" and "UNREGISTERED". The default is "UNREGISTERED".
WRCONTROL_WRADDRESS_REG_B String No Specifies the clock for the wren_b port and the wraddress_b[] port. Values are "INCLOCK_B" and "UNREGISTERED".The default is "UNREGISTERED".
WRADDRESS_ACLR_A String No Specifies the asynchronous clear for the wraddress_a[] port. Values are "INACLR_A" and "NONE". The default is "NONE".
WRADDRESS_ACLR_B String No Specifies the asynchronous clear for the wraddress_b[] port. Values are "INACLR_B" and "NONE". The default is "NONE".
WRCONTROL_ACLR_A String No Specifies the asynchronous clear for the wren_a port. Values are "INACLR_A" and "NONE". The default is "NONE".
WRCONTROL_ACLR_B String No Specifies the asynchronous clear for the wren_b port. Values are "INACLR_B" and "NONE". The default is "NONE".
RDCONTROL_REG_A String No Specifies the clock for the rden_a port. Values are "INCLOCK_A", "OUTCLOCK_A", and "UNREGISTERED". The default is "UNREGISTERED".
RDCONTROL_REG_B String No Specifies the clock for the rden_b port. Values are "INCLOCK_B", "OUTCLOCK_B" and "UNREGISTERED". The default is "UNREGISTERED".
RDCONTROL_ACLR_A String No Specifies the asynchronous clear for the rden_a port. Values are "INACLR_A", "OUTACLR_A", and "NONE". The default is "NONE".
RDCONTROL_ACLR_B String No Specifies the asynchronous clear for the rden_b port. Values are "INACLR_B", "OUTACLR_B", and "NONE". The default is "NONE".
RDADDRESS_REG_A String No Specifies the clock for the rdaddress_a[] port. Values are "INCLOCK_A", "OUTCLOCK_A" and "UNREGISTERED". The default is "UNREGISTERED".
RDADDRESS_REG_B String No Specifies the clock for the rdaddress_b[] port. Values are "INCLOCK_B", "OUTCLOCK_B" and "UNREGISTERED". The default is "UNREGISTERED".
RDADDRESS_ACLR_A String No Specifies the asynchronous clear port for the rdaddress_a[] port. Values are "INACLR_A", "OUTACLR_A" and "NONE". The default is "NONE".
RDADDRESS_ACLR_B String No Specifies the asynchronous clear port for the rdaddress_b[] port. Values are "INACLR_B", "OUTACLR_B" and "NONE". The default is "NONE".
OUTDATA_REG_A String No Specifies the clock for the q_a[] port. Values are "INCLOCK_A", "OUTCLOCK_A" and "UNREGISTERED". The default is "UNREGISTERED".
OUTDATA_REG_B String No Specifies the clock for the q_b[] port. Values are "INCLOCK_B", "OUTCLOCK_B" and "UNREGISTERED". The default is "UNREGISTERED".
OUTDATA_ACLR_A String No Specifies the asynchronous clear port for the q_a[] port. Values are "INACLR_A", "OUTACLR_A" and "NONE". The default is "NONE".
OUTDATA_ACLR_B String No Specifies the asynchronous clear port for the q_b[] port. Values are "INACLR_B", "OUTACLR_B" and "NONE". The default is "NONE".

 

Truth Table/Functionality:

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

Synchronous Write to Memory (all inputs registered)
inclock_a/inclock_b inclocken_a/inclocken_b wren_a/wren_b 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_a[]/wraddress_b[] is loaded with data_a[]/data_b[].

 

Synchronous Read from Memory
inclock_a/inclock_b inclocken_a/inclocken_b 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_a nor outclock_a is connected.

Asynchronous Memory Operations
wren_a/wren_b Function 
L No change.
H The memory location pointed to by wraddress_a[] is loaded with data_a[] and controlled by wren_a.
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.

NOTE This topic prints best in Landscape orientation.


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.