Commit Graph

21 Commits

Author SHA1 Message Date
Schuyler Eldridge 5cffc8537b
[firrtl] Move LowerLayers after LowerXMR (#8405)
Move the `LowerLayers` pass after the `LowerXMR` pass.  To do this, all
passes at the end of the CHIRRTL to Low FIRRTL pipeline are moved after
`LowerXMR`.  This is necessary because the `LowerLayers` pass cannot, at
present, be moved after the passes at the end of the pipeline.

This is done to enable forcing out of layers.  By lowering probes to XMRs,
the layers can be lowered trivially to modules/instances and their XMRs
will now (seemingly) magically just work.  By doing the loweirng in this
way, it avoids ever having to represent an input probe in the FIRRTL
dialect.

A consequence of this is that there are now simplifying
assumptions (preconditions) that can be made about the `LowerLayers` pass:

1. It will never see a number of probe ops because the `LowerXMR` pass has
   a postcondition that all of these are removed.

2. Input and output ports can never be created on modules created from
   layer blocks.

While I am generally always in favor of passes being relocatable anywhere
in the pipeline, this is one pass that really does _not_ make sense to be
relocatable.  In effect, this pass is part of the lowering from FIRRTL to
HW.  There is no point in being able to use it earlier in the pipeline.
That said, it still is tested to work with things which we may one-day
preserve, like `WhenOp`s.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2025-04-24 11:02:55 -04:00
Andrew Young 0276e17b2e
[firtool] Add option to disable layer sink (#7981)
The layer sink pass is showing some performance problems, and we want
the ability to turn it off to work around the issue, until we can
properly fix it.
2024-12-13 10:45:26 -08:00
Prithayan Barua b5141b7f1d
[InstanceChoice] Add a default override for unspecified options (#7955)
Add an override that, instead of emitting an error, selects the default target
 to specialize an instance choice when the option is unspecified. By default a
 partially specified instance choice is not allowed. But we can override the
 error and select the default target, by using
 `--select-default-for-unspecified-instance-choice` with `firtool`.
This enables a user to specialize the instance choice for a particular build
 flow, and fall-back to the default for all others.
2024-12-05 14:40:24 -08:00
Prithayan Barua fd08d90333
[firtool] Add an option to disable CSE in classes (#7931)
This PR adds the option to run CSE only on `firrtl.module`, and ignore
 other operations. There are some tools, that are not able to handle CSE of
 `firrtl.object` in `firrtl.class`. Specifically, the reuse of `firrtl.object`
 is not modeled properly.
This is a temporary workaround to disable the CSE of operations inside
 `firrtl.class`, which can be removed once the actual issue is fixed.
2024-12-02 14:31:41 -08:00
Mike Urbach af4b15a59c
[FIRRTL] Remove all traces of OMIR JSON support. (#7907)
This legacy system for representing an object model has been replaced
by FIRRTL classes, objects, and properties. This removes the old
system completely.

The main change is removing the EmitOMIR pass completely, but there
are several other things related to OMIR JSON to clean up. This
includes command line options and annotations for specifying input and
output OMIR JSON, as well as support for parsing the JSON and
scattering OMIR tracker annotations. Any tests related to the above
were also removed.

The only remaining legacy OMIR feature is the OMIRTracker annotation,
which is currently used in some canBeDeleted logic on annotations in
folders, IMDCE, etc. This is being separated, and removed in this PR:
https://github.com/llvm/circt/pull/7908.
2024-11-26 16:42:55 -07:00
Will Dietz 0806944a52
[FIRRTL] Drop Hoistpassthroughs pass. (#7097)
This has only been used for probes, but without input probes
this is no longer useful or necessary.

The HW-signal hoisting works well (if limited) and has no
known issues[1] but has yet to be used in practice due
primarily to passthroughs being intentional occasionally
and lacking a mechanism to capture or distill this intent
properly (it must be ""optimized"" yet not).

Since this is unused, and lacking traction on the above,
remove from pipeline and delete this for now instead of
having it bitrot and be a maintenance burden while
adding/completing new features.

Lives on in version control history!

[1] FWIW, see https://github.com/llvm/circt/pull/6115 for
both small example and before/after on chipyard, as well
as testing internally back when this was introduced.
2024-05-28 13:38:51 -05:00
Fabian Schuiki 719bbfde79
[CAPI] Add circt-capi target and build it in CI (#7017)
Add a `circt-capi` target that depends on all C API libraries. Introduce
a new `add_circt_public_c_api_library` CMake function that wraps around
the MLIR equivalent, but also adds a dependency from `circt-capi`. Make
at least the short integration tests CI job build the `circt-capi`
target to ensure it has a bit of CI coverage.
2024-05-09 11:21:33 -07:00
Will Dietz b2ae5cf526
[FIRRTL] Error if asked to add a port to a public module. (#6936)
Add option to allow this for compatibility.

Add statistic to count ports added to public modules,
as an interesting bit of information but particularly
to track how many are still being added when updating
a code base to avoid this.
2024-04-30 16:15:56 -05:00
Amelia Dobis 69fccebb31
[firtool] btor2 integration (#6947)
* added btor2 as a target in firtool

* removed duplicated pass pipeline check

* registered conversion pass

* added small test for firtool
2024-04-29 14:20:53 -07:00
Hideto Ueno de58c5f911
[LowerToHW] Emission Option for verification flavors (#6885)
This commits replaces `--emit-chisel-asserts-as-sva` with an option with more fine grained control.
Specifically an option `--verification-flavor={none, if-else-fatal, immediate, sva}` is added. `none` is the option for the current behaviour that uses per-op configuration (which must be deprecated once after `has_been_reset` is properly used for assertions that are expected to be disabled while pre-resets). 

Close https://github.com/llvm/circt/issues/6543
2024-04-02 14:09:38 +09:00
Will Dietz 2bc975079d [CAPI][Firtool] Don't use default in covered switches over enums.
https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations
2023-12-07 10:26:40 -06:00
Sprite 3b7d738056 [FIRRTL][CAPI] Add the rest of setters for options 2023-11-30 16:26:55 +08:00
Andrew Lenharth 12c35d96b4 [NFC] clean up a few attributes which should be symbols attributes 2023-11-28 14:21:46 -06:00
Andrew Lenharth ae62ffdbc5 [CAPI] Fix broken build 2023-11-27 12:48:51 -06:00
Andrew Lenharth 57aff18faf
[FIRTOOL] Make firtool options behave like the rest of llvm. (#6435)
Move firtool pipeline configuration over to the same mechanism the rest of llvm and mlir use. Export this via the CAPI. Add a couple examples of methods to change options to the CAPI. Interested parties are encouraged to finish out the set of functions.

Since the CAPI has no tests, this breaks nothing.

As an aside, the configuration space of the firrtl pipeline is WAY too big.
2023-11-27 10:57:18 -06:00
fzi-hielscher f37fe720e6
[Firtool][CAPI] Remove dedup option (#6423) 2023-11-17 00:14:53 +01:00
George Lyon 55505ebcb9
firtoolPopulateCHIRRTLToLowFIRRTL doesn't need a module (#6304) 2023-10-19 12:38:03 -07:00
Nandor Licker dadf87b742 [NFC][firtool] Fix CAPI 2023-10-11 04:24:33 -07:00
Andrew Lenharth f14cbe3b25 [NFC] LLVM bump 2023-10-03 09:24:06 -05:00
Sprite b636edaef1 [Firtool][CAPI] Add options setters and getters 2023-09-30 21:53:23 +08:00
Sprite a01f3db3cc [Firtool][CAPI] Add C-API for Firtool lib 2023-09-30 21:53:23 +08:00