.get() on a type should construct a new type. BaseAlias was using this function to ALSO return the wrapped type. Rename the accessor to not conflict with the factory.
This adds initial support for Dedup to handle deduping classes and
objects. For the most part, this amounts to ensuring core
functionality is implemented in terms of the FModuleLike and
FInstanceLike interfaces, which classes and objects implement,
respectively.
There are a couple places where some specific logic is added for
objects, similar to the specific logic that was already there for
instance ops.
Finally, a small change related to paths is needed in
LowerClasses. There is some logic there that confirms a hierarchical
path's root module is contained within the path's owning module. In
the case of deduping hierarchical paths, an extra layer of hierarchy
is added to hierpath ops, which breaks this logic. A new condition is
added, and if the owning module is anywhere in the hierarchical path,
it is used as the root module.
An end-to-end firtool test is added to demonstrate that classes and
objects dedup, and the final paths are valid in both the local and
hierarchical cases.
This initial support is capable of generating valid paths, but does
not actually confirm that paths which dedup point to entities that
dedup. Comments have been left, and a ticket opened to address this:
https://github.com/llvm/circt/issues/6583.
This initial support does not handle references to objects in class
ports, in the case the objects' classes are deduped. A ticket has also
been opened to address this:
https://github.com/llvm/circt/issues/6603
When inlining and flattening FIRRTL instances, create `dbg.scope`
operations to track information about the original hierarchy in the
debug info.
To do this, the FIRRTL inliner now creates a `dbg.scope` op for every
inlined instance. When renaming the operations in the inlined module's
body, debug operations are assigned this scope (unless they already had
a scope assigned). This retains information about the original
hierarchy.
Unfortunately, this approach currently only works for debug variables
and scopes. Instances have no `scope` operand where a parent scope can
be annotated. As a result, instance ops whose parent module got inlined
do not properly track their original scope. This limitation will go away
in the future once we are either able to interact with and modify the
implicit scope created by instances, or instances scopes get passed in
as explicit operands.
Xilinx Runtime Shell (XRT) support for exposing the MMIO header and
manifest over MMIO. XRT is the platform used by Azure's NP instances
which have access to attached U250 FPGAs. Works in both hw_emu and real
hardware.
This is a re-write of comb loop detection pass. It simplifies the pass to use DFS
over a reaching definitions graph to detect comb loops in the IR.
Also adds support for RefTypes and fixes few bugs.
Fixes: #4691, #5462, #6587
* [Comb] Handle type aliases in `comb.concat`
* [Comb] Add regression test (#5772)
* [Comb] Adhere to convention
* [Comb] Test for presence of `comb.concat` in output
This fixes O(N^2) compile time regression in OrOp(and other logical operations) canonicalizers. Currently tryFlattenOperands flattens operands by only one level, e.g:
Or(a, Or(b, Or(c, d)))
->
Or(a, b, Or(c, d))
->
Or(a, b, c, d)
Problematically this canonicalizer visits operands until a first operand we can flatten every time so this is problematic when chains is really long. This PR fixes the issue by flattening all operands recursively from a root all at once. Also flatteing is moved to a start of canonicalizations so that other canonicalizations are only applied to root operations. This PR should be essentially NFC but there are several differences in verilog files since canonicalizations are applied in a different order and are not canonical.
Benchmark for one of the largest internal cores:
```
Before:
389.7719 ( 9.6%) 341.5307 ( 29.6%) Canonicalizer
4077.4128 (100.0%) 1153.8959 (100.0%) Total
After:
43.4950 ( 1.3%) 1.7205 ( 0.2%) Canonicalizer
3350.8652 (100.0%) 803.7959 (100.0%) Total
```
Fix one of the problems of https://github.com/llvm/circt/issues/6587
Adds a MMIO service implementation for CosimBSP. Doesn't actually fulfill any service requests, just exposes a header (magic number, version, ptr to the manifest) and the system manifest. Implemented in PyCDE as part of the Cosim BSP.
Uses the AXI MMIO cosimulation DPI module so this implementation is likely to work on any platform which uses AXI-lite for device MMIO (e.g. any XRT platform, like the U250 on Azure's NP instances).
Fix warning about holding on to MLIR ops. Service generator instances
get held through a C++/Python interaction barrier, unlike regular
instances. So the member variable `inst` (which points to the MLIR
instance operation) has to be cleared before attempting to clear the
live operations.
Add support for the MMIO ESI service to PyCDE. Most implementations of this service will embed the compressed manifest, which this PR is intended to support. So let's just expose the read service for now.
Self-hosted runners were disabled in our repo, so none of our builds are
being picked up. Going back to the slow ones (with less disk space)
while we figure out the situation.
The 'esi-cosim' script starts a simulation, waits for it to start, then
executes the 'inner' command. When the specified command exits, it kills
the simulation. Very helpful for debugging designs via ESI cosimulation.
Only supports Verilator currently.