




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 美术课件中的各种职业
- 美术技能装饰画课件图片
- 纺织行业消防安全管理规定(试行)
- 安全风险大讨论心得体会
- 安全技术管理论文
- 工程质量事故分析报告
- 配备专兼职安全生产管理人员
- 电力设施安全防范系统技术规范
- 安全生产管理建立什么机制
- 安全生产管理制度的红头文件
- (高清版)DZT 0275.1-2015 岩矿鉴定技术规范 第1部分:总则及一般规定
- 2024十八项医疗核心制度必考试题库及答案
- 广汽传祺M8领秀版说明书
- 梯度压力袜用于静脉血栓栓塞症防治专家共识
- 小学四年级英语下册期中试卷分析3篇
- 来料检验规范
- 小学科学实验报告单空表
- 酒店流水单模板
- 税务行政处罚文书(标准版)
- 2023-2024学年辽宁省大连市小学语文五年级期末评估试卷附参考答案和详细解析
- 2023年小学数学必背定义和公式
评论
0/150
提交评论