Megafunctions

altmult_accum (Multiply-Accumulate) Megafunction



Parameterized multipy-accumulate megafunction. The altmult_accum megafunction consists of a single multiplier feeding an accumulator.

This topic contains the following information:


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

FUNCTION altmult_accum (dataa[NUMBER_OF_MULTIPLIERS * WIDTH_A - 1..0], datab[NUMBER_OF_MULTIPLIERS * WIDTH_B - 1..0], addnsub, accum_sload,
      signa, signb, clock0, clock1, clock2, clock3, ena0, ena1, ena2, ena3, aclr0, aclr1,
      aclr2, aclr3 ) 
   WITH (WIDTH_A, WIDTH_B, WIDTH_RESULT, INPUT_REG_A, INPUT_ACLR_A, INPUT_REG_B, INPUT_ACLR_B,
      ADDNSUB_REG, ADDNSUB_ACLR, ADDNSUB_PIPELINE_REG, ADDNSUB_PIPELINE_ACLR, ACCUM_DIRECTION, 
      ACCUM_SLOAD_REG, ACCUM_SLOAD_ACLR, ACCUM_SLOAD_PIPELINE_REG, ACCUM_SLOAD_PIPELINE_ACLR, 
      REPRESENTATION_A, SIGN_REG_A, SIGN_ACLR_A, SIGN_PIPELINE_REG_A, SIGN_PIPELINE_ACLR_A, 
      SIGN_REG_B, SIGN_ACLR_B, REPRESENTATION_B, SIGN_PIPELINE_REG_B, SIGN_PIPELINE_ACLR_B, 
      MULTIPLIER_REG, MULTIPLIER_ACLR, OUTPUT_REG, OUTPUT_ACLR, EXTRA_LATENCY, 
      DEDICATED_MULTIPLIER_CIRCUITRY ) 
   RETURNS  (result[WIDTH_RESULT - 1..0], overflow, scanouta[WIDTH_A - 1..0],
      scanoutb[WIDTH_B - 1..0]); 


VHDL Component Declaration:


