All Projects → ZipCPU → Zipcpu

ZipCPU / Zipcpu

A small, light weight, RISC CPU soft core

Projects that are alternatives of or similar to Zipcpu

Biriscv
32-bit Superscalar RISC-V CPU
Stars: ✭ 208 (-67.5%)
Mutual labels:  verilog, fpga, cpu
Mips Cpu
A MIPS CPU implemented in Verilog
Stars: ✭ 38 (-94.06%)
Mutual labels:  verilog, fpga, cpu
Riscv
RISC-V CPU Core (RV32IM)
Stars: ✭ 272 (-57.5%)
Mutual labels:  verilog, fpga, cpu
Vexriscv
A FPGA friendly 32 bit RISC-V CPU implementation
Stars: ✭ 1,041 (+62.66%)
Mutual labels:  verilog, fpga, cpu
J1sc
A reimplementation of a tiny stack CPU
Stars: ✭ 64 (-90%)
Mutual labels:  verilog, fpga, cpu
Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+65.94%)
Mutual labels:  verilog, fpga, cpu
Hrm Cpu
Human Resource Machine - CPU Design #HRM
Stars: ✭ 43 (-93.28%)
Mutual labels:  verilog, fpga, cpu
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (-87.97%)
Mutual labels:  verilog, fpga, cpu
kianRiscV
KianRISC-V! No RISC-V, no fun! RISC-V CPU with strong design rules and unittested! CPU you can trust! kianv rv32im risc-v a hdmi soc with harris computer architecture in verilog: multicycle, singlecycle and 5-stage pipelining Processor. Multicycle Soc with firmware that runs raytracer, mandelbrot, 3d hdmi gfx, dma controller, etc.....
Stars: ✭ 167 (-73.91%)
Mutual labels:  cpu, fpga, verilog
Cores
Various HDL (Verilog) IP Cores
Stars: ✭ 271 (-57.66%)
Mutual labels:  verilog, fpga
Icezum
🌟 IceZUM Alhambra: an Arduino-like Open FPGA electronic board
Stars: ✭ 280 (-56.25%)
Mutual labels:  verilog, fpga
Platformio Core
PlatformIO is a professional collaborative platform for embedded development 👽 A place where Developers and Teams have true Freedom! No more vendor lock-in!
Stars: ✭ 5,539 (+765.47%)
Mutual labels:  verilog, fpga
Edalize
An abstraction library for interfacing EDA tools
Stars: ✭ 270 (-57.81%)
Mutual labels:  verilog, fpga
Openpiton
The OpenPiton Platform
Stars: ✭ 282 (-55.94%)
Mutual labels:  verilog, fpga
Fake-SDcard
Imitate SDcard using FPGAs.
Stars: ✭ 26 (-95.94%)
Mutual labels:  fpga, verilog
Beagle sdr gps
KiwiSDR: BeagleBone web-accessible shortwave receiver and software-defined GPS
Stars: ✭ 300 (-53.12%)
Mutual labels:  verilog, fpga
Reduceron
FPGA Haskell machine with game changing performance. Reduceron is Matthew Naylor, Colin Runciman and Jason Reich's high performance FPGA softcore for running lazy functional programs, including hardware garbage collection. Reduceron has been implemented on various FPGAs with clock frequency ranging from 60 to 150 MHz depending on the FPGA. A high degree of parallelism allows Reduceron to implement graph evaluation very efficiently. This fork aims to continue development on this, with a view to practical applications. Comments, questions, etc are welcome.
Stars: ✭ 308 (-51.87%)
Mutual labels:  verilog, fpga
blarney
Haskell library for hardware description
Stars: ✭ 81 (-87.34%)
Mutual labels:  fpga, verilog
Verilog
Repository for basic (and not so basic) Verilog blocks with high re-use potential
Stars: ✭ 296 (-53.75%)
Mutual labels:  verilog, fpga
Fpga Imaging Library
An open source library for image processing on FPGA.
Stars: ✭ 325 (-49.22%)
Mutual labels:  verilog, fpga

The Zip CPU

