On Wed, Aug 12, 2020 at 06:39:58AM -0700, Alaa Salman wrote:
> is there any working example for connecting accelerator to RocketChip?
Rocket Chip has three toy RoCC accelerators written in Chisel and one
toy RoCC accelerator written in Verilog:
- AccumulatorExample: src/main/scala/tile/LazyRoCC.scala
- TranslatorExample: src/main/scala/tile/LazyRoCC.scala
- CharacterCountExample: src/main/scala/tile/LazyRoCC.scala
- RoccBlackBox: src/main/resources/vsrc/RoccBlackBox.v
You can build a Verilator-based simulation of this with (assuming that
you have built rocket-tools and set your RISCV environment variable
appropriately):
cd rocket-chip
RISCV=<set this> make CONFIG=freechips.rocketchip.system.RoccExampleConfig -C emulator
There is example software for talking to the AccumulatorExample
located here:
-
https://github.com/seldridge/rocket-rocc-examples
Note: that I haven't run this in some time and I never setup CI for
it. YMMV
Assembly macros (used by above) for building software to exercise your
RoCC (without hacking binutils) can be found:
-
https://github.com/ibm/rocc-software/