版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 广西凭祥产业园区管理委员会2026年春季公开招聘辅助岗人员备考题库及答案详解1套
- 广西国际壮医医院2026年(第二批)人才招聘备考题库及一套完整答案详解
- 延安大学2026年人事代理人员招聘备考题库带答案详解
- 2026年机器人集成公司安全管控成果盘点与清查管理制度
- iOS应用开发流程及关键要点
- 雨课堂学堂在线学堂云《Hospitality English(南开)》单元测试考核答案
- 小学科学教学中学习分析技术辅助下的教学干预策略研究教学研究课题报告
- 2025年智能穿戴行业创新报告及可穿戴设备趋势
- 2026年医疗行业远程医疗发展报告及AI医疗技术创新应用报告
- 小学生利用科学探究设计校园节水方案课题报告教学研究课题报告
- 继电保护装置调试作业指导书
- 老同学聚会群主的讲话发言稿
- 国家开放大学最新《监督学》形考任务(1-4)试题解析和答案
- 天然气输气管线阴极保护施工方案
- 高血压问卷调查表
- QC成果提高花岗岩砖铺装质量
- GB/T 25156-2010橡胶塑料注射成型机通用技术条件
- GB/T 25085.3-2020道路车辆汽车电缆第3部分:交流30 V或直流60 V单芯铜导体电缆的尺寸和要求
- GB/T 242-2007金属管扩口试验方法
- GB/T 21776-2008粉末涂料及其涂层的检测标准指南
- 第六单元作文素材:批判与观察 高一语文作文 (统编版必修下册)
评论
0/150
提交评论