




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 旅行學(xué)習(xí)與研學(xué)活動(dòng)安排計(jì)劃
- 社會(huì)實(shí)踐小班社區(qū)活動(dòng)的開展計(jì)劃
- 人力資源的發(fā)展與管理計(jì)劃
- 2025年企業(yè)管理服務(wù)項(xiàng)目建議書
- 2025年白喉、百日咳、破傷風(fēng)、乙肝四聯(lián)制劑合作協(xié)議書
- 跨國業(yè)務(wù)數(shù)據(jù)轉(zhuǎn)換合規(guī)指南
- 基于人工智能的智能家居設(shè)計(jì)合作協(xié)議
- 服裝設(shè)計(jì)行業(yè)服裝設(shè)計(jì)版權(quán)協(xié)議
- 2025年抗帕金森病藥項(xiàng)目建議書
- Pipemidic-acid-trihydrate-Standard-生命科學(xué)試劑-MCE
- 2023-2024學(xué)年統(tǒng)編版高中語文選擇性必修下冊(cè)古詩詞誦讀《客至》課件
- 城市道路施工作業(yè)區(qū)規(guī)范資料匯編
- JBT 6697-2023 農(nóng)林拖拉機(jī)和機(jī)械 電氣設(shè)備 基本技術(shù)規(guī)范 (正式版)
- 冀人版科學(xué)六年級(jí)下冊(cè)全冊(cè)同步練習(xí)
- 2024年注冊(cè)安全工程師考試題庫及參考答案【完整版】
- 府谷縣飛馬梁煤礦礦山地質(zhì)環(huán)境保護(hù)與土地復(fù)墾方案
- 2024年中國科學(xué)技術(shù)大學(xué)少年創(chuàng)新班數(shù)學(xué)試題真題(答案詳解)
- 衛(wèi)生院藥房工作計(jì)劃
- 國家基本基藥培訓(xùn)課件
- 部編版小學(xué)語文一年級(jí)下冊(cè)第一單元教材解讀分析
- 2024年新疆維吾爾自治區(qū)成考(專升本)大學(xué)政治考試真題含解析
評(píng)論
0/150
提交評(píng)論