Commit Graph

7781 Commits

Author SHA1 Message Date
Mike Urbach 8801f42463 [NFC] Rename Python wheel job name from Nightly to Weekly.
We have changed the job to run weekly to avoid running out of space in
PyPI. This just updates the job name to reflect that.
2024-01-25 13:09:56 -07:00
Andrew Lenharth 76cda20533 [NFC] Rename confusing api.
.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.
2024-01-24 16:14:08 -06:00
John Demme 6ef649eb43
[PyCDE] Fix import hw modules (#6130) (#6605)
Fixes #6130.
2024-01-24 12:25:27 -08:00
Andrew Lenharth bd157adbce [NFC] bump llvm 2024-01-24 13:47:14 -06:00
Andrew Lenharth 070b77689b [NFC] functions should be file local 2024-01-24 13:46:59 -06:00
Andrew Lenharth 2654d56b93 [NFC] remove some warnings 2024-01-24 13:46:37 -06:00
Mike Urbach 19d522f1e5
[FIRRTL] Initial support for classes and objects in Dedup. (#6582)
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
2024-01-24 10:42:21 -07:00
Nandor Licker cb19b5458d [NFC] Remove extraneous dump 2024-01-23 12:19:20 -08:00
Nandor Licker 176926b814 [NFC][CheckCombLoops] Allow UnrealizedConversionCast to close loops 2024-01-23 12:08:55 -08:00
Andrew Lenharth dc711a8157 [NFC] llvm bump 2024-01-23 11:57:51 -06:00
fzi-hielscher 38b53252ae
[FIRRTL][ExtractInstances] Clear entire state on pass invocation (#6599)
Clear 'dutModuleNames' and 'dutPrefix' along with the other members before running the pass.
2024-01-23 02:17:01 +01:00
Andrew Lenharth b689f6378c [NFC] bump llvm 2024-01-22 16:25:22 -06:00
Nandor Licker be15910448
[Seq] Add a representation for clock inverters (#6575) 2024-01-22 20:45:56 +02:00
Andrew Lenharth 2a809a3565 [FIRRTL] Make the Field Source analysis more robust to newer ops 2024-01-22 11:55:31 -06:00
Andrew Lenharth d8b3cf6b70 [NFCI] Test cases are invalid if initialization check happens early 2024-01-22 11:51:00 -06:00
Fabian Schuiki ce274399ee
[FIRRTL] Create debug info scopes for inlined modules (#6512)
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.
2024-01-22 08:57:45 -08:00
John Demme 7c3c6c8799 [PyCDE] Fixing ESI manifest test for builders without GitPython
FileCheck line assumed that repo and commitHash were filled in, which
they wouldn't be if GitPython isn't installed.
2024-01-21 00:56:30 +00:00
John Demme 26cf76c591 [Ibistool] Replace wide include with something more targetted
Avoids introducing implicit dependencies on header files which may or
may not be generated. (GPU dialect was the specific issue.)
2024-01-21 00:07:30 +00:00
John Demme 0cd857f581 [PyCDE] Remove a bunch of old cruft
A lot of this functionality was replaced by the ESI runtime.
2024-01-20 03:05:53 +00:00
John Demme d0879a7663
[PyCDE] Add ESI metadata to modules (#6597)
Users can either explicitly specify metadata or it can be automatically generated.
2024-01-19 17:28:54 -08:00
John Demme 01022f7f7b [PyCDE] Fixing tests broken by XRT merge
Oops... didn't run these tests!
2024-01-19 23:08:03 +00:00
John Demme ac60e3af1b
[ESI] XRT support for MMIO based manifest fetching (#6596)
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.
2024-01-19 14:20:43 -08:00
Will Dietz 3c1ca32322 [FIRRTL][FIRParser] Tweak error for Probe<T> where T isn't base.
Probe<Integer> shouldn't complain about nested "reference" types.
2024-01-19 15:54:19 -06:00
Prithayan Barua 7032ca61b9
[CheckCombLoops] Refactor comb loop detection pass (#5647)
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
2024-01-19 10:21:34 -08:00
hovind 86a6b745ad
[Comb] Handle type aliases in `comb.concat` (#6588)
* [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
2024-01-19 18:05:53 +01:00
Megan Wachs 28d430dd25
bump llvm submodule to tip of main (103fa3250c46) (#6589) 2024-01-19 09:45:35 -06:00
Hideto Ueno 3a8733e88f [CombFolds] Fix a typo in a comment, NFC 2024-01-19 04:54:08 -08:00
Hideto Ueno a784585073
[CombFolds] Flatten operands all at once (#6593)
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
2024-01-19 19:31:35 +09:00
John Demme 6f4562b684
[ESI] MMIO based manifest cosim support (#6592)
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).
2024-01-18 20:50:36 -08:00
John Demme c2c1cd5c07
[PyCDE] Fix service generator warning (#6595)
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.
2024-01-18 20:05:50 -08:00
Hideto Ueno 822235043d
[FIRRTL] Naming bounce wires properly (#6594)
LowerSignatures creates anonymous bound wires as a place holder but these didn't get proper names from ports.
2024-01-19 12:49:28 +09:00
John Demme fe5efb3a6e [PyCDE] Expose input ports, rename output getter, fix name issue 2024-01-19 03:46:07 +00:00
Andrew Lenharth 3837b1057c [NFCI] Don't clone arith dialect attrs into comb. Comb doesn't know about these. 2024-01-18 12:01:17 -06:00
Hideto Ueno a285ab792b [HW] Replace func.func with hw.module in HW/errors.mlir, NFC 2024-01-18 01:19:27 -08:00
John Demme 14b8450bc5
[PyCDE] Support for ESI MMIO service -- read side only (#6590)
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.
2024-01-17 21:04:25 -08:00
John Demme 90f2bea727 [PyCDE] Fix esi_ram integration test
Changed 'write' to 'req' on the CIRCT side without updating the PyCDE
side. Fixed.
2024-01-18 02:23:47 +00:00
John Demme 2e0936e1c4 [PyCDE] Verify the system after finishing generation
Helps improve debuggablity of the design.
2024-01-18 02:16:28 +00:00
Sprite 7b7134c4fd [FIRRTL][CAPI] Expose `foldFlow` function 2024-01-18 08:35:52 +08:00
John Demme 9af79e2f66
[ESI] Lower manifest op to a ROM (#6585)
Since ESI hardware embeds the manifest, lower the zlib-compressed version of it to a module to be instantiated by a BSP.
2024-01-16 22:47:12 -08:00
John Demme c2d9d36aec
[ESI] Introduce MMIO std service (#6584)
Currently, can only request a single 32-bit register. In the future,
we'll add the ability to request structs of config/status registers.
2024-01-16 21:34:35 -08:00
John Demme f2428b995f Revert "[Builds] Revert back to small runners (#6586)"
This reverts commit 34489a17f0.
2024-01-17 05:18:35 +00:00
John Demme 34489a17f0
[Builds] Revert back to small runners (#6586)
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.
2024-01-16 19:22:53 -08:00
John Demme 769c6b0609 [ESI] Cosim MMIO: detect too many read/write responses
If the simulation attempts to send more responses than there are
outstanding requests, log an error.
2024-01-17 02:36:14 +00:00
John Demme 985858c7b3 [PyCDE] New ignore for dev-convient soft link 2024-01-17 00:30:01 +00:00
Andrew Lenharth 7cd2e31494 [NFC] LLVM bump 2024-01-16 17:10:42 -06:00
John Demme b32297eec0 [ESI] Fix integration tests (missing file) 2024-01-16 22:57:22 +00:00
Nandor Licker 0fd109f6e1 [NFC][Seq] Do not update temporary ops with names 2024-01-16 14:36:53 -08:00
Nandor Licker 3d8d8982a2 [NFC][Seq] Use the rewriter in the clock gate lowering 2024-01-16 13:33:39 -08:00
John Demme 7c59a2ef43
[ESI][Runtime] Add a utility wrap a command with a cosim (#6579)
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.
2024-01-15 15:37:20 -08:00
Bea Healy 05d0886671
Update FSMToSV summary (#6580) 2024-01-15 17:03:54 +00:00