cs 2630 computer organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. i...

41
CS 2630 Computer Organization What did we accomplish in 15 weeks? Brandon Myers University of Iowa

Upload: others

Post on 13-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

CS2630ComputerOrganization

Whatdidweaccomplishin15weeks?BrandonMyers

UniversityofIowa

Page 2: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Whytake2630?

• Theesotericanswer:Computer Sciencegraduatesshouldhaveanappreciationforhowrealcomputerswork• Butreally…

• 1.Itwillbeuptoyoutodesignournewcomputersystems...computerarchitectshavebeenpanickingfornearlyadecadeandtheyarenot calmingdown

• 2.Evenifyouvowtonever,ever,EVERdoanythingexceptapplicationsprogramming...atsomepointyouwillbehavetomeasureasystemyou’vebuilt:performance(latency&throughput),energyusage,reliability,...Tounderstandhowtomeasure/interpret/improveyoursystem,youneedtounderstandmoreofthecomputer

require slidefromday1

Page 3: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

App

High-levellanguage(e.g.,C,Java)

Instructionsetarchitecture(e.g.,MIPS)

Compiler

Operatingsystem(e.g.,Linux,Windows)

Memorysystem I/OsystemProcessor

Datapath &Control

Digitallogic

Circuits

Devices(e.g.,transistors)

Physics

Page 4: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

lw $t0, 4($s0)addi $t0, $t0, 10sw $t0, 8($s0)

YoulearnedhowtowriteassemblycodeinHW2(usuallythecompilerdoestheworkforus)

rug:don’tneedtowriteassemblycodeforaparticulararchitecture.InsteadwriteportableJava/Python/Ccode

bumps:someCcodeisn’tportable;someprogrammerswritesnippetsofassemblycodewhenthecompilerdoesn’tdothebestthing

Page 5: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000

lw $t0, 4($s0)addi $t0, $t0, 10sw $t0, 8($s0)

Project1– MiniMAtheMIPSassemblerrug:wecanwriteMIPS

programsinalanguagemadeofhuman-readablecharacters,usepseudoinstructions,refertolabelseventhoughthemachinereadsbinarynumbers

Page 6: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000

lw $t0, 4($s0)addi $t0, $t0, 10sw $t0, 8($s0)

100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000

100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000

100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000100001000001011111000000001111000011100100001101010000000000100000000110000010000000000000001000100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000

math.astdlib.a

browser.exe

rug: linkerallowsustowriteourprogramsmodularly

Page 7: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

PEERINSTRUCTION(actually,asurvey)stronglyagreeagreeneutraldisagreestronglyagree

abcde

1. Iunderstandtherelationshipbetweenbits,numbers,andinformation.

2. Iunderstandthestoredprogramconcept3. Iunderstandtheroleoftheinstructionsetarchitectureina

computer4. Iunderstandwhyabstractionsareessentialforbuildingcomplex

systems5. Iunderstandwhythedigitalabstractionisimportant6. Iunderstandwhythesynchronousabstractionisimportant7. Iunderstandthetradeoffsinthememoryhierarchy8. Iunderstandhowproblemscanbedecomposedintoadatapath and

acontrol9. Iappreciatethelayersofthecomputingstackandwhytheymay

needtochangeinthenearfuture.

Page 8: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

100011100000100000000000000001000010000100001000000000000000101010101110000010000000000000001000

browser.exe

InProject2-2youplayedtheroleoftheLoaderbyloadingyourheximageintotheInstructionmemory

rug: ourprogramhastheillusionofhavingaccesstotheentireaddressspace(e.g.all232bytes)ofthecomputer

Page 9: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Project2-2,youdesigned,built,andtestedaprocessorthatrunsassembledMIPSprograms datapath andcontrol

rug:machinecodefortheMIPSarchitectureoughttorunonanyMIPSprocessor,regardlessofitsdesign(itsmicroarchitecture)

bumps:choicesaboutthearchitecturesometimesarebasedonassumptionsaboutthemicroarhitecture (e.g.,MIPSbranchdelayslot).

Page 10: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Project2-1,HW4youbuiltcomponents(likeregisterfilesandfinitestatemachines)fromsequentiallogic

rug:wecanbuildacomplexsystemoutofbasiccomponents.Synchronous abstractionallowsustonothavetoworryaboutinterfacesbetweencomponents

Page 11: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Digitallogic

Circuits

Instructionsetarchitecture(e.g.,MIPS)

GPUinstructionsetneuralnetwork

structureandweights

Youdon’thavetobuildthe5-stagepipelinedMIPSprocessor

http://people.cs.pitt.edu/~cho/cs2410/papers/yeager-micromag96.pdf