COMPONENT altmult_accum 
   GENERIC 
      (WIDTH_A                        : INTEGER  := 3;
      WIDTH_B                         : INTEGER  := 3;
      WIDTH_RESULT                    : INTEGER  := 10;
      INPUT_REG_A                     : STRING   := "CLOCK0";
      INPUT_ACLR_A                    : STRING   := "ACLR3";
      INPUT_REG_B                     : STRING   := "CLOCK0";
      INPUT_ACLR_B                    : STRING   := "ACLR3";
      ADDNSUB_REG                     : STRING   := "CLOCK0";
      ADDNSUB_ACLR                    : STRING   := "ACLR3";
      ADDNSUB_PIPELINE_REG            : STRING   := "CLOCK0";
      ADDNSUB_PIPELINE_ACLR           : STRING   := "ACLR3";
      ACCUM_DIRECTION                 : STRING   := "ADD";
      ACCUM_SLOAD_REG                 : STRING   := "CLOCK0";
      ACCUM_SLOAD_ACLR                : STRING   := "ACLR3";
      ACCUM_SLOAD_PIPELINE_REG        : STRING   := "CLOCK0";
      ACCUM_SLOAD_PIPELINE_ACLR       : STRING   := "ACLR3";
      REPRESENTATION_A                : STRING   := "UNSIGNED";
      SIGN_REG_A                      : STRING   := "CLOCK0";
      SIGN_ACLR_A                     : STRING   := "ACLR3";
      SIGN_PIPELINE_REG_A             : STRING   := "CLOCK0";
      SIGN_PIPELINE_ACLR_A            : STRING   := "ACLR3";
      REPRESENTATION_B                : STRING   := "UNSIGNED";
      SIGN_REG_B                      : STRING   := "CLOCK0";
      SIGN_ACLR_B                     : STRING   := "ACLR3";
      SIGN_PIPELINE_REG_B             : STRING   := "CLOCK0";
      SIGN_PIPELINE_ACLR_B            : STRING   := "ACLR3";
      MULTIPLIER_REG                  : STRING   := "CLOCK0";
      MULTIPLIER_ACLR                 : STRING   := "ACLR3";
      OUTPUT_REG                      : STRING   := "CLOCK0";
      OUTPUT_ACLR                     : STRING   := "ACLR0";
      EXTRA_MULTIPLIER_LATENCY        :INTEGER   := 0;
      EXTRA_ACCUMULATOR_LATENCY       :INTEGER   := 0;
      DEDICATED_MULTIPLIER_CIRCUITRY  :STRING    := "AUTO");
 
   PORT (dataa                             : IN STD_LOGIC_VECTOR(NUMBER_OF_MULTIPLIERS * WIDTH_A -1 DOWNTO 0);
         datab                             : IN STD_LOGIC_VECTOR(NUMBER_OF_MULTIPLIERS * WIDTH_B -1 DOWNTO 0);
         addnsub, clock0, clock1, clock2,  
            clock3, ena0, ena1, ena2, ena3 : IN STD_LOGIC := '1';
         accum_sload, signa, signb, aclr0, 
            aclr1, aclr2, aclr3            : IN STD_LOGIC := '0';
         result                            : OUT STD_LOGIC_VECTOR(WIDTH_RESULT -1 DOWNTO 0);
         overflow                          : OUT STD_LOGIC;
         scanouta                          : OUT STD_LOGIC_VECTOR (WIDTH_A -1 DOWNTO 0);
         scanoutb                          : OUT STD_LOGIC_VECTOR (WIDTH_B -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
dataa[] Yes Data input to the multiplier. Input port [NUMBER_OF_MULTIPLIERS * WIDTH_A-1..0] wide.
datab[] Yes Data input to the multiplier. Input port [NUMBER_OF_MULTIPLIERS * WIDTH_B-1..0] wide.
addnsub No Controls the functionality of the adder. If the addnsub port is high, the adder performs an add function; if the addnsub port is low, the adder performs a subtract function.
accum_sload No Causes the value on the accumulator feedback path to go to zero (0). If the accumulator is adding and the accum_sload port is high, then the multiplier output is loaded into the accumulator. If the accumulator is subtracting, then the opposite (negative value) of the multiplier output is loaded into the accumulator.
signa No Specifies the numerical representation of the dataa[] port. If the signa port is high, the multiplier treats the dataa[] port as a signed two's complement number. If the signa port is low, the multiplier treats the dataa[] port as an unsigned number.
signb No Specifies the numerical representation of the datab[] port. If the signb port is high, the multiplier treats the datab[] port as a signed two's complement number. If the signb port is low, the multiplier treats the datab[] port as an unsigned number.
clock0 No The first clock input, usable by any register in the megafunction.  
clock1 No The first clock input, usable by any register in the megafunction.  
clock2 No The first clock input, usable by any register in the megafunction.  
clock3 No The first clock input, usable by any register in the megafunction.  
ena0 No Clock enable for the clock0 port.  
ena1 No Clock enable for the clock1 port.  
ena2 No Clock enable for the clock2 port.  
ena3 No Clock enable for the clock3 port.  
aclr0 No The first asynchronous clear input.  
aclr1 No The second asynchronous clear input.  
aclr2 No The third asynchronous clear input.  
aclr3 No The fourth asynchronous clear input.  

OUTPUT PORTS

Port Name Required Description Comments
result[] Yes Accumulator output port. Output port [WIDTH_RESULT-1..0] wide
overflow No Overflow port for the accumulator adder.  
scanouta[] No Output of the first shift register. Output port [WIDTH_A-1..0] wide.
scanoutb[] No Output of the second shift register. Output port [WIDTH_B-1..0] wide.


Parameter Descriptions:

Parameter Type Required Comments
WIDTH_A Integer Yes Width of the dataa[] operand of each multiplier.
WIDTH_B Integer Yes Width of the datab[] port.
WIDTH_RESULT Integer Yes Width of the result[] port.
INPUT_REG_A String No Specifies the clock port for the dataa[] port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0".
INPUT_ACLR_A String No Specifies the asynchronous clear port for the dataa[] port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3".
INPUT_REG_B String No Specifies the clock port for the datab[] port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", and "CLOCK2". If omitted the default is "CLOCK0".
INPUT_ACLR_B String No Specifies the asynchronous clear port for the datab[] port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3".
ADDNSUB_REG String No Specifies the clock for the addnsub port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the addnsub port is unused.
ADDNSUB_ACLR String No Specifies the asynchronous clear for the addnsub port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR0". This parameter is ignored if the addnsub port is unused.
ADDNSUB_PIPELINE_REG String No Specifies the clock for the second register on the addnsub port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the addnsub port is unused.
ADDNSUB_PIPELINE_ACLR String No Specifies the asynchronous clear for the second register on the addnsub port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR0". This parameter is ignored if the addnsub port is unused.
ACCUM_DIRECTION String No Specifies whether the accumulator performs an add or subtract function. Values are "ADD" and "SUB". When this parameter is set to "ADD", the accumulator adds the product to the current accumulator value. When this parameter is set to "SUB", the accumulator subtracts the product from the current accumulator value. If omitted the default is "ADD". This parameter is ignored if the addnsub port is used.
ACCUM_SLOAD_REG String No Specifies the clock signal for the accum_sload port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the accum_sload port is unused.
ACCUM_SLOAD_ACLR String No Specifies the asynchronous clear signal for the accum_sload port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3". This parameter is ignored if the accum_sload port is unused.
ACCUM_SLOAD_PIPELINE_REG String No Specifies the clock signal for the second register on the accum_sload port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the accum_sload port is unused.
ACCUM_SLOAD_PIPELINE_ACLR String No Specifies the asynchronous clear signal for the second register on the accum_sload port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3". This parameter is ignored if the accum_sload port is unused.
REPRESENTATION_A String No Specifies the numerical representation of the dataa port. Values are "UNSIGNED" and "SIGNED". When this parameter is set to "UNSIGNED", the accumulator interprets the dataa input as an unsigned number. When this parameter is set to "SIGNED", the accumulator interprets the dataa input as a signed two's complement number. If omitted the default is "UNSIGNED". This parameter is ignored if the signa port is used.
SIGN_REG_A String No Specifies the clock signal for first register on the signa port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the signa port is unused.
SIGN_ACLR_A String No Specifies the asynchronous clear signal for the first register on the signa port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3". This parameter is ignored if the signa port is unused.
SIGN_PIPELINE_REG_A String No Specifies the clock signal for the second register on the signa port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the signa port is unused.
SIGN_PIPELINE_ACLR_A String No Specifies the asynchronous clear signal for the second register on the signa port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3". This parameter is ignored if the signa port is unused.
REPRESENTATION_B String No Specifies the numerical representation of the datab port. Values are "UNSIGNED" and "SIGNED". When this parameter is set to "UNSIGNED", the accumulator interprets the datab input as an unsigned number. When this parameter is set to "SIGNED", the accumulator interprets the datab input as a signed two's complement number. If omitted the default is "UNSIGNED". This parameter is ignored if the signb port is used.
SIGN_REG_B String No Specifies the clock signal for first register on the signb port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the signb port is unused.
SIGN_ACLR_B String No Specifies the asynchronous clear signal for the first register on the signb port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3". This parameter is ignored if the signb port is unused.
SIGN_PIPELINE_REG_B String No Specifies the clock signal for the second register on the signb port. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0". This parameter is ignored if the signb port is unused.
SIGN_PIPELINE_ACLR_B String No Specifies the asynchronous clear signal for the second register on the signb port. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3". This parameter is ignored if the signb port is unused.
MULTIPLIER_REG String No Specifies the clock signal for the register immediately following the multiplier. Values are "UNREGISTERED", "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0".
MULTIPLIER_ACLR String No Specifies the asynchronous clear signal for the register immediately following the multiplier. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3".
OUTPUT_REG String No Specifies the clock signal for the registers on the outputs. Values are "CLOCK0", "CLOCK1", "CLOCK2", and "CLOCK3". If omitted the default is "CLOCK0".
OUTPUT_ACLR String No Specifies the asynchronous clear signal for the registers on the outputs. Values are "ACLR0", "ACLR1", "ACLR2", and "ACLR3". If omitted the default is "ACLR3".
EXTRA_MULTIPLIER_LATENCY Integer No Specifies the number of clock cycles of latency for the multiplier portion of the DSP block. If the MULTIPLIER_REG parameter is specified, then the specified clock port is used to add the latency. If the MULTIPLIER_REG parameter is set to "UNREGISTERED", then the clock0 port is used to add the latency.
EXTRA_ACCUMULATOR_LATENCY String No Adds the number of clock cycles of latency, specified by the OUTPUT_REG parameter, to the accumulator portion of the DSP block.
DEDICATED_MULTIPLIER_CIRCUITRY String No Specifies whether to use dedicated multiplier circuitry. Values are "AUTO", "ON", and "OFF". If omitted, the default is "AUTO". This parameter is available for Mercury, Stratix, and Stratix GX devices only.


NOTE This topic prints best in Landscape orientation.

Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.