Site Tools


documentation:hardware:opera:dsp

Documentation

General Details

  • 16bit words
  • 20bit ALU
  • 20bit accumulator
  • 512 words of “N” memory (iNstruction memory)
  • 256 words of “I” memory (Internal memory)
  • 128 words of “EI” memory (external input memory)
  • 16 words of “EO” memory (external output memory)
  • 13 DMA input channels (from DRAM), buffered by 8 sample deep FIFO
  • 4 DMA output channels (to DRAM)
  • 2 modes: one for audio processing (cyclic) and one for general purpose processing (free-running)

Status Flags

FlagNameDescription
NnegativeSet if the ALU resuilt is negative (the high bit is set).
VoverflowAfter an ALU 'add', set if and only if the signs of the inputs are identical and th esign of the result is different from the signs of the inputs. After an ALU 'subtract', set if and only if the signs of the inputs are opposite and the sign of the result is the same as the sign of the subtrahend.
CcarrySet if the carry result from the ALU is set.
ZzeroSet if the high-order 16 bits of the ALU result are zero.
XexactSet if the low-order four bits of the ALU result are zero.

Instructions

From page 27 of the patent:

Instruction words can either be arithmetic or control instructions. if bit 15 is 0, then the instruction is an arithmetic instruction, and if bit 15 is 1, the instruction is a control instruction.

Formats

Found in Figure 7 on page 95 of patent WO09416383A1.

Descriptions of fields are in the specific sections found below.

Control Instruction Format

1514:131211:109:0
1MODEFLG_SELFLAG_MASKBCH_ADDRESS

Arithmetic Instruction Format

1514:131211:109:87:43:0
0NUM_OPSM2_SELALU_MUX_AALU_MUX_BALUBS

Immediate Operand Format

15141312:0
11JST-FYIMMEDIATE_VAL

Non-Registered Operand Format

1514131211109:0
100XWB1D_IOP_ADDRESS (DIRECT OR INDIRECT)

Registered 1 or 2 Operand Format

15141312111098:543:0
101WB2WB1NUM_RGSR2_D_IR2R1_D_IR1

Registered 3 Operand Format

151413:1098:543:0
0R3_D_IR3R2_D_IR2R1_D_IR1

Control Instructions

Conditional Branch

Inputs for conditional branch are the status flags, mode bits, flag select, and flag mask. The patent includes pseudo code for determining if a branch is to be taken. A_C refers to bit 15 of the instruction.

Md0   = (!MODE1 && !MODE0);
Md1   = (!MODE1 &&  MODE0);
Md2   = ( MODE1 && !MODE0);
Md3   = ( MODE1 &&  MODE.0);
Stat0 = ((FLAG_SELECT && C) || (!FLAG_SELECT && N));
Stat1 = ((FLAG_SELECT && Z) || (!FLAG_SELECT && V));
New_Stat0 = (Stat0 != Md2);
New_Stat1 = (Stat1 != Md2);
tmp_dcare0 = (!FLAG_MASK0 || (FLAG_MASK0 && New_Stat1));
tmp_dcare1 = (!FLAG_MASK1 || (FLAG_MASK1 && New_Stat0));
Really_Dcare = (!FLAG_MASK1 && !FLAG_MASK0);
Md12_Success = (tmp_dcare1 && tmp_dcare0 && (MODE1 != MODE0) && !Really_Dcare);
Super_Duper0 = (A_C && Md1 && !FLAG_SELECT && Really_Dcare);
Super_Duper1 = (A_C && Md1 && FLAG_SELECT && Really_Dcare);
All_Zero = (Super_Duper0 && Z && X);
Not_All_Zero = (Super_Duper1 && !(Z && X));
Sd_Success = (All_Zero || Not_All_Zero);
Nvtest = ((((N != V) || (Z && FLAG_MASK0)) != FLAG_MASK1) && !FLAG_SELECT);
Tmp_Cz = (C && !Z);
Cztest = ((Tmp_Cz != FLAG_MASK0) && FLAG_SELECT && FLAG_MASK1);
Xactest = ((X != FLAG_MASK0) && FLAG_SELECT && FLAG_MASK1);
Md3_Success = ((Nvtest || Cztest || Xactest) && Md3);
Branch = ((Md12_Success || Md3_Success || Sd_Success) && A_C);
ConditionLogic1514131211109:0
1M1M0SFM1FM0BCH_ADDRESS
all zeroX and Z101000
overflowV101001
negativeN101010
negative and overflowN and V101011
not all zero!X or !Z101100
equal to zeroZ101101
carryC101110
carry and zeroC and Z101111
high (unsigned)!X and !Z110000
not overflow!V110001
positive!N110010
negative and overflow both not set!N and !V110011
low or the same (unsigned)X or Z110100
not equal to zero!Z110101
carry clear!C110110
carry and zero both not set!C and !Z110111
less than (signed)(N xor V)111000
less than or equal (signed)(N xor V) or Z111001
greater than or equal (signed)!(N xor V) or Z111010
greater than (signed)!(N xor V) and !Z111011
unsigned overflowC and !Z111100
not unsigned overflow!C or Z111101
exactX111110
not exact!X111111

