版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
计算机体系结构周学海xhzhou国科学技术大学Welcometo……主讲:周学海(xhzhou@)助教:程玉明(yumingc@)
夏昊珺(xhjustc@)
俞天灿(ytc2013@)办公地点:嵌入式系统实验室
(网络中心西区服务部内)办公电话/p>
http:///~xhzhou/CA-Spring2018/CA.html8/15/2026中国科学技术大学28/15/2026中国科学技术大学教材与主要参考书JohnL.Hennessy,DavidA.Patternson,ComputerArchitecture:AQuantitativeApproach.FifthEdition.机械工业出版社,2012DavidA.Patternson,JohnL.Hennessy,ComputerOrganization&Design:TheHardware/SoftwareInterface,ThirdEdition.SanFrancisco:MorganKaufmannPublishers,Inc.2005张晨曦等,计算机系统结构教程,清华大学出版社3WhatisComputerArchitecture?ApplicationPhysicsGaptoolargetobridgeinonestepInitsbroadestdefinition,computerarchitectureisthedesignofthe
abstractionlayersthatallowustoimplementinformationprocessingapplicationsefficientlyusingavailablemanufacturingtechnologies.(butthereareexceptions,e.g.magneticcompass)8/15/2026中国科学技术大学48/15/2026中国科学技术大学现代计算机系统的抽象层次AlgorithmGates/Register-TransferLevel(RTL)ApplicationInstructionSetArchitecture(ISA)OperatingSystem/VirtualMachineMicroarchitectureDevicesProgrammingLanguageCircuitsPhysics5WhatisComputerArchitecture?描述计算机系统的功能、组织和实现的一组规则和方法。计算机体系结构是研究如何选择(设计)功能部件和互联方法来满足计算机系统的功能、性能、价格约束的科学计算机体系结构是软件设计者与硬件设备(VLSI)之间的中间层,是软件与硬件的接口(Interface)8/15/2026中国科学技术大学68/15/2026中国科学技术大学计算机体系结构的定义过去的定义:
程序员可见的计算系统的属性。包括:概念性的结构和功能行为。不包括:数据流和控制流的组织、逻辑设计以及物理实现。
–Amdahl,Blaauw,andBrooks,1964
Instruction-SetArchitecture广义的定义:
计算机体系结构研究如何
设计、组织,以及使用可用的生产技术实现一个计算系统,该计算系统可有效地执行软件应用,满足价格、功耗和性能约束7计算机体系结构的定义(续)过去的观点:InstructionSetArchitecture(ISA)设计即体系结构设计需要关注并确定:寄存器组织、如何访问存储器、寻址方式、指令操作数、硬件支持的操作种类、指令编码方式目前的观点:根据目标机器的特定需求,在成本、功耗、可用性等约束下最大化机器性能包括ISA,计算机组织(微体系结构),硬件实现8/15/2026中国科学技术大学88/15/2026中国科学技术大学instructionsetsoftwarehardwareISA:aCriticalInterface98/15/2026中国科学技术大学ISA需说明的主要内容MemoryaddressingAddressingmodesTypesandsizesofoperandsOperationsControlflowinstructionsEncodinganISA……优秀的ISA所具有的特征可持续用于很多代机器上(portability)可以适用于多个领域(generality)对上层提供方便的功能(convenientfunctionality)可以由下层有效地实现(efficientimplementation)……108/15/2026中国科学技术大学DigitalAlpha (v1,v3)1992-97HPPA-RISC (v1.1,v2.0) 1986-96SunSparc (v8,v9) 1987-95SGIMIPS (MIPSI,II,III,IV,V) 1986-96Intel(8086,80286,80386, 1978-96
80486,Pentium,MMX,...)指令集结构举例118/15/2026中国科学技术大学指令类型Load/StoreComputationalJumpandBranchFloatingPointcoprocessorMemoryManagementSpecialR0-R31PCHILOOPOPOPrsrtrdsafunctrsrtimmediatejumptarget3种指令格式:all32bitswideRegistersMIPSR3000InstructionSetArchitecture(Summary)J型I型R型128/15/2026中国科学技术大学LogicDesigner'sViewISALevelFUs&Interconnect计算机组成(ComputerOrganizationorMicroarchitecture):ISA的逻辑实现物理机器级中的数据流和控制流的组成以及逻辑设计等计算机实现(ComputerImplementation):计算机组成的物理实现CPU,MEMORY等的物理结构,器件的集成度、速度,模块、插件、底板的划分与连接、信号传输、电源、冷却及整机装配技术等例如确定指令系统中是否有乘法指令(Architecture)确定用加法器实现乘法还是用专门的乘法实现(Organization)器件的选定及所用的微组装技术(Implementation)计算机组成与实现138/15/2026中国科学技术大学ExampleOrganizationTISuperSPARCtmTMS390Z50inSunSPARCstation20BootPROMFloating-pointUnitIntegerUnitInstCacheRefMMUDataCacheStoreBufferBusInterfaceSuperSPARCL2$CCMBusModuleMBusL64852MBuscontrolM-SAdapterSBusDRAMControllerSBusDMASCSIEthernetSTDIOserialkbdmouseaudioRTCFloppySBusCards14体系结构vs.微结构Architecture/InstructionSetArchitecture(ISA)ClassofISA:register-memoryorregister-registerarchitecturesProgrammervisiblestate(RegisterandMemory)AddressingModes:howmemoryaddressesarecomputedDatatypesandsizesforintegerandfloating-pointoperandsInstructions,encoding,andoperationExceptionandInterruptsemanticsMicroarchitecture/OrganizationTradeoffsonhowtoimplementtheISAforspeed,energy,costPipelinewidthanddepth,cachesize,peakpower,buswidth,executionorder,etc8/15/2026中国科学技术大学15计算机体系结构设计者的任务设计和实现不同档次的计算机系统UnderstandsoftwaredemandsUnderstandtechnologytrendsUnderstandarchitecturetrendsUnderstandeconomicsofcomputersystems最大化性能、可编程性等指标在一定的技术和成本的限制下体系结构现状:Today’smicroprocessorsaremultiprocessorsSeveralcoresonasinglechipEachcorecapableofexecutingmultiplethreads中国科学技术大学8/15/2026168/15/2026中国科学技术大学体系结构设计是循环渐进的过程:SearchthepossibledesignspaceMakeselectionsEvaluatetheselectionsmadeBadIdeasCreativityGoodIdeasMediocreIdeasCost/PerformanceAnalysis计算机体系结构设计过程Goodmeasurementtoolsarerequiredtoaccuratelyevaluatetheselection.178/15/2026中国科学技术大学SimulateNewDesignsandOrganizationsTechnologyTrendsEvaluateExistingSystemsforBottlenecksBenchmarksWorkloadsImplementNextGenerationSystemImplementationComplexityAnalysisDesignImple-mentation计算机工程方法学188/15/2026中国科学技术大学课程目标掌握系统定量分析的基本方法和技术深入理解提高CPU性能的基本方法深入理解存储系统的基本原理和优化方法理解数据级并行、线程级并行的基本原理和方法19本课程的主要内容Simplemachinedesign(Chapter1,AppendixA,AppendixC)ISAs,IronLaw,simplepipelinesMemoryhierarchy(Chapter2,AppendixB)DRAM,caches,virtualmemorysystemsComplexpipelining(Chapter3)score-boarding,out-of-orderissueExplicitlyparallelprocessors(Chapter4)vectormachines,VLIWmachines,multithreadedmachinesMultiprocessorarchitectures(Chapter5,Chapter6)memorymodels,cachecoherence,synchronization8/15/2026中国科学技术大学208/15/2026中国科学技术大学为什么学这门课深入理解计算机体系结构:开展体系结构研究与设计的基础TherearestillmanychallengesleftExample:theCPU-memorygap…….更好地设计与实现操作系统、编译器Needtore-evaluatethecurrentassumptionsandtradeoffsExample:gigabitnetworks,Parallelsystems,HeterogeneoussystemsModerncomputersneedbetteroptimizingcompilersandbetterprogramminglanguages更好地设计与实现应用程序Understandtheperformanceimplicationsofalgorithms,datastructures,andprogramminglanguagechoices218/15/2026中国科学技术大学评分规则授课授课总学时60学时,实验30学时3C101:
1(3,4),3(3,4)评分平时作业10%实验30%期中考试25%期终考试35%228/15/2026中国科学技术大学关于作弊作业实验考试(测验)2302/28-review过去的观点:InstructionSetArchitecture(ISA)设计即体系结构设计需要关注并确定:寄存器组织、如何访问存储器、寻址方式、指令操作数、硬件支持的操作种类、指令编码方式目前的观点:根据目标机器的特定需求,在成本、功耗、可用性等约束下最大化机器性能包括ISA,计算机组织(微体系结构),硬件实现8/15/2026中国科学技术大学24Chapter1量化设计与分析基础
1.1引言计算机体系结构的定义计算机的分类现代计算机系统发展趋势1.2定量分析基础8/15/2026中国科学技术大学25ComputingDevicesThen…EDSAC,UniversityofCambridge,UK,19498/15/2026中国科学技术大学268/15/2026中国科学技术大学ComputingSystemsTodayScalable,Reliable,SecureServicesMEMSforSensorNetsInternet
ConnectivityClustersMassiveClusterGigabitEthernetDatabasesInformationCollectionRemoteStorageOnlineGamesCommerce …TheworldisalargeparallelsystemMicroprocessorsineverythingVastinfrastructurebehindthemRobotsRoutersCarsSensor
NetsRefrigerators27CompatibilityCostofsoftwaredevelopmentmakescompatibilityamajorforceinmarket体系结构发展的驱动力ApplicationsTechnologyApplicationssuggesthowtoimprovetechnology,providerevenuetofunddevelopmentImprovedtechnologiesmakenewapplicationspossible8/15/2026中国科学技术大学28计算机系统设计方面的巨大变化在过去的50年,Moore’slaw和Dennardscaling(登纳德缩放比例定律)主宰着芯片产业的发展Moore
1965年预测:晶体管数量随着尺寸缩小按接近平方关系增长(每18个月2X)Dennard
1974年预测:晶体管尺寸变小,功耗会同比变小(相同面积下功耗不变)工艺技术的进步可在不改变软件模型的情况下,持续地提高系统性能/能耗比最近10年间,工艺技术的发展受到了很大制约Dennardscalingover(supplyvoltage~fixed)Moore’sLaw(cost/transistor)over?Energyefficiencyconstrainseverything……功耗问题成为系统结构设计必须考虑的问题软件设计者必须考虑:ParallelsystemsHeterogeneoussystems8/15/2026中国科学技术大学29New“GreatIdeas”8/15/2026中国科学技术大学PersonalMobileDevices30OldMachineStructures8/15/2026中国科学技术大学I/OsystemProcessorCompilerOperatingSystem(MacOSX)Application(ex:browser)DigitalDesignCircuitDesignInstructionSetArchitectureDatapath&ControltransistorsMemoryHardwareSoftwareAssembler31CoreCore…MemoryInput/OutputComputerNew“GreatIdeas”ParallelRequestsAssignedtocomputere.g.,Search“Katz”ParallelThreadsAssignedtocoree.g.,Lookup,AdsParallelInstructions>1instruction@onetimee.g.,5pipelinedinstructionsParallelData>1dataitem@onetimee.g.,Addof4pairsofwordsHardwareDescriptionsAllgatesfunctioninginparallelatsametimeProgrammingLanguages8/15/2026Smart
PhoneWarehouseScaleComputerSoftwareHardwareLeverage
Parallelism&AchieveHigh
PerformanceLogicGates
CacheMemoryCoreInstructionUnit(s)FunctionalUnit(s)A3+B3A2+B2A1+B1A0+B0中国科学技术大学328/15/2026中国科学技术大学WarehouseScaleComputer33计算机的分类8/15/2026中国科学技术大学34Figure1.3Costsroundedtonearest$100,000ofanunavailablesystemareshownbyanalyzingthecostofdowntime(intermsofimmediatelylostrevenue),assumingthreedifferentlevelsofavailability,andthatdowntimeisdistributeduniformly.ThesedataarefromLandstrom(2014)andwerecollectedandanalyzedbyContingencyPlanningResearch.Costofdowntime计算机的分类(续)集群/仓储级计算机(Clusters/WarehouseScaleComputers)100,000’scoresperwarehouseMarketdominatedbyx86-compatibleserverchipsDedicatedapps,pluscloudhostingofvirtualmachinesStartingtoseesomeGPUusage,butmostlygeneral-purposeCPUcodeUsedfor“SoftwareasaService(SaaS)”Sub-class:Supercomputers,emphasis:floating-pointperformanceandfastinternalnetworksEmphasisonavailabilityandprice-performance嵌入式计算机(EmbeddedComputers)Wired/wirelessnetworkinfrastructure,printersConsumerTV/Music/Games/Automotive/Camera/MP3Emphasis:price8/15/2026中国科学技术大学36Figure1.2Asummaryofthefivemainstreamcomputingclassesandtheirsystemcharacteristics.Salesin2015includedabout1.6billionPMDs(90%cellphones),275milliondesktopPCs,and15millionservers.Thetotalnumberofembeddedprocessorssoldwasnearly19billion.Intotal,14.8billionARM-technology-basedchipswereshippedin2015.Notethewiderangeinsystempriceforserversandembeddedsystems,whichgofromUSBkeystonetworkrouters.Forservers,thisrangearisesfromtheneedforverylarge-scalemultiprocessorsystemsforhigh-endtransactionprocessing.五类主流计算系统特点GreatIdeasinComputerArchitectureDesignforMoore’sLawAbstractiontoSimplifyDesignMaketheCommonCaseFastDependabilityviaRedundancyMemoryHierarchyPerformanceviaParallelism/Pipelining/Prediction8/15/2026中国科学技术大学388/15/2026中国科学技术大学Moore’sLaw“CrammingMoreComponentsontoIntegratedCircuits”GordonMoore,Electronics,1965#ontransistorsoncost-effectiveintegratedcircuitdoubleevery18months3939AbstractionviaLayersofRepresentation8/15/2026中国科学技术大学lw $t0,0($2)lw $t1,4($2)sw $t1,0($2)sw $t0,4($2)HighLevelLanguage
Program(e.g.,C)AssemblyLanguageProgram(e.g.,MIPS)MachineLanguageProgram(MIPS)HardwareArchitectureDescription
(e.g.,blockdiagrams)
CompilerAssemblerMachineInterpretationtemp=v[k];v[k]=v[k+1];v[k+1]=temp;00001001110001101010111101011000101011110101100000001001110001101100011010101111010110000000100101011000000010011100011010101111
LogicCircuitDescription
(CircuitSchematicDiagrams)ArchitectureImplementationAnythingcanberepresented
asanumber,
i.e.,dataorinstructions40MaketheCommonCaseFast在进行设计选择时,经常发生的事件优先优化不经常执行的代码意义不大选择一种(性能)度量方式来确定经常性事件(Commoncase)8/15/2026中国科学技术大学CapabilityCapacity41DependabilityviaRedundancy通过冗余使得部分部件失效不影响整个系统的运行8/15/2026中国科学技术大学1+1=21+1=21+1=11+1=22of3agreeFAIL!Increasingtransistordensityreducesthecostofredundancy42MemoryHierarchy8/15/2026中国科学技术大学Fast,Expensive,butSmallCheap,
Large,
butSlow43Parallelism/Pipelining/Prediction8/15/2026中国科学技术大学44中国科学技术大学现代体系结构发展趋势总体发展趋势:并行应用需求计算的需求不断增长,如Scientificcomputing,video,graphics,databases,…工艺发展的趋势芯片的集成度不断提高,但提升的速度在放缓时钟频率的提高在放缓,并有降低的趋势体系结构发展的趋势指令集并行受到制约线程级并行和数据级并行是发展的方向提高单处理器性能花费的代价呈现上升趋势8/15/202645中国科学技术大学ApplicationTrends应用需求驱动硬件技术的发展科学计算
网络服务、移动计算…..硬件技术的发展催生新的应用微处理器的性能随着主频的提升大幅提高对性能的需求推动着并行体系结构的发展FormostdemandingapplicationsNewApplicationsMorePerformance8/15/20264621st
信息通信技术新的应用层出不穷以数据为中心的个性化医疗以计算驱动的科学发现其他应用…..社交网络及分析8/15/2026中国科学技术大学4721st
应用特征大数据未来技术进步的推动力?用户始终在线安全/隐私8/15/2026中国科学技术大学4821世纪体系结构发展面临的挑战8/15/2026中国科学技术大学4921世纪体系结构发展面临的机遇8/15/2026中国科学技术大学50Growthinprocessorperformanceover40years中国科学技术大学Almost10000ximprovementbetween1978and2005Sloweddownbypowerandmemorylatency8/15/202651[Hennessy&Patterson,2017]CloserLookatProcessorTechnology特征尺寸不断减小(featuresize(
)),芯片集成度不断提高CircuitsbecomefasterDiesizeisgrowingtooClockratealsoimproves(butpowerdissipationisaproblem)Numberoftransistorsimproveslike
性能>100×perdecadeClockrateisabout10×(nolongerthecase!)DRAMsizequadruplesevery3years如何使用这些晶体管?Parallelisminprocessing:morefunctionalunitsMultipleoperationspercyclereducesCPI-ClocksPerInstructionLocalityindataaccess:biggercachesAvoidslatencyandreducesCPI,alsoimprovesprocessorutilization8/15/2026中国科学技术大学528/15/2026中国科学技术大学Moore’sLaw“CrammingMoreComponentsontoIntegratedCircuits”GordonMoore,Electronics,1965#ontransistorsoncost-effectiveintegratedcircuitdoubleevery18months53CPUTransistorCount(1971–2008)10-CoreXeonWestmere-EXintroducedin2011has2.6billiontransistorsandusesa32nmprocessonadiesize=512mm28/15/2026中国科学技术大学54StorageTrends内存的容量和性能的提高差别较大Capacityincreasedby1000xfrom1980-95,speedonly2xGigabitDRAMin2008,butgapwithprocessorspeediswidening处理器与存储器之间的Gap在增大NeedtotransfermoredatainparallelNeedcachehierarchies,buthowtoorganizecaches?存储系统需关注并行和局部性问题FetchmorebitsinparallelPipelinedtransferofdata采用缓存和并行技术提高磁盘存储器的性能UsingparalleldiskstoimproveperformanceCachingrecentlyaccesseddata新的存储技术的出现为体系结构设计提供了新的途径8/15/2026中国科学技术大学55GrowthofCapacityperDRAMChipDRAMcapacityquadrupledalmostevery3years60%increaseperyear,for20years8/15/2026中国科学技术大学56ImprovementsinDiskStorage(1983-2003)CDCWrenI,19833600RPM0.03GBytescapacityTracks/Inch:800Bits/Inch:9550Three5.25”platters
Bandwidth:
0.6MBytes/secLatency:48.3msCache:noneSeagate373453,200315000RPM (4X)73.4GBytes (2500X)Tracks/Inch:64000 (80X)Bits/Inch:533,000 (60X)Four2.5”platters
(in3.5”formfactor)Bandwidth:
86MBytes/sec (143X)Latency:5.7ms (8X)Cache:8MBytes8/15/2026中国科学技术大学57DiskLatencyvs.Bandwidth(~20years)PerformanceMilestonesDisk:3600,5400,7200,10000,15000RPMBandwidthimprovement=143XLatencyImprovement=8X8/15/2026中国科学技术大学58MemoryLatencyvsBandwidth(~20years)PerformanceMilestones
MemoryModule: 16bitplainDRAM,PageModeDRAM,32b,64b,SDRAM,
DDRSDRAMBandwidthImprovement=120XLatencyImprovement=4X8/15/2026中国科学技术大学59NetworkLatencyvsBandwidth(~20years)PerformanceMilestones
Ethernet:10Mb/s,100Mb/s,1000Mb/s,10000Mb/sBandwidthImprovement=1000XLatencyImprovement=16X8/15/2026中国科学技术大学60ArchitecturalTrends体系结构将技术的进步转化为系统能力和性能的提升主要解决并行性和局部性的权衡Currentmicroprocessor:1/3compute,1/3cache,1/3off-chipconnectTradeoffsmaychangewithscaleandtechnologyadvances基础元件经历了4代:tube,transistor,IC,VLSIHerefocusonlyonVLSIgenerationVLSI的最大趋势是不断地挖掘并行性8/15/2026中国科学技术大学61Architecture:IncreaseinParallelismBitlevelparallelism(before1985)4-bit→8-bit→16-bitSlowsafter32-bitprocessorsAdoptionof64-bitinlate90s,128-bitandbeyondforvectorprocessingGreatinflectionpointwhen32-bitprocessorandcachefitonachipInstructionLevelParallelism(ILP):Mid80suntillate90sPipeliningandsimpleinstructionsets(RISC)+compileradvancesOn-chipcachesandfunctionalunits=>superscalarexecutionGreatersophistication:outoforderexecutionandhardwarespeculationToday:threadlevelparallelismandchipmultiprocessorsThreadlevelparallelismgoesbeyondinstructionlevelparallelismRunningmultiplethreadsinparallelinsideaprocessorchipFittingmultipleprocessorsandtheirinterconnectonasinglechip8/15/2026中国科学技术大学62HowfarwillILPgo?LimitedILPunderidealsuperscalarexecution:infiniteresourcesandfetchbandwidth,perfectbranchpredictionandrenaming,butrealcache.Atmost4instructionissuepercycle90%ofthetime.8/15/2026中国科学技术大学63Thread-LevelParallelism“onboard”MicroprocessorisabuildingblockforamultiprocessorMakesitnaturaltoconnectmanytosharedmemoryFasterprocessorssaturatebusInterconnectionnetworksareusedinlargerscalesystemsProcProcProcProcMEM8/15/2026中国科学技术大学648/15/2026中国科学技术大学Power&Energy65Power8/15/2026中国科学技术大学Intel80386consumed~2W3.3GHzIntelCorei7consumes130WHeatmustbedissipatedfrom1.5x1.5cmchipThisisthelimitofwhatcanbecooledbyair66LimitingForce:PowerDensity8/15/2026中国科学技术大学67有关体系结构的新旧观念OldConventionalWisdom:Powerisfree,TransistorsexpensiveNewCW:“Powerwall”Powerexpensive,Transistorsfree(Canputmoreonchipthancanaffordtoturnon)OldCW:通过编译、体系结构创新来增加指令级并行(Out-of-order,speculation,VLIW,…)NewCW:“ILPwall”
挖掘指令级并行的收益越来越小OldCW:乘法器速度较慢,访存速度比较快NewCW:“Memorywall”
乘法器速度提升了,访存成为瓶颈
(200clockcyclestoDRAMmemory,4clocksformultiply)OldCW:Uniprocessorperformance2X/1.5yrsNewCW:PowerWall+ILPWall+MemoryWall=BrickWallUniprocessorperformancenow2X/5(?)yrs
Seachangeinchipdesign:multiple“cores”
(2Xprocessorsperchip/~2years)More,simplerprocessorsaremorepowerefficient8/15/2026中国科学技术大学68SeaChangeinChipDesign8/15/2026中国科学技术大学Intel4004(1971):4-bitprocessor,
2312transistors,0.4MHz,
10micronPMOS,11mm2chip
Processoristhenewtransistor?
RISCII(1983):32-bit,5stage
pipeline,40,760transistors,3MHz,
3micronNMOS,60mm2chip125mm2chip,0.065micronCMOS
=2312RISCII+FPU+Icache+DcacheRISCIIshrinksto~0.02mm2at65nmCachesviaDRAMor1transistorSRAM?698/15/2026中国科学技术大学
“Wearededicatingallofourfutureproductdevelopmenttomulticoredesigns.…Thisisaseachangeincomputing”PaulOtellini,President,Intel(2004)Differenceisallmicroprocessorcompanieshaveswitchedtomultiprocessors(AMD,Intel,IBM,Sun;allnewApples2+CPUs)
Procrastinationpenalized:2Xsequentialperf./5yrs
Biggestprogrammingchallenge:from1to2CPUs
70ManyCoreChips:Thefutureishere“ManyCore”referstomanyprocessors/chip64?128?HardtosayexactboundaryHowtoprogramthese?Use2CPUsforvideo/audioUse1forwordprocessor,1forbrowser76forviruschecking???Somethingnewisclearlyneededhere…8/15/2026中国科学技术大学718/15/2026中国科学技术大学TheEndoftheUniprocessorEraSinglebiggestchangeinthehistoryofcomputingsystems——摘自BerkeyleyCS25272Summary计算机体系结构的基本概念ISA+Organization+Implementation本课程将涉及的主要内容简单机器设计(ISA,基本流水线)指令级并行存储系统(Cache,VirtualMemory)复杂流水线(动态指令流调度、动态分支预测)显式并行处理器(向量处理器、VLIW,多线程处理)多处理器结构体系结构设计面临的新问题PowerWall+ILPWall+MemoryWall=BrickWall8/15/2026中国科学技术大学7303/05-review计算机体系结构的基本概念ISA+Organization+Implementation计算机系统个人移动设备(PMD)Emphasisonenergyefficiencyandreal-time桌面计算(DesktopComputing)Emphasisonprice-performance服务器(Servers)Emphasisonavailability,scalability,throughput集群/仓储级计算机(Clusters/WarehouseScaleComputers)
Emphasisonavailabilityandprice-performance嵌入式计算机(EmbeddedComputers)Emphasis:price8/15/2026中国科学技术大学7403/05-review8/15/2026中国科学技术大学758/15/2026中国科学技术大学1.2定量分析技术基础性能的含义CPU性能度量计算机系统性能度量76DefiningCPUPerformanceX比Y性能高的含义是什么?Ferrarivs.SchoolBus?2013Ferrari599GTB
2passengers,11.1secsinquartermile2013TypeDschoolbus54passengers,quartermiletime?
/watch?v=KwyCoQuhUNA
响应时间:e.g.,timetotravel¼mile吞吐率/带宽:e.g.,passenger-miin1hour8/15/2026中国科学技术大学778/15/2026中国科学技术大学Timetodothetask(ExecutionTime)
–executiontime,responsetime,latencyTasksperday,hour,week,sec,ns...(Performance)
–throughput,bandwidth这两者经常会有冲突的。PlaneBoeing747BAD/SudConcordeSpeed610mph1350mphDCtoParis6.5hours3hoursPassengers470132Throughput(pmph)286,700178,200哪个性能高?性能的两种含义788/15/2026中国科学技术大学TimeofConcordvs.Boeing747?Concordis1350mph/610mph=2.2timesfaster=6.5hours/3hoursThroughputofConcordevs.Boeing747?Concordis178,200pmph/286,700pmph=0.62“timesfaster”Boeingis286,700pmph/178,200pmph =1.60“timesfaster”Boeingis1.6times(“60%”)fasterintermsofthroughputConcordis2.2times(“120%”)fasterintermsofflyingtime我们主要关注单个任务的执行时间程序由一组指令构成,指令的吞吐率(Instructionthroughput)非常重要!举例79以时间(Time)度量性能ResponseTime从任务开始到任务完成所经历的时间通常由最终用户观察和测量也称Wall-ClockTimeorElapsedTimeResponseTime=CPUTime+WaitingTime(I/O,scheduling,etc.)CPUExecutionTime指执行程序(指令序列)所花费的时间不包括等待I/O或系统调度的开销可以用秒(msec,µsec,…),或可以用相对值(CPU的时钟周期数(clockcycles))8/15/2026中国科学技术大学80以吞吐率度量性能Throughput=单位时间完成的任务数任务数/小时、事务数/分钟、100Mbits/s缩短任务执行时间可提高吞吐率(throughput)Example:使用更快的处理器执行单个任务时间少⇒单位时间所完成的任务数增加硬件并行可提高吞吐率和响应时间(responsetime)Example:采用多处理器结构多个任务可并行执行,单个任务的执行时间没有减少减少等待时间可缩短响应时间8/15/2026中国科学技术大学818/15/2026中国科学技术大学某程序运行在X系统上X性能是Y的n倍”是指
相对性能828/15/2026中国科学技术大学CPU性能度量Responsetime(elapsedtime):包括完成一个任务所需要的所有时间UserCPUTime(90.7)SystemCPUTime(12.9)ElapsedTime(2:39)例如:unix中的time命令90.7s12.9s2:3965%(90.7/159)83CPU性能公式-CPI8/15/2026中国科学技术大学84不同类型的指令具有不同的CPI8/15/2026中国科学技术大学
858/15/2026中国科学技术大学CPI计算举例BaseMachine(Reg/Reg)Op Freq CPIiCPIi*Fi (%Time)ALU 50% 1 .5 (33%)Load 20% 2 .4 (27%)Store 10% 2 .2 (13%)Branch 20% 2 .4 (27%) 1.5868/15/2026中国科学技术大学
InstCount CPI ClockRateProgram X (X)Compiler X XInst.Set. X X(X)Organization X XTechnology X878/15/2026中国科学技术大学888/15/2026中国科学技术大学假设对机器的部件进行了改进(加速比的概念)
ExTimew/oEPerformancew/ESpeedup(E)==ExTimew/EPerformancew/oE假设可改进部分E在原来的计算时间所占的比例为F,而部件加速比为S,任务的其他部分不受影响,则ExTime(withE)=
((1-F)+F/S)XExTime(withoutE)Speedup(withE)=1/((1-F)+F/S))
重要结论(性能提高的递减原则):如果只针对整个任务的一部分进行优化,那么所获得的加速比不大于1/(1-F)
Amdahl'sLaw898/15/2026中国科学技术大学XBOXOneTheoretic
vs.Real
Performance908/15/2026中国科学技术大学举例假设给定一体系结构硬件不支持乘法运算,乘法需要通过软件来实现。在软件中做一次乘法需要200个周期,而用硬件来实现只要4个时钟周期。如果假设在程序中有10%的乘法操作,问整个程序的加速比?如果有40%的乘法操作,问整个程序的加速比又是多少?假设一计算机在运行给定的一程序时,有90%的时间用于处理某一类特定的计算。现将用于该类计算的部件性能提高到原来的10倍。如果该程序在原来的机器上运行需100秒,那么该程序在改进后的机器上运行时间是多少?新的系统相对于原来的系统加速比是多少?在新的系统中,原来特定的计算占整个计算的比例是多少?918/15/2026中国科学技术大学基本评估方法-市场评估方法MIPS:每秒百万条指令数MIPS=IC/(CPI*IC*T*106)=1/(CPI*T*106)
MIPS依赖于指令集在同一台机器上,MIPS因程序不同而变化,有时差别较大MIPS可能与性能相反举例。在一台load-store型机器上,有一程序优化编译可以使ALU操作减少到原来的50%,其他操作数量不变。F=500MHZALU(43%1)loads(21%2)stores(12%2)Branches(24%2)MFLOPS基于操作而非指令,它可以用来比较两种不同的机器。但MFLOPS也并非可靠,因为不同机器上浮点运算集不同。CRAY-2没有除法指令,Motorola68882有SPEC测试(StandardPerformanceEvaluationCorporation)928/15/2026中国科学技术大学ComputerPerformanceNameFLOPSyottaFLOPS1024zettaFLOPS1021exaFLOPS1018petaFLOPS1015teraFLOPS1012gigaFLOPS109megaFLOPS106kiloFLOPS103938/15/2026中国科学技术大学基本评估方法-benchmark测试五种类型的测试程序(预测的精度逐级下降)真实程序:这是最可靠的方法。修改过的程序:通过修改或改编真实程序来构造基准程序模块。原因:增强移植性或集中测试某种特定的系统性能核心程序(Kernels):由从真实程序中提取的较短但很关键的代码构成。LivermoreLoops及LINPACK是其中使用比较广泛的例子。
小测试程序(toyprograms):一般在100行以内。合成测试程序(Syntheticbenchmarks):首先对大量的应用程序中的操作进行统计,得到各种操作比例,再按这个比例人造出测试程序。Whetstone与Dhrystone是最流行的合成测试程序。
948/15/2026中国科学技术大学基准测试程序套件EmbeddedMicroprocessorBenchmarkConsortium(EEMBC)DesktopBenchmarksSPEC2017SPEC2006SPEC2000SPEC95SPEC92SPEC89ServerBenchmarksProcessorThroughput-orientedbenchmarks(基于SPECCPUbenchmarks->SPECrateSPECSFS,SPECWebTransaction-processing(TP)benchmarks(TPC-A,TPC-C,…)…..StandardPerformanceEvaluationCorporation()95Figure1.17SPEC2017programsandtheevolutionoftheSPECbenchmarksovertime,withintegerprogramsabovethelineandfloating-pointprogramsbelowtheline.Ofthe10SPEC2017integerprograms,5arewritteninC,4inC++.,and1inFortran.Forthefloating-pointprograms,thesplitis3inFortran,2inC++,2inC,and6inmixedC,C++,andFortran.Thefigureshowsall82oftheprogramsinthe1989,1992,1995,2000,2006,and2017releases.Gccistheseniorcitizenofthegroup.Only3integerprogramsand3floating-pointprogramssurvivedthreeormoregenerations.Althoughafewarecarriedoverfromgenerationtogeneration,theversionoftheprogramchangesandeithertheinputorthesizeofthebenchmarkisoftenexpandedtoincreaseitsrunningtimeandtoavoidperturbationinmeasurementordominationoftheexecutiontimebysomefactorotherthanCPUtime.ThebenchmarkdescriptionsontheleftareforSPEC2017onlyanddonotapplytoearlierversions.ProgramsinthesamerowfromdifferentgenerationsofSPECaregenerallynotrelated;forexample,fppppisnotaCFDcodelikebwaves.Figure1.18ActivebenchmarksfromSPECasof2017.8/15/2026中国科学技术大学性能的综合评价算术平均或加权的算术平均SUM(Ti)/n或SUM(Wi×Ti)/n规格化执行时间,采用几何平均SPEC采用这种方法(SPECRatio)98SPEC性能综合8/15/2026中国科学技术大学99几何平均的两个重要特性几何平均的比率等于比率的几何平均几何平均的比率等于性能比率的几何平均与参考机器的选择无关8/15/2026中国科学技术大学100SPECfp2000ExecutionTimes&SPECRatios8/15/2026中国科学技术大学1018/15/2026中国科学技术大学为什么对规格化数采用几何平均?10203/06-review性能度量响应时间(responsetime)吞吐率(Throughput)CPU执行时间=IC×CPI×TCPI(CyclesperInstruction)MIPS=MillionsofInstructionsPerSecondLatencyversusBandwidthLatency指单个任务的执行时间,Bandwidth指单位时间完成的任务量(rate)Latency的提升滞后于带宽的提升(在过去的30年)Amdahl’sLaw用来度量加速比(speedup)性能提升受限于任务中可加速部分所占的比例Benchmarks
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2026学年四川省凉山彝族自治州宁南县四下数学期末调研模拟试题(含答案解析)
- 2026全球减贫促进减贫行业市场现状供需分析及投资评估规划分析研究报告
- 2026日本东京电子商务市场竞争行为法律监管评估规划分析
- 2026深圳智能照明系统需求分析及行业投资策略研究
- 成考历史地理综合试题及答案
- 2026中国跨境电商物流体系优化与全球市场拓展策略
- 2026中国智能物流装备行业市场需求与商业模式创新报告
- 2025-2026学年吉林省延边朝鲜族自治州图们市数学四年级第二学期期中达标测试试题(含解析)
- 2026设计行业风险投资发展分析及投资融资策略研究报告
- 2026日本新材料产业市场研究及行业投资与发展趋势分析
- TCPCIF-《化学品自动化立体仓库设计规范》
- 标准化考场建设投标方案
- 专题37 小作文写作(场景描写、说明文片段、议论性片段、邀请函、演讲词)
- 工程项目监理廉政建设实施细则
- T-GDASE 0042-2024 固定式液压升降装置安全技术规范
- 大棚维修协议合同范本
- 2023年陕西工业职业技术学院专任教师招聘考试真题
- (正式版)JBT 14878-2024 柔性直流换流阀子模块旁路开关
- 专题03 与圆有关的角和圆内接四边形(题型专练)(原卷版)
- 公路工程试验检测机构资质等级及公路工程试验检测实施细则
- (15)-8 桃生物学特性果树栽培学
评论
0/150
提交评论