This file imports the necessary Chisel dependencies and defines an Add module that future notebooks will import.

Call the load_ivy script.

Located in the source folder, the load_ivy.sc script will use ammonite to download snapshots of the chisel libraries, to be cached on your system. This is necessary for EVERY chisel notebook so we can then import our chisel libraries like we would in an SBT project structure.

import $file.$                

Prevent namespace error

  • To prevent an ambiguous reference to 'Input' by chisel3.Input and root.almond.input.Input, we have to make sure that we rename our chisel3 Input on import. It suffices to do as follows without requiring to change the name to something like IInput:
    import chisel3.{Input => Input}
import chisel3.{Input => Input}

import chisel3._

import chisel3.util._

import chisel3.iotesters.{ChiselFlatSpec, Driver, PeekPokeTester}

Here we define a very basic chisel module that we will import into an active notebook after this notebook is converted to .sc file.

defined class Add

Export the file to .sc

  • File -> Export Notebook As... -> Executable Script
  • Move into same directory as your other chisel notebooks
  • This will create a file ToImport.scala
  • Rename it to ToImport.sc
  • Can now import using import $file.ToImport