ug_intro_to_megafunctions
更新时间:2023-05-12 07:58:01 阅读量: 实用文档 文档下载
May2013
IntroductiontoMegafunctionIPCores
UG-01056-3.0
Alteraprovidesafreelibraryofparameterizableintellectualproperty(IP)blocks,calledmegafunctions,that
emegafunctionstoaccessarchitecture-specificfeatureswithinmemory,DSPblocks,shiftregisters,andothersimpleandcomplexfunctions.
YoucanquicklydefineamegafunctionvariationintheMegaWizardPlug-InManagerGUI.Alternatively,youcandefineandinstantiatemegafunctionsdirectlyinHDLfiles.TheQuartusIIsoftwareautomaticallyinfersmegafunctioncodewheneverHDLcodecanbeoptimizedbymegafunctionsubstitution.
AlteraProvidedMegafunctions
TheQuartusIIsoftwareimplementsyourspecifiedsystemorIPcoreparametersandgeneratesfilesforsynthesisandsimulationintheQuartusIIsoftwareandotherEDAtools.TheQuartusIIsoftwareincludesthefollowingmegafunctionsforusewithoutadditionallicense.
ArithmeticMegafunctions
TheQuartusIIsoftwareincludesthesearithmeticmegafunctions.
MegafunctionName
Function
LPM_ABSLPM_ADD_SUBLPM_COMPARELPM_COUNTERLPM_DIVIDELPM_MULTALTACCUMULATEALTECCALTMEMMULTALTMULT_ACCUMALTMULT_ADD
AbsolutevalueAdder/SubtractorComparatorCounterDividerMultiplierAccumulatorECCEncoder/Decoder
MemoryConstantCoefficientMultiplierMultiply-AccumulatorMultiply-Adder
©
2013AlteraCorporation.Allrightsreserved.ALTERA,ARRIA,CYCLONE,HARDCOPY,MAX,MEGACORE,NIOS,/common/legal.html.AlterawarrantsperformanceofitssemiconductorproductstocurrentspecificationsinaccordancewithAltera'sstandardwarranty,butreservestherighttomakechangestoanyproductsandservicesatanytimewithoutnotice.Alteraassumesnoresponsibilityorliabilityarisingoutoftheapplicationoruseofanyinformation,product,orservicedescribedhereinexceptasexpresslyagreedtoinwritingbyAltera.Alteracustomersareadvisedtoobtainthelatestversionofdevicespecificationsbeforerelyingonanypublishedinformationandbeforeplacingordersforproductsorservices.
ISO9001:2008Registered
UG-01056-3.0
May2013
2Floating-PointMegafunctions
MegafunctionNameFunction
ALTMULT_COMPLEXALTSQRTPARALLEL_ADD
ComplexMultiplierIntegerSquare-RootParallelAdder
Floating-PointMegafunctions
TheQuartusIIsoftwareincludesthesefloating-pointmegafunctions.
MegafunctionName
Function
ALTFP_ADD_SUBALTFP_DIVALTFP_MULTALTFP_EXPALTFP_INVALTFP_INV_SQRTALTFP_LOGALTFP_ATANALTFP_SINCOSALTFP_ABSALTFP_COMPARE
Adder/SubtractorDividerMultiplierExponentialInverse
InverseSquareRootNaturalLogarithmArctangent
TrigonometricSine/CosineAbsolutevalueComparator
GateMegafunctions
TheQuartusIIsoftwareincludesthesegate
megafunctions.
MegafunctionName
Function
LPM_CLSHIFTLPM_CONSTANTLPM_DECODELPM_MUX
CombinatoriallogicshifterConstantgeneratorDecoderMultiplexer
I/OMegafunctions
TheQuartusIIsoftwareincludestheseI/Omegafunctions.
AlteraCorporationIntroductiontoMegafunctionIPCores
UG-01056-3.0May2013
MemoryMegafunctions3
MegafunctionNameFunction
ALTLVDSALTPLL
ALTPLL_RECONFIGALTERA_PLL
ALTREMOTE_UPDATEALTGXBAL2TGXBALTOCTALTCLKCTRLALTDDIOALTIOBUFALTTEMP_SENSEALTDLL
ALTDQandALTDQSALTDQ_DQS2ALTASMI_PARALLEL
LVDStransmitterandreceiverPhase-LockedLoop(PLL)PLLreconfiguration
Phase-LockedLoopforStratix®VdevicesonlyRemoteUpdate
Gigabittransceiverblock(GXB)GigabittransceiverblockII(GXB)On-ChipTerminationClockControlDoubleDataRateI/OI/OBuffer
TemperatureSensorDelayLockedLoop(DLL)DQandDQS
DQandDQSforStratixVActiveSerialMemoryInterface
MemoryMegafunctions
TheQuartusIIsoftwareincludesthesememorymegafunctions.
MegafunctionName
Function
RAMandROMSCFIFOandDCFIFOFIFOPartitionerLPM_SHIFTREGALTSHIFT_TAPSALT_UFMALTOTP
Internalmemories
SingleclockFIFOandDual
ClockFIFOFirst-InFirst-OutPartitionerShift-registerRAMShiftRegisterUserFlashMemory
One-TimeProgrammablefunction
IntroductiontoMegafunctionIPCoresAlteraCorporation
UG-01056-3.0
May2013
4JTAGMegafunctions
JTAGMegafunctions
TheQuartusIIsoftwareincludestheseJTAGextensiblemegafunctions.
MegafunctionName
Function
PFL
SLD_VIRTUAL_JTAG
RelatedInformation
ParallelFlashLoaderVirtualJTAG
MegafunctionsandIPDocumentationWebPage
CustomizingMegafunctions
ingmegafunctionsinyourdesigninvolvesthefollowingsteps:
1.Identifythemegafunctionthatbestmeetsyourdesignandtargetdevicerequirements.
2.TodefineandinstantiateamegafunctionusingtheGUI,clickTools>MegaWizardPlug-InManagerandfollowthewizardtodefineyourmegafunction.TheQuartusIIsoftwareautomaticallygeneratessynthesisandoptionalsimulationoutputfiles.
etheBlockEditororQsystoconnectthemegafunctiontootherelementsinthedesign.
pileyourdesignintheQuartusIIsoftware.OptionallygenerateanetlistforotherEDAtools.5.SimulateyourdesigninyourpreferredEDAsimulator.
RelatedInformation
ConnectingMegafunctionsonpage5UsingHDLCodeTemplatesonpage7
SynthesizingMegafunctionsinotherEDAToolsonpage11
CustomizingMegafunctionsintheGUI
TheMegaWizardPlug-InManagerGUIallowsyoutodefineandinstantiateacustomvariationofanAlteramegafunction.Youcaneditmegafunctionsatanytime.MegafunctionsdefinedinyourprojectappearintheProjectNavigator.Toeditamegafunction,double-clickthemegafunctionfileintheProjectNavigatororBlockEditortodisplaytheMegaWizardGUI.TocustomizeamegafunctionusingtheMegaWizardPlug-InManagerGUI,followthesesteps:
unchtheMegaWizardPlug-InManagerusinganyofthefollowingmethods:
IntheQuartusIIsoftware,clickTools>MegaWizardPlug-InManager.
IntheProjectNavigator,right-clickamegafunctionfileandclickMegaWizardPlug-InManager. IntheBlockEditor,clickEdit>InsertSymbolasBlock.IntheSymboleditor,clickMegaWizardPlug-InManager.
Startthestand-aloneversionoftheMegaWizardPlug-InManagerGUIbytypingthefollowingcommandat
thecommandprompt:qmegawiz(forGUIorcommand-linemode)or
AlteraCorporation
IntroductiontoMegafunctionIPCores
UG-01056-3.0May2013
ConnectingMegafunctions5
qmegawizq(forGUIonly)
2.SpecifyCreate,Edit,orCopyamegafunction.
3.InWhichdevicefamilywillyoubeusing?selectyourtargetdevicefamily.
OnlymegafunctionsavailableforthetargetdeviceareavailableinWhichmegafunctionwouldyouliketocustomize?Unsupportedmegafunctionsaregrayedout.
4.Specifythenameandfileformatoftheoutputfile.ClickNext
5.Parameterizethemegafunctionbyspecifyingoptionsinthewizard.ClickNext.6.IfthewizardincludesEDAandSummarytabs,followthesesteps:
Somethird-partysynthesistoolscanuseagreyboxnetlistthatcontainsthestructureofanIPcorewithoutdetailedlogictooptimizetimingandperformanceofthedesigncontainingit.Tousethisfeature,turnonGenerateNetlisttogenerateanetlistfileforareaandtimingestimationinsteadofawrapperfile.
OntheSummarytab,selectthefilesyouwanttogenerate.Agraycheckmarkindicatesafilethatisautomaticallygenerated.Allotherfilesareoptional.ThisstepinstantiatesthemegafunctionintoyourHDLcodeandcreatesawrapperfile.7.ClickFinish.Themegafunctionvariationisgeneratedalongwiththefilesyouspecify.
8.Toviewthemegafunctionschematic,openthegeneratedblocksymbolfile(.bsf)locatedinyourprojectdirectory.ThemegafunctionblocksymbolappearsintheSymbolwindow.
Youcaneditmegafunctionsatanytime.MegafunctionsdefinedinyourprojectappearintheProjectNavigator.Toeditamegafunction,double-clickthemegafunctionfileintheProjectNavigatororBlockEditortodisplaytheMegaWizardGUI.Figure1:ExampleParameterizedGlobalClockControl
Module
RelatedInformation
CreatingaSystemwithQsys
ConnectingMegafunctions
YoucaneasilyvisualizeandconnectmegafunctionstootherelementsofyourdesignwiththeQuartusIIBlockEditor.Youcanmakeconnectionsbydrawingnode(wire),bus,andconduitconnectionsbetweenblocksrepresentingmegafunctionsandprimitivesintheschematic.IftheI/Osignalnamesinoneblockmatchthoseinanotherconnectedblock,theQuartusIIsoftwareautomaticallyconnectscommonI/O's
IntroductiontoMegafunctionIPCores
AlteraCorporation
UG-01056-3.0
May2013
6GeneratedMegafunctionFiles
betweentheblocks.IftheI/Osintwoconnectedblocksaredifferentlynamed,youcanassignanamethatmatchesablockI/Oporttoconnecttheporttothebusorconduit,oryoucanmapthesignalconnectionbynameexplicitly.YoucanalsoconnectmegafunctionsincludedinaQsyssystemintheQsysGUI.Toconnectamegafunctionusingtheblockeditor,followthesesteps:
1.Todrawawire,busorconduitlineconnectingoneormoreblock,performanyofthefollowing: Todrawaconduit,clicktheSelectionandSmartDrawingToolortheOrthogonalConduitToolbuttononthetoolbar.Thesmartselectionanddrawingtoolautomaticallychangestothecorrectnode,bus,orconduittoolwhenyoudragitfromablockorsymbolborder. Todrawabus,clicktheOrthogonalBusToolbuttononthetoolbar. Todrawawire,clicktheOrthogonalNodeToolbuttononthetoolbar.
TheQuartusIIsoftwareautomaticallyconnectscommonI/O'sbetweentheblocks2.TomapdifferentlynamedI/Obetweentwomegafunctions,followthesesteps:
a.Ataconduitconnection,doubleclickthemappersymbol.TheMapperPropertiesdialogboxappears.b.OntheGeneraltab,specifytheI/OType.c.ClicktheMappingstab.
d.UnderConduitMappings,selectthenameofyourI/OonblockandthecorrespondingSignalsinconduit.
e.ClickAdd.Alogicalconnectioniscreatedbetweenthesignals.3.IntheFilemenu,clickSave.
Figure2:ExampleGlobalClockControl
Connections
GeneratedMegafunctionFiles
TheMegaWizardPlug-InManagergeneratesoneormoreofthefollowingfilesforsynthesisandsimulationofthemegafunctionIPcoreintheQuartusIIsoftwareandotherEDAtools.
AlteraCorporation
IntroductiontoMegafunctionIPCores
UG-01056-3.0May2013
InstantiatingMegafunctionsinHDL7
Figure3:IPFilesGeneratedbyMegaWizardPlug-In
Manager
RelatedInformation
SynopsysSimplifySupport
InstantiatingMegafunctionsinHDL
YoucaninstantiateamegafunctiondirectlyinyourHDLcodebycallingthemegafunctionandsettingitsparametersasyouwouldinanyothermodule,component,orsubdesign.WheninstantiatingamegafunctioninVHDL,besuretoincludethecorrectlibraries.
UsingHDLCodeTemplates
TheQuartusIIsoftwareincludescodeexamplesortemplatesforinferredRAMs,ROMs,shiftregisters,arithmeticfunctions,andDSPfunctionsoptimizedforAlteradevices.ToaccessHDLcodetemplatestodefinemegafunctions,followthesesteps:
1.Openafileinthetexteditor.2.OntheEdit>Inserttemplate.
3.IntheInsertTemplatedialogbox,clickthe+icontoexpandeithertheVerilogHDLcategoryortheVHDLcategory,dependingontheHDLyouprefer.
4.UnderFullDesigns,expandthenavigationtreetodisplaythetypeoffunctionsyouwanttoinfer.5.SelectthefunctiontodisplaythecodefortheselectedtemplateinthePreviewpane,andclickInsert.Note:FornewDSPfeaturesoptimizedforArriaV,CycloneV,andStratixV,expandtheArithmetic
category,andthenexpandtheDSPfeatures(Stratix-V,Arria-VandCyclone-V)category.
IntroductiontoMegafunctionIPCores
AlteraCorporation
UG-01056-3.0
May2013
8ExampleTop-LevelVerilogModule
ExampleTop-LevelVerilogModule
VerilogHDLALTFP_MULTinTop-LevelModulewithOneInputConnectedtoMultiplexer.moduleMF_top(a,b,sel,datab,clock,result);
input[31:0]a,b,datab;inputclock,sel;
output[31:0]result;wire[31:0]wire_dataa;
assignwire_dataa=(sel)?a:b;
altfp_multinst1(.dataa(wire_dataa),.datab(datab),.clock(clock),.result(result));
defparam
inst1.pipeline=11,inst1.width_exp=8,inst1.width_man=23,
inst1.exception_handling="no";
endmodule
ExampleTop-LevelVHDLModule
VHDLALTFP_MULTinTop-LevelModulewithOneInputConnectedtoMultiplexer.libraryieee;
useieee.std_logic_1164.all;libraryaltera_mf;
usealtera_mf.altera_mf_components.all;
entityMF_topis
port(clock,sel:instd_logic;
a,b,datab:instd_logic_vector(31downto0);result:outstd_logic_vector(31downto0));
endentity;
architecturearch_MF_topofMF_topis
signalwire_dataa:std_logic_vector(31downto0);begin
wire_dataa<=awhen(sel='1')elseb;inst1:altfp_mult
genericmap(
pipeline=>11,width_exp=>8,width_man=>23,
exception_handling=>"no")
portmap(
dataa=>wire_dataa,datab=>datab,clock=>clock,result=>result);
endarch_MF_top;
AlteraCorporation
IntroductiontoMegafunctionIPCores
UG-01056-3.0May2013
ExampleMegafunctionInference9
ExampleMegafunctionInference
TheQuartusIIsoftwareinfersfollowingthefollowingVerilogHDLcodeastheLPM_MULTor
ALTMULT_ADDmegafunctionsforanunsignedandasignedmultiplier.EachexamplefitsintooneDSPblock9-bitelement.Inaddition,whenregisterpackingoccurs,noextralogiccellsforregistersarerequired.moduleunsigned_mult(out,a,b);
output[15:0]out;input[7:0]a;input[7:0]b;
assignout=a*b;endmodule
modulesigned_mult(out,clk,a,b);
output[15:0]out;inputclk;
inputsigned[7:0]a;inputsigned[7:0]b;regsigned[7:0]a_reg;regsigned[7:0]b_reg;regsigned[15:0]out;
wiresigned[15:0]mult_out;
assignmult_out=a_reg*b_reg;always@(posedgeclk)begin
a_reg<=a;b_reg<=b;
out<=mult_out;endendmodule
RelatedInformation
RecommendedHDLCodingStylesQuartusIIIntegratedSynthesis
UsingqmegawizCommand-LineExecutable
Youcanuseqmegawizcommand-lineversionoftheMegaWizardPlug-InManagerthatallowsyoutomodify,update,orcreatevariationfileswithoutusingaGUI.ThefollowingtablelistscommonqmegawizsyntaxoptionsandargumentsTouseqmegawiz,usethefollowingsyntax:
qmegawiz[options][module=<modulename>]|wizard=<wizardname>][<param>=<value>...<port>=<used>|<unused>...]<variationfilename>
Options/Arguments
Description
-silent
-f:<parameterfile>
RunstheMegaWizardPlug-InManagerin
command-linemode,withoutdisplayingtheGUI.Specifiesa.txtnamethatcontainsalltheparameterandportvalues.
AlteraCorporation
IntroductiontoMegafunctionIPCores
UG-01056-3.0
May2013
10UsingIP-generateCommand-LineExecutable
Options/ArgumentsDescription
-p:<workingdirectory>module=<modulename>wizard=<wizardname>
Specifiesthedefaultworkingdirectorythatqmegawizuseswhenitgeneratesfiles.
Specifiesthemoduleorwizardname.Whentherearemultiplewizardnamesthatcorrespondtoonemodulename,usethewizardoptiontospecifyonewizard.Whentherearemultiplemodulenamesthatcorrespondtoonewizardname,usethemoduleoptiontospecifyonemodule.
Specifiestheparametervalues.Specifieswhethertheportsareused.
Specifiesavariationfilename.Validextensionsare.v,.vhd,or.tdf.
<param>=<value><port>=<used>|<unused><variationfilename>
Forexample,
qmegawiz-silentmodule=altlvds_rxwizard=altlvds
common_rx_tx_pll=ONtx_coreclock=usedlvds_sample.v
RelatedInformation
Command-LineScripting
UsingIP-generateCommand-LineExecutable
Youcanuseip-generatetocreateormodifycustommegafunctionvariations.Toruntheip-generatecommand,followthesesteps:
1.Typethefollowingcommandatthecommandpromptofyouroperatingsystem:<ACDSinstallationdirectory>\quartus\sopc_builder\bin\2.Toruntheexecutabletypeip-generate.
3.Toinstantiatethemegafunctionusingtheexecutablefile,typethefollowingsyntax:ip-generate--component-name=altdq_dqs2
-–component-system-param=DEVICE_FAMILY=”StratixV”
-–file-set=QUARTUS_SYNTH--output-name[=<file_name>]–-component-param[=<parameter_name>][=<parameter_value>]
RelatedInformation
Command-LineScripting
IP-GenerateArguments
IP-generateacceptsthesecommonarguments.
AlteraCorporation
IntroductiontoMegafunctionIPCores
UG-01056-3.0May2013
SynthesizingMegafunctionsinotherEDATools11
Options/ArgumentsDescription
--component-name=<variantname>-–file-set=QUARTUS_SYNTH--output-name[=<file_name>]
-–component-system-param=DEVICE_FAMILY=”<devicefamilyname>”–-component-param[=<parameter_name>][=<parameter_value>]
Specifiesthemegafunctionvariantname.
Aparameterthatisusedbytheip-generatortospecifyanoutputfile.Validextensionsare.v,.sv,.vhd,or.tdf.Specifiesthetargetdevicefamily.
Specifiesthetargetdevicefamily.
SynthesizingMegafunctionsinotherEDATools
YoucanusesupportedEDAtoolstosynthesizeadesignthatincludesmegafunctions.Whenyougeneratemegafunctionsynthesisfilesforusewiththird-partyEDAsynthesistools,youcanoptionallycreateanareaandtimingestimationnetlist.
areaandtimingestimationnetlistdescribethemegafunctionconnectivityandarchitecture,butnotdetailsabouttruefunctionality(greybox).Thisinformationenablescertainthird-partysynthesistoolstobetterreportareaandtimingestimates.Inaddition,synthesistoolscanusethetiminginformationtoachievetiming-drivenoptimizationsandimprovethequalityofresults.
Thenetlistfileiscalled<variantname>_syn.vfile.TheQuartus
IIsoftwaregeneratesthisfileinVerilogHDLformatregardlessoftheoutputfileformatyouspecify.Ifyouusethisnetlistforsynthesis,youmustincludethemegafunctionwrapperfile<variantname>.vor<variantname>.vhdinyourQuartusIIprojectforplacementandrouting.
IntroductiontoMegafunctionIPCoresAlteraCorporation
UG-01056-3.0
May2013
12SimulatingMegafunctions
Figure4:QuartusIIGeneratedFilesforOtherEDA
Tools
RelatedInformation
QuartusIIIntegratedSynthesis
SimulatingMegafunctions
Simulationverifiesdesignbehaviorbeforedeviceprogramming.TheQuartusIIsoftwaresupportsRTLandgateleveldesignsimulationofmegafunctionIPcoresinotherEDAsimulators.Simulationinvolvessettingupyoursimulatorworkingenvironment,compilingsimulationmodellibraries,andrunningyoursimulation.Alteraprovidesvarioustoolstohelpyouquicklysetupandrunsimulation.YoucanusetheQuartusIINativeLinkfeaturetoautomaticallygeneratesimulationfilesandscripts.NativeLinklaunchesyourpreferredsimulatorafromwithintheQuartusIIsoftware.
Useacustomflowformorecontroloverallaspectsofsimulationfilegeneration.Alternatively,theSimulationLibraryCompilerautomaticallycompilesandstoresthecorrectsimulationmodellibrariesforfunctionalandgate-leveltimingsimulationofyourdesign.
RelatedInformation
SimulatingAlteraDesigns
AlteraCorporation
IntroductiontoMegafunctionIPCores
正在阅读:
ug_intro_to_megafunctions05-12
mpu6050和6000中文 - 图文11-08
中国石油焦产业投资潜力分析及发展趋势预测报告2016-2021年09-06
同济大学中德学院教学大楼防火隐患调查研究 - 图文03-18
三年级教案认识计算机03-10
宋代妇女衣装研究06-07
规章制度之招投标制度实施细则12-18
纸锅煮蛋作文500字06-16
《绿化树》赏析04-22
综合基础知识第五篇09-21
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- megafunctions
- intro
- ug
- 新会计准则科目表
- 中级财务管理公式大全
- 实验三 定时器、计数器应用实验一
- 佳木镇汉校 班主任素质提升活动方案
- 活动三气门传动组的构造与检修
- 十八大知识竞赛题库
- XXXX年建筑机电安装工程施工工作总结
- 水质工程学课程设计指导书
- 如何看待留守群体(老人、儿童和妇女)问题
- 最新西师版四年级下册数学复习资料
- 生命在于运动 主题班会
- 2014年中考物理压轴题热点 故障电路
- 吉林省第七次社会科学优秀成果奖及省社科联第二次优秀成果奖评奖工作实施细则
- 山西面食传奇人物——岳师傅面来香董事长岳更生
- 地区电网变压器经济运行研究
- 山东省17市2011年中考数学试题分类解析汇编 专题10 四边形
- 新华百货半年报摘要
- 七年级生物植物细胞的结构与功能2
- 宁夏回族自治区护理资格试题辅导每日一练(2016.5.13)
- 电力工程人工挖孔桩施工方案(掏挖基础施工方案)