17.11.2012 Views

Soft-Core Processor Design - CiteSeer

Soft-Core Processor Design - CiteSeer

Soft-Core Processor Design - CiteSeer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

esult of a read operation from these registers is undefined. Other control registers include CPU<br />

ID (%ctl6) which identifies the version of the Altera Nios processor, and several reserved<br />

registers whose function is not defined in the documentation [22,23]. The 32-bit Altera Nios also<br />

has control registers ICACHE (%ctl5) and DCACHE (%ctl7), used to invalidate cache lines in<br />

the instruction and data caches, respectively. Both ICACHE and DCACHE are write-only<br />

registers. Reading these registers produces an undefined value.<br />

Control registers can be directly read and written to by using instructions RDCTL and<br />

WRCTL, respectively. Control registers can also be modified implicitly as a result of other<br />

operations. Condition code flags are updated by arithmetic and logic instructions depending on<br />

the result of their operation. Fields IPRI and IE bit in the STATUS register are modified, and the<br />

old value of the STATUS is stored to the ISTATUS register when the interrupt occurs.<br />

The register set also includes the program counter (PC) and the K register. The program<br />

counter holds the address of the instruction that is being executed. K is an 11-bit register used to<br />

form longer immediate operands. Since both 16- and 32-bit Nios have an instruction word that is<br />

16-bits wide, it is not possible to fit a 16-bit immediate operand into the instruction word. The<br />

16-bit immediate value is formed by concatenating the 11-bit value in the K register with the 5-bit<br />

immediate operand from the instruction word. The K register is set to 0 by any instruction other<br />

than PFX, which is used to load the K register with the 11-bit immediate value specified in the<br />

instruction word. The PFX instruction and the instruction following it are executed atomically.<br />

Interrupts are disabled until the instruction following the PFX commits. The PFXIO instruction is<br />

available only in the 32-bit Altera Nios; it behaves just like the PFX instruction except that it<br />

forces the subsequent memory load operation to bypass the data cache.<br />

3.1.2. Nios Instruction Set<br />

The Nios instruction set is optimized for embedded applications [33]. To reduce the code size,<br />

all instruction words are 16-bits wide in both 16- and 32-bit Nios architectures. Previous research<br />

on other architectures has shown that using the 16-bit instruction width can produce up to 40%<br />

reduction in code size compared to the 32-bits wide instruction word [34]. Nios is a load-store<br />

architecture with the two-operand instruction format and 32 addressable general-purpose<br />

registers. More than ten different instruction formats exist to accommodate the addressing modes<br />

available.<br />

The Nios instruction set supports several addressing modes, including 5/16-bit immediate,<br />

register, register indirect, register indirect with offset, and relative mode. Many arithmetic and<br />

logic instructions use 5-bit immediate operands specified in the instruction word. If such an<br />

15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!