From 952bcd56f3b4e412594920ef02d9d740b3ce119a Mon Sep 17 00:00:00 2001 From: oharboe Date: Thu, 21 Aug 2008 21:12:57 +0000 Subject: merging in some docs to zpu_arch.html --- zpu/docs/images/gccgdb.PNG | Bin 0 -> 34473 bytes zpu/docs/images/zpusim.PNG | Bin 0 -> 17817 bytes zpu/docs/zpu_arch.html | 106 +++++++++++++++++++++++++++++++++++++++---- zpu/hdl/index.html | 49 -------------------- zpu/index.html | 20 -------- zpu/sw/helloworld/gccgdb.PNG | Bin 34473 -> 0 bytes zpu/sw/helloworld/zpusim.PNG | Bin 17817 -> 0 bytes zpu/sw/index.html | 44 ------------------ 8 files changed, 98 insertions(+), 121 deletions(-) create mode 100644 zpu/docs/images/gccgdb.PNG create mode 100644 zpu/docs/images/zpusim.PNG delete mode 100644 zpu/hdl/index.html delete mode 100644 zpu/index.html delete mode 100644 zpu/sw/helloworld/gccgdb.PNG delete mode 100644 zpu/sw/helloworld/zpusim.PNG delete mode 100644 zpu/sw/index.html (limited to 'zpu') diff --git a/zpu/docs/images/gccgdb.PNG b/zpu/docs/images/gccgdb.PNG new file mode 100644 index 0000000..afdfc31 Binary files /dev/null and b/zpu/docs/images/gccgdb.PNG differ diff --git a/zpu/docs/images/zpusim.PNG b/zpu/docs/images/zpusim.PNG new file mode 100644 index 0000000..d8fc277 Binary files /dev/null and b/zpu/docs/images/zpusim.PNG differ diff --git a/zpu/docs/zpu_arch.html b/zpu/docs/zpu_arch.html index f6fd8d1..84ccc1a 100644 --- a/zpu/docs/zpu_arch.html +++ b/zpu/docs/zpu_arch.html @@ -2,8 +2,9 @@

Index

- -

Getting started

-The ZPU comes with a few simulation examples. + +
+

Getting started - FPGA

+The simplest version of the ZPU uses BRAM. When getting accustomed to the ZPU, a BRAM ZPU with a UART +is a good place to start. +

+You'll find a working simulation script in hdl/example/simzpu_small.do and hdl/example_medium/simzpu_medium.do, which +show simulation of the small(zpu_core_small.vhd) and medium sized ZPU(zpu_core.vhd). hdl/example/simzpu_interrupt.do +shows use of interrupts. +

+When implementing the ZPU, copy the following files and modify them to your needs: +

    +
  1. hdl/example/zpu_config.vhd - set up RAM size here +
  2. hdl/example/helloworld.vhd - dual port BRAM implementation. +
+Obviously you must also connect the ZPU to the rest of your IO subsystem. IO is memory mapped(read/write) in the ZPU. +

Generating VHDL BRAM initialization

+ + +../install/bin/zpu-elf-objcopy -O binary hello.elf hello.bin
+java -classpath ../simulator/zpusim.jar com.zylin.zpu.simulator.tools.MakeRam hello.bin >hello.bram
+ +
+

Running example simulation

+The hdl/example directory has a simulation written for Xilinx WebPack ModelSim. From the ModelSim command prompt: +
    +
  1. cd c:/<installfolder>/hdl/example +
  2. do zpusim_small.do +
+

+After running the hello world simulation (see zpusim.do), two files are written to the hdl/example directory: +

    +
  1. log.txt - contains the "Hello world!" text written to the debug channel/simplified UART. +
  2. trace.txt - a trace file for the CPU. The instruction set simulator has the capability of taking +this file as input in order to verify that the HDL implementation matches the instruction set simulator. +When a mismatch is found, the GDB debugger will break. Very handy for debugging custom ZPU implementations. +
+

HDL Directories & files

+ + +The HDL files need a bit of spit and polish! + +
+

Getting started - software

+The ZPU comes with a standard GCC toolchain and an instruction set simulator. This allows compiling, running & debugging simple test programs. The Simulator has +some very basic peripherals defined: counter, timer interrupt and a debug output port. +

Installing

+
    +
  1. Install Cygwin. http://www.cygwin.com +
  2. Install Java +
  3. Start Cygwin bash +
  4. cd zpu/sw +
  5. sh setup.sh +
  6. /tmp/zpu/install/bin now has the .exe files for the GCC toolchain & GDB +
  7. Optionally you may set up PATH variables to point to /tmp/zpu/install/bin
    +source env.sh +
+

Hello world example

+The ZPU toolchain comes with newlib & libstdc++ support which means that many C/C++ programs can be compiled without modification. +

+ +cd zpu/sw/helloworld
+../install/bin/zpu-elf-gcc -phi hello.c -o hello.elf
+
+

Running the hello world example in GDB

+
    +
  1. cd zpu/sw/helloworld +
  2. Launch the simulator from a seperate bash shell:

    +java -classpath ../simulator/zpusim.jar -Xmx512m com.zylin.zpu.simulator.Phi 4444 +

    + +

  3. Launch GDB:

    +../install/bin/zpu-elf-gdb hello.elf +

  4. Connect to target, load and run application:

    + +(gdb) target remote localhost:4444
    +(gdb) load
    +(gdb) continue
    +

    -Start with VHDL synthesis examples + + +

+ + -

Introduction

+

Architecture introduction

The ZPU is a zero operand, or stack based CPU. The opcodes have a fixed width of 8 bits.

Example: @@ -893,7 +980,8 @@ the right choices w.r.t. optimisation for your application.

