From cae9e8c62d8f3fd3900bd90148c20c90730324eb Mon Sep 17 00:00:00 2001 From: oharboe Date: Fri, 15 Aug 2008 20:32:50 +0000 Subject: some more docs. --- zpu/docs/zpu_arch.html | 133 ++++++++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 61 deletions(-) diff --git a/zpu/docs/zpu_arch.html b/zpu/docs/zpu_arch.html index 312bdb6..825f0d2 100644 --- a/zpu/docs/zpu_arch.html +++ b/zpu/docs/zpu_arch.html @@ -136,7 +136,6 @@ end if Pop value off stack and store it in the SP+xxxxx*4 memory location, where xxxxx is a positive integer. - Fix! @@ -150,7 +149,7 @@ end if Push value of memory location SP+xxxxx*4, where xxxxx is a positive integer, onto stack. - Fix! + @@ -164,7 +163,7 @@ end if Add value of memory location SP+xxxx*4 to value on top of stack. - Fix! + @@ -175,10 +174,16 @@ end if 001x xxxx - Push PC to stack and set PC to 0x0+xxxxx*32. This is used to emulate opcodes. See zpupgk.vhd for list of emulate opcode values used. zpu_core.vhd contains reference implementations of these instructions rather than letting the ZPU execute the EMULATE instruction + Push PC to stack and set PC to 0x0+xxxxx*32. This is used to emulate opcodes. See + zpupgk.vhd for list of emulate opcode values used. zpu_core.vhd contains + reference implementations of these instructions rather than letting the ZPU execute the EMULATE instruction +

+ One way to improve performance of the ZPU is to implement some of + the EMULATE instructions. + - Fix! + @@ -192,7 +197,7 @@ end if Pushes program counter onto the stack. - Fix! + @@ -206,21 +211,7 @@ end if Pops address off stack and sets PC - Fix! - - - - - LOAD - - - 0000 1000 - - - Pops address stored on stack and loads the value of that address onto stack. - - - Fix! + @@ -233,10 +224,13 @@ end if Pops address stored on stack and loads the value of that address onto stack.

- Bit 0 and 1 of address are always 0. + Bit 0 and 1 of address are always treated as 0(i.e. ignored) by + the HDL implementations and C code is guaranteed by the programming + model never to use 32 bit LOAD on non-32 bit aligned addresses(i.e. + if a program does this, then it has a bug). - Fix! + @@ -249,10 +243,10 @@ end if Pops address, then value from stack and stores the value into the memory location of the address.

- Bit 0 and 1 of address are always 0 + Bit 0 and 1 of address are always treated as 0 - Fix! + @@ -266,7 +260,7 @@ end if Pushes stack pointer. - Fix! + @@ -277,10 +271,10 @@ end if 0000 1101 - Used to allocate/deallocate space on stack for variables or when changing threads. + Pops value off top of stack and sets SP to that value. Used to allocate/deallocate space on stack for variables or when changing threads. - Fix! + @@ -294,7 +288,7 @@ end if Pops two values on stack adds them and pushes the result - Fix! + @@ -308,7 +302,7 @@ end if Pops two values off the stack and does a bitwise-and & pushes the result onto the stack - Fix! + @@ -322,7 +316,7 @@ end if Pops two integers, does a bitwise or and pushes result - Fix! + @@ -337,7 +331,7 @@ end if - Fix! + @@ -348,10 +342,12 @@ end if 0000 1010 - Reverses the bit order of the value on the stack, i.e. abc->cba, 100->001, 110->011, etc. + Reverses the bit order of the value on the stack, i.e. abc->cba, 100->001, 110->011, etc. +

+ The raison d'etre for this instruction is mainly to emulate other instructions. - Fix! + @@ -362,10 +358,11 @@ end if 0000 1011 - No operation, clears IDIM flag as side effect + No operation, clears IDIM flag as side effect, i.e. used between two + consequtive IM instructions to push two values onto the stack. - Fix! + @@ -381,7 +378,7 @@ end if pushIntStack(a+b);
- Fix! + @@ -396,7 +393,7 @@ end if setPc(popIntStack()+getPc()); - Fix! + @@ -412,7 +409,7 @@ end if pushIntStack(b-a);
- Fix! + @@ -426,7 +423,7 @@ end if pushIntStack(popIntStack() ^ popIntStack()); - Fix! + @@ -437,10 +434,13 @@ pushIntStack(popIntStack() ^ popIntStack()); 51 + 8 bit load instruction. Really only here for compatibility with + C programming model. Also it has a big impact on DMIPS test. +

pushIntStack(cpuReadByte(popIntStack())&0xff); - Fix! + @@ -451,12 +451,15 @@ pushIntStack(popIntStack() ^ popIntStack()); 52 + 8 bit store instruction. Really only here for compatibility with + C programming model. Also it has a big impact on DMIPS test. +

addr = popIntStack();
val = popIntStack();
cpuWriteByte(addr, val); - Fix! + @@ -467,10 +470,15 @@ pushIntStack(popIntStack() ^ popIntStack()); 34 + + 16 bit load instruction. Really only here for compatibility with + C programming model. +

+ pushIntStack(cpuReadWord(popIntStack())); - Fix! + @@ -481,12 +489,15 @@ pushIntStack(popIntStack() ^ popIntStack()); 35 + 16 bit store instruction. Really only here for compatibility with + C programming model. +

addr = popIntStack();
val = popIntStack();
cpuWriteWord(addr, val); - Fix! + @@ -503,7 +514,7 @@ addr = popIntStack();
pushIntStack((a < b) ? 1 : 0);
- Fix! + @@ -520,7 +531,7 @@ addr = popIntStack();
pushIntStack((a <= b) ? 1 : 0); - Fix! + @@ -539,7 +550,7 @@ addr = popIntStack();
pushIntStack((a < b) ? 1 : 0); - Fix! + @@ -558,7 +569,7 @@ addr = popIntStack();
pushIntStack((a <= b) ? 1 : 0); - Fix! + @@ -582,7 +593,7 @@ addr = popIntStack();
} - Fix! + @@ -606,7 +617,7 @@ addr = popIntStack();
}
- Fix! + @@ -621,7 +632,7 @@ addr = popIntStack();
pushIntStack(popIntStack() * popIntStack()); - Fix! + @@ -642,7 +653,7 @@ addr = popIntStack();
pushIntStack(a / b);
- Fix! + @@ -663,7 +674,7 @@ addr = popIntStack();
pushIntStack(a % b);
- Fix! + @@ -684,7 +695,7 @@ addr = popIntStack();
pushIntStack(t);
- Fix! + @@ -705,7 +716,7 @@ addr = popIntStack();
pushIntStack(t);
- Fix! + @@ -726,7 +737,7 @@ addr = popIntStack();
- Fix! + @@ -745,7 +756,7 @@ addr = popIntStack();
setPc(address);
- Fix! + @@ -762,7 +773,7 @@ int address = pop();
push(pc + 1);
setPc(address+pc); - Fix! + @@ -776,7 +787,7 @@ int address = pop();
pushIntStack((popIntStack() == popIntStack()) ? 1 : 0); - Fix! + @@ -788,7 +799,7 @@ int address = pop();
pushIntStack((popIntStack() != popIntStack()) ? 1 : 0); - Fix! + @@ -800,7 +811,7 @@ int address = pop();
pushIntStack(-popIntStack()); - Fix! + -- cgit v1.1