Commit Graph

8432 Commits

Author SHA1 Message Date
Amelia Dobis ef30e1f20a
[FIRRTL][Verif][LTL] Replace `ltl.disable` with an enable folded into `verif.assert` (#7150)
This PR gets rid of the `ltl.disable` op and intrinsic in favor of having an enable operand on the verif assert like ops. This made it trivial to fix an incorrect when condition folding for `AssertProperty`. Most of the PR relates to fixing the chaos that was caused by removing `ltl.disable`.
2024-06-20 11:24:37 -07:00
Andrew Young a3f726dc7f
README.md: remove link to broken build (#7222)
The build flow which attempted to build CIRCT against LLVM head was
deleted a long time ago, and our README should not be referencing it.
2024-06-20 10:55:28 -07:00
Hideto Ueno 62cb3d109e
[HW] Clean up HWTypes (#7209)
* Port some of customAssemblyFormat to declarative assembly-format. HW uses unconventional printer so we still need to use a custom directive though. 
* Replace manual `get` declarations with TypeBuilderWithInferredContext in several places
* Make banner consistent with others
2024-06-21 02:28:16 +09:00
Andrew Young 5087c1072a [FIRRTL] SpecializeLayers: rename test to be unique
This renames the name of a test case which is use with CHECK-LABEL,
which works best when the test names are all unique.
2024-06-20 09:35:57 -07:00
Andrew Young c3538f2344 [FIRRTL] SpecializeLayers: fix race condition
This pass processes all modules and layers in parallel, and since this
could result in the operation being deleted, could lead to crash when
two side-by-side ops are removed at the same time and try to modify each
other's next and previous pointers.  This changes the pass to handle the
part of the specialization which can delete the operation in serial.
2024-06-20 09:35:57 -07:00
Andrew Lenharth 2f382b2c5a
[FIRRTL] LHSType wrapper to indicate writable values. (#7117)
This is to enable a split between writable identifiers and readable identifiers.  This removed flow from the dialect eventually.
2024-06-20 10:21:00 -05:00
Hailong Sun c7f4557b4c
[Moore] Fix the stacking fault caused by cast<Variable> and remove unused headers. (#7219) 2024-06-20 15:56:11 +08:00
Hideto Ueno 13ba02f9e0 [CI] Set `actions: write` permission to GarbageCollectCICache github action
Also update the bash script
2024-06-19 23:30:50 -07:00
Hideto Ueno 40992c0e6a [CI] Actually remove cache for short integration tests
The github action looks working fine so actually turn on.
https://github.com/llvm/circt/actions/runs/9592557284/job/26451332772

This commit also increases the number to prevent erasing too much
2024-06-19 23:20:50 -07:00
Hideto Ueno 1aa88e33b6
[CI] Add a job to remove cache created by short integrations tests (#7214)
This PR adds a CI job that deletes caches created by short integrations tests. Almost 10GB is used by short integrations test and I think it's sufficient to have keep most recent ones. By doing that we should be able to keep cache for nightly-integration tests. This PR adds CI job that calls `gh cache delete $id` for results of `gh cache list -k ccache-short-clang-Release-ON-ON`.   

```
gh cache list -k ccache-short-clang-Release-ON-ON -L 50

Showing 27 of 27 caches in llvm/circt

ID     KEY                                         SIZE        CREATED               ACCESSED
66695  ccache-short-clang-Release-ON-ON-2024-0...  360.61 MiB  about 10 minutes ago  about 10 minutes ago
66694  ccache-short-clang-Release-ON-ON-2024-0...  360.33 MiB  about 15 minutes ago  about 15 minutes ago
66665  ccache-short-clang-Release-ON-ON-2024-0...  357.96 MiB  about 13 hours ago    about 22 minutes ago
66692  ccache-short-clang-Release-ON-ON-2024-0...  359.77 MiB  about 1 hour ago      about 1 hour ago
66675  ccache-short-clang-Release-ON-ON-2024-0...  354.45 MiB  about 8 hours ago     about 8 hours ago
66674  ccache-short-clang-Release-ON-ON-2024-0...  358.33 MiB  about 8 hours ago     about 8 hours ago
66673  ccache-short-clang-Release-ON-ON-2024-0...  359.41 MiB  about 8 hours ago     about 8 hours ago
66672  ccache-short-clang-Release-ON-ON-2024-0...  358.70 MiB  about 9 hours ago     about 8 hours ago
66667  ccache-short-clang-Release-ON-ON-2024-0...  358.85 MiB  about 11 hours ago    about 11 hours ago
66663  ccache-short-clang-Release-ON-ON-2024-0...  359.24 MiB  about 16 hours ago    about 13 hours ago
66664  ccache-short-clang-Release-ON-ON-2024-0...  381.06 MiB  about 13 hours ago    about 13 hours ago
66597  ccache-short-clang-Release-ON-ON-2024-0...  357.85 MiB  about 1 day ago       about 14 hours ago
66650  ccache-short-clang-Release-ON-ON-2024-0...  374.79 MiB  about 21 hours ago    about 16 hours ago
66661  ccache-short-clang-Release-ON-ON-2024-0...  376.57 MiB  about 17 hours ago    about 17 hours ago
66660  ccache-short-clang-Release-ON-ON-2024-0...  375.24 MiB  about 17 hours ago    about 17 hours ago
66659  ccache-short-clang-Release-ON-ON-2024-0...  377.82 MiB  about 17 hours ago    about 17 hours ago
66609  ccache-short-clang-Release-ON-ON-2024-0...  354.95 MiB  about 1 day ago       about 17 hours ago
66658  ccache-short-clang-Release-ON-ON-2024-0...  359.28 MiB  about 17 hours ago    about 17 hours ago
66651  ccache-short-clang-Release-ON-ON-2024-0...  358.97 MiB  about 20 hours ago    about 17 hours ago
66657  ccache-short-clang-Release-ON-ON-2024-0...  375.18 MiB  about 19 hours ago    about 19 hours ago
66656  ccache-short-clang-Release-ON-ON-2024-0...  364.31 MiB  about 20 hours ago    about 20 hours ago
66655  ccache-short-clang-Release-ON-ON-2024-0...  369.52 MiB  about 20 hours ago    about 20 hours ago
66654  ccache-short-clang-Release-ON-ON-2024-0...  363.87 MiB  about 20 hours ago    about 20 hours ago
66653  ccache-short-clang-Release-ON-ON-2024-0...  369.72 MiB  about 20 hours ago    about 20 hours ago
66652  ccache-short-clang-Release-ON-ON-2024-0...  374.89 MiB  about 20 hours ago    about 20 hours ago
66647  ccache-short-clang-Release-ON-ON-2024-0...  374.50 MiB  about 21 hours ago    about 21 hours ago
66649  ccache-short-clang-Release-ON-ON-2024-0...  361.49 MiB  about 21 hours ago    about 21 hours ago
```
2024-06-20 15:16:20 +09:00
cepheus 560257cd4c
[Moore] Support unconnected behavior (#7202) 2024-06-20 11:12:31 +08:00
John Demme 1f6c29fb64
[ESI][PyCDE] Callback service (#7153)
Call software functions from hardware.
2024-06-18 22:14:35 -07:00
Andrew Young 0e13467021 [FIRRTL] AnnotationSet: clang-tidy clean 2024-06-18 18:39:27 -07:00
Andrew Young 961d7467e7 [FIRRTL] AnnotationSet: remove unused functionality 2024-06-18 18:39:27 -07:00
Andrew Young 76ef34a530 [FIRRTL] AnnotationSet: add static variadic hasAnnotation
This annotation helper is more convenient to use due to being variadic,
and slightly more efficient as it will not create an empty array
attribute if the target has no annotations.
2024-06-18 18:39:27 -07:00
Andrew Young e2e8e6536b [FIRRTL] AnnotationSet: array attr is never null
We have a fast path when removing annotations that checks if the
underylying array attr is null, which should be impossible.  Remove this
code path and add some asserts.
2024-06-18 18:39:27 -07:00
Will Dietz 6f2aadcb02
[FIRRTL] Fast-path removeAnnotations for operations having none. (#7203)
Common pattern of walk/visit many operations looking for annotations
and removing along the way is taking considerable amount of time
in ArrayAttr::get.  It may make sense to rework AnnotationSet to
not promise a non-null ArrayAttr but for now add a fast-path
where it matters -- in removeAnnotations(Operation *op, predicate).
2024-06-18 14:52:16 -05:00
Prithayan Barua 6cbca83fe5
[HW] Move the CombDataFlow op interface from FIRRTL to HW (#7195)
Move the `CombDataFlow` op interface from `FIRRTL` to `HW` dialect.
The op interface is better suited to reside in the `HW` dialect, along with
 other interfaces like the `HWModuleLike`.
This makes it more convenient for non-`FIRRTL` dialects to implement ops using
 this interface, without introducing a new dependence on the `FIRRTL` dialect,
 assuming  `HW` dependence already exists.
2024-06-18 10:55:05 -07:00
Andrew Young f2d4bb5284 [FIRRTL][CheckCombLoops] Verify that detection works with region ops 2024-06-18 08:45:43 -07:00
Andrew Young b98d7f65e5 [FIRRTL][CheckCombLoops] rename test to match pass name, nfc 2024-06-18 08:45:43 -07:00
Andrew Young 6201aae645 [firtool] Move SpecializeLayers before LowerLayers
We can't specialize away layers after they are lowered, so this pass was
placed in the wrong spot in the pipeline. It was a last minute change to
move specialize layers after checking for combinational loops which
caused this bug, as we need to make sure that all diagnostic passes run
before we start deleting logic, otherwise we can hide errors from the
user.  This adds a few tests that layer specialization is working as
intended, and that it doesn't prevent detection of errors.
2024-06-18 08:45:22 -07:00
Andrew Young 28986b8b98 [firtool] verify that comb loop checking resolves last connects 2024-06-18 08:45:22 -07:00
Andrew Young baec1a1db1
[FIRRTL][SpecializeLayers] Fix incorrect CF leading to double free (#7200)
As a part of specializing layers we have to remove any HierPathOps which
included a reference to deleted instances.  If any member of the path
array is contained in the deleted references list, we need to delete the
op.  There was incorrect use of `continue` which caused us to continue
processing the path instead of skipping to the next path operation,
which could lead to a double free when multiple instances in the path
were removed.
2024-06-18 08:42:26 -07:00
fzi-hielscher d340ca137c
[NFCI][OM][SSP][SystemC] Refactor TableGen Pass includes (#7184) 2024-06-18 14:52:24 +02:00
fzi-hielscher 15ae39ec07
[NFCI][DC][FSM][Handshake][Pipeline] Refactor TableGen Pass includes (#7181) 2024-06-18 13:26:12 +02:00
Andrew Young a49e31d60e
[FIRRTL][SpecializeLayers] Update doc with proper attribute name (#7199) 2024-06-17 19:34:50 -07:00
Andrew Lenharth 6b6855910a [NFC] Add more clang options. From my reading of the docker file, most of them don't actually work since most clang versions are not installed. But regardless, do this in anticipation of different clang versions 2024-06-17 14:35:48 -05:00
Andrew Lenharth 89bc24690d [NFC][FIRRTL] Narrow type for SizedType. 2024-06-17 11:28:48 -05:00
Andrew Lenharth 0046bab73a [NFC][FIRRTL] Narrow SizedPassiveType to FIRRTLBaseType 2024-06-17 11:23:59 -05:00
Hideto Ueno 97da411151
[ExportVerilog] Fix two state type emission of aggregate types (#7189)
This PR fixes an issue that `emitAsTwoStateType` flag was not propagated for aggregate types.

This PR also fixes a bug that ctypes (int/shortint etc) are used as an inner type of packed types (e.g. `int [2:0]` is invalid) according to SV spec 6.8.
2024-06-18 01:14:50 +09:00
Hideto Ueno d1545f4f5a [LowerDPI] Fix the incorrect input type checking
LowerDPI checks that improted DPI functions have the same function
signatures over their call sites. This fixes a bug that mistakenly
regards operand types of call op as input types. Call op has clock and
enable operands so operand types are not equal to input types of
DPI functions.
2024-06-17 08:44:51 -07:00
fzi-hielscher 9afdd4d069
[NFCI][FIRRTL] Refactor TableGen Pass includes (#7178) 2024-06-17 16:18:07 +02:00
Hideto Ueno 3e67926aa3
[SimToSV] Fix DPICall lowering to use `replaceOp` (#7192)
Previously DPICallLowering called `rewriter.replaceAllUsesWith` for individual
results but it seems that is not equivalent to `replaceOp`. 

This also adds missing dialect dependency to seq

Close #7191
2024-06-17 19:44:20 +09:00
Hideto Ueno 18d2872d70
[FIRRTL][ExpandWhens] Add StmtExprVisitor to Visitor and Support DPI intrinsic in ExpandWhens (#7177)
This adds `StmtExprVisitor` struct for visitor to handle operations with an optional result. Currently `GenericIntrinsicOp `and `DPICallIntrinsicOp` are added.

Besides that `ExpandWhens` is modified to handle DPI intrinsic.
2024-06-17 06:21:11 +09:00
fzi-hielscher 28c29619c8
[NFCI][LLHD][Moore][SV][Verif] Refactor TableGen Pass includes (#7183) 2024-06-16 18:36:00 +02:00
fzi-hielscher f5378eb8d9
[NFCI][ESI][Ibis][MSFT] Refactor TableGen Pass includes (#7179) 2024-06-16 18:33:18 +02:00
fzi-hielscher f3054773df
[NFCI][Comb][HW][Seq] Refactor TableGen Pass includes 2024-06-16 18:29:59 +02:00
Robert Young b271e8ac9f
Add missing header includes (#7187) 2024-06-16 10:19:17 -04:00
Robert Young ae1b8f778e
Fix paths in tests for windows builds (#7185)
* Fix paths in tests for windows builds

* Fix patterns that check mlir: backslashes are rendered as double backslashes

* Fix fir emitter for output dirs with backslashes

* Try fixing patterns, again

* FIRLexer: parse escaped backslashes in strings

* Fix more patterns with backslashes

* This time, for an absolute path
2024-06-15 16:20:03 -04:00
Andrew Young c93ca4ecf4 [firtool] Support layer specialization 2024-06-14 15:48:53 -07:00
Andrew Young fbbf36f35a [FIRRTL] Add pass to specialize layers 2024-06-14 15:48:53 -07:00
Andrew Young 870a43ae38 [FIRRTL] InstanceChoiceOp: add method to erase ports 2024-06-14 15:48:53 -07:00
Andrew Young 0ffb67973f [FIRRTL] Passes.td: reflow whitespace, nfc 2024-06-14 15:48:53 -07:00
Amelia Dobis 0a81a3eb69
[Verif] Add PrepareForFormal pass (#7175)
This PR introduces a PrepareForFormal pass that tries to alleviate some of the heavy lifting being done in the btor emission. For now this only flattens wires, but in the future in will also handle formal contracts and anything else that is done to make emission for formal tools easier, which is why it's part of the verif dialect and not hw.

This is derived from #7150
2024-06-14 12:07:06 -07:00
Robert Young 41ebd04f88
[FIRRTL] Output directory control for layers and modules (#6971)
* Add getDirectoryAttr helper to HWOutputFileAttr

This helper gets the directory component of an output file name, or returns
nullptr if there is none.

* Output directory control v2

Instead of using an explicit precedence declaration anno to help guide the
assignment of floating modules to output directories, use the directory
hierarchy itself.  So if a module is used under directory A/B and A/C, it will
be placed into directory A.

* Support absolute output directories for modules

* Add comment

* Make it so output dir annos only apply to public modules

* Simplify lower layers

* Add ability to configure the output directory of assign-output-dirs

* Update tests

* Address review comments

* Clean up whitespace in test

* clang-format

* Fix up firtool integration test excercising dedup + output dirs

* Address review comments
2024-06-14 14:51:28 -04:00
fzi-hielscher 7690177154
[NFCI][Transforms] Refactor TableGen Pass includes (#7173) 2024-06-14 19:13:15 +02:00
fzi-hielscher 2554a14234
[NFCI][Calyx] Refactor TableGen Pass includes (#7182) 2024-06-14 18:55:51 +02:00
fzi-hielscher 0e22c2b27a
[NFCI][Conversion] Refactor TableGen Pass includes (#7174)
Refactor includes of TableGen passes in the "Conversion" sub-tree to the new style.
See #3962 , https://reviews.llvm.org/D143773
2024-06-14 16:37:29 +02:00
Hideto Ueno ff4c6218f3
[LowerDPI] Create a helper struct, NFC (#7176)
This is a preparation for another PR. Create `LowerDPI` struct and refactor the logic into several helper functions.
2024-06-14 23:10:08 +09:00
Hideto Ueno f32a5a196c
Bump llvm (#7167)
Bump to 00bb18a77c

* applySignatureConversion change 52050f3ff3
2024-06-14 14:38:46 +09:00