Add a named sink cross module reference.
Add a named sink cross module reference. Multiple sinks may map to the same source.
sink circuit component
unique identifier for this sink that must resolve to
disable deduplication of this sink component (this should be true if you are trying to wire specific, identical sinks differently)
if true, require that the provided name
paramater already exists in the global namespace
BoringUtilsException
if name is expected to exist and itdoesn't
Add a named source cross module reference
Add a named source cross module reference
source circuit component
unique identifier for this source
disable dedupblication of this source component (this should be true if you are trying to wire from specific identical sources differently)
if true, this will use a non-conflicting name from the global namespace
the name used
if a uniqueName is not specified, the returned name may differ from the user-provided name
Connect a source to one or more sinks
Connect a source to one or more sinks
a source component
one or more sink components
the name of the signal used to connect the source to the sinks
the returned name will be based on the name of the source component
Utilities for generating synthesizable cross module references that "bore" through the hierarchy. The underlying cross module connects are handled by FIRRTL's Wiring Transform.
Consider the following exmple where you want to connect a component in one module to a component in another. Module
Constant
has a wire tied to42
andExpect
will assert unless connected to42
:We can then connect
x
toy
using BoringUtils without modifiying the Chisel IO ofConstant
,Expect
, or modules that may instantiate them. There are two approaches to do this:1. Hierarchical boring using BoringUtils.bore
2. Non-hierarchical boring using BoringUtils.addSink/BoringUtils.addSource
Hierarchical Boring
Hierarchcical boring involves connecting one sink instance to another source instance in a parent module. Below, module
Top
contains an instance ofCosntant
andExpect
. Using BoringUtils.bore, we can connectconstant.x
toexpect.y
.Non-hierarchical Boring
Non-hierarchical boring involves connections from sources to sinks that cannot see each other. Here,
x
is described as a source and given a name,uniqueId
, andy
is described as a sink with the same name. This is equivalent to the hierarchical boring example above, but requires no modifications toTop
.Comments
Both hierarchical and non-hierarchical boring emit FIRRTL annotations that describe sources and sinks. These are matched by a
name
key that indicates they should be wired together. Hierarhical boring safely generates this name automatically. Non-hierarchical boring unsafely relies on user input to generate this name. Use of non-hierarchical naming may result in naming conflicts that the user must handle.The automatic generation of hierarchical names relies on a global, mutable namespace. This is currently persistent across circuit elaborations.