Commit Graph

8210 Commits

Author SHA1 Message Date
Will Dietz b8fb074687
[FIRRTL][LowerAnnotations] Reject non-local fullasyncreset anno's. (#6988)
These are not understood in a non-local way, reject them.

Docs say this annotation cannot be used on a module instantiated
multiple times (apparently) so non-local should never be needed.
2024-05-07 09:32:29 -05:00
hovind 24b845cf3c
[CAPI][Moore] Remove deprecated types (#6994) 2024-05-07 12:00:41 +02:00
Martin Erhart 282bdb85b2 [Moore] Remove remaining usages of EnumType 2024-05-07 11:10:13 +02:00
Morten Borup Petersen aba85bf470
[Handshake] Add control_merge deconstruction pattern (#6934)
This pass deconstructs the (rather complex) semantics of a >2 input cmerge operation into a series of 2-input cmerge operations + supporting logic. This simpler structure is better suited for `dc` lowering, which only supports lowering 2-input control merge operations.

Simplify

fix test

Also split regular merges

nit

Fix index type propagation for cmerge

Also zext non-`builtin.index`-typed `control_merge` operations
2024-05-07 11:08:04 +02:00
Morten Borup Petersen 836e745b6b
[DC] Add merge lowering (#6943)
* [DC] Add merge lowering

Modelled after the Handshake lowering, however, becomes trivial with a 2-input merge.

* Add Handshake->DC merge lowerings

* Update lib/Conversion/DCToHW/DCToHW.cpp

Co-authored-by: Christian Ulmann <christianulmann@gmail.com>

* Update lib/Conversion/HandshakeToDC/HandshakeToDC.cpp

Co-authored-by: Christian Ulmann <christianulmann@gmail.com>

* format

* notifyMatchFailure

---------

Co-authored-by: Christian Ulmann <christianulmann@gmail.com>
2024-05-07 10:21:25 +02:00
Morten Borup Petersen 91348ba8f1
[Pipeline] Verify >0 result types for LatencyOp (#6992) 2024-05-07 09:56:51 +02:00
Fabian Schuiki 475c6b459c
[Moore] Remove named and ref types
Remove the named and ref types from the Moore dialect. These
corresponded to Verilog `typedef`s and the `type(<expr>)` syntax,
respectively. Since Slang performs full type checking on its AST, these
types are no longer necessary at the Moore dialect level. This
significantly simplifies the dialect's type system. Once we have a
working lowering from Slang to the core dialects, we can reintroduce a
dedicated type to track user-defined type names.
2024-05-06 21:09:45 -07:00
Fabian Schuiki a36c258349
[Moore] Remove enum type
Remove the enum type from the Moore dialect. No passes or lowerings
currently make use of this type, but imemdiately resolve it to its
underlying integer type instead. This simplifies the dialect. Once the
need for an enum type arises again in the future, we can define a new
one.
2024-05-06 20:45:34 -07:00
Fabian Schuiki 2769f6528a
[Moore] Move simple leaf types into TableGen; NFC
Move the definitions of the `void`, `string`, `chandle`, and `event`
types into TableGen.
2024-05-06 20:14:33 -07:00
Fabian Schuiki e9ce6dd29d
[Moore] Remove unused type constraints; NFC 2024-05-06 20:07:06 -07:00
Andrew Lenharth b2d3a3815a [NFC] LLVM bump 2024-05-06 17:26:26 -05:00
Martin Erhart 4bf56eed16
[CombToArith] Fix coarsening of division by zero UB (#6945) 2024-05-06 15:59:36 +02:00
Will Dietz 62fbb3ae68
[FIRRTL][Dedup] Alter dedup group handling, avoid exponential behavior. (#6985)
Transmute these annotations to simple (temporary) attributes on modules.

This causes the desired behavior for hashing and since this must
match, when deduplicating no work is needed.

Presently, as annotations, each module dedup'd into the group
walks all annotations and "adds context" (makes them non-local)
and interns a new annotation array with those annotations.
At the end of the pass, all dedupGroup annotations are removed.

This causes a lot of unnecessary symbols, hierpaths, annotations, and arrays of
annotations as well as some quadratic behavior.

DedupGroup annotations are commonly on every single module,
so for those designs large dedup groups scaled poorly.

Instead, drop these annotations immediately and add as a simple
named attribute indicating the group.

Drop the (temporary) dedup group attributes at end of pass,
as they are just an in-IR way to track this per-module
during the pass.

Fixes #6979.

Also:
Cleanup all module-like's, not just fmoduleop's.

Pre-existing that caused these to persist to LowerToHW which
generated warnings about them (on non-fmoduleop fmodulelike's).

Now, prune the attribute added (on all) so they don't leak past.
2024-05-03 15:30:07 -05:00
Will Dietz 7fc69f14c6 Remove "using namespace mlir" from include.
Hopefully fix Windows builder.

See d090c6689d (commitcomment-141641867) .
2024-05-03 15:02:42 -05:00
Will Dietz 054df98be3
[FIRRTL][InferResets] Fix fullasyncreset diag to use right name. (#6987) 2024-05-03 14:57:56 -05:00
Amelia Dobis 800209ca6f
[firtool] Integrate AssertProperty lowering into BTOR2 pipeline (#6975)
* Add lowering for AssertProperty operations

* removed nl at start of file

* integrated ltl lowering into --btor2

* sorted cmake and removed unreachable branches

* reordered cmake

* cleaned up test

* added pass registration
2024-05-03 12:35:09 -07:00
Will Dietz 00036d73a5
[FIRRTL] docs: fullasync annotation targets signal not module. (#6986) 2024-05-03 14:28:18 -05:00
Andrew Lenharth 79f0f81383
[NFCI] Document division and the rational for the handling of divide by zero (#6962) 2024-05-03 14:15:15 -05:00
Amelia Dobis d090c6689d
[LTL to Core] Add lowering for AssertProperty operations (#6974)
* Add lowering for AssertProperty operations

* removed nl at start of file

* sorted cmake and removed unreachable branches

* Removed useless wire in test + removed symbol from hbr compreg
2024-05-02 12:57:52 -07:00
Théo Degioanni 523d6fd7e3
[Arc] Hoist reset value in CompReg when lowering for simulation (#6972)
Arcilator currently does not support non-zero reset values for compreg. This change canonicalizes reset values to a mux on the input, as it currently makes no difference for simulation purposes, and sidesteps the reset value limitations.
2024-05-02 11:13:56 +02:00
Martin Erhart 8e36cea43f
[SMT] Add quantifier support to LLVM lowering (#6973) 2024-05-02 10:09:14 +02:00
Schuyler Eldridge 279a3e3cd9
[FIRRTL] Add inline convention to layers (#6980)
Add an "inline" convention to layers by adding this to the existing
enumeration.  By the nature of how the parser works, this automatically
adds support to parse this attribute without modifications to the parser.

This does not add any support for this in the FIRRTL pipeline.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2024-05-02 00:24:08 -04:00
Will Dietz 87d3b5d11b
[FIRRTL] Drop dead ScalaClassAnnotation. (#6981)
We've rejected this during LowerAnnotations since we've had
LowerAnnotations, so it's safe to say this is thoroughly dead.

The internal source of this was removed in January.
2024-05-01 19:50:12 -05:00
Schuyler Eldridge de0425e2e7
[FIRRTL] Whitespace cleanup, NFC
Cleanup trailing whitespace in a test.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2024-05-01 19:29:38 -04:00
Théo Degioanni ff39dd4d86
[Seq] Fix compreg printer printing two spaces (#6978)
This is an interesting TableGen quirk where adding an empty punctuation before a custom assembly format directive avoids the double space printing.
2024-05-01 22:23:02 +02:00
Andrew Lenharth bdc8503217 [FIRRTL] Fix missing folding of sizeof for aggregates. 2024-04-30 22:47:49 -05:00
Andrew Lenharth acbee5dc91 [FIRRTL] Fix isX lowering for aggregates
Oversight in lowering.  bitcast to an int to do the check.

Closes #6926
2024-04-30 22:32:26 -05: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
Will Dietz 38cd3ac905
[FIRRTL][FIRParser] Add deprecation warning about printf/when-encoding. (#6792)
Only warn once per module to keep it from being entirely overwhelming.
(and report how many, in terms of printf's, to convey magnitude)

Split out when-encoding parser behavior to dedicated file,
and look for the deprecation diagnostics in tests that use them.
2024-04-30 11:06:38 -05:00
Will Dietz 3ef492c80e
[ExportVerilog] Ensure DivS/ModS are signed regardless of context. (#6966)
Fixes #6961.
2024-04-30 07:07:08 -05:00
Andrew Lenharth 61b360ab4f [FIRRTL] Minor canonicalization of cat(asuint) 2024-04-29 18:08:32 -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
Amelia Dobis 6ce4438878
[HW] Moved and renamed arc/inlineModules to hw/flattenModules (#6964)
* Moved and renamed arc/inlineModules to hw/flattenModules

* removed unused code and reformulated pass description
2024-04-29 13:41:50 -07:00
Andrew Lenharth 6100c2f028
[NFC] LLVM Bump (#6963)
Some namespace issues in ibis, presumably from an mlir tablegen change.
2024-04-29 11:19:06 -05:00
Andrew Lenharth 917e5b0b33 [NFC] Set myself as codeowner for the common dialects 2024-04-29 10:21:42 -05:00
7FM ef689399ca [FlattenMemRefs] fix op use after replace 2024-04-29 16:36:22 +02:00
7FM bcbac57895 [HW][FlattenIO] fix op use after replace 2024-04-29 16:36:22 +02:00
7FM e187ba7ad7 [HWArith] fix op use after replace 2024-04-29 16:36:22 +02:00
Andrew Lenharth 8acaeb5941
[FIRRTL] Canoncializations of not( cmp ) (#6957)
Simple peephole optimization.  Triggers on real designs.
2024-04-29 09:06:35 -05:00
Martin Erhart 81789e21ba Add myself as codeowner of the SMT dialect 2024-04-29 10:01:13 +02:00
Martin Erhart f78d522fa8 [FIRRTL] Fix signed/unsigned comparison warning 2024-04-28 17:18:17 +02:00
Martin Erhart 5955eff5e3 [FIRRTL] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 17:05:52 +02:00
Martin Erhart 594e3fb83f [Calyx][OM][Pipeline] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:53:58 +02:00
Martin Erhart ad1b56c01b [Ibis] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:49:52 +02:00
Martin Erhart ad148fb46c [HW] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:41:57 +02:00
Martin Erhart f14114c4e2 [SV] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:35:44 +02:00
Martin Erhart 0135db8709 [Seq] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:12:57 +02:00
Martin Erhart a3e86791a1 [ESI][MSFT] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:11:30 +02:00
Martin Erhart 0953c767fa [SystemC] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:08:01 +02:00
Martin Erhart 6520a1b82a [Comb] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 16:01:16 +02:00