Skip to content
seanhalle edited this page Dec 22, 2021 · 13 revisions

Previous | ToC | Next


Project Task

Introduction

MMIO stands for memory-mapped input output, so the name explains the concept – it’s a digital subsystem that allows interacting with devices by using Ld and St instructions. It pretends the devices are in the memory, but they're actually not. That is just a convenient way to write code to interact with them.
Note that when you read Berkeley docs, they have a habit of disregarding the value of names, and often make unfortunate choices for names that cause confusion. "Widget" is one of these cases. Old Berkeley docs used "widget" in the context of FireSim to refer to RTL that is added to FPGA in order to connect the device under test to the FireSim main simulation loop running on the Host. Then, Berkeley also used the same word "widget" as a generic term for MMIO peripheral, digital subsystem, and circuit in the RISCV/Chisel/Rocket-chip/chipyard/UC Berkeley documents. We will refer to such things by their actual name. If we need to refer to the class of things that one puts on an SoC, we use the term "SoC subsystem" or "component".

To add a new MMIO peripheral we need to deal with three files:

  1. the file we are going to actually work on ==> for this example let’s call it JustRead.scala.
  2. DigitalTop.scala
  3. RocketConfig.scala

The latter two files serve to plug what we create in the former file to the rest of the Rocket-chip, namely, in the two latter files we’ll just copy/paste and edit a few lines, whereas this write-up focuses on the first file = that’s where this whole project actually lives.

Verification

Testing consists of two phases:

  • First, we need to create a simulator. Managing to do that, we have confirmed that
    • our Chisel is syntactically correct,
    • the circuit makes sense (it’s feasible as a digital system),
    • the peripheral is correctly interconnected with the rest of the SoC
    • the whole SoC is successfully translated to Verilog and Verilog again to C++
  • next, we need a program, a piece of software that we will write in either C or RISCV assembly and compile and run bare metal, i.e. directly on the simulator we created

The task

**Our task is to design a circuit that responds to the CPU with the value 230 (unsigned integer), when the CPU performs a Ld on the address 2000. We write RTL for MMIO. Wrap that into TL and Cake Create simulator with that witin rocket-chip Run binary (riscv compiles .c program) on that simulator Program reads value that the MMIO puts to appropriate address. ** We also need to write a prog performs is reading – hence the name of the widget: JustRead.


Previous | ToC | Top | Next

Clone this wiki locally