計組---指令、中斷、連接、總線、PCI(二)

目錄

Computer Components - Top Level View   計算機組成頂層視圖

Instruction Cycle 指令週期

1)Fetch Cycle

2)Execute Cycle

Example of Program Execution  程序執行示例

Interrupts 中斷

Program Flow Control 程序流程控制

Interrupt Cycle 中斷週期

Multiple Interrupts

Connecting 連接

Buses 總線

Bus Interconnection Scheme 總線互連方案

Physical Realization of Bus Architecture 總線結構的物理實現

總線類型:

Bus Arbitration 總線仲裁

PCI(Peripheral Component Interconnection) Bus 外設組件互連標準


Computer Components - Top Level View   計算機組成頂層視圖

Instruction Cycle 指令週期

Two steps: 1)Fetch 2)Execute

 Halt:停止,暫停

1)Fetch Cycle

程序計數器(Program Counter, PC)存儲要取出的指令的地址;

處理器(Processor)從內存(memory)中取出PC所指向的指令;

指令加載進指令寄存器(Instruction Register, IR);

處理器翻譯指令並執行相應操作

2)Execute Cycle

Processor-memory(處理機-存儲器):Data transfer between CPU and main memory

Processor I/O(處理器輸入輸出):Data transfer between CPU and I/O module

Data processing:Some arithmetic or logical operation on data

Control:Alteration of sequence of operations

Combination of above

Instruction Cycle State Diagram 指令循環狀態圖

 Operand:操作數


Example of Program Execution  程序執行示例

圖中Memory中:

Step1:300~302爲指令存儲的地址 --> 指令加載進IR(指令寄存器);指令300 -> 取出操作數0003

Step2:940~941爲操作數地址 --> 操作數加載進AC

Step3:加載指令301進IR;指令301 -> 取出操作數相加

Step4:取出操作數0002,與0003相加後,結果存儲在AC中

Step5:加載指令302進IR;指令302 -> 將AC中的結果存入941(原操作數0002的地址)

Step6:將結果存入地址941中
 

 

Interrupts 中斷

中斷:其他模塊(例如I/O)可能中斷正常處理順序的機制

Interrupts:Mechanism by which other modules (e.g. I/O) may interrupt normal sequence of processing

Program:overflow / division by zero

Timer(計時器):Generated by internal processor timer(由內部處理器定時器生成 )/ Used in pre-emptive multi-tasking(用於搶佔式多任務處理 )

I/O:from I/O controller

Hardware failure:memory parity error(存儲器奇偶誤差 )

Program Flow Control 程序流程控制

Interrupt Cycle 中斷週期

添加到指令循環中  ->  處理器檢查中斷(用中斷信號表示)  ->  如果沒有中斷,獲取下一條指令  ->  如果中斷未決  ->  暫停執行當前程序  ->  保存上下文 ->  將PC設置爲中斷處理程序的起始地址 ->  進程中斷 ->  恢復上下文並繼續中斷程序 

Instruction Cycle with Interrupts 包含中斷的指令週期

Instruction Cycle with Interrupts -  State Diagram 

Multiple Interrupts

1. Disable Interrupt 禁用中斷

處理器在處理一箇中斷時將忽略其他中斷。 中斷保持未決,並在第一個中斷被處理後進行檢查。中斷按發生的順序進行處理。

2. Define priorities 定義優先級

低優先級的中斷可以被高優先級的中斷所中斷(Low priority interrupts can be interrupted by higher priority interrupts)

當優先級較高的中斷被處理完後,處理器就返回到之前的中斷。

Multiple Interrupts - Sequential                                  Multiple Interrupts – Nested(嵌套)

                 

ISR:中斷服務程序

 

Connecting 連接

 

Buses 總線

總線:連接兩個或多個設備的通信路徑(A communication pathway connecting two or more devices)

Usually broadcast ; Often grouped

Data Bus:

Carries data:Remember that there is no difference between “data” and “instruction” at this level

Width is a key determinant of performance(寬度是性能的關鍵決定因素 ):8, 16, 32, 64 bit

Address Bus:

Identify the source or destination of data:e.g. CPU needs to read an instruction (data) from a given location in memory

Bus width determines maximum memory capacity of system:e.g. 8080 has 16 bit address bus giving 64K address space

Control Bus:

Control and timing information  /  Memory read/write signal  /  Interrupt request  /  Clock signals

Bus Interconnection Scheme 總線互連方案

總線的外觀:電路板上的平行線,帶狀電纜,母板上的帶狀連接器 (例如PCI(周邊元件擴展接口)),成套電線 

Physical Realization of Bus Architecture 總線結構的物理實現

單總線(single bus)存在的問題:

傳播延遲(Propagation delays):長數據路徑意味着總線使用的協調(co-ordination of bus use)會對性能產生不利影響(If aggregate data transfer approaches bus capacity)

大多數系統都使用多總線來克服這種問題

總線類型:

dedicated(專用):分開的數據總線與地址總線 (Separate data & address lines)

Multiplexed(多路複用):Shared lines,Address valid or data valid control line

優點:fewer lines   

缺點:More complex control,Ultimate performance(最大性能)

Bus Arbitration 總線仲裁

多個模塊同時控制總線(如, CPU and DMA(直接存儲器存取) controller)

一次只能有一個模塊可以控制總線,仲裁可以是集中的,也可以是分散的(Arbitration may be centralised or distributed)

Centralised:Single hardware device controlling bus access; May be part of CPU or separate

Distributed:Each module may claim the bus; Control logic on all modules

 

PCI(Peripheral Component Interconnection) Bus 外設組件互連標準

PCI Bus Lines:

(required)

Systems lines:Including clock and reset

Address & Data:32 time mux lines for address/data(用於地址/數據的32time多路複用線路 )

Interrupt & validate lines (中斷和驗證線):Interface Control(接口控制)

Arbitration:Not shared,Direct connection to PCI bus arbiter (直接連接到PCI總線仲裁器)

Error lines

(Optional)

Interrupt lines:Not shared

Cache support (緩存支持)

64-bit Bus Extension (64位總線擴展):Additional 32 lines,Time multiplexed (時間複用),2 lines to enable devices to agree to use 64-bit transfer

JTAG/Boundary Scan (JTAG / 邊界掃描):For testing procedures

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章