ISA: The Hardware – Software Interface

99 downloads 93 Views 363KB Size Report
Inf3 Computer Architecture - 2011-2012. 1. ISA: The Hardware – Software Interface. ▫ Instruction Set Architecture (ISA) is where software meets hardware.
ISA: The Hardware – Software Interface   Instruction Set Architecture (ISA) is where software meets hardware –  In embedded systems, this boundary is often flexible –  Understanding of ISA design is therefore important

  Instruction Set Definition –  Operands: int32, uint32, int16, uint16, int8, uint8, float32, float64 –  Operations: four major types        

Operator functions (add, shift, xor, mul, etc) Memory access (load-word, store-byte, etc) Control transfer (branch, jump, call, return, etc) Privileged, and miscellaneous instructions (not generated by compiler)

  Good understanding of compiler translation is essential

Inf3 Computer Architecture - 2011-2012

1

ISA Design Considerations

  Simple target for compilers   Support for OS and HLL features   Support for important data types (floating-point, vectors)   Code size   Impact on execution efficiency (especially with pipelining)   Backwards compatibility with legacy processors   Provision for extensions

Inf3 Computer Architecture - 2011-2012

2

CISC vs RISC   CISC –  Assembly programming  HLL features as instruction –  Small # registers, memory not that slow  memory operands –  Code size must be small  variable length –  Backward compatibility  complexity increases

  RISC –  Compilers  Simple instructions –  Large # registers, memory much slower than processor  load store architecture –  Simple and fast decoding  fixed length, fixed format

Inf3 Computer Architecture - 2011-2012

3

Operators and their Instructions

  Integer Arithmetic + * / %

add sub mul div rem

  Relational < >= == !=

slt, sle, sgt, sge, seq sne

sltu sleu sgtu sgeu

C operator

Comparison

Reverse

Branch

==

seq

0

bnez

!=

seq

0

beqz


=

slt, sltu

0

beqz

>

slt, sltu

1

bnez

> >>
2

addi

$1, $2, -10

addi

$2

$1

0xfff6

16
bits
 immediate
value/addr


Inf3 Computer Architecture - 2011-2012

address offset

17

MIPS J-type instruction format 6
bits
 opcode


call func

26
bits
 address


call

absolute func address >> 2

Inf3 Computer Architecture - 2011-2012

18

ISA Guidelines

  Regularity: operations, data types, addressing modes, and registers should be independent (orthogonal)   Primitives, not solutions: do not attempt to match HLL constructs with special IS instructions   Simplify tradeoffs: make it easy for compiler to make choices based on estimated performance

Inf3 Computer Architecture - 2011-2012

19

Suggest Documents