Code Monkey home page Code Monkey logo

risc-v-cpu's Introduction

RISC-V CPU (Tape-Out with U18 Technology)

This is a 32-bit 5-stage pipelined RISC-V CPU that supports basic instructions and some vector arithmetic.
In order to tape out, gate level synthesis and APR are done as well.
The simulation was done by NC-verilog and synthesised by Desgin Compiler.
This chip has been tested on Dec.2 2019, and all functions work correctly.

Usage

To run this work, you will need a verilog compiler such as ncverilog.
$ ncverilog testbench.v CPU.v to run RTL simulation.
$ ncverilog testbench.v WIN.v +define+SDF to run gate level simulation.
$ ncverilog testbench.v core_APR.v +define+SDF to run APR simulation.
Note that you need to decompress the file in APR_files.zip and put those file in the src folder to run APR simulation.

To run your own RISC-V program, change line 57 in the testbench to the file you want.
The first line of the file must be 11111110 and the last line must be 11111111 in order to indicate the CPU to start and end respectively.
Your instructions has to be breakdown into 8-bits.

For example:
11111110_00000000_00000000_00000010_00010011 //addi $a0, $r0, 0
will be convert into:
00000000
00000000
00000010
00010011
in the instruction file

Block Diagram

Block Diagram

Supported Instructions

  • Basic Instructions
    • and
    • or
    • add
    • sub
    • mul
    • addi
    • lw
    • sw
    • beq
  • Vector Arithmetic
    • VSUM (vector sum)
    • VSUB (vecotr subtraction)
    • VSM (vector scalar multiplication)
    • VDP (vector dot product) Instruction Desgin

Hazard Detection Supported

Hazard Detection Our work supports data forwarding to prevent data hazard. Forwarding works in most case but branch jump, to deal with it our design supportd hazard detection as well.

I/O Port

I/O figure

  • Input Ports
    • Instr_i : Reads in instructions 8-bit at a time. It will take 4 cycles to read in one instruction.
    • D/R : If = 0, output value saved in DataMemory, else output value saved in register.
    • addr: Address that you want to access, this input is 5-bit since size of both DataMemory and Register are 32.
    • value_o_addr : The value saved in the memories are 32-bit, but our CPU can only ouput 8-bit at a time. Thus, we need to decide which 8-bit are to be read. For example, if value_o_addr = 0, the CPU will output the most signficant 8-bit in the address we assigned.
  • Output Ports
    • value_o : Output value.
    • is_positive : This is for handling overflow cases when doing vector sum. When two 7-bit value are added together, it produces a 8-bit value and the value will be interpret as a negative value. When is_positive = 1, the 8-bit output should be interpret as a 8-bit positive value instead of a negative value.

Schematic

CPU Pipelined Forward Vector

Layout

Chip APR result Virtuoso

Design Specification

Spec Value
Frequency 100MHz
Chip size 1456.84*1462.96 µm^2
Power 67.9428 mW
Techonlogy UMC 180nm
PADs 38

Background

This is originally a course project of Integrated Circuits Design Laboratory at National Taiwan University,
lectured by Prof. Tzi-Dar Chiueh
This work has been taped-out at TSRI (Taiwan Semiconductor Research Institute.) and received on Oct.30 2019.

Reference

David A. Patterson and John L. Hennessy. 2017. Computer Organization and Design RISC-V Edition: The Hardware Software Interface (1st ed.). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.

risc-v-cpu's People

Contributors

daniel00aa avatar jasonlin316 avatar misomochi 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.