JUMP

Branch always to BCH_ADDRESS

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKBCH_ADDRESS
100001XXXXXXXXXX

JSR

Jump to subroutine at BCH_ADDRESS; store current PC in SUBR register.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKBCH_ADDRESS
100010XXXXXXXXXX

BFM

Branch from a branch target stream to a new BCH_ADDRESS.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKBCH_ADDRESS
100011XXXXXXXXXX

MOVEREG

Move the following operand to the specified register, director or indirect.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKBCH_ADDRESS
100100XXXXXXXXXX

MOVE

Move the following operand to the specified address, direct or indirect.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKBCH_ADDRESS
100110XXXXXXXXXX

or

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKBCH_ADDRESS
100111XXXXXXXXXX

NOP

No operation

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP-------
100000000-------

BAC

Branch to address indicated by accumulator ACC (13:4)

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP-------
100000001-------

RBASE

Change Register base value that is specified in 5:0 of instruction.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP-RBASE_VAL
100000010-XXXXXX

RMAP

Change register mapping latch to that specified in 2:0 of instruction.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP----RMAP_VAL
100000011----XXX

RTS

Return from subroutine to main instruction sequence. PC = SUBR.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP-------
100000100-------

OP_MASK

Change operand mask bits to those specified in 4:0 of instruction.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP--OPERAND_MASK_VAL
100000101--XXXXX

SLEEP

Wait until reset by underflow output of counter or external reset signal.

1514131211109876543210
A_CMODEFLAG_SELFLAG_MASKSUB_OP-------
100000111-------

Arithmetic Instructions

Format

1514:131211:109:87:43:0
0NUM_OPSM2_SELALU_MUX_AALU_MUX_BALUBS

NUM_OPS

indicate the number of operands which follow the instruction

M2_SEL

indicates whether an ACC/carry word or one of the operands is to be used for the second input of the multiplier

ALU_MUX_A / ALU_MUX_B

indicate which selections should be made by the dual multiplexer in providing operands to the ALU; bits 11:10 (ALU_MUX_A) select the source for 'A' input port of the ALU and bits 9:8 (ALU_MUX_B) select the source for the 'B' in put port of the ALU.

ALU (ASEL)

The ALU function.

ASELTypeFunction
0000arithmeticA
0001arithmetic-B
0010arithmeticA + B
0011arithmeticA + carry
0100arithmeticA - B
0101arithmeticA - borrow
0110arithmeticA + 1
0111arithmeticA - 1
1000logicalA
1001logicalNOT A
1010logicalA AND B
1011logicalA NAND B
1100logicalA OR B
1101logicalA NOR B
1110logicalA XOR B
1111logicalA XNOR B

BS (BSEL)

For all BSELs except 1000, the shift type (arithmetic or logical) is determined by bit 7, which is the same as the high order bit of ASEL. Basically, if the ALU function is arithmetic, so will the shift be arithmetic. If the ALU function is logical, so will the shift be logical. If BSEL = 1000, then an operand is loaded which specifies both the shift type and a new BSEL explicitly. If the newly loaded operand is itself 1000, then the barrel shifter performs a 1-bit left rotate of bits 19:4 with bit 19 being rotated into the carry bit.

