15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

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.

The opcode statement assigns instruction fields with values. The operand statement specifies how an<br />

instruction’s operand is encoded in an instruction field. The iclass statement describes the assembly<br />

format for an instruction and lists the input and output operands of the instruction. A large set of predefined<br />

instruction fields and operands (used to describe the base Xtensa ISA) can be used directly in<br />

the TIE description. The following example describes two instructions: A4 and S4. These instructions<br />

take two 32-bit operands from the core register file, perform four 8-bit additions and subtractions and<br />

store the result back to the core register file:<br />

© 2002 by CRC Press LLC<br />

opcode A4 op2 = 0 CUST0<br />

opcode S4 op2 = 1 CUST0<br />

iclass RR {A4, S4} {out arr, in ars, in art}<br />

The first two lines define the opcodes for A4 and S4 as sub-opcodes of a previously defined opcode<br />

CUST0 with the addition of field op2 equal to 0 and 1, respectively. The third line makes use of the predefined<br />

register operands arr, ars, and art, and defines two new assembly instructions,<br />

A4 arr, ars, art<br />

S4 arr, ars, art<br />

Customized Datapath<br />

The computational part of an instruction is specified in a TIE reference block. The syntax of a reference<br />

block is very similar to the Verilog hardware description language. The variables used in the reference<br />

block are predefined (if they appear in the iclass statement), or locally declared variables. The<br />

reference block for the A4 and S4 instructions defined in the previous section are shown below,<br />

reference A4 {<br />

}<br />

assign arr = {<br />

ars[31:24] + art[31:24],<br />

ars[32:16] + art[23:16],<br />

ars[15:8] + art[15:8],<br />

ars[7:0] + art[7:0]};<br />

reference S4 {<br />

}<br />

assign arr = {<br />

ars[31:24] - art[31:24],<br />

ars[32:16] - art[23:16],<br />

ars[15:8] - art[15:8],<br />

ars[7:0] - art[7:0]};<br />

The reference description for the two instructions is simple and direct, yet may not result in the best<br />

hardware implementation. For example, the logic for addition and subtraction could be shared between<br />

the two instructions. TIE allows the designer to describe this high-level hardware sharing between<br />

multiple instructions using the semantic block. The semantic block is similar to a reference

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

Saved successfully!

Ooh no, something went wrong!