Coder Social home page Coder Social logo

martinkindall / 8-bit-multicycle-cpu Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 15 KB

Minimalist 8 bit multicycle RISC CPU

SystemVerilog 83.50% Assembly 0.86% Tcl 15.64%
8-bit 8-bit-computer 8-bit-cpu basys3 basys3-fpga cpu fpga multicycle multicycle-processor systemverilog

8-bit-multicycle-cpu's Introduction

Minimalist 8-bit multicycle RISC CPU

This work is based on the following implementation from Benjamin Unger: 8-Bit Multicycle Processor Design and Implementation in Verilog.

I made my own SystemVerilog code based on the instruction set and diagrams exposed in the mentioned reference.

Instruction Set

Instruction Opcode

  • lw 0000
  • sw 0001
  • add 0100
  • sub 0101
  • j 1000
  • jcz 1001
  • jco 1010
  • hlt 1011

Top Module

The top module is CPUTopIO.sv. Check the constraint file to understand how are the leds, switches and displays wired to the CPU.

Program

The demo program is called program.asm which is also compiled to binary in program.dat. This code will be automatically added to the RAM on synthesis, thanks to Vivado, so no need to manually feed the binary. Check the file Mem.sv and you will see the program is initialized in the initial block. Normally this block is considered only during simulation, but Vivado also allows to add data in some cases.

Slow clock

The cpu runs with a slow clock (1Hz) which allows to follow the fetch-decode-execute process with the eye. Anyways you can manually debug using the switch to enable/disable the clock at each step.

8-bit-multicycle-cpu's People

Contributors

martinkindall avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.