The Zip CPU is a small, light-weight, RISC CPU. Specific design goals include:

  • 32-bit. All registers, addresses, and instructions are 32-bits in length. While the byte-size itself was at one time 32-bits, the CPU now handles 8-bit bytes like all other CPUs
  • A RISC CPU. Instructions nominally complete in one cycle each, with exceptions for multiplies, divides, memory accesses, and (eventually) floating point instructions.
  • A load/store architecture. Only load and store instructions may access memory.
  • Wishbone compliant. All memory and peripherals are accessed across a single wishbone bus.
  • A Von-Neumann architecture, meaning that both instructions and data share a common bus.
  • A pipelined architecture, having stages for prefetch, decode, read-operand(s), a combined stage containing the ALU, memory, divide, and floating point units, and then the final write-back stage.
  • A two mode machine: supervisor and user, with each mode having a different access level.
  • Completely open source, licensed under the GPL.

Unique features and characteristics

  • Only 29 instructions are currently implemented. Six additional instructions have been reserved for a floating point unit, but such a unit has yet to be implemented.
  • (Almost) all instructions can be executed conditionally. Exceptions include load immediate, the debug break instruction, the bus lock and simulation instructions, and the no-operation instruction. The assembler will quietly turn a conditional load immediate into a two-instruction equivalent.
  • Simplfied wishbone bus. While the ZipCPU conforms to the Wishbone B4 standard, some simplifications have been made. All tgx lines have been removed, although the select lines have been kept. All accesses are (or can be) pipelined. Finally, the ZipCPU project (and its daughter projects/peripherals) assumes that the strobe line is zero whenever the cycle is zero. This simplifies peripheral processing.
  • The CPU makes heavy use of pipelined wishbone processing wherever and whenever it can. Hence, loading two vaues in a row may cost only one clock more than just loading the one value.
  • The CPU has no interrupt vectors, but rather two register sets. On any interrupt, the CPU just switches from the user register set to the supervisor register set. This simplifies interrupt handling, since the CPU automatically saves, preserves, and restores the supervisor's context between enabling interrupts and receiving the next interrupt. An interrupt peripheral handles the combining of multiple interrupts into a single interrupt line.

Getting Started

If you'd like to get started with the ZipCPU, you might wish to know that this repository contains the CPU, its documentation, and the toolchain. The CPU implementation found here, though, is just that: a CPU. This implementation requires a bus with peripherals hanging off of it, things such as RAM, flash (ROM), serial port, etc. This is just where I keep the CPU apart from any necessary peripherals.

So, if you want to try out the CPU, feel free to download and build this repository (use git-clone with a depth of 1--there's a lot of stuff in the git repo that you don't necessarily need). You'll need it for the binutils, GCC, and newlib support provided by it.

Once you've built these tools, then I'd suggest you look into the ZBasic repository. That repository places the CPU in an environment with block RAM, QSPI flash, and SD-card (SPI protocol) access. From that repository, you can either tweak the distro (main.v, regdefs.h, board.h, board.ld) to add the peripherals you want to use the CPU with, or you can use autofpga to adjust your RAM size, add or remove peripherals and so forth while maintaining (creating, really) all of these files for you.

Even more than that, the ZBasic distribution has complete Verilator support so that you can build your design, and simulate it, from power on reset through bootloader through ... well, however far you'd like to simulate and your disk has space for.

If you aren't interested in simulating the CPU, there is an assembly level debugger that you can use to stop and step the CPU, as well as an integrated wishbone scope that you can use to get traces from within the design while it is running.

Need help?

If you'd like to use the ZipCPU, and don't know where to begin, feel free to find me on IRC as ZipCPU. I tend to inhabit the #openarty channel of the Freenode IRC server. If you get stuck, I've been known to help folks out there as well.

Current Status

I've recently blogged about the ZipCPU at zipcpu.com! Articles you might find valuable include:

I'm also working on formally verifying the entire CPU. My goal will be to prove, via yosys-smtbmc, that the ZipCPU will never enter into an invalid state. I've been successful so far proving the various components of the ZipCPU. What remains is the CPU itself.

Not yet integrated

  • An MMU has been written for the ZipCPU, and even integrated into it, but it has not yet been tested. Using formal methods, I've now proved that this component works. A test bench also exists to exercise it.

  • A data cache has been written for the ZipCPU, but has yet to be fully optimized.

  • I would also like to integrate SDCard support into the newlib C-library to give the CPU file access. If and when this takes place, it will take place as part of the ZBasic repository first.

  • The ZipOS would greatly speed up and improve the bare bones newlib library--primarily by providing "O/S" level interrupt support when using the library. This integration has not (yet) been accomplished.

    On the other hand, if the MMU is available, I might rather just create a Linux distribution.

Commercial Opportunities

If the GPLv3 license is insufficient for your needs, other licenses (for all but the tool-chain) can be purchased from Gisselquist Technology, LLC.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].