Skip to content

lishangli/tiny_gpu-chisel

 
 

Repository files navigation

Tiny GPU(chisel version)

Introduction

This is a project refering to tiny-gpu.

Quick Start

To use this repo as your Chisel development environment, simply follow the steps.

  1. Clone this repo;
git clone git@github.com:lishangli/tiny_gpu-chisel.git
  1. Install dependencies and setup environments:
  • Arch Linux pacman -Syu --noconfirm make parallel wget cmake ninja mill dtc verilator git llvm clang lld protobuf antlr4 numactl
  • Nix nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
  1. [Optional] Remove unused dependences to accelerate bsp compile in build.sc playground.moduleDeps;
cd playground # entry your project directory
vim build.sc
// build.sc

// Original
object playground extends CommonModule {
  override def moduleDeps = super.moduleDeps ++ Seq(myrocketchip, inclusivecache, blocks, rocketdsputils, shells, firesim, boom, chipyard, chipyard.fpga, chipyard.utilities, mychiseltest)
  ...
}

// Remove unused dependences, e.g.,
object playground extends CommonModule {
  override def moduleDeps = super.moduleDeps ++ Seq(mychiseltest)
  ...
}
  1. Init and update dependences;
cd playground # entry your project directory
make init     # init the submodules
make patch    # using the correct patches for some repos
  1. Generate IDE bsp;
make bsp
  1. Open your IDE and wait bsp compile;
idea . # open IDEA at current directory

Project Structure

.
├── src
│   └── main
│       └── scala
│           ├── Convert.scala
│           ├── Main.scala
│           ├── Playground.scala
│           └── tinygpu
│               ├── ALU.scala
│               ├── Controller.scala
│               ├── Core.scala
│               ├── DCR.scala
│               ├── Decoder.scala
│               ├── Dispatch.scala
│               ├── Fetcher.scala
│               ├── Gpu.scala
│               ├── GpuConfig.scala
│               ├── LSU.scala
│               ├── PC.scala
│               ├── Registers.scala
│               ├── Scheduler.scala
│               └── Tester.scala
└── test
    └── src
        ├── GpuTester.scala
        └── tinygpu

IDE support

For mill use

mill mill.bsp.BSP/install

then open by your favorite IDE, which supports BSP

Pending PRs

Philosophy of this repository is fast break and fast fix. This repository always tracks remote developing branches, it may need some patches to work, make patch will append below in sequence:

rocket-chip-inclusive-cache https://github.com/chipsalliance/rocket-chip-inclusive-cache/pull/22.diff

Always keep update-to-date

You can use this template and start your own job by appending commits on it. GitHub Action will automatically bump all dependencies, you can merge or rebase chipsalliance/master to your branch.

cd playground # entry your project directory
git rebase origin/master

ToDO

  • Add tests
  • Fix issues in designs

About

A tiny GPU project with chisel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 92.9%
  • Assembly 3.4%
  • Nix 2.2%
  • Makefile 1.1%
  • Shell 0.4%