版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1Embedded System Architecture lecture 09-Processor(1)_stagesJun WANG2ContentsOperation fieldStorage and accessOperationsTop-view and block diagramVerilog for stagesDesign targetRISC CPUData path 16bData memory28 X 16bOperation memory:28 X 16bSize of operation set: 25General register8 X 16bFlagsNF, Z
2、F, CFControl Clock, reset, enable, startTesting4 bit selection for 16 bit output34Operation field5Access memory and registerAccess register:Ex. grr1, r1 for simplificationr1/r1gets register numberAccess memory:Ex. mr2+val3, r2+val3/gr(r2)+val3 gets address of memoryAccess immediate data:Ex. val2, va
3、l3,MSB: val2, LSB:val3An example of operation codes (assemble language) LOAD gr1, gr0, 0LOAD gr2, gr0, 1NOPNOPNOPADD gr3, gr1, gr2NOPNOPNOPSTORE gr3, gr0, 2HALT6In C code:Y = A + BMgr0+2 =Mgr0+1+Mgr0+07OperationData transfer & Arithmeticmnemonicoperand1operand2operand3op codeoperationNOP *00000no op
4、erationHALT *00001haltLOAD *r1r2val300010grr1-mr2+val3STORE *r1r2val300011mr2+val3-r1LDIHr1val2val310000r1-r1+val2, val3, 0000_0000 (lower 8b0 can be given with ADDI)ADD *r1r2r301000r1-r2+r3ADDIr1val2val301001r1-r1+val2, val3ADDCr1r2r310001r1-r2+r3+CFSUBSUBISUBCCMP *r2r301100r2-r3; set CF,ZF and NF*
5、: operations have been implemented in the following verilog8OperationLogical / shiftmnemonicoperand 1operand2operand3op codeoperationANDr1r2r301101r1-r2 and r3ORXORSLLr1r2val300100r1-r2 shift left logical (val3 bit shift)SRLSLAr1r2val300101r1-r2 shift left arithmetical (val3 bit shift)SRALogical shi
6、ft: 1001 SRL 2b 0010 (append 0)Arithmetical shift: 1001 SRA 2b 1110 (keep the sign)9OperationControlmnemonicoperand 1operand2operand3op codeoperationJUMPval2val311000jump to val2, val3JMPRr1val2val311001jump to r1+val2, val3BZ *r1val2val311010if ZF=1 branch to r1+val2, val3BNZr1val2val311011if ZF=0
7、branch to r1+val2, val3BN *r1val2val311100if NF=1 branch to r1+val2, val3BNNBCr1val2val311110if CF=1 branch to r1+val2, val3BNCFlag registers: -Used for control operations (conditional branch) -ZF (zero flag), NF (negative flag), CF (carry flag)10Block diagramsmdr: data for save memory directly Use
8、LOAD, STORE, ADD, BZ to help you understand this graph11Top view12StorageOutside CPUInstruction storageInstruction memory (25 X 16b)Data storageData memory (28 X 16b)Inside CPUInstruction storageStage instruction registersid_ir(16b x1), ex_ir (16b x 1), mem_ir (16b x 1), wb_ir (16b x 1)Data storageG
9、eneral registersStorage for operand data (23 X 16b) Stage data registers ID: reg_A (16b x 1), reg_B (16b x 1), smdr (16b x 1), EX : reg_C (16b x 1), flag (1b x3), dw (1b x1), smdr1 (16b x 1), WB: reg_C1 (16b x 1)13CPU control14IF15IDoperand1: r1operand2: r2operand3: r3operand2,3: val2+val3operand3:
10、val3reg_A: 1st input operand of ALU, always grreg_B: 2nd input operand of ALU, gr or valsmdr: used only for STORE Note latch!EXNote latch !MEMWBNote latch !Example of test pattern (texture simulation)LOAD gr1, gr0, 0LOAD gr2, gr0, 1NOPNOPNOPADD gr3, gr1, gr2NOPNOPNOPSTORE gr3, gr0, 2HALTSimulation r
11、esults (texture)Please test by yourself, and analyse itLOAD gr1, gr0, 0LOAD gr2, gr0, 1NOPNOPNOPADD gr3, gr1, gr2NOPNOPNOPSTORE gr3, gr0, 2HALTresetLabs1, Complete the designs aboveComplete the verilog with variable declarationsSimulate by the test pattern (texture simulation)2, Add more to your ver
12、ilogComplete the left operations other than * onesLDIH, ADDI,ADDC, Add flag registerCFAdd your original operationsYou can add up to 5 ops with unused codes: 10011, 10100, 10101, 10110, 10111.Design you own test patternsSubmit your report due to Dec 18thYour own operation set description (like the ta
13、ble in slide#7/8/9), verilog, testbenchsnapshot of simulation (texture only), RTL snapshots, design report (timing/area/power). Note: no board verificationImpression (感想) on this projectHazardsSituations that prevent starting the next instruction in the next cycleStructure hazardsA required resource
14、 is busyData hazardNeed to wait for previous instruction to complete its data read/writeControl hazardDeciding on control action depends on previous instructionStructure HazardsConflict for use of a resourceIn X86(by intel) pipeline with a single memoryLoad/store requires data accessInstruction fetch would have to stall for that cycleWould cause a pipeline “bubble”So called von Neumann structureIn ARM/MIPS pipelineseparate instruction/data cachesSo called von Harvard structureData HazardsAn instruction depends on completion o
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年临时搬运合同
- 2024年度某新能源汽车制造技术许可合同
- 2024年度文化娱乐活动策划合同
- 2024年广播剧配音委托合同
- 2024年建筑工程地面建设合同
- 企业普通员工年终个人工作总结
- 2024年度风力发电设备安装合同
- 节能宣传课件教学课件
- 2024医疗机构人力资源共享与培训合同
- 2024年度碎石料供需合同
- 护士与医生的合作与沟通
- GB 42295-2022电动自行车电气安全要求
- 产品系统设计开发 课件 第4、5章 产品系统设计类型、产品系统设计开发综合案例
- 1编译原理及实现课后题及答案
- 焊接材料的质量控制和追溯规范
- 让阅读成为习惯家长会课件
- 家庭健康照护服务方案
- 施工方案 谁编
- 沪教牛津版八上英语Unit-6-单元完整课件
- 新能源及多能互补互补技术
- 混凝土搅拌站安装及拆除方案
评论
0/150
提交评论