MIPSR10000(out-of-ordersuperscalar)

youdon’thavetobuildaMIPSprocessor

systolicarrayandcontrol

Page 12: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

everycomponentismadeoflogicgates;youlearnedhowtobuildlogiccircuitsinHW3

Page 13: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

logicgatemadeofpMOS andnMOStransistorsarrangedinaCMOSconfiguration

rug: ItisabiteasierjusttothinkofgatesthatarefunctionsasopposedtotransistorsattachingoutputtoVsource orVground

rug:CMOSensureseverygatehasapure0or1output!Thisideaisthedigitalabstractionthatletsthelayersabovecomposetwoelectricalcircuitswithoutworryingabouthowtheyaffecteachother.

Page 14: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

layoutengineer’sviewofaNORgate

https://commons.wikimedia.org/wiki/File:NOR_gate_layout.png

rug:Whenbuildingafunctionaldigitallogiccircuit,noneedtoworryabouthowitisarrangedonthesilicon

Page 15: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

https://commons.wikimedia.org/wiki/File:NOR_gate_layout.png

nMOScrosssection

https://commons.wikimedia.org/wiki/File:MOSFET_functioning_body.svg

rug:deviceengineersprovidelayoutengineerswith“designrules”.Iftheyobeytherequiredspacingbetweencomponentsthenthetransistorswillwork

Page 16: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

OFF ON

rug:WhenoperatingatransistorinthesaturationregimesitlookslikeanelectricalswitchbetweenvoltagesGNDandVDD.Partofsupportingthedigitalabstraction.

Page 17: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

TheCreationofAdam

Page 18: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Theprogrammablecomputer

blatantlystealingatraditionfrommy ComputerOrganizationinstructor

thisslidesettoHandel’sHallelujahchorus

SOFTWARE

HARDWARE

Page 19: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

It’snotenoughtojustbuildsoftwarethesedays

ProjectCatapult:customhardwarerunningpartofBingsearch

computervisionprocessorsrunningGoogle’saugmentedrealityplatformTango

“holographic”processorforMicrosoft’saugmentedrealityplatformHoloLens

Sparc M7chipisbuiltspecificallyforforacceleratingdatabasequeries

allinproductionnotjustresearch

GoogleTPUisbuiltformachinelearning

Page 20: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

LifebeyondLogisim?• Logisim’s mainmodeofinputisschematicentry

• Muchdigitallogicdesignuseshardwaredescriptionlanguages(HDL)likeVerilog(lookupVeriloginyourtextbookindex)• HDLisnotmuchdifferentthanwhatyoudid,exceptitistextualinsteadofgraphical

• Typicallyhavepowerfulcompilersthanmakedevelopmenteasier thanusingLogisim,e.g.,writeastatementlike

case(ALUCtrl){0:R=X+Y1:R=X-Y…

}AndyougetanALU!

Page 21: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Didwereallybuildarealprocessor?

• Yes!YouimplementedmuchoftheMIPSInstructionSetArchitectureandI/O.YourProject2-2couldrunLinux(at4KHzclockfrequency)givenabootloaderprogramandLinuxcompiledforMIPS.

No,Imeanlikereal hardware

Page 22: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

No,Imeanlikereal hardware

Ifweuseahardwarecompiler,wecouldturnyourlogisimfiles(lookinside;it’sjustsomeXMLlistingabunchofcomponentsandwires)intoanFPGAdesignorstandard-cellVLSIdesign

moretolearnabouthowtodealwiththedetailsofthesedesignflows,butyouhaveagoodstartingpoint

Page 23: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Administrivia

• FinalExam• Friday,3-5pminhere!• opennotes/book,noelectronics• reminder:practicematerialsonICONannouncement

Page 24: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Theinsightsyoubroughttothecourse:CATopics

Page 25: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Whatcoursesnext?• CS:3620OperatingSystems

• CS:3210ProgramminglanguagesandTools(inC++)

• CS:3640IntroductiontoNetworksandTheirApplications

• CS:3820ProgrammingLanguageConcepts

• CS:4640 ComputerSecurity

• CS:4700HighPerformanceandParallelComputing

• CS:5610:Highperformancecomputerarchitecture

• CS:4980TopicsinCS(CompilerConstructiononraspberrypi)• CS:4980TopicsinCS(askforacomputerarchitecturecourse!)

Page 26: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

What’stolearnnext:operatingsystems

Page 27: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Questionswedidn’tgettoanswerfullyinCS2630Operatingsystems

• howdomultipleprogramssharethecomputer?• 2-64processors• 1 networkinterface• 1 memory• 1keyboard,mouse,screen• 100’sofrunningprograms

