Home

lpm_mult Megafunction User Guide

image

Contents

1. The MegaWizard Plug In Manager will create these files in the directory C Documents and Sattinac chlarcantNeclrant WewlFilact Draiacte Manskiinctinnctinn mul Meciar EZ mult v Variation file O mult inc AHDL Include file O mult cmp VHDL Component declaration file 4 mult bsf Quartus symbol file O mult_inst v Instantiation template file MM mult_bb v Verilog Black Box declaration file E mult_waveforms html Sample waveforms in summary i mult_wave ipg Sample waveform file s em mu 23 Page 7 of the lpm_mult MegaWizard Plug In Manager provides a summary of the megafunction Ensure that the option to generate the Quartus II software block symbol file bsf is turned on 24 Click Finish The lpm_mult megafunction is built 25 Move the pointer to place the multiplier symbol in between the input and output ports of the multiplier bdf file Click as necessary to place the multiplier symbol 26 You have now completed the design file see Figure 2 7 on page 2 11 27 On the File menu select Save to save the design 2 16 Altera Corporation Ipm_mult Megafunction User Guide March 2007 Getting Started Altera Corporation March 2007 Implement the 9 Bit Multiplier Next implement the multiplier assign the EP2S15F484C3 device to the project and compile the project 1 On the Assignments menu select Settings and then Files and add multiplier bdf and mult v to the project Click OK 2 On the
2. Edit an existing custom megafunction variation Copy an existing custom megafunction variation Copyright 1991 2006 Altera Corporation Cancel Next gt Click Next Page 2a displays Figure 2 9 2 11 Ipm_mult Megafunction User Guide Design Example 9 Bit Multiplier Figure 2 9 MegaWizard Plug In Manager Ipm_mult page 2a MegaWizard Plug In Manager page 2a Which megafunction would you like to customize Select a megafunction from the list below J Installed Plug Ins Ay Altera SOPC Builder Arithmetic ALTACCUMULATE ALTFP_ADD_SUB ALTFP_MULT ALTMEMMULT ALTMULT_ACCUM MAC ALTMULT_ADD ALTSORT LPM_ABS LPM_ADD_SUB LPM_COMPARE LPM_COUNTER LPM_DIVIDE LPM_MULT PARALLEL_ADD Communications l DSP fa Gates 1 0 Interfaces i Memory Compiler Serial Flash Loader Which device family will you be using Stratis Il F Which type of output file do you want to create AHDL VHDL Verilog HDL What name do you want for the output file Browse _mult 00_Design_example ste lpm_mult_unzipped Ipm_mult mult Generate clear box netlist file instead of a default wrapper file for use with supported EDA synthesis tools only J Retum to this page for another create operation Note To compile a project successfully in the Quartus II software your design files must be in the project directory in the global user libraries specified in the
3. 3 1 Altera Corporation iii Ipm_mult Megafunction User Guide Contents Ipm_mult Megafunction User Guide iv Altera Corporation Ipm_mult Megafunction User Guide About this User Guide Revision Histo ry The table below displays the revision history for the chapters in this User G uide Date Document Version Changes Made March 2007 2 2 Added Cyclone III information No new screenshots were taken December 2006 Added Stratix III information No new screenshots were taken June 2006 2 0 Updated for Quartus II 6 0 software Also added ModelSim simulation section September 2004 1 0 Initial release How to Contact Altera Altera Corporation March 2007 For the most up to date information about Altera products go to the Altera world wide web site at www altera com For technical support on this product go to www altera com mysupport For additional information about Altera products consult the sources shown below Information Type USA amp Canada www altera com mysupport Technical support 800 800 EPLD 3753 7 00 a m to 5 00 p m Pacific Time Product literature www altera com Altera literature services lit_req altera com 7 FTP site ftp altera com Note to table 1 You can also contact your local Altera sales office or sales representative v Ipm_mult Megafunction User Guide Typographic Conventions Typographic Conventions This documen
4. Cyclone II Cyclone HardCopy II HardCopy Stratix MAX II MAX 3000A MAX 7000AE MAX 7000 B MAX 7000 S ACEX 1K APEX JI APEX 20KC APEX 20KE FLEX 10K FLEX 10KA FLEX 10KE FLEX 6000 As design complexities increase use of vendor specific intellectual property IP blocks has become a common design methodology Altera provides parameterizable megafunctions that are optimized for Altera device architectures Using megafunctions instead of coding your own logic saves valuable design time Additionally the Altera provided functions may offer more efficient logic synthesis and device implementation You can scale the megafunction s size by setting parameters The Ipm_mult megafunction implements the basic multiplier and offers many additional features which include 1 1 Ipm_mult Megafunction User Guide General Description m Parameterizable input data widths m Availability of an extra input data port for direct addition to the multiplication result Parameterizable output data widths Ability to specify a constant value for the datab input to optimize implementation Support for both signed and unsigned data representations Options for implementation in dedicated or general hardware Support for pipelining with parameterized output latency Active high asynchronous clear and clock enable control inputs Support for area versus speed trade off IF Thealtmult add megafunction can be used to implement a multiplier with gr
5. Parameterized Ipm_mult Megafunction Interface Part 5 of 5 Parameter DEDICATED MULTIPLIER_ MIN INPUT WIDTH FOR AUTO Type Integer Required No Description If the DEDICATED MULTIPLIER CIRCUITRY parameter setting is AUTO this parameter specifies the minimum value of the LPM_WIDTHA and LPM WIDTHB parameters for the multiplier to be built using dedicated circuitry This parameter is available for HardCopy Stratix Mercury Stratix Stratix Il Stratix GX and Cyclone Il devices only DEDICATED MULTIPLIER_ MIN OUTPUT WIDTH FOR AUTO Integer If the DEDICATED MULTIPLIER CIRCUITRY parameter setting is AUTO this parameter specifies the minimum value of the sum of the LPM_WIDTHA and LPM_WIDTHB parameters for the multiplier to be built using dedicated circuitry This parameter is available for HardCopy Stratix Mercury Stratix Stratix Il Stratix GX and Cyclone Il devices only 3 6 Ipm_mult Megafunction User Guide Altera Corporation March 2007
6. also have the option to enable the generation of a clear box netlist for this megafunction Figure 2 1 Figure 2 1 MegaWizard Plug In Manager Ipm_mult page 2a MegaWizard Plug In Manager page 2a Which megafunction would you like to customize Select a megafunction from the list below J Installed Plug Ins A Altera SOPC Builder Arithmetic ALTACCUMULATE ALTFP_ADD_SUB ALTFP_MULT ALTMEMMULT ALTMULT_ACCUM MAC ALTMULT_ADD ALTSORT LPM_ABS LPM_ADD_SUB LPM COMPARE LPM COUNTER LPM DIVIDE PARALLEL_ADD Communications l DSP Gates f 1 0 Interfaces fl Memory Compiler Serial Flash Loader which device family will you be using Stratis II v Which type of output file do you want to create AHDL VHDL Verilog HDL What name do you want for the output file _mult 00_Design_example stc lpm_mult_unzipped lpm_mult mult J Generate clear box netlist file instead of a default wrapper file for use with supported EDA synthesis tools only I Return to this page for another create operation Note To compile a project successfully in the Quartus II software your design files must be in the project directory in the global user libraries specified in the Options dialog box Tools menu or a user library specified in the User Libraries page of the Settings dialog box Assignments menu Your current user library directories are Cancel lt Back Next gt i 2 2 Ipm
7. megafunction for larger area These settings are for backward compatibility only if the setting is between 6 and 8 the compiler optimizes for larger area and higher speed if the setting is between 1 and 5 the compiler optimizes for smaller area and high speed If the setting is 0 the smallest and generally slowest design results For designs with LPM_WIDTHB parameters that are non power of 2 the default setting is 1 through 5 For designs with LPM _WIDTHB parameters that are a power of 2 the default is 6 8 For an UNSIGNED multiplier with no inputs being a constant if the setting for MAXIMIZE_ SPEED is 6 or higher the compiler optimizes for larger area and higher speed If the setting is between 0 and 5 which is the default value the compiler optimizes for smaller area Specifies whether to use dedicated multiplier circuitry Values are AUTO YES and NO The default is AUTO This parameter is available for Mercury HardCopy Stratix Stratix Stratix Il Stratix GX and Cyclone II devices only For HardCopy Stratix Stratix and Stratix GX devices the value of AUTO specifies that the Quartus II software makes a choice whether to use the dedicated multiplier circuitry based on the width of the multiplier For Mercury devices a value of AUTO defaults to no dedicated multiplier circuitry Altera Corporation March 2007 3 5 Ipm_mult Megafunction User Guide Ports amp Parameters Table 3 3
8. the DSP block and embedded multiplier chapters in the Stratix Stratix II and Cyclone II handbooks for information about the architecture of the DSP blocks and embedded multipliers and for detailed information about the hardware conversion process Table 1 1 summarizes the resource usage for an lpm_mult function used to implement an 8 bit signed multiplier You can force the compiler to implement the multiplier in logic resources DSP blocks or embedded multipliers or allow the compiler to use the default optimum implementation Table 1 1 Ipm mult Megafunction Resource Use Device Family Optimization Width Logic Usage Stratix Stratix GX Speed 8 95 logic elements Cyclone Cyclone Il Balanced 8 95 logic elements HardCopy Stratix Area 8 95 logic elements Speed 8 62 ALUTs Stratix II Balanced 8 62 ALUTs Area 8 62 ALUTs LS The Ipm_mult MegaWizard Plug In Manager reports approximate resource utilization based on the user s specification and parameters This is reported in the bottom left corner of the MegaWizard Plug In Manager Ipm_mult Megafunction User Guide Altera Corporation March 2007 Chapter 2 Getting Started NOTE RYAN System amp Software Requirements MegaWizard Plug In Manager Customization Using the MegaWizard Plug In Manager Altera Corporation March 2007 The instructions in this section require the following hardware and software m A PC runni
9. LPM_WIDTHS only the LPM_WIDTHP MSBs are present Table 3 3 Parameterized Ipm_mult Megafunction Interface Part 1 of 5 Parameter Type Required Description LPM _WIDTHA Integer Yes Width of the dataa port LPM _WIDTHB Integer Yes Width of the datab port LPM _WIDTHP Integer Yes Width of the result port LPM WIDTHS Integer Yes Width of the sum port Required even if the sum port is not used LPM_REPRESENTATION String No Data representation SIGNED UNSIGNED or UNUSED The default is UNSIGNED The signed representation for all library of parameterized modules LPM megafunctions is two s complement 3 2 Ipm_mult Megafunction User Guide Altera Corporation March 2007 Specifications Table 3 3 Parameterized Ipm_mult Megafunction Interface Part 2 of 5 Parameter LPM PIPELINE Type Integer Required No Description Specifies the number of clock cycles of latency associated with the result output A value of zero 0 indicates that no latency exists and that a purely combinational function is instantiated If the value of the LPM_PIPELINE parameter is greater than zero for the Mercury dedicated multiplier one of the pipeline stages is always placed on the outputs The default is 0 non pipelined For HardCopy Stratix Stratix and Stratix GX devices if the design uses DSP blocks you can increase the perf
10. Options dialog box Tools menu or a user library specified in the User Libraries page of the Settings dialog box Assignments menu Your current user library directories are Cancel lt Back Next gt t 6 On page 2a expand the Arithmetic folder and select the LPM_MULT megafunction 7 To answer the question Which device family will you be using select Stratix II 8 To answer the question What type of output file do you want to create select Verilog HDL 9 Name the file lt project directory gt mult 10 Click Next Page 3 displays Figure 2 10 2 12 Ipm_mult Megafunction User Guide Altera Corporation March 2007 Getting Started Figure 2 10 MegaWizard Plug In Manager Ipm_mult page 3 of 7 MegaWizard Plug In Manager LPM_MULT page 3 of 7 LPM_MULT Version 6 0 m Multiplier configuration Multiply dataa input by datab input Multiply dataa input by itself squaring operation How wide should the dataa input bus be 3 bits How wide should the datab input bus be 3 v bits M Create a sum input bus with a width of 3 v bits How should the width of the result output be determined Automatically calculate the width Restrict the width to bits L Cancel lt Back Next gt Finish Resource Usage 11 On page 3 of the lpm_mult MegaWizard Plug In Manager under the Multiplier Configuration section turn on Multiply dataa i
11. Processing menu select Start Compilation or click on the compile symbol to compile the design 3 In the dialog box asking Save changes to multiplier bdf click Yes 4 When the Full Compilation was successful message box displays click OK 5 Onthe Assignments menu view how the module is implemented in the Stratix II device by selecting Timing Closure Floorplan Functional Results Simulate the 9 Bit Multiplier Design in Quartus Simulate the lpm_mult design module and verify the results Set up the Quartus II simulator by performing the following steps 1 On the Processing menu select Generate Functional Simulation Netlist command 2 When the Functional Simulation Netlist Generation was successful message box displays click OK 3 To open the Settings dialog box on the Assignments menu select Settings 4 Inthe Category list select Simulator Settings 5 Under Simulation mode select Functional and then select the necessary input vector waveform file multiplier vwf 6 Click OK 7 On the Processing menu select Start Simulation or press Ctrl I or in click on the simulation button to run a simulation 8 When the Simulator was successful message box displays click OK 2 17 Ipm_mult Megafunction User Guide Design Example 9 Bit Multiplier 9 Inthe Simulation Report window view the simulation output waveforms and verify the results Figure 2 14 shows the expected si
12. _mult Megafunction User Guide Altera Corporation March 2007 Getting Started On Page 3 of the lpm_mult MegaWizard Plug In Manager specify the input data widths sum input port and its data width and the output data width Figure Figure 2 2 MegaWizard Plug In Manager Ipm_mult page 3 of 7 MegaWizard Plug In Manager LPM_MULT page 3 of 7 LPM_MULT Version 6 0 Pipelining result 17 0 databl 0 AS Unsigned multiplication Resource Usage Multiplier configuration Multiply dataa input by datab input Multiply dataa input by itself squaring operation 9 9 v bits bits 3 E bits How should the width of the result output be determined How wide should the dataa input bus be How wide should the datab input bus be M Create a sum input bus with a width of Automatically calculate the width Restrict the width to E bits Cancel lt Back Next gt Einish Table 2 1 shows the options available on Page 3 of the lpm_mult MegaWizard Plug In Manager Table 2 1 Ipm_mult MegaWizard Plug In Manager Page 3 Options Function Multiplier configuration Description Indicate whether the dataa is to be multiplied by datab or multiplied by itself squared How wide should the dataa input bus be How wide should the datab input bus be Specify the width of the dataa input Specify the widt
13. and embedded multipliers in Altera devices refer to m AN 306 Techniques for Implementing Multipliers in FPGA Devices m The Using the DSP Blocks in Stratix amp Stratix GX Devices chapter in volume 2 of the Stratix Device Handbook m The DSP Blocks in Stratix II Devices chapter in volume 2 of the Stratix II Device Handbook m The Embedded Multipliers in Cyclone II Devices chapter of the Cyclone II Device Handbook Resou rce The lpm_mult megafunction can be implemented using either logic eer resources or dedicated multiplier circuitry in Altera devices Typically Utilization and the Ipm_mult megafunction is translated to the dedicated multiplier Pe rform ance circuitry when it is available because it provides better performance and resource utilization If all of the input data widths are smaller than or equal to nine bits the function uses the 9 x 9 multiplier configuration in the dedicated multiplier Otherwise 18 x 18 multipliers are used to process data with widths between 10 bits and 18 bits If you use the sum port of the lpm_mult megafunction the addition is implemented using logic resources The output adders in the Stratix Stratix GX and Stratix II DSP blocks cannot be used to implement the adder because the adder can only be fed by the outputs of the DSP block multipliers and not by external logic Altera Corporation 1 3 March 2007 Ipm_mult Megafunction User Guide Resource Utilization and Performance 1 4 Refer to
14. ar megafunction When you use the MegaWizard Plug In Manager to set up and parameterize a megafunction it creates either a VHDL or Verilog HDL wrapper file that instantiates the megafunction a black box methodology For some megafunctions you can generate a fully synthesizable netlist for improved results with EDA synthesis tools such as Synplify and Precision RTL Synthesis a clear box methodology Both clear box and black box methodologies are described in volume 1 of the Quartus II Handbook During compilation with the Quartus II software analysis and elaboration is performed to build the structure of your design To locate your megafunction in the Project Navigator window expand the compilation hierarchy and locate the megafunction by its name Similarly to search for node names within the megafunction using the Node Finder in the Look in box click Browse and select the megafunction in the Hierarchy box The Quartus II Simulation tool provides an easy to use integrated solution for performing simulations The following sections describe the simulation options Quartus Simulation The Quartus II Simulator is a powerful tool for testing and debugging the logical operation and internal timing of Altera megafunctions instantiated in your design Altera Corporation March 2007 Getting Started SignalTap Il Embedded Logic Analyzer Altera Corporation March 2007 With the Quartus II Simulator you can pe
15. ce families The default value is to use dedicated circuitry where reasonable For example unless otherwise specified if the input bit width is less than five bits the Quartus II software defaults to using logic resources On Page 5 of the lpm_mult MegaWizard Plug In Manager choose options and settings to control the output latency for pipelining enabling active high asynchronous clear and clock enable inputs and selecting the optimization technique for the multiplier function see Figure 2 6 2 6 Ipm_mult Megafunction User Guide Altera Corporation March 2007 Getting Started Figure 2 6 MegaWizard Plug In Manager Ipm_mult page 5 of 7 MegaWizard Plug In Manager LPM_MULT page 5 of 7 LPM_MULT Version 6 0 About Documentation IL Do you want to pipeline the function No Yes I want an output latency of clock cycles L Create an asynchronous Clear input L Create a Clock Enable input Which type of optimization do you want Default D Speed _ Area Cancel I lt Back Next gt Einish Table 2 3 shows the options available on the Page 5 of the Ipm_mult MegaWizard Plug In Manager Table 2 3 Ipm_mult MegaWizard Plug In Manager Page 5 Options Function Description Do you want to pipeline the function Creates a clock port to register and provides a pipelined operation for the Ipm_mult function Create an asynchronous Clear input Enables a
16. eater flexibility and complexity compared to the Ipm_mult megafunction Refer to the altmult_add Megafunction User Guide for more information I The altmemmult megafunction can be used to implement a multiplier using M4K or M512 memory blocks Refer to the altmemmult Megafunction User Guide for more information Gene ral The Ipm_mult megafunction is one of the arithmetic megafunctions Descri p ti on provided in the Quartus II software MegaWizard Plug In Manager The basic function of a multiplier is to multiply two input data values to produce a product as an output Figure 1 1 shows a basic multiplier Figure 1 1 Basic Multiplier dataal result datab Eu result dataa x datab The lIpm_mult megafunction is an operator that lets you multiply two sets of data Figure 1 2 shows the lpm_mult megafunction with input data width of nine bits and an unsigned number representation 1 2 Altera Corporation Ipm_mult Megafunction User Guide March 2007 About this Megafunction Figure 1 2 Ipm_mult Megafunction Symbol multiplication i Common Applications Multipliers are used in many common applications such as implementing Finite Impulse Response FIR filters Infinite Impulse Response IIR filters Fast Fourier Transforms FFTs digital mixers and any other designs that require multiplication of one or more sets of data 2 For details about implementing a multiplier and using the DSP blocks
17. h of the datab input Do you want a sum input bus Specify a sum input port and its data width How should the width of the result output be determined Specify the data width for the output This width can be automatically determined by the function based on the input bit widths or you can specify it Altera Corporation March 2007 2 3 Ipm_mult Megafunction User Guide Using the MegaWizard Plug In Manager Starting on Page 3 of the lpm_mult MegaWizard Plug In Manager you can generate a sample simulation waveform launch AN 306 Techniques for Implementing Multipliers in FPGA Devices and launch the Quartus II software help for the lpm_mult megafunction Select the options On the Web Quartus II Megafunction Reference or Generate Sample Waveforms from the Documentation button see Figure 2 3 Figure 2 3 Ipm_mult Megafunction Documentation Options MegaWizard Plug In Manager LPM_MULT page 3 of 7 LPM_MULT Version 6 0 On the Web Quartus II Megafunction Reference Generate Sample Waveforms Multiplier configuration Multiply dataa input by datab input resuff17 0 Multiply dataa input by itself squaring operation datab 8 0 x Unsigned N multiplication How wide should the dataa input bus be 3 E bits How wide should the datab input bus be 3 bits M Create a sum input bus with a width of 13 v bits How should the width of
18. here gt with the directory path of the appropriate library files For example C Modeltech ae altera verilog stratixii On the File menu select Save Start ModelSim Altera On the File menu select Change Directory Select the folder in which you unzipped the files Click OK On the Tools menu select Execute Macro Select the multiplier do file and click Open This is a script file for ModelSim that automates all the necessary settings for the simulation 17 Verify the results by looking at the Waveform Viewer window You may need to rearrange signals remove redundant signals and change the radix to suit the results in the Quartus II Simulator Figure 2 15 shows the expected simulation results in ModelSim Figure 2 15 ModelSim Simulation Results j wave default File Edit View Insert Format Tools Window roultiplier_vlq_vec_tst t__wire__aclr multiplier_vlg_vec_tst t__wire__clken roultiplier_vlg_vec_tst t__wire__clock multiplier vig vec tst t wire dataa roultiplier_vlg_vec_tst t__wire__datab Zmultiplier vig vec tst t wire result multiplier vig vec tst t wire sum ALERA szaalt A mida oP a yl A SMe e wal Q Qamx amp O ps to 21955 ps Now 1 us Delta 0 N Altera Corporation March 2007 2 19 Ipm_mult Megafunction User Guide Conclusion Conclusion The Quartus II software provides parameterizable megafunctions ra
19. ign In this example you perform the following tasks m Generate a 9 bit multiplier m Implement the multiplier in architecture by assigning the Stratix II EP2S15F484C3 device and compile the project m Simulate the customized multiplier Altera Corporation Ipm_mult Megafunction User Guide March 2007 Getting Started Altera Corporation March 2007 Figure 2 7 shows the lpm_mult megafunction design Figure 2 7 Ipm_mult Megafunction Design dataa 8 0 ARN RN RANN n sum 2 0 i ee er resukt 17 0 2 7 a g dab gt multiplication Generate a 9 Bit Multiplier 1 2 Open the project file multiplier qpf Open the top level file multiplier bdf This file is an incomplete file that you will complete in the course of this example Double click on a blank area in the block design bdf file and then click the MegaWizard Plug In Manager button from the Symbol window or on the Tools menu choose MegaWizard Plug In Manager On Page 1 of the MegaWizard Plug In Manager to answer the question What action do you want to perform click Create a new custom megafunction variation Figure 2 8 Figure 2 8 MegaWizard Plug In Manager Ipm_mult page 1 MegaWizard Plug In Manager page 1 The MegaWizard Plug In Manager helps you create or modify design files that contain custom variations of megafunctions Which action do you want to perform Create a new custom megafunction variation
20. ion option 18 Click Next Page 5 displays Figure 2 12 2 14 Ipm_mult Megafunction User Guide Altera Corporation March 2007 Getting Started Figure 2 12 MegaWizard Plug In Manager Ipm_mult page 5 of 7 MegaWizard Plug In Manager LPM_MULT page 5 of 7 LPM_MULT m Do you want to pipeline the function No Yes I want an output latency of 1 clock cycles M Create an asynchronous Clear input Which type of optimization do you want Default D Speed 2J Area 19 On Page 5 to answer the question Do you want to pipeline the function turn on Yes I want an output latency of and type 1 in the Clock cycles box 20 Turn on Create an Asynchronous Clear input and Create a Clock Enable input 21 To answer Which type of optimization do you want turn on Default 22 Click Finish Page 7 displays Figure 2 13 Altera Corporation 2 15 March 2007 Ipm_mult Megafunction User Guide Design Example 9 Bit Multiplier Figure 2 13 MegaWizard Plug In Manager Ipm_mult page 7 of 7 Summary MegaWizard Plug In Manager LPM_MULT page 7 of 7 Summary LPM_MULT When the Finish button is pressed the MegaWizard Plug In Manager will create the checked files in the following list You may choose to include or exclude a file by checking or unchecking its corresponding checkbox respectively The state of checkboxes will be remembered for the next MegaWizard Plug In Manager session
21. lation with other EDA simulators If you wish to use this parameter when you instantiate the function in a Block Design File bdf you must specify it by entering the parameter name and value manually with the Parameters tab Symbol Properties Command or the Parameters tab Block Properties Command You can also use this parameter name in a Text Design File tdf or a Verilog Design File v You must use the LPM HINT parameter to specify the USE_EAB parameter in VHDL Design Files LATENCY Integer Same as LPM_PIPELINE This parameter is provided only for backward compatibility For all new designs you must use the LPM PIPELINE parameter instead 3 4 Ipm_mult Megafunction User Guide Altera Corporation March 2007 Specifications Table 3 3 Parameterized Ipm_mult Megafunction Interface Part 4 of 5 Parameter MAXIMIZE SPEED DEDICATED MULTIPLIER CIRCUITRY Type Integer String Required No Description You can specify a value between 0 and 10 If used the Quartus II software attempts to optimize a specific instance of the Ipm_mult function for speed rather than area and overrides the setting of the Optimization Technique logic option If MAXIMIZE_SPEED is unused the value of the Optimization Technique option is used instead Fora SIGNED multiplier with no inputs being a constant if the setting for MAXIMIZE SPEED is 9 10 the compiler optimizes the Ipm_mult
22. lpm_mult Megafunction A DTE RYA o 101 Innovation Drive San Jose CA 95134 408 544 7000 www altera com User Guide Software Version Document Version Document Date 7 0 2 2 March 2007 Copyright 2006 Altera Corporation All rights reserved Altera The Programmable Solutions Company the stylized Altera logo specific device des ignations and all other words and logos that are identified as trademarks and or service marks are unless noted otherwise the trademarks and service marks of Altera Corporation in the U S and other countries All other product or service names are the property of their respective holders Al tera products are protected under numerous U S and foreign patents and pending applications maskwork rights and copyrights Altera warrants performance of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any products and services at any time without notice Altera assumes no responsibility or liability arising out of the ap plication or use of any information product or service described herein except as expressly agreed to in writing by Altera NSAI Corporation Altera customers are advised to obtain the latest version of device specifications before relying on any published in formation and before placing orders for products or services I S EN ISO 9001 UG MF91104 2 2 ii Altera Corporation Ipm_mult Megafunc
23. mulation results These output waveforms show the behavior of lpm_mult megafunction for the chosen set of parameters The design is a9 x 9 signed multiplier that produces an 18 bit output The design has a 3 bit sum input The output of the multiplier has a latency of 1 Figure 2 14 Multiplier Simulation Results Simulation Waveforms Simulation mode Functional Interval 15 0 ns 17 5 ns 16 024 ns a H dataa datab 2 E result so E sum 3 Functional Results Simulate the 9 Bit Multiplier Design in ModelSim Altera Simulate the design in ModelSim to compare the results of both simulators This User Guide assumes that you are familiar with using ModelSim Altera before trying out the design example If you are unfamiliar with ModelSim Altera refer to the support page for ModelSim Altera on the Altera website www altera com There are various links to topics such as installation usage and troubleshooting Set up the ModelSim Altera simulator by performing the following steps a Unzip the lpm_mult_msim zip file to any working directory on your PC 2 18 Altera Corporation Ipm_mult Megafunction User Guide March 2007 Getting Started 10 11 12 13 14 15 16 Browse to the folder in which you unzipped the files and open the multiplier do file in a text editor In line 1 of the muliplier do file replace lt insert_directory_path_
24. n active high asynchronous clear signal for registered usage Create a Clock Enable input Enables an active high clock enable signal for registered usage Which type of optimization do you want Allows selection of the optimization technique for the multiplier function The default optimization is for area Altera Corporation 2 7 March 2007 Ipm_mult Megafunction User Guide Inferring Megafunctions from HDL Code Inferring Megafunctions from HDL Code Instantiating Megafunctions in HDL Code Identifying a Megafunction after Compilation Simulation 2 8 Ipm_mult Megafunction User Guide Synthesis tools including Quartus II integrated synthesis recognize certain types of HDL code and automatically infer the appropriate megafunction when a megafunction will provide optimal results The Quartus II software uses the Altera megafunction code when compiling your design even if you did not specifically instantiate the megafunction The Quartus II software infers megafunctions because they are optimized for Altera devices so the area and performance may be better than generic HDL code Additionally you must use megafunctions to access certain Altera architecture specific features such as memory DSP blocks and shift registers that generally provide improved performance compared with basic logic elements Refer to volume 1 of the Quartus II Handbook for specific information about your particul
25. nager LPM_MULT page 4 of 7 LPM_MULT Version 6 0 Pipelining Does the datab input bus have a constant value No Yes the value is multiplication Which type of multiplication do you want igned which multiplier implementation should be used Use the default implementation Use dedicated multiplier circuitry Not available For all families Use logic elements Resource Usage Altera Corporation 2 5 March 2007 Ipm_mult Megafunction User Guide Using the MegaWizard Plug In Manager Table 2 2 shows the options available on Page 4 of the lpm_mult MegaWizard Plug In Manager Table 2 2 Ipm_mult MegaWizard Plug In Manager Page 4 Options Function Does the datab input bus have a constant value Description Select Yes to set the width of datab port to a constant value Which type of multiplication do you want Select the sign representation of the inputs Unsigned or Signed The default is Unsigned The signed representation for all library of parameterized modules LPM megafunctions is two s complement Which multiplier implementation should be used Select the hardware implementation type dedicated circuitry or logic elements The dedicated circuitry option implements the multiplier in DSP blocks or embedded multipliers and is only available in the Stratix Stratix II Stratix GX Cyclone II HardCopy Stratix and Mercury devi
26. ng either Windows NT 2000 XP Red Hat Linux 7 3 or 8 0 Red Hat Linux Enterprise 3 or an HP workstation running the HP UX 11 0 operating system or a Sun workstation running the Solaris 8 or 9 operating system E Quartus II software version 4 1 or later You can use the MegaWizard Plug In Manager to set the lpm_mult megafunction features for each multiplier in the design Search for Ipm mult in the Quartus II Help for a listing of the parameters to use when instantiating the megafunction without using the MegaWizard Plug In Manager You can start the MegaWizard Plug In Manager in one of the following ways On the Tools menu choose MegaWizard Plug In Manager When working in the Block Editor click MegaWizard Plug In Manager in the Symbol window Start the stand alone version of the MegaWizard Plug In Manager by typing the following command on a command prompt qmegawizt This section provides an in depth description of each page in the Ipm_mult megafunction Tables 2 1 2 2 and 2 3 show the features or settings for the lpm_mult megafunction Use these tables to determine appropriate settings for your multiplier designs 2 1 Ipm_mult Megafunction User Guide Using the MegaWizard Plug In Manager On Page 2a select the lpm_mult megafunction from the Arithmetic category select the device you intend to use the type of output file you want to create Verilog VHDI or AHDL and what you want to name the output file You
27. nging from simple arithmetic units such as adders and counters to advanced phase locked loop PLL blocks multipliers and memory structures These megafunctions are performance optimized for Altera devices and therefore provide more efficient logic synthesis and device implementation because they automate the coding process and save valuable design time You should use these functions during design implementation so you can consistently meet your design goals 2 20 Altera Corporation Ipm_mult Megafunction User Guide March 2007 Chapter 3 Specifications NOTERYA Ports amp Parameters Figure 3 1 shows the ports and parameters for an lpm_mult megafunction Table 3 1 shows the input ports Table 3 2 shows the output ports and Table 3 3 shows the parameterized megafunction interface The parameter details are only relevant for users who bypass the MegaWizard Plug In Manager interface and use the megafunction as a directly parameterized instantiation in their design The details of these parameters are hidden from MegaWizard Plug In Manager interface users Refer to the latest version of the Quartus II software help for the most current information on the ports and parameters for this megafunction Figure 3 1 Ipm_mult Port amp Parameter Description Symbol dataal result datab result dataa x datab Table 3 1 Ipm_mult Megafunction Input Ports Part 1 of 2 Port Name Req
28. nput by datab input Then to answer the questions How wide should the dataa input bus be and How wide should the dataa input bus be select 9 bits 12 Turn on Create a sum input bus with a width of and set the width value to 3 13 To answer the question How should the width of the result output be determined turn on Restrict the width to and set a width value of 18 14 Click Next Page 4 displays Figure 2 11 Altera Corporation 2 13 March 2007 Ipm_mult Megafunction User Guide Design Example 9 Bit Multiplier Figure 2 11 MegaWizard Plug In Manager Ipm_mult page 4 of 7 MegaWizard Plug In Manager LPM_MULT page 4 of 7 LPM_MULT Ve n 6 0 about Documentation r Does the datab input bus have a constant value No Yes the value is 1 m Which type of multiplication do you want D Unsigned Signed Which multiplier implementation should be used Use the default implementation D Use dedicated multiplier circuitry Not available For all Families Use logic elements Cancel lt Back Next gt Einish 15 On Page 4 to answer Does the datab input bus have a constant value question turn on Yes the value is and type 1 in the corresponding field 16 To answer the question Which type of multiplication do you want turn on the Signed option 17 To answer the question Which multiplier implementation should be used turn on the Use the default implementat
29. ormance of the design when the value of the LPM_PIPELINE parameter is three or less LPM HINT String Assigns Altera specific parameters in VHDL Design Files vhd The default is UNUSED LPM TYPE String Identifies the library of parameterized modules LPM entity name in VHDL Design Files INPUT A IS CONSTANT String Values are YES NO and UNUSED If dataal is connected to a constant value setting INPUT _A IS CONSTANT to YES optimizes the multiplier for resource usage and speed The default is NO INPUT B IS CONSTANT String Values are YES NO and UNUSED If datab is connected to a constant value setting INPUT B IS CONSTANT to YES optimizes the multiplier for resource usage and speed The default is NO Altera Corporation March 2007 3 3 Ipm_mult Megafunction User Guide Ports amp Parameters Table 3 3 Parameterized Ipm_mult Megafunction Interface Part 3 of 5 Parameter USE_EAB Type String Required No Description Values are ON OFF and UNUSED Setting the USE_EAB parameter to ON lets the Quartus Il software use ESBs to implement 4 x 4 or 8 x const value building blocks in APEX 20K APEX II Excalibur and Mercury devices or EABs in ACEX 1K and FLEX 10K devices Altera recommends that you set USE_EAB to ON only when LCELLS are in short supply This parameter is not available for simu
30. re information about these attributes is available in volume 1 of the Quartus IT Handbook EDA Simulation Depending on the simulation tool you are using refer to the corresponding chapter in volume 3 of the Quartus II Handbook The Quartus II Handbook chapters show you how to perform functional and gate level timing simulations that include the megafunctions with details on the files that are needed and the directories where those files are located The SignalTap II embedded logic analyzer provides you with a non intrusive method of debugging all of the Altera megafunctions within your design With the SignalTap II embedded logic analyzer you can capture and analyze data samples for the top level ports of the Altera megafunctions in your design while your system is running at full speed To monitor signals from your Altera megafunctions first configure the SignalTap II embedded logic analyzer in the Quartus II software and then include the analyzer as part of your Quartus II project The Quartus II software then embeds the analyzer along with your design in the selected device 2 9 Ipm_mult Megafunction User Guide Design Example 9 Bit Multiplier Design Example 9 Bit Multiplier 2 10 For more information about using the SignalTap II embedded logic analyzer refer to volume 3 in the Quartus II Handbook Multipliers are one of the basic building blocks that are commonly used in digital signal processing DSP application
31. rform two types of simulations functional and timing A functional simulation in the Quartus II program enables you to verify the logical operation of your design without taking into consideration the timing delay in the FPGA This simulation is performed using only RTL code When performing a functional simulation add only signals that exist before synthesis With the registers you can find pre synthesis design entry or pin filters in the Node Finder The top level ports of megafunctions are found using these three filters In contrast timing simulation in the Quartus II software verifies the operation of your design with annotated timing information This simulation is performed using the post place and route netlist When performing a timing simulation add only signals that exist after place and route These signals are found with the post compilation filter of the Node Finder During synthesis and place and route the names of RIL signals change Therefore it might be difficult to find signals from your megafunction instantiation in the post compilation filter To preserve the names of your signals during the synthesis and place and route stages use the synthesis attributes keep or preserve These are Verilog and VHDL synthesis attributes that direct Analysis amp Synthesis to keep a particular wire register or node intact Use these synthesis attributes to keep a combinational logic node so you can observe the node during simulation Mo
32. s For example multipliers are often used to implement Finite Impulse Response FIR filters Ls The altmult add megafunction can be used to implement a multiplier with greater flexibility and complexity compared than the lpm_mult megafunction Refer to the altmult_add Megafunction User Guide for more information on the altmult_add megafunction gt The altmemmult megafunction can be used to implement a multiplier using M4K or M512 memory blocks Refer to the altmemmult Megafunction User Guide for more information on the altmemmult megafunction This section presents a design example that uses the lpm_mult megafunction to generate a basic multiplier This example uses the MegaWizard Plug In Manager in the Quartus II software to customize this megafunction As you go through the wizard each page is described in detail When you are finished with this example you can incorporate it into an overall design Design Files The example design files are available in the Quartus II Projects section on the Design Examples page of the Altera web site www altera com Example This example shows how to instantiate an lpm_mult megafunction using the MegaWizard Plug In Manger In this case an Ipm_mult is instantiated with all the features enabled This example also shows simulation results that illustrate the behavior of the lpm_mult megafunction for the chosen set of parameters in the design You can change the parameters as needed for your des
33. t uses the typographic conventions shown below Visual Cue Bold Type with Initial Capital Letters Meaning Command names dialog box titles checkbox options and dialog box options are shown in bold initial capital letters Example Save As dialog box bold type Italic Type with Initial Capital Letters Italic type External timing parameters directory names project names disk drive names filenames filename extensions and software utility names are shown in bold type Examples fmax qdesigns directory d drive chiptrip gdf file Document titles are shown in italic type with initial capital letters Example AN 75 High Speed Board Design Internal timing parameters and variables are shown in italic type Examples tpa n 1 Variable names are enclosed in angle brackets lt gt and shown in italic type Example lt file name gt lt project name gt pof file Initial Capital Letters Keyboard keys and menu names are shown with initial capital letters Examples Delete key the Options menu Subheading Title References to sections within a document and titles of on line help topics are shown in quotation marks Example Typographic Conventions Courier type Signal and port names are shown in lowercase Courier type Examples datal tdi input Active low signals are denoted by suffix n e g resetn Anything that must be typed exactly as it appears is shown in Courier
34. the result output be determined Automatically calculate the width Restrict the widthto 18 bits Cancel lt Back Next gt Einish I These documentation options are only available in the P y Quartus II software version 4 1 and later The sample waveform illustrates the behavior of the lpm_mult megafunction for the chosen set of parameters in the lpm_mult design module Figure 2 4 This option generates a sample waveform in HTML format in the specified lpm_mult design directory The HTML file contains descriptions showing the multiplier operation 2 4 Altera Corporation Ipm_mult Megafunction User Guide March 2007 Getting Started Figure 2 4 Sample Waveforms for the Ipm mult Megafunction dataa datab zum ee en ieee sap pt shiek ee eigea i i clken a a acir H H H H i i H H H H i i result XXXEX X oo001 xX Doooo X 00005 X 00002 00004 These waveforms show the behavior of the Ipm_mult megafunction for the chosen set of parameters The design is an 8 x 8 unsigned multiplier that produces a 16 bit output The design has a sum input of width 1 On Page 4 of the lpm_mult MegaWizard Plug In Manager specify whether the datab input bus value is variable or constant set the sign representation of the inputs and set the hardware implementation Figure 2 5 Figure 2 5 MegaWizard Plug In Manager Ipm_mult page 4 of 7 MegaWizard Plug In Ma
35. tion User Guide N D TE RYN Contents About this User Guide Revision History How to Contact Altera Typographic Conventions Chapter 1 About this Megafunction Device Family Support Introduction Features c General Description siisii iii Common Applications Resource Utilization and Performance Chapter 2 Getting Started System amp Software Requirements mmm MegaWizard Plug In Manager Customization Using the MegaWizard Plug In Manager uneessesesenesenensnennenenenennenenesnnenenenennnnenennnsenensnnnsenennnn Inferring Megafunctions from HDL Code Instantiating Megafunctions in HDL Code Identifying a Megafunction after Compilation SHILA LION sron al luln RR EOT Quartus I Simulation EDA SmM l tion u eietnrssdsermerarrerinelenn ceaees Poeeasbavdbcassaua sostevees Innere sacle SignalTap II Embedded Logic Analyzer u u suu sunnenien anna Design Example 9 Bit Multiplier Design Files cos FFs sce sctesaratves atest sale Orka b rs ars ds bre sp eb da gasen bt E E E Example eieiei A E AR E EE Generate a 9 Bit Multiplier Implement the 9 Bit Multiplier Functional Results Simulate the 9 Bit Multiplier Design in Quartus s eeemmmmssessm 2 17 Functional Results Simulate the 9 Bit Multiplier Design in ModelSim Altera 2 18 CONCIUSION una denn EE 2 20 Chapter 3 Specifications Ports Gc Parameters a unse kan med
36. type For example c qdesigns tutorial chiptrip gdf Also sections of an actual file such as a Report File references to parts of files e g the AHDL keyword SUBDESIGN as well as logic function names e g TRI are shown in Courier 1 2 3 and Numbered steps are used in a list of items when the sequence of the items is a b c etc important such as the steps listed in a procedure E o gt Bullets are used in a list of items when the sequence of the items is not important v The checkmark indicates a procedure that consists of one step only Ls The hand points to information that requires special attention The caution indicates required information that needs special consideration and A understanding and should be read prior to starting or continuing with the procedure or process The warning indicates information that should be read prior to starting or continuing the procedure or processes The angled arrow indicates you should press the Enter key Toe The feet direct you to more information about a particular topic vi Altera Corporation Ipm_mult Megafunction User Guide March 2007 Chapter 1 About this A DTE RA e Megafunction Device Family Support Introduction Features Altera Corporation March 2007 The lpm_mult megafunction supports the following target Altera device families Stratix II Stratix II GX Stratix II Stratix Stratix GX Cyclone III
37. uired Description Comments dataal Yes Value to be multiplied to datab 1 Input port LPM_WIDTHA wide Multiplicand datab Yes Value to be multiplied to dataal Input port LPM_WIDTHB wide Multiplier sum No Partial sum The sum input is added Input port LPM_WIDTHS wide to the multiplier output outside of the DSP block clock No A clock port to register and provide The clock port provides pipelined pipelined usage operation for the Ipm_mult function For LPM_PIPELINE values other than 0 default value the clock port must be connected Altera Corporation March 2007 3 1 Ipm_mult Megafunction User Guide Ports amp Parameters Table 3 1 Ipm_mult Megafunction Input Ports Part 2 of 2 Port Name Required Description Comments aclr No An active high asynchronous clear port The pipeline initializes to an undefined for registered usage X logic level The aclr port can be used at any time to reset the pipeline to all Os asynchronously to the clock signal clken No An active high clock enable port for If not used the default is 1 registered usage Table 3 2 Ipm_mult Megafunction Output Ports Port Name Required result Yes Description Output port result dataal x datab sum The product LSB is aligned with the sum LSB Comments Output port LPM WIDTHP wide If LPM WIDTHP lt max LPM_WIDTHA LPM_WIDTHB LPM WIDTHS or LPM_WIDTHA

Download Pdf Manuals

image

Related Search

Related Contents

Silastic S2  Lien vers PDF  DS6300 - Kirby Risk Electrical Supply  Composition Excipients Indications Mode d`emploi Forme  ARIBニュース864号  Fellowes 79Ci Manual  HP Single-ended SCSI-2/Centronics host adapter board  Sensores de velocidad MD-36  Herunterladen - Konica Minolta  Manual de instalação da Central CP-2010 RET  

Copyright © All rights reserved.
Failed to retrieve file