building custom risc v socs in chipyard
play

Building Custom RISC-V SoCs in Chipyard Abraham Gonzalez UC - PowerPoint PPT Presentation

Building Custom RISC-V SoCs in Chipyard Abraham Gonzalez UC Berkeley abe.gonzalez@berkeley.edu Goals Get the basics of modifying a configuration Create a heterogeneous BOOM and Rocket RISC-V SoC Learn how to generate Verilog for


  1. Building Custom RISC-V SoCs in Chipyard Abraham Gonzalez UC Berkeley abe.gonzalez@berkeley.edu

  2. Goals • Get the basics of modifying a configuration • Create a heterogeneous BOOM and Rocket RISC-V SoC • Learn how to generate Verilog for an SoC • Learn how to run Verilator RTL simulations • Case Study: Integrating a SHA3 accelerator into a Chipyard SoC! • Add a SHA3 accelerator to Chipyard • Add the accelerator to a configuration! • Get Verilog and run Verilator simulations

  3. Tutorial Roadmap Custom SoC Configuration FireMarshal RTL Generators Bare-metal & RISC-V Multi-level Custom Accelerators Peripherals Linux Cores Caches Verilog Custom Workload RTL Build Process FIRRTL FIRRTL IR Verilog QEMU & Spike Transforms Software RTL Simulation FireSim FPGA-Accelerated Simulation Automated VLSI Flow Tech- Tool- VCS Verilator Simulation Debugging Networking Hammer plugins plugins

  4. Tutorial Roadmap Custom SoC Configuration FireMarshal RTL Generators Bare-metal & RISC-V Multi-level Custom Accelerators Peripherals Linux Cores Caches Verilog Custom Workload RTL Build Process FIRRTL FIRRTL IR Verilog QEMU & Spike Transforms Software RTL Simulation FireSim FPGA-Accelerated Simulation Automated VLSI Flow Tech- Tool- VCS Verilator Simulation Debugging Networking Hammer plugins plugins

  5. Getting Started

  6. Interactive Section! Having trouble? Raise a hand and someone will come help you. You can find these slides on https://fires.im/micro-2019-tutorial/

  7. How things will work Interactive Slide Explanation Slide “Follow Along” “What’s happening?”

  8. How things will work // SOME COMMENT HERE # command 1 class SmallBoomConfig extends Config( > echo “Chipyard Rules!” new WithTop ++ new WithBootROM ++ new boom.common.WithSmallBooms ++ # command 2 new boom.common.WithNBoomCores(1) ++ > do_this arg1 arg2 new freechips.rocketchip.system.BaseConfig) Terminal Section Inside-a-File Section

  9. Interactive # start a tmux session > tmux new –s soc # return to chipyard > cd ~/chipyard-morning/ > ls 10

  10. Directory Structure chipyard-morning/ generators/ Our library of Chisel generators rocket-chip/ sha3/ sims/ Utilities for simulating SoCs verilator/ software/ Utilities for building RISC-V software firemarshal/ tools/ Chisel/FIRRTL chisel/ firrtl/ build.sbt Config file enumerating generators and dependencies 11

  11. Build and simulate a heterogeneous BOOM + Rocket SoC 12

  12. Default Chipyard Project • You need a top-level project that combines all the chipyard-morning/ generators wanted generators/ example/ • Want Rocket Chip, BOOM, SHA3 accelerator, etc… rocket-chip/ • In our case we are using the `example` project boom/ sha3/ • Located in `generators/example` sims/ verilator/ • This holds things such as tools/ • Test Harness code chisel/ • Top-level module (matches the top-level of the DUT) firrtl/ tests/ • SoC configurations build.sbt • Most of the work will be done in this project 13

  13. BOOM Integration • BOOM source code already added chipyard-morning/ generators/ • Located in ` generators/boom ` example/ • Already has default configurations rocket-chip/ boom/ • Located in sha3/ ` generators/example/src/main/scala/ sims/ BoomConfigs.scala ` verilator/ tools/ chisel/ firrtl/ tests/ build.sbt 14

  14. Interactive chipyard-morning/ # open up the default boom configurations file generators/ > cd generators/example/src/main/scala example/ > less BoomConfigs.scala src/main/scala/ BoomConfigs.scala rocket-chip/ boom/ sha3/ sims/ verilator/ tools/ chisel/ firrtl/ tests/ build.sbt 15

  15. Interactive chipyard-morning/ # open up the default boom configurations file generators/ > cd generators/example/src/main/scala example/ > less BoomConfigs.scala src/main/scala/ BoomConfigs.scala rocket-chip/ Reminder: use q boom/ to quit less sha3/ sims/ verilator/ tools/ chisel/ firrtl/ tests/ build.sbt 16

  16. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq() chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new TLBroadcast) tests/ BootROMParams => BootROMParams() build.sbt BuildTop => None 17

  17. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq() chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new TLBroadcast) tests/ BootROMParams => BootROMParams() build.sbt BuildTop => None 18

  18. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq(BoomParams()) chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new TLBroadcast) tests/ BootROMParams => BootROMParams() build.sbt BuildTop => None 19

  19. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq(BoomParams(Small)) chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new TLBroadcast) tests/ BootROMParams => BootROMParams() build.sbt BuildTop => None 20

  20. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq(BoomParams(Small)) chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new InclusiveCache) tests/ BootROMParams => BootROMParams() build.sbt BuildTop => None 21

  21. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq(BoomParams(Small)) chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new InclusiveCache) tests/ BootROMParams => BootROMParams(“../bootrom.rv64.img”) build.sbt BuildTop => None 22

  22. Configuring a SoC with BOOM class SmallBoomConfig extends Config( chipyard-morning/ new WithTop ++ generators/ new WithBootROM ++ example/ new freechips.rocketchip.subsystem.WithInclusiveCache ++ src/main/scala/ new boom.common.WithSmallBooms ++ BoomConfigs.scala new boom.common.WithNBoomCores(1) ++ rocket-chip/ new freechips.rocketchip.system.BaseConfig) boom/ sha3/ • Bottom-to-top (right-to-left) config hierarchy sims/ • Configs can read/override other configs verilator/ tools/ BoomTilesKey => Seq(BoomParams(Small)) chisel/ RocketTilesKey => Seq() firrtl/ BankedL2Key => Module(new InclusiveCache) tests/ BootROMParams => BootROMParams(“../bootrom.rv64.img”) build.sbt BuildTop => Module(new Top) 23

Recommend


More recommend