• howdoyoukeepprogramsisolatedfromeachotheroroneprogramfromconsumingallresources?

• howdoyouimplementsyscalls?

• howdoyouloadtheOScodeintomemorywhenyoupoweronthecomputer?

Page 28: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

What’stolearnnext:computerarchitecture

Page 29: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

What’stolearnnext:computerarchitecture

• theroleofparallelisminmicroarchitectures

• everyimplementationanditseffectonperformance...

𝑠𝑒𝑐𝑜𝑛𝑑𝑠𝑝𝑟𝑜𝑔𝑟𝑎𝑚 =

𝑠𝑒𝑐𝑜𝑛𝑑𝑠𝑐𝑦𝑐𝑙𝑒 ∗

𝑐𝑦𝑐𝑙𝑒𝑠𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛 ∗

𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠𝑝𝑟𝑜𝑔𝑟𝑎𝑚

...andcostandenergy

Page 30: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Parallelisminarchitecturespipelining

vector

superscalar

dataflow

andothers...multicore,VLIW,multithreading,...

Page 31: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Vectormachinesfoundin...• earlysupercomputers

• IntelAVX• GPUs

SIMD:singleinstruction,multipledata

Page 32: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Superscalarmachines

Replicateresources,e.g.,• twodecoders,2-wide

instructioncachereadport:fetchtwoinstructionsatatime

• twoALUs:executetwoinstructionsatatime

• moreregisterfilewriteports:writebacktworegistersinonecycle

foundin...mostCPUsinserversandsmartphones

superscalar+pipelining

superscalar

Page 33: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Dataflowmachinesaprocessorneedstogettheinstructionandtheinputdatatothesamephysicalplaceatthesametime(knownas“dataflowlocality”)

DataflowmachineshaveabunchofExecutionunitsofvariouskind;thedata”flows”throughtheoperators

Challenges?

Page 34: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

What’stolearnnext:parallelcomputing

Page 35: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Metricforperformancecomparison:TimeMyprogramrunsin100seconds

IfI“parallelizeit”on10processorsIsawthatitrunsin12seconds

Whatisthespeedup?

Tserial /Tparallel =100/12=8.33X

Page 36: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Predictingparallelrunningtime(Tpar)fromserialrunningtimeMyprogramrunsinTser =100seconds

IfI“parallelizeit”on10processors,howfastwillitrun(i.e.,whatisTpar)?

𝑇4567689:𝑇6;<54=>?

=1

1 − 𝑟 + 𝑟𝑠

𝑇6;<54=>? = 𝑇4567689: ∗ ( 1 − 𝑟 ∗ 1 + 𝑟 ∗1𝑠)

Inthisform,itiscalledAmdahl’slaw:saysyourspeedupislimitedbyhowmuchoftheprogramisimproved(e.g.,parallelize)

r=fractionofprogramthatisabletobeimproveds=speedupwhenapplyingtheimprovement

Page 37: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

https://en.wikipedia.org/wiki/Amdahl's_law#/media/File:AmdahlsLaw.svg

Amdahl’slawappliedtoparallelization

r

s

Page 38: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Asequentialabstractmachinemodelyoualreadyknow• RAM:randomaccessmemory• justlikeanyothercomputationalstep,accessingmemoryiscostof1

memory

processor

RAM

Page 39: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Oneofthefoundationalparallelmachinemodels:ParallelRandomAccessMachine(PRAM)• Allprocessorsareattachedtoasharedmemory

• Memoryaccesstakes1step

• MorerealisticvariantsofPRAMincurgreatercostfor“conflicting”memoryaccesses

• usedveryoftenforunderstandingthespeeduplimitsofparallelalgorithms;notveryrealistic

Page 40: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

Oneofthefoundationalparallelmachinemodels:Bulksynchronousparallel(BSP)

https://en.wikipedia.org/wiki/Bulk_synchronous_parallel

w1 w2wp

𝑙

ℎ6

(seeblackboardnotes)

thisabstractmachinedoesnotsupportasmanyalgorithmsasCTA,butitissimpler

Page 41: CS 2630 Computer Organizationhomepage.cs.uiowa.edu/~bdmyers/cs2630_sp17/public/... · 1. I understand the relationship between bits, numbers, and information. 2. I understand the

ThefutureofCS2630• Pleasestayintouch!• TellothershowawesomeCS2630is!• Signuptobeanapprovedtutor!https://cs.uiowa.edu/resources/approved-tutors

• CS2630movingtoTILEclassroomsinFall• Replacingsomelectureswithlabassignments• allowustobettersupportlearningallthetools,getmoretimeanalyzinganddesigningprogramsandcircuits• veryspeculatively:futureopportunityforlabassistants(helpstudentsbutdonotgradework)