The “clip on overflow” function of the barrel shifter essentially prevents the ALU from exceeding the largest positive or negative number which can be represented in 20 bits. In this function, if the overflow (V) output of ALU is set, the barrel shifter will output the largest positive number if the sign bit from the ALU is negative, or the largest negative number if the sign bit from the ALU is positive. Clip on overflow is useful esspecially in digital filter applications.

BSELFunction
0000No shift
0001Left shift 1
0010Left shift 2
0011Left shift 3
0100Left shift 4
0101Left shift 5
0110Left shift 8
0111Clip on overflow
1000Load operand
1001Right shift 16
1010Right shift 8
1011Right shift 5
1100Right shift 4
1101Right shift 3
1110Right shift 2
1111Right shift 1

Immediate Operand

15141312:0
11JST-FYIMMEDIATE_VAL

JST-FY

Justify bit (bit 13) indicates whether the 13bit immediate value is to be left or right justified in the 16bit field. If it is to be left justified, then zeros are added to the right, and if it is to be right justified, then the value is sign extended to the left.

IMMEDIATE_VAL

The value used for the instruction in question.

Non-Registered Operand

1514131211109:0
100XWB1D_IOP_ADDRESS (DIRECT OR INDIRECT)

Registered 1 or 2 Operand

15141312111098:543:0
101WB2WB1NUM_RGSR2_D_IR2R1_D_IR1

Registered 3 Operand

151413:1098:543:0
0R3_D_IR3R2_D_IR2R1_D_IR1

Register Mapping

===Address===Description
0x000 - 0x07Fexternal registers in (EI memory). Read only (by the DSP).
0x080 - 0x0FFMirror of 0x000 - 0x07F.
0x100 - 0x1FFinternal registers (I memory). Read/write (by the DSP)
0x200 - 0x2FFMirror of 0x100 - 0x1FF.
0x300 - 0x3FFexternal registers out (EO memory). Write only (by the DSP).
0x000 - 0x06FCPU coefficient space
0x0D0 - 0x0DEEIFIFO status words
0x0E0 - 0x0E3EOFIFO status words
0x0EAPRNG / pseudo random noise generator (white noise)
0x0EBaudio output status read (including AUDLOCK, LFTFULL, RGTFULL)
0x0ECsemaphore status. Can only be read by either the CPU or DSP. bit 0: the CPU was the last to write to the semaphore data word. bit 1: the DSP was the last to write to the semaphore data word. bit 2: the CPU has acknowledge the current data word. bit 3: the DSP has acknowledge the current data word. When either the CPU or DSP writes to the semaphore data word the DSP automatically sets the correct status bit and clears all others. When either the CPU or the DSP writes to the semaphore ACK address the appropriate ACK bit in the semaphore status register is set.
0x0EDsemaphore data word. Can be read or written to by either CPU or DSP.
0x0EEPC / program counter
0x0EFDSP clock counter value
0x0F0 - 0x0FEinput FIFOs
0x070 - 0x07Eread corresponding input FIFO in 0x0F0 - 0x0FE but without removing the input word from the FIFO
0x300 - 0x30F“quick-out” latches, readable by external CPU
0x3EBwrite AUDLOCK; MSB sets/clears
0x3ECsemaphore ACK
0x3EDsemaphore write
0x3EECPU interrupt register. Any write to this address sends an interrupt to the external CPU; the data written to this address is sent as the interrupt word.
0x3EFDSP clock counter reload value. Writes to this address change the DSP clock counter reload value, but do not reset the clock immediately.This changes the basic cycle time of a program running in the DSP. Only direct writes to this address are effective.
0x3F0 - 0x3F3Output FIFOs, which may be used for audio reverb or data streams.
0x3FDFlush output FIFO. Bits 3:0 flush output FIFOs 3:0 respectively. Forces a DMA request.
0x3FE - 0x3FFLeft and right audio outputs.
documentation/hardware/opera/dsp.txt · Last modified: 2022/10/02 19:41 (external edit)