EDA练习.docx
《EDA练习.docx》由会员分享,可在线阅读,更多相关《EDA练习.docx(77页珍藏版)》请在冰点文库上搜索。
EDA练习
ExerciseManual
for
Quartus®IISoftwareDesignSeries:
Foundation
SoftwareRequirementstocompleteallexercises
QuartusIIsoftwareversion11.0
LinktotheQuartusIIHandbook:
Usethelinkbelowtodownloadthedesignfilesfortheexercises:
Exercise1
Exercise1
Objectives:
∙CreateaprojectusingtheNewProjectWizard
∙Nametheproject
∙Pickadevice
Note:
Intheseexercises,you’llcreateabrandnewprojectandcompleteanexistingdesign.You’llhavethechoiceofcreatingthedesignusingthreedifferenttypesofdesignentry:
Verilog,VHDL,orasaQuartusIIschematic.Wherenoted,besuretoonlyfollowtheinstructionsappropriateforyourchoiceofdesignentrymethod.Bytheendoftheclass,you’llhaveafinal,optimizeddesign,readyforprogrammingintoaCyclone®IVEFPGAdevice.
Besuretocompletelyreadtheinstructionsforeachstepandsub-stepinthislabmanual.Eachstepfirstsummarizeswhatyou’llbedoinginthatstepbeforeprovidingcompleteinstructions.Usethelinesnexttoeachstep(____)tokeeptrackofyourprogressortocheckoffcompletedstepsintheexercises.
Ifyouhaveanyquestionsorproblems,pleaseasktheinstructorforassistance.
Step1:
Createnewprojectforuseinthelabexercises
____1.Unzipthelabprojectfiles.InanExplorerwindow,gotoC:
\altera_trn\Quartus_II_Software_Design_Series_Foundation.ThenameofthedirectorymaybeshortenedtoQuartus_II_Foundationorsimilaronsomemachines.Thiswillbeyourlabinstallationdirectory.DeleteanyoldlabfilefoldersthatmayalreadyexisttherelabeledQIIF*.Double-clicktheexecutablefilefoundinthatlocationorthefileyoudownloadedfromthelinkinyourclassregistrationemail.Ifyoustillcannotfindthisfile,askyourinstructorforassistance.IntheWinZipdialogbox,simplyclickUnziptoautomaticallyextractthefilesinplacetoanewfoldernamedQIIF11_0inthedirectorymentionedabove.CloseWinZip.
____2.StarttheQuartusIIsoftware.IntheWindowsStartmenufromtheAllProgramslist,gototheAlterafolderandthentheQuartusII11.0folder.Dependingonyouroperatingsystem,clickQuartusII11.0(64-bit)orQuartusII11.0(32-bit)tostarttheprogram.Checkwithyourinstructorifunsure.Theremayalsobeashortcutonthedesktop.
____3.StarttheNewProjectWizard.YoucanopenitfromtheGettingStartedWithQuartusIISoftwarewelcomedialogthatappears.Ifyou’veclosedthiswindow,intheTaskswindowontheleftsideoftheQuartusIIinterface,expandtheStartProjectfolderanddouble-clickOpenNewProjectWizard.YoucanalsoselectNewProjectWizard…fromtheFilemenu.TheNewProjectWizardappears.IftheIntroductionscreenappears,clickNext.
____4.CompletetheNewProjectWizardtocreatetheproject.SelectoneoftheworkingdirectoriesshowninTable1dependingonthetypeofdesignentryyouwanttouse.Nametheprojectpipemultandleavethetoplevelentitynamepipemult.
Table1.Settingsforpage1ofNewProjectWizard
workingdirectory
\QIIF11_0\Ex1\VHDL
\QIIF11_0\Ex1\Verilog
\QIIF11_0\Ex1\Schematic
nameofproject
pipemult
top-leveldesignentity
pipemult
____5.ClickNexttoadvancetopage2.
____6.Onpage2,clickthebrowsebutton
.NavigatetotheprojectdirectoryastheSelectFiledialogboxmaynotautomaticallybepointingthere.Selectthetop-levelfilepipemult(.v,.vhd,or.bdf,dependingonthedesignentrymethodyouchosein#4).AfterclickingOpen,clickAddtoaddthefiletotheproject.ClickNext.
Notethatthisstepisn’treallynecessarysincethedesignfileisalreadylocatedintheprojectworkingdirectory.Thenewprojectwouldautomaticallyincludethedesignfileaspartoftheproject.Filesorfiledirectories(libraries)onlyneedtobeaddedonpage2oftheNewProjectWizardiftheyarenotlocatedintheprojectdirectory.Addingthefiletotheprojectremovesthewarningthatthefilehasnotbeenadded.
____7.Onpage3,selectCycloneIVEastheFamily.IntheShowin‘Availabledevice’listsection,setPackagetoFBGA,Pincountto256,andSpeedgradetoFastest.Thisfiltersthelistofavailabledevices.SelecttheEP4CE6F17C6devicefromtheAvailabledevices:
window.
____8.ClickNext.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
____9.Onpage4(shownbelow),youcanspecifythird-partyEDAtoolsyoumaybeusing.SincetheseexerciseswillbedoneentirelywithintheQuartusIIsoftwarewithoutanyothertools,clickNexttoskipthisstep.
____10.Thesummaryscreenappears.
____11.ClickFinish.
Theprojectisnowcreated.
Keeptheprojectopenasyoucontinuethroughtheexercises.Thereisnoneedtoclosetheproject.Ifyoudoclosetheprojectforsomereason,besuretoselectOpenProjectinsteadofjustOpenfromtheFilemenu(orOpenExistingProjectfromtheTaskswindow).TheOpencommandisusedtosimplyopenasinglefileinsteadofaproject,preventingtheabilitytoperformmanyproject-basedoperations,suchascompilation.
ExerciseSummary
∙CreatedaprojectusingtheNewProjectWizard
–Namedtheproject
–Pickedadevice
ENDOFEXERCISE1
Exercise2
Exercise2
Objectives:
∙CreateamultiplierandRAMblockusingtheMegaWizardPlug-inManagertocompletethedesign
∙CreateaHEXfiletoinitializetheRAMblockusingtheMemoryEditor
∙Analyzeandelaboratethedesigntocheckforerrors
PipelinedMultiplierDesign
Figure1showsaschematicrepresentationofthetop-leveldesignfileyouwillbeusingtoday.ItconsistsofamultiplierandaRAMblock.DataisfedtothemultiplierfromanexternalsourceandstoredintheRAMblock,whichisalsocontrolledexternally.ThedataisthenreadoutoftheRAMblockbyaseparateaddresscontrol.
Figure1
IMPORTANTNOTE:
Forexercises2-6,youshouldeithercontinueworkingintheEx1directory(preferred),oryoucanopenaproject(FilemenuorTaskswindowOpen[Existing]ProjectSelectpipemult.qpfandclickOpen)foundinoneoftheEx#directories.TheEx#directorieseachcontainprojectsinthethreeversions(schematic,Verilog,VHDL)completeduptothebeginningofthatexerciseintheexercisemanual.TheSolutionsdirectorycontainsaWorddocumentwiththeanswerstoquestionsaskedintheexercisesaswellasthefinalprojectasitwouldbesetupattheendofexercise5.
Step1:
Buildan8x8multiplierusingtheMegaWizard®Plug-inManager
____1.ChooseToolsMegaWizardPlug-InManagerordouble-clickMegaWizardPlug-InManagerintheCreateDesignfolderoftheTaskswindow.Inthewindowthatappears,selectCreateanewcustommegafunctionvariation.ClickNext.
____2.Selectthemegafunctiontocreate.Onpage2a(shownabove),dothefollowing:
a.ExpandtheArithmeticfolderandselectLPM_MULT.
b.Inthedrop-downmenu,makesuretheCycloneIVEdevicefamilyisselected.
TheselectionofadevicefamilyhereletstheMegaWizardPlug-InManagerknowwhatdeviceresourcesareavailableasthemegafunctioniscreated.Youcouldchangethedevicefamilyifyouwantedtocreatethesamemegafunctionbutforadifferentprojectthatusesadifferentdevice.
c.ChooseVHDLorVerilogHDLoutputdependingonyourchoiceofHDLandexercisedirectory.IfyouareusingtheSchematicexercise,chooseeitherVHDLorVerilog.
d.Forthenameoftheoutputfile,typemult.Youcanaddthistotheendofthedirectorypathorerasetheentirepathtoautomaticallyplacethegeneratedmegafunctionfilesintheprojectdirectory.
____3.ClickNext.
/////////////////////////////////////////////////////////////////////////////////////////////
\
____4.Onpage3(General),setthewidthofthedataaanddatabbusesto8bitsiftheyarenotalreadyset.Fortheremainingsettingsinthiswindow,usethedefaultsthatappear.
____5.ClickNext.
____6.Onpage4(General2),useallthedefaultsettings(i.e.databinputdoesNOThaveaconstantvalue,useunsignedmultiplication,andselectthedefaultmultiplierimplementation).
____7.ClickNext.
____8.Onpage5(Pipelining),chooseYes,Iwantanoutputlatencyof2clockcycles.
____9.ClickNext.
____10.Youshouldnowbeonpage6(section2oftheMegaWizardcalledEDA).ThistabindicatesthesimulationmodelfileneededtosimulateLPM_MULTinanEDAsimulationtool(e.g.ModelSimorsomeother3rd-partysimulationtool).Thelpmsimulationmodelfileshouldbeindicatedasshownabove.Youalsohavetheoptionofgeneratingatimingandresourceestimationnetlistforusebya3rd-partysynthesistools.Wearenotusinganythird-partytools,sojustclickNext.
____11.Onpage7,usingTable2belowchecktheappropriateboxesdependingontheDesignEntryMethodselected.
Table2.MegaWizardfilestogenerate
DesignEntryMethod
FilestoEnableinMegaWizardPlug-In
VHDL
mult_inst.vhd&mult.cmp
Verilog
mult_inst.v
Schematic
mult.bsf
____12.ClickFinishtocreatethemegafunction.IfadialogboxappearsaskingifyouwanttoaddtheQIPfiletotheQuartusIIproject,clickYes.
Themultiplierisbuilt.
Ifforsomereasonyourmegafunctionisincorrectoryouforgotormissedacheckboxforgeneratingalltherequiredoutputfiles,opentheMegaWizardPlug-InManageragainfromtheToolsmenuorTaskswindow.Selecttoeditanexistingmegafunction.Thenselectthemainvariationf