In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory,...
Transcript of In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory,...
![Page 1: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/1.jpg)
1
![Page 2: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/2.jpg)
2
Inthislecture,wewillconsiderthevarioustypeofstorage(memory)thatFPGAsallowustoimplement.ThemajoradvantageofFPGAsisthatitcontainslotsofsmallblocksofmemorymodules,whichcaneitherbeusedindependently,orcombinedtoformlargermemoryblocks.Theyalsoprovidevariousconfigurationssuchasmulti-portorregisteredinput/outputfordataandaddress.
Therearevarioususefulreferencesyoucanlookupifyouareinterestedtolearnmoreaboutthis.Forthepurposeofexamination,thecontentsinthislectureandintheVERIexperimentaresufficient.
![Page 3: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/3.jpg)
3
Thesimplestformofstorageisaregisterfile.Allmicroprocessorshaveregisterfiles,whichareknownas“registers” inthearchitecturalcontext.
Registerfilesarefast,largeandflexible.TheyaregenerallyusedtostoretemporarydataforeasyaccessbytheALUorfloatingpointunitofamicroprocessor,orforcomputationalengineofaapplicationspecifydigitalsystem.
OntheFPGA,registerfilesareoftenimplementedwiththeD-FF’sintheAdaptiveLogicModules(ALMs).EachALMhastwoD-FFs.Thereforea32-bitregisterwilltakeup16ALMs.Alternativelyonecouldalsousethestaticmemoryblocksforthispurpose.
![Page 4: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/4.jpg)
4
Thecircuitofaregisterfileissimple– itconsistsofarraysofD-FFs,whichcanbedisable(andoutputbecomeshighimpedance).Theregisterselectsignalssel_reg0,sel_reg1etc.enablethecorrectregistertoputthedataonthedataline(calledbitlinehere).Theread/writecontrolsignalWEisusedtodetermineifyouarereadingorwritingtotheregister.
![Page 5: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/5.jpg)
5
Theregisteridentification(regid)determineswhichregisteryouaretryingtoaccess.Thisisachievedthroughastandarddecoder,whichgenerateaone-hotcodewordtoselecttheappropriateregistertoaccess.
![Page 6: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/6.jpg)
6
NowletusturntotheCycloneVFPGA.TheFPGAhasmanydifferenttypeofresourcesinadditionaltoAdaptiveLogicModules(ALMs).Theseare:memoryblocks,DigitalSignalProcessing(DSP)units,phase-lockedloopsandinput/outputpads.Inaddition,thereisadual-coreARMprocessoranditsassociatedbusinterfacecircuit(showninlightgreen).
Herewefocusonmemory.IntheC5-SE-A5series,whichistheoneweuseintheDE1board,therearenear400separatememoryblocks,eachwith10kbitsofstorage.TogetherwiththeALMs,thereis4.45Mbitsofflexiblememorystorageavailabletothedesigner.
![Page 7: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/7.jpg)
7
Eachoftheseblocks(knownasM10K)canbeconfiguredwithdifferentdepthanddatawidthasshownintheableabove.
Evenmoreimportantly,thecanalsobeconfiguredtoactasconventionalsingle-portmemory,orsimpledual-portwithoneportforreadandoneportforwrite.
Further,theycanbemadetobetruedual-port,bothportsbeingread/writeports,orasashiftregister,aROMorafirst-in-first-outbuffer(FIFO).
![Page 8: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/8.jpg)
8
AsyouhaveseenintheVERIexperiment,ifthememoryblockisaROM(orevenasaRAM),itscontentcanbeconfiguredviaamemoryinitializationfile.mif.Theformatofthefileisshownhere.Typingthecontentsofa1024ROMmodulebyhandissillyandimpractical.Iwrotetwoversionsofasimpleprogrammetogeneratethis.miffile,oneinMatlabandoneinPython.BelowisthecodefortheMatlabversion.TheROMisproducedusingtheIPCatalogtool.Hereisa1024x10bitROMgeneratedwithallinputandoutputregisteredandsynchronisedwiththeclocksignal.
![Page 9: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/9.jpg)
9
Intheexperiment,youhavealreadyimplementedasinewavegeneratorusingtheROMtostoreonecycleofasinewave.Thecounterisusedtoadvancethephaseofthesinewave,whichisspecifiedastheaddressXoftheROM.ThecontentoftheROM,y=F(x)isthecontentoftheROMandisthegeneratedwaveform.Insteadofstoringasinewave,youcaneasilystoreanyothersignal(suchasavoiceormusicsegment).Inorderimplementavariablefrequencysinewave,youcouldmodifytheaddresscountersothatitisgoesupnotonlyby1countforeachclockcycle,butbyN.ForexampleifNis2,thentheaddresscounterwillskipeveryothersampleintheROMandthereforethegeneratedsinewavewillbeattwicethesignalfrequency.
![Page 10: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/10.jpg)
10
Hereisageneratedsingle-portmemorywithALLpossiblesignalsincluded.Themeaningofallthesignalsareselfexplanatory.
![Page 11: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/11.jpg)
11
HereisthetimingoftheRAMconfiguredasasingleport.Sincewehaveseparatedatainputport(data_a)anddataoutputport(q_a),itisimportanttounderstandwhatdatayoureadback(oldornew)fromagivenaddressduringawritecycle.
![Page 12: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/12.jpg)
12
HereisanexampleofusingtheMegaWizardmanagertoolinQuartus.Weareproducinga1-portRAMwith1024x8,allsignalsareclocked.Thegeneratorproducesasampleheaderfile(atemplate)whichdefinestheinterfacesignaltothegeneratedblock.RememberyoumustticktheVerilogHDLradiobutton.
![Page 13: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/13.jpg)
13
YoucanalsoconfiguretheM9Kmemoryblockasashiftregister.Hereisan8-bit16stageSR.Inaddition,itprovides“tap” outputsforeverystage,i.e.16x8=128outputsignals.ThisisveryusefultoimplementFIRfilterorperformtimedomainconvolution.
![Page 14: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/14.jpg)
InthePartIVoftheVERIexperiment,youwillbeusingaFIFOtoimplementanechosynthesizer.TheactionofaFIFOisshowninthediagramabove.
14
![Page 15: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/15.jpg)
HereisagenericblockdiagramofaFIFOwithitstypicalinterfacesignals.FIFOisaformofqueue.Internallytheretypicallytwocounters,onekeepingtrackofthereadaddress(orreadpointer)andanothercounterkeepingtrackofthewriteaddress(writepointer).ThereneedstobestatussignalssuchasFULL,whichisassertediftheFIFOiscompletelyfilledandwritinganymorewordstoitwilldestroystoreddata,orEMPTY,whichsignifiesthattherearenodatalefttoread.
15
![Page 16: In this lecture, we will consider the various type of storage … 14... · 2018-11-27 · memory, or simple dual-port with one port for read and one port for write. Further, they](https://reader033.fdocuments.us/reader033/viewer/2022050402/5f8019b2bdbb206641258bcd/html5/thumbnails/16.jpg)
16
FIFOcanbegeneratedusingtheIPCatalogmanagertool.Hereisanexampleofa32wordx8bitFIFO.