Skip to content

Make the device from the architectures, and add flat routing and the analytical placer to the staged flow - #2905

Open
ganeshgore wants to merge 4 commits into
gg_agent_apifrom
staged-flow-more
Open

ganeshgore wants to merge 4 commits into
gg_agent_apifrom
staged-flow-more

Conversation

@ganeshgore

Copy link
Copy Markdown
Collaborator

Stacked on #2875 (base gg_agent_api). It extends the flow that is run stage by stage so that it covers more of what the one-shot vpr command does, and gives a program what it needs to drive it at a fixed channel width.

What it adds

The device before the circuit

  • The stage DEVICE is reached as soon as the two architectures are read, so that the device can be looked at before a design is chosen. Reading the circuit makes the device again with it; pack (and read_packing) is refused until a circuit is read, with the command to run.
  • The diagnostic of a missing device now asks for the two architectures.

Flat routing

  • router.flat_routing runs in the staged flow as vpr --flat_routing on does: the atom netlist is routed with the port equivalences turned off, and analysis syncs the clustering with the flat routing. The files, results, bitstream, fabric, testbench and SDC are those of the one-shot flow.
  • report_run says routing.flat_routing.

The analytical placer

  • New option place.placer: classic (pack, then place) or analytical (vpr --analytical_place). With it, pack and place both run the analytical placer and reach PACKED and PLACED together; the two are one result, so a change that drops the placement drops the packing too. A placement is not read on its own on such a packing.
  • report_run says the placer and the estimates of the global placement.

For programs

  • report_app_option --json (and report_stage) give each option its VPR flag (vpr_flag, e.g. --seed).
  • Session.fixed_width_refusal(command, flat_routing=True) says why a flow that only routes at a fixed width does not run a command now (vpr, a route without a channel width, a flat route on a device that does not support it).

Fixes found on the way

  • The grid of VPR is reset when a run is freed: a grid made from a routing resource graph that was read stayed fixed for every later device of the process.
  • RemoteSession.call() passed an option called name to itself.
  • A checkpoint of a flow with no circuit is refused instead of failing in the middle.

Tests

  • test_equivalence compares the staged flow with vpr --flat_routing on on three more golden designs; test_flat_routing (run report, files read back, fabric/testbench/SDC, checkpoints) and test_analytical_placement (equivalence with vpr --analytical_place on all golden designs, what drops what, run report, checkpoints, a failure) are new; test_stages and test_run_report cover the device without a circuit; test_fixed_width covers the refusals.
  • C++: test_openfpga_session (device without circuit, analytical placer), test_json_writer and test_vpr_app_options (vpr_flag, place.placer).
  • Full openfpga_flow/tasks/python_binding_tests and the ctest subset of the session, options, JSON and glob tests pass.

Not included

  • The device packages that came with this work in the source branch (their channel width, cached device files and reference designs) are not part of OpenFPGA; the generic hooks they need come in a later PR of this stack.

report_app_option --json, and the options of report_stage, give each option
its flag on the command line of VPR (vpr_flag, e.g. --seed for place.seed),
or null for an option of OpenFPGA. A program that holds options as the flags
of VPR, e.g. a list of VPR options for a device, can then find the
application option of each flag without a table of its own.

AppOption.vpr_flag has it in the Python Session.
A grid made from a routing resource graph that was read (--read_rr_graph) is
marked as fixed by it, and VPR then gives it back for every device that it
makes in the process. Freeing a run now resets the grid, so that the next run,
of another architecture or layout, makes its own.
A flow that a program or a model drives runs the stages one by one and
routes with the channel width it is given. Session.fixed_width_refusal()
says why such a flow does not run a command now, or None: vpr, which runs
the whole flow in one command, and route (or analysis before a routing)
while router.route_chan_width is not set, as VPR would then search for the
smallest width. With flat_routing=False (a device that does not support flat
routing) a route is refused while router.flat_routing is set. The shell and
the rest of the Python API are unchanged.

Also let RemoteSession.call() pass an option called name to the method: the
name of the method is positional only.
…analytical placer

The device (stage DEVICE) is now made as soon as the two architectures are
read, before the circuit, so that the device can be looked at first. Reading
the circuit makes it again with the design, and pack (or read_packing) is
refused until a circuit is read, with the command to run. A checkpoint still
needs the circuit.

Flat routing (router.flat_routing) runs in the stage-by-stage flow as
'vpr --flat_routing on' does: route routes the atom netlist with the port
equivalences turned off, and analysis syncs the clustering to the flat
routing. The files, results, bitstream, fabric, testbench and SDC are those
of the one-shot vpr command. report_run says routing.flat_routing.

The new option place.placer chooses the placer: classic (pack, then place)
or analytical, the analytical placement of VPR, which packs and places at
once as 'vpr --analytical_place' does. With it, pack and place both run it
and reach PACKED and PLACED together, and the two are one result: a change
that drops the placement drops the packing too. The stages that are made
again on fresh data run the analytical placer again, unless the packing was
read from a file, as a checkpoint is restored. A placement is not read on
its own on the packing of the analytical placer. report_run says the placer
and the estimates of the global placement.

The Python tests compare both with the vpr command on the golden designs,
and check the run report, the files read back and the checkpoints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant