您的位置:首页 > 其它

Arm 学习笔记 第二章: ARM Processor Fundamentals

2010-10-20 08:43 190 查看
Difference between Von Neumann implementation & Harvard implementation of ARM
Von Neumann implementation: data items and instructions share the same bus.
Harvard implementations: it uses two different buses.

Load-store architecture:
Load : memory-----(load instructions copy data)------->registers in core
Store: registers----(store instructions copy data)------>memory
There are no data processing instructions that directly manipulate data in memory.

Register:
There are 18 active registers available in user mode, 16 data registers(r0~r15) and 2 processor status registers(cpsr,spsr).
r0~r12 are general purpose registers,
r13 is stack pointer(sp),
r14 is link register(lr,store the reture address when a subroutine is called),
r15 is program counter(pc, contains the address of the next instruction to be feteched.)
sometimes r13 and 14 can be used as general-purpose registers, but using r13 is dangerous.
In ARM state r0~r13 are orthogonal: any instructions that you can apply to r0 you can equally well apply to any of the other registers(r1~r13).

Structure of psr:

N Z C V (j) I F T mode
31 30 29 28 ----24----------------------- 7 6 5 4----0

condition flag:
N-Negative: bit 31 of the result is a binary 1
Z-Zero: the result is 0, 常用於indicate equality
C-Carry: an unsigned carry happens in the result
V-Overflow: signed overflow happens
I: Interrupt request
F: Fast inturrupt request

Six privileged Modes
abort: when there is a failed attempt to access memory.
fast interrupt: 略
interrupt request: 略
supervisor: is the mode that the processor is in after reset and is the mode that an OS kernel operates in.
system: a special version of user mode that allow full read-write access to cpsr.
undefined:
Nonprivileged mode
user: 略

Interrput Masks
used to stop specific interrput requests from interrupting the processor.
bit 7 and 6 (or I and F) are controlling the masking of IRQ and FIQ. When I bit is set to 1 IRQ is masked. So does F.

Conditional execution:
Conditional execution controls whether or not the core will execute the instruction.
The condition attribute is postfixed to the instruction mnemonic, which is encoded into the instruction. When a condition mnemonic is not present, the defalt behavior is to set it to always execute.

Pipeline:
Using a pipeline speeds up execution by fetching the next instruction while other instructions are being decoded and executed.

Pipeline executing characteristics:
1. The pipeline has not processed an instruction until it passes completely through the execute stage.
2. Program counter(ps) alway points to the address of the instruction plus 8bytes (or plus two instructions ahead),因為它指的是下一條要取的指令. In Thumb state, it pluses 4bytes.
3. The execution of a branch instruction or branching by direct modification of pc causes the core to flush its pipeline.
4. ARM10 uses branch protection by predicting possible branches.
5. an instruction in the execute stage will complete eventhough an interrupt has been raised.

Exceptions, Interrupts and the vector table:
When an exception or interrupt occurs, the processor set the pc to a specific memory address which is called the vector table. The entries of this are instructions that brach to specific routines designed to handle a particular exception or interrupt.

There are 3 hardware extensions of core:
1.Cache and tightly coupled memory(TCM)
2.Memory management: 1)no extensions 2)Memory protection unit(MPU) provides limited protection 3)Memory management unit(MMU) providing full protection.
3.Coprocessor interface: A coprocessor extends the processing features of a core by extending the instruciton set or by providing configuration registers.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: