lab01.docx
- 文档编号:6163158
- 上传时间:2023-01-04
- 格式:DOCX
- 页数:31
- 大小:393.86KB
lab01.docx
《lab01.docx》由会员分享,可在线阅读,更多相关《lab01.docx(31页珍藏版)》请在冰豆网上搜索。
lab01
Lab1:
Creatinga12x8MACUsingtheSystemGeneratorforDSP
TargetingtheSpartan-3EStarterKit
Creatinga12x8MACUsingthe
XilinxSystemGenerator
Introduction
Inthislab,youwillcreatea12-bitx8-bitMAC(MultiplierAccumulator)withamultiplierandanaccumulatorusingSystemGeneratorforDsP,andestimatetheresourceutilizationusingtheResourceEstimatorblockoftheSystemGenerator.TheSystemGeneratorallowsyoutouseblocksthatrepresentXilinxLogiCOREs.AfterdesignandverificationinthesoftwareenvironmentofSystemGenerator,youwillgenerateVHDLcodeandcoresfromthisdesign,andimplementtheMACintheXilinxISE8.2(ProjectNavigator)softwareenvironment
Note:
Thereisacompletedexampleinc:
\xup\dsp_flow\labsolutions\lab1.
Objectives
Aftercompletingthislab,youwillbeableto:
∙HandlethebasicsofSimulink
∙UnderstandthebasicsofbuildingadesigninSystemGenerator
∙SimulateadesigninSystemGenerator
∙RuntheSystemGeneratortokentogenerateVHDLcode
∙RundesignsthroughtheSystemGeneratordesignflow
∙EstimatetheresourcesusingResourceEstimator
∙ImplementthedesigninXilinxISE8softwareenvironmentandgenerateabitstreamfile
DesignDescription
UseSystemGeneratorunderSimulinkenvironmentrunningunderMATLABtocreatea12x8MAC:
∙Multiplierinputdatawidthsof12bitsand8bitsofsigneddata
∙Multiplieroutputwidthof20bits
∙Accumulatoroutputwidthof27-bits
Procedure
Thislabcomprisesnineprimarysteps:
thefirstfourstepsintroduceyoutoSystemGeneratorandthenextfivestepsguideyouthroughhowtocreateadesignstartingfromSystemGenerator,andfinally,implementthedesignusingtheXilinxISE8softwareenvironment.YouwillbeintroducedtoSimulinkinstep1,andtheXilinxblocksetinstep2.Instep3,youwillevaluatetheprecision,and,instep4,youwillanalyzetheeffectofthesampleperiodupontheoutput.Step5requiresyoutodesigna12x8MACcoreusingtheSystemGeneratorsoftwareenvironment,andstep6requiresyoutoestimatetheresourcesusingtheResourceEstimatorblock.Instep7,youwillsimulatethedesigninSimulink,andinstep8youwillgeneratetheVHDLcoreusingtheSystemGeneratorblock.Instep9,youwillimplementthedesignusingtheXilinxISE8softwareenvironment.Beloweachgeneralinstructionforagivenprocedure,youwillfindaccompanyingstep-by-stepdirectionsandillustratedfiguresprovidingmoredetailforperformingthegeneralinstruction.Ifyoufeelconfidentaboutaspecificinstruction,feelfreetoskipthestep-by-stepdirectionsandmoveontothenextgeneralinstructionintheprocedure.
Note:
Ifyouareunabletocompletethelabatthistime,youcandownloadthelabfilesforthismodulefromtheXilinxUniversityProgramsiteat
Foreachprocedurewithinaprimarystep,therearegeneralinstructions(indicatedbythe
symbol).Thesegeneralinstructionsonlyprovideabroadoutlineforperformingtheprocedure.Belowthesegeneralinstructions,youwillfindaccompanyingstep-by-stepdirectionsandillustratedfiguresthatprovidemoredetailforperformingtheprocedure.Ifyoufeelconfidentaboutcompletingaprocedure,youcanskipthestep-by-stepdirectionsandmoveontothenextgeneralinstruction.
IntroductiontoSimulinkStep1
GeneralFlowforthisLab:
Step4:
Designa12x8MAC
Step3:
AnalyzePrecisionandSampleRate
Step2:
IntroduceXilinxBlocks
Step1:
IntroductiontoSimulink
Step5:
Simulatea12x8MAC
Step7:
CodeGeneration
Step6:
ResourceEstimation
BecomefamiliarwiththeMATLAB,Simulinkenvironments(softwaretoolsfromTheMathWorks)andtheXilinxblocksetrunningundertheSimulinkenvironment.Createablankworksheet,addSineWavesourceelement,addScopesinkelement,andwirethemupasshowninFigure1-1.
Figure1–1.DoublePrecisionDesign.
❶OpentheMATLABcommandwindowbydouble-clickingtheMATLABicononyourdesktop,orgotoStartMenuProgramsMATLAB7MATLAB7
Figure1-2.MATLABIcon.
❷Changedirectorytoc:
\xup\dsp_flow\labs\lab1\:
Typecdc:
\xup\dsp_flow\labs\lab1\inthecommandwindow
Youmaynavigatetoproductdirectoriesbytypinga“cd”commandintheMATLABcommandwindow.Type“ls”toseethedirectorycontents.ManyUNIXshellcommandsworkfromtheMATLABcommandWindow
❸LaunchSimulink:
TypesimulinkattheMATLABcommandprompt;oropentheSimulinkLibraryBrowserbyclickingthecorrespondingbuttonontheMATLABtoolbar
Figure1–3.SimulinkLibraryBrowser.
❹LookattheblocksavailableintheSimulinkLibraryBrowser.Thefollowingelements,amongothers,shouldappear:
∙Simulink(sourcesandsinks)
∙SignalProcessingBlockset
∙XilinxBlockset
∙XilinxReferenceBlockset
Figure1–4.SimulinkLibraryBrowser.
❺Right-clickanyblockinthelibrarybrowser,andchooseHelpfromtheMATLABmenu
Figure1–5.ChooseHelp.
Note:
Thisprovidesdetailsabouttheblock.YoucanalsouseHelpwiththeXilinxBlocksetelements
❻Createa“newmodel”blanksheetbyclickingtheCreateanewmodelbuttonoftheSimulinkLibraryBrowser
Figure1–6.CreateNewModel.
❼Inthelibrarybrowserwindow,expandtheSimulinkLibrary,andclickSources
❽AddtheSineWavesourceontheworksheet:
ScrollthroughthelibrarytofindtheSineWavesource,leftclickSineWave,anddragitontotheworksheet
❾AddtheScopesinkelementandwireittotheSineWavesourceontheworksheet:
FromSimulinkSimulinkSinks,addtheScopeblock,anddrawawirefromtheSineWavetotheScopeblock
Note:
Todrawawire,left-clicksourceanddragmousetodestination
Figure1–7.WiretheElements.
Assign2*pi*(1/150)frequencytotheSineWaveelement,showportdatatypes,andchangesimulationparameter’sstoptimetoinf(infinity)
❶Double-clicktheSineWaveblock
TheBlockParametersdialogboxopens.
❷Changethefrequencyto2*pi*(1/150)andclickOKtoclosethedialogbox
Figure13–8.ChangetheFrequency.
❸Ontheworksheet,gotoFormatPort/SignalDisplaysandclickPortDataTypes
Thesignalwidthisdisplayedonthewireasshowninthefollowingfigure.
Figure1–9.DoublePrecision.
❹Fromyourprojectsheet,pulldowntheSimulationmenuandselectConfigurationParameters
❺FromtheSimulationParametersdialogbox,selectSolverinthelefthandwindowandchangethestoptimetoinf,andclickOK
Thisallowsyoursimulationtoruntoinfinity(untilyoumanuallystopthesimulation).
Figure1–10.SimulationParametersDialogBox.
ParameterizetheScopeblock,andrunthesimulation
❶Double-clicktheScopeblock
❷ClicktheScopeParametersbutton
Figure13–11.ScopeParametersButton.
❸IntheScopeParametersbox,setthetimerangeto500,andclickOK
❹Runthesimulation:
FromyourSimulinkprojectworksheet,clickStartSimulationbutton,oruseSimulationStart
Figure1–12.SimulationButton.
❺OntheScopedisplay,clicktheAutoscalebuttonsotheoutputwillfitintotheScope
Figure1–13.AutoscaleButton.
❻ViewtheScopeoutput
Asmoothsinewaveshouldfitintoyourscopewindow.Thisiswhatyouwouldexpectbecauseyouarerunningadouble-precisionsoftwaresimulation.
❼Stopthesimulationasshownbelow
Figure1–14.StopSimulation.
IntroducetheXilinxGatewaysandMUXBlocksStep2
Step4:
Designa12x8MAC
Step3:
AnalyzePrecisionandSampleRate
Step2:
IntroduceXilinxBlocks
Step1:
IntroductiontoSimulink
Step5:
Simulatea12x8MAC
Step7:
CodeGeneration
Step6:
ResourceEstimation
UsetheXilinxGatewayIn,GatewayOut,SystemGenerator,andMUXblocks,asshownbelow,whichprovideinterfacetotheXilinxBlocksetsinSimulink.
Figure1–15.GatewayInandOut.
❶UsingSimulationConfigurationParametersdialogbox,setthestoptimeto500,andclickOK
❷FromtheXilinxBlockset(intheSimulinkLibraryBrowser),openBasicElementsanddragtheGatewayInblockontothedesignsheet.DropitontheconnectionbetweentheSineWaveandtheoutputScope.Itwillautomaticallyinsertitself
❸Double-clickGatewayIntoopentheBlockParameters,andsettheNumberofbitsto8andBinaryPointto2
❹VerifythatQuantizationissettoround,andoverflowtosaturate.
❺Similarly,dragaGatewayOutblockontothesheet,anddropitbetweentheGatewayInblockandtheoutputScopeblock
Figure1–16.DragGatewayInBlock.
❻AddaSimulinkMUXbetweentheGatewayOutandtheScopebyusingSimulinkSignalRouting(seeFigure1-15)
❼AddanadditionalnetbetweentheSineWaveandtheMUX
Note:
Thiswillmakethescopedisplayboththedouble-precisionsinewaveandtheuser-definedprecisionsinewavethathasgoneintoandbackoutoftheXilinxgateways
❽Addasystemgeneratortoken
fromtheXilinxBlocksetBasicElementslibrarytothedesign
❾ToviewthenumberofsignalsgoingintotheMUX,selectWidenonscalarlines,Signaldimensions,andPortdatatypesundertheFormatPort/SignalDisplaysmenu
Figure1–17.FormatMenu.
❿Updatethediagram:
selectEditUpdateDiagram
Note:
Nowlookatyourporttypes.Noticethatthegatewayinblockhaschangedthesignalsfromdouble-precisiontofixed-pointtypes.Fixed-pointlookslikeFix_8_2inthiscase.
AnalyzePrecisionandSampleRateStep3
Step4:
Designa12x8MAC
Step3:
AnalyzePrecisionandSampleRate
Step2:
IntroduceXilinxBlocks
Step1:
IntroductiontoSimulink
Step5:
Simulatea12x8MAC
Step6:
ResourceEstimation
Step7:
CodeGeneration
Runthesimulationwithdefaultsettingsandunderstandtheoutput.Changethedatatypeands
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- lab01
![提示](https://static.bdocx.com/images/bang_tan.gif)