Add ChipTop to enable real chip configs with IO cells, etc. (#480)
This adds an additional layer (ChipTop) between the System module and the TestHarness. The IOBinder API is now changed to take only a single parameter (an Any) and return a 3 things: The IO port(s), the IO cell(s), and a function to call inside the test harness, which is analogous to the old IOBinder function, except that it takes a TestHarness object as an argument instead of (clock, reset, success). * A new Top-level module, ChipTop, has been created. ChipTop instantiates a "system" module specified by BuildSystem. * BuildTop now builds a ChipTop dut module in the TestHarness by default * A new BuildSystem key has been added, which by default builds DigitalTop (previously just called Top) * The IOBinders API has changed. IOBinders are now called inside of ChipTop and return a tuple3 of (IO ports, IO cells, harness functions). The harness functions are now called inside the TestHarness (this is analogous to the previous IOBinder functions). * IO cell models have been included in ChipTop. These can be replaced with real IO cells for tapeout, or used as-is for simulation. * The default for the TOP make variable is now ChipTop (was Top)
This commit is contained in:
@@ -21,7 +21,7 @@ import hwacha.{Hwacha}
|
||||
import sifive.blocks.devices.gpio._
|
||||
import sifive.blocks.devices.uart._
|
||||
|
||||
import chipyard.{BuildTop}
|
||||
import chipyard.{BuildTop, BuildSystem, ChipTopCaughtReset}
|
||||
|
||||
/**
|
||||
* TODO: Why do we need this?
|
||||
@@ -65,8 +65,8 @@ class WithL2TLBs(entries: Int) extends Config((site, here, up) => {
|
||||
))
|
||||
})
|
||||
|
||||
class WithTracegenTop extends Config((site, here, up) => {
|
||||
case BuildTop => (p: Parameters) => Module(LazyModule(new tracegen.TraceGenSystem()(p)).suggestName("Top").module)
|
||||
class WithTracegenSystem extends Config((site, here, up) => {
|
||||
case BuildSystem => (p: Parameters) => Module(LazyModule(new tracegen.TraceGenSystem()(p)).suggestName("Top").module)
|
||||
})
|
||||
|
||||
|
||||
@@ -150,3 +150,13 @@ class WithControlCore extends Config((site, here, up) => {
|
||||
)
|
||||
case MaxHartIdBits => log2Up(up(RocketTilesKey, site).size + up(BoomTilesKey, site).size + 1)
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* Config fragment to use ChipTopCaughtReset as the top module, which adds a reset synchronizer to
|
||||
* the top-level reset, allowing it to be asynchronous with the clock.
|
||||
* NOTE: You must remember to set TOP=WithChipTopCaughtReset when building with this config
|
||||
*/
|
||||
class WithChipTopCaughtReset extends Config((site, here, up) => {
|
||||
case BuildTop => (p: Parameters) => Module(new ChipTopCaughtReset()(p).suggestName("top"))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user