Currently the entrypoint of PRGA is *.new_context, and file rendering engine is created by *.new_renderer, in which * is a configuration circuitry type (magic, scanchain, or pktchain). This forces the selection of configuration circuitry types before describing the architecture. It also makes *.InsertProgCircuitry pass error-prone.
We should instead start with a generic context, and then leave the configuration circuitry selection to later steps. We can use magic as the default configuration circuitry type, which is not real, but helps with debugging the FPGA architecture at the abstract level. Then, the context may be "materialize" to a specific configuration circuitry type.
For example:
ctx = Context()
ctx.create_global(...)
ctx.create_segment(...)
ctx.build_logic_block(...)
...
flow = Flow(
Translation(),
SwitchPathAnnotation(),
InsertProgCircuitry(), # calls Magic._InsertProgCircuitry under the hood
VPRArchGeneration("vpr/arch.xml"),
VPR_RRG_Generation("vpr/rrg.xml"),
VerilogCollection('rtl'),
YosysScriptsCollection(r, "syn"),
).run(ctx)
# Until now everything is using `magic` as the configuration circuitry type.
ctx = Scanchain.materialize(ctx)
flow = Flow(
Translation(),
SwitchPathAnnotation(),
InsertProgCircuitry(), # calls Scanchain._InsertProgCircuitry under the hood
VPRArchGeneration("vpr/arch.xml"),
VPR_RRG_Generation("vpr/rrg.xml"),
VerilogCollection('rtl'),
YosysScriptsCollection(r, "syn"),
).run(ctx)
Currently the entrypoint of PRGA is
*.new_context
, and file rendering engine is created by*.new_renderer
, in which*
is a configuration circuitry type (magic
,scanchain
, orpktchain
). This forces the selection of configuration circuitry types before describing the architecture. It also makes*.InsertProgCircuitry
pass error-prone.We should instead start with a generic context, and then leave the configuration circuitry selection to later steps. We can use
magic
as the default configuration circuitry type, which is not real, but helps with debugging the FPGA architecture at the abstract level. Then, the context may be "materialize" to a specific configuration circuitry type.For example: