chipsalliance / rocket-chip

Rocket Chip Generator
Other
3.28k stars 1.14k forks source link

running a LED blinking program on rocket-chip #915

Closed ninode closed 7 years ago

ninode commented 7 years ago

Hello,

I want to run a program which targets zedboard LEDs on rocket-chip. Does that require to write it in Chisel, as provided in:

import chisel3._

class GCD extends Module {
  val io = IO(new Bundle {
    val a  = Input(UInt(32.W))
    val b  = Input(UInt(32.W))
    val e  = Input(Bool())
    val z  = Output(UInt(32.W))
    val v  = Output(Bool())
  })
  val x = Reg(UInt(32.W))
  val y = Reg(UInt(32.W))
  when (x > y)   { x := x -% y }
  .otherwise     { y := y -% x }
  when (io.e) { x := io.a; y := io.b }
  io.z := x
  io.v := y === 0.U
}

Or could it be written in C ? Also, in which directory should the program be placed (rocket-chip RAM space) ?

Thank you

ben-k commented 7 years ago

This question doesn't really have to do with Rocket Chip. You might take a look at the fpga-zynq or project-template repos.