Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX...
Transcript of Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX...
![Page 1: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/1.jpg)
Lab1OverviewandMicrocodeReview
Sec3on22/1/2016
![Page 2: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/2.jpg)
Agenda
• Lab1– Whywe’reaskingyou?– Whatwe’vegivenyou?– Whatyou’reaskedtodo?
• MicrocodeReview• Miscellaneous(RISC-V,Chisel,etc.)Ques3ons
![Page 3: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/3.jpg)
ComputerArchitect’sJob• Findthecommoncase(s),andmakesureyoucansupportthemefficiently– Some3mesatthecostofsupporttheuncommoncaseinefficiently
• Examples– Found20%ofVAXinstruc3onsresponsiblefor60%ofmicrocode,butonlyaccountfor0.2%ofexecu3on3me!
– Registerimmediateinstruc3ons• Howdoweknowwhattodo?– Intui3on,Simula3on,Building,Experiments,…
![Page 4: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/4.jpg)
Experimentsaren’teasy
• Althoughthereareproper3esthatyoucanprovemathema3cally,computerarchitectureiso[enbasedonempiricalstudies
• Thismeansthatyourdatawillbeapplica3onspecific– Pickyourapplica3onscarefully!(benchmarks)
• “Itdepends”:Alwaysthinkaboutbothsidesoftheargument– Keepaskingques3onstoyourselftounderstand
![Page 5: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/5.jpg)
Lab1
• Understandhowin-orderpipelinedmicroarchitectureaffectsprocessor
• Guided– CPI– Instruc3onMix
• Open-ended– Bypassing– CISCmicrocode– GeneralDesign– Yourfunidea!
![Page 6: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/6.jpg)
Lab1Given• ProvidedRISC-V32Iprocessors– 1-stage– 2-stage– 3-stage– 5-stage
• Fullybypassed• Interlocked(stalltoresolveallhazards)
– Micro-coded• Only1-stageand5-stageareusedinthedirectedpor3on– 2-stage3-stageandmicro-codearethereforyoutoinves3gateoruseintheopen-endedpor3on
![Page 7: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/7.jpg)
Lab1GivenotherMisc.
• Chisel->C++simulator(emulator)• Benchmarksandtestprograms• Instruc3onTracertogatherstats– CPI,instruc3onmix
• Ques3onsandanalysis– Makerecommenda3ons– Proposenewdesigns
![Page 8: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/8.jpg)
Lab1ChiselProcessor
TileCore
CPath DPath
RAM
![Page 9: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/9.jpg)
Lab1ProcessorEmulator
Emulator.cpp
Target System: Top-0.h Top-0.cc
TileCore
CPath DPath
RAMFESVR
![Page 10: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/10.jpg)
DEMO!
• Addtoolstoyourpath$ source ~cs152/sp13/cs152.bashrc
• CopyLabFiles$ cp –R ~cs152/sp13/lab1 .
• BuildaChiselprocessor,Compilesimulator,runalltests&benchmarks$ make run-emulator
![Page 11: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/11.jpg)
HowisChiselusedinLabChisel(
![Page 12: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/12.jpg)
Lab1Ques3ons
![Page 13: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/13.jpg)
Microcode/Lecture2Review
• Endianness• Combina3onalPath• Cri3calPath• BenefitsofMicrocode• HorizontalvsVeritcal• Nanocoding
![Page 14: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/14.jpg)
DataFormatsandMemoryAddresses
14
Dataformats:8-bBytes,16-bHalfwords,32-bwordsand64-bdoublewords
Someissues• Byteaddressing
• WordalignmentSupposethememoryisorganizedin32-bitwords.Canawordaddressbeginonlyat0,4,8,....?
0 1 2 3 4 5 6 7
MostSignificantByte
LeastSignificantByte
ByteAddresses
3 2 1 0
0 1 2 3BigEndian
Li8leEndian(RISC-V)
![Page 15: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/15.jpg)
PerformanceIssues
15
Microprogrammedcontrol=>mul3plecyclesperinstruc3on
Cycle3me?tC>max(treg-reg,tALU,tμROM)
Suppose10*tμROM<tRAM
Goodperformance,relaDvetoasingle-cyclehardwiredimplementaDon,canbeachievedevenwithaCPIof10
![Page 16: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/16.jpg)
CycleTime,Combina3onalPath,Cri3calPath
1
IR A B
RegWr enReg
MemWr enMem
MA
addr addr
data data
rs rs11 rd 32(PC)
RegSel
busy? zero?
ALUOp
Opcode
ldIR ldA ldB ldMA
IntRq
Memory 32 GPRs +
PC + IRA + ...
(32-bit regs) ALU
enALU
Immed Select
enImm
ImmSel
Bus
![Page 17: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/17.jpg)
HorizontalvsVer3calµCode
• Horizontalµcodehaswiderµinstruc3ons– Mul3pleparallelopera3onsperµinstruc3on– Fewermicrocodestepspermacroinstruc3on– Sparserencoding⇒morebits
• Ver3calµcodehasnarrowerµinstruc3ons– Typicallyasingledatapathopera3onperµinstruc3on
– separateµinstruc3onforbranches– Moremicrocodestepspermacroinstruc3on– Morecompact⇒lessbits
• Nanocoding– Triestocombinebestofhorizontalandver3calµcode
17
#µInstruc3ons
BitsperµInstruc3on
![Page 18: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/18.jpg)
Nanocoding
18
• MC68000had17-bitµcodecontainingeither10-bitµjumpor9-bitnanoinstruc3onpointer– Nanoinstruc3onswere68bitswide,decodedtogive196controlsignals
µcodeROM
nanoaddress
µcodenext-state
µaddress
μPC(state)
nanoinstruc3onROMdata
Exploitsrecurringcontrolsignalpa}ernsinµcode,e.g.,ALU0 A<=Reg[rs1]...ALUi0 A<=Reg[rs1]...
![Page 19: Lab 1 Overview and Microcode Reviewcs152/sp16/sections/...• Examples – Found 20% of VAX instruc3ons responsible for 60% of microcode, but only account for 0.2% of execu3on me!](https://reader033.fdocuments.in/reader033/viewer/2022050603/5faa4e03c770622b516b87e3/html5/thumbnails/19.jpg)
Ques3ons