Phi memory map

The ZPU architecture does not define a memory map as such, but the GCC + libgloss + ecos hal library uses the -memory map below. +memory map below. "Phi" is just a three letter word for the particular memory layout below that came about +while developing the ZPU.

@@ -1387,5 +1475,7 @@ For this to make sense, the performance must hit 20 DMIPS w/DRAM & cache. This ZPU could run a TCP/IP stack with relevant performance to compete with stripped down ARM7 type systems. + + \ No newline at end of file diff --git a/zpu/hdl/index.html b/zpu/hdl/index.html deleted file mode 100644 index e206113..0000000 --- a/zpu/hdl/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - -

Getting started - FPGA

-The simplest version of the ZPU uses BRAM. When getting accustomed to the ZPU, a BRAM ZPU with a UART -is a good place to start. -

-You'll find a working simulation script in hdl/example/simzpu_small.do and hdl/example_medium/simzpu_medium.do, which -show simulation of the small(zpu_core_small.vhd) and medium sized ZPU(zpu_core.vhd). hdl/example/simzpu_interrupt.do -shows use of interrupts. -

-When implementing the ZPU, copy the following files and modify them to your needs: -

    -
  1. hdl/example/zpu_config.vhd - set up RAM size here -
  2. hdl/example/helloworld.vhd - dual port BRAM implementation. -
-Obviously you must also connect the ZPU to the rest of your IO subsystem. IO is memory mapped(read/write) in the ZPU. -

Generating VHDL BRAM initialization

- - -../install/bin/zpu-elf-objcopy -O binary hello.elf hello.bin
-java -classpath ../simulator/zpusim.jar com.zylin.zpu.simulator.tools.MakeRam hello.bin >hello.bram
- -
-

Running example simulation

-The hdl/example directory has a simulation written for Xilinx WebPack ModelSim. From the ModelSim command prompt: -
    -
  1. cd c:/<installfolder>/hdl/example -
  2. do zpusim_small.do -
-

-After running the hello world simulation (see zpusim.do), two files are written to the hdl/example directory: -

    -
  1. log.txt - contains the "Hello world!" text written to the debug channel/simplified UART. -
  2. trace.txt - a trace file for the CPU. The instruction set simulator has the capability of taking -this file as input in order to verify that the HDL implementation matches the instruction set simulator. -When a mismatch is found, the GDB debugger will break. Very handy for debugging custom ZPU implementations. -
-

HDL Directories & files

-
    -
  • example - contains example files & working ZPU. Start here. -
  • wishbone - contains wishbone interface for the ZPU -
  • zpu3 - if you are interested in developing ZPU cores and not only using them, then this directory contains various stuff of more or less historical interest. -
  • zpu4 - if you are interested in developing ZPU cores and not only using them, then this is the active development version. You'll also want to copy out the -files you need from this folder to your own project. -
- -The HDL files need a bit of spit and polish! - - diff --git a/zpu/index.html b/zpu/index.html deleted file mode 100644 index 7343ab6..0000000 --- a/zpu/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - -

Getting started

-FPGA: check out zpu/hdl, read zpu/hdl/index.html -

-Software: check out zpu/sw, read zpu/sw/index.html -

-Docs: start with ZPU architecture doc -

Other directories

-You probably don't need or want to download other directories. -
    -
  • -gccsrc - the complete GCC toolchain source. Big! Almost certainly not something you need or want to download. This has been moved to /trunk/zpugccsrc to -avoid subversion choking. -
  • roadshow - various bits and bobs to demonstrate the ZPU that has not been sorted/reorganized yet. - -
- - - diff --git a/zpu/sw/helloworld/gccgdb.PNG b/zpu/sw/helloworld/gccgdb.PNG deleted file mode 100644 index afdfc31..0000000 Binary files a/zpu/sw/helloworld/gccgdb.PNG and /dev/null differ diff --git a/zpu/sw/helloworld/zpusim.PNG b/zpu/sw/helloworld/zpusim.PNG deleted file mode 100644 index d8fc277..0000000 Binary files a/zpu/sw/helloworld/zpusim.PNG and /dev/null differ diff --git a/zpu/sw/index.html b/zpu/sw/index.html deleted file mode 100644 index fd0a1b4..0000000 --- a/zpu/sw/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - -

Getting started - a ZPU hello world program

-The ZPU comes with a standard GCC toolchain and an instruction set simulator. This allows compiling, running & debugging simple test programs. The Simulator has -some very basic peripherals defined: counter, timer interrupt and a debug output port. -

Installing

-
    -
  1. Install Cygwin. http://www.cygwin.com -
  2. Install Java -
  3. Start Cygwin bash -
  4. cd zpu/sw -
  5. sh setup.sh -
  6. /tmp/zpu/install/bin now has the .exe files for the GCC toolchain & GDB -
  7. Optionally you may set up PATH variables to point to /tmp/zpu/install/bin
    -source env.sh -
-

Hello world example

-The ZPU toolchain comes with newlib & libstdc++ support which means that many C/C++ programs can be compiled without modification. -

- -cd zpu/sw/helloworld
-../install/bin/zpu-elf-gcc -phi hello.c -o hello.elf
-
-

Running the hello world example in GDB

-
    -
  1. cd zpu/sw/helloworld -
  2. Launch the simulator from a seperate bash shell:

    -java -classpath ../simulator/zpusim.jar -Xmx512m com.zylin.zpu.simulator.Phi 4444 -

    - -

  3. Launch GDB:

    -../install/bin/zpu-elf-gdb hello.elf -

  4. Connect to target, load and run application:

    - -(gdb) target remote localhost:4444
    -(gdb) load
    -(gdb) continue
    -
    -

    - - - - - -- cgit v1.1