OpenCores
URL https://opencores.org/ocsvn/zpu/zpu/trunk

Subversion Repositories zpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 64 to Rev 65
    Reverse comparison

Rev 64 → Rev 65

/trunk/zpu/index.html File deleted
/trunk/zpu/docs/images/zpusim.PNG Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
trunk/zpu/docs/images/zpusim.PNG Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/zpu/docs/images/gccgdb.PNG =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/zpu/docs/images/gccgdb.PNG =================================================================== --- trunk/zpu/docs/images/gccgdb.PNG (nonexistent) +++ trunk/zpu/docs/images/gccgdb.PNG (revision 65)
trunk/zpu/docs/images/gccgdb.PNG Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/zpu/docs/zpu_arch.html =================================================================== --- trunk/zpu/docs/zpu_arch.html (revision 64) +++ trunk/zpu/docs/zpu_arch.html (revision 65) @@ -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.

-Start with VHDL synthesis examples +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! + + +

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
    +
    +

    + + +

+ +
-

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 @@

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 @@ 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 Index: trunk/zpu/sw/index.html =================================================================== --- trunk/zpu/sw/index.html (revision 64) +++ trunk/zpu/sw/index.html (nonexistent) @@ -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
    -
    -

    - - - - - Index: trunk/zpu/sw/helloworld/gccgdb.PNG =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/zpu/sw/helloworld/gccgdb.PNG =================================================================== --- trunk/zpu/sw/helloworld/gccgdb.PNG (revision 64) +++ trunk/zpu/sw/helloworld/gccgdb.PNG (nonexistent)

    trunk/zpu/sw/helloworld/gccgdb.PNG Property changes : Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: trunk/zpu/sw/helloworld/zpusim.PNG =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/zpu/sw/helloworld/zpusim.PNG =================================================================== --- trunk/zpu/sw/helloworld/zpusim.PNG (revision 64) +++ trunk/zpu/sw/helloworld/zpusim.PNG (nonexistent)
    trunk/zpu/sw/helloworld/zpusim.PNG Property changes : Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property

    powered by: WebSVN 2.1.0

    © copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.