Commit Graph

6271 Commits

Author SHA1 Message Date
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
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 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
Martin Erhart cfaf3d79ae [Handshake] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 15:57:40 +02:00
Martin Erhart 8867f7b867 [LLHD] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 15:48:54 +02:00
Martin Erhart 93e2cb71a2 [Moore] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 15:42:37 +02:00
Martin Erhart f396653c7c [Arc] Use free variants of isa/cast/dyn_cast
Refer to https://mlir.llvm.org/deprecation/
2024-04-28 15:36:36 +02:00
Hideto Ueno a794b8a255
[FIRRTL] Don't fail Dedup group annotation EICG_wrapper (#6955)
Currently `DedupGroup` is added to almost every module including `EICG_wrapper`. However EICG_wrapper later becomes intrinsic when a compiler option `fixup-eicg-wrapper` is given. This causes a compilation error since annotation is added to an intrinsic. The right fix is to use to EICG intrinsic in the first place but there are still a few things to migrate ( ExtractInstances).  Since dropping DedupGroup annotation on EICG_wrapper is practically safe this PR removes the annotation with a warning.
2024-04-27 08:07:16 +09:00
7FM d2ba0968d3
[Scheduling] computeStartTimesInCycle: clear before recomputation (#6951)
This PR adds a `clearStartTimesInCycle()` method to the ChainingProblem to simplify the reuse of one problem instance for multiple solving attempts.
2024-04-26 10:35:13 +02:00
Hailong Sun d9e35fa8a9
[MooreToCore] Lower moore operators into comb or hw. (#6940)
Co-authored-by: Fabian Schuiki <fschuiki@iis.ee.ethz.ch>
2024-04-24 09:44:41 +08:00
John Demme 20ef1a2cb1 [ESI][runtime] Opt out of cosim and error out if capnp not found
Fixes a runtime link error on non-capnp builds. Provides an option to
disable ESI cosim. If enabled (the default), produce a CMake error if
capnp is not found.
2024-04-23 21:15:13 +00:00
hovind e4ed019926
[Comb] Remove more idempotent operands (#6903)
For `op`s `{and,or}` rewrite `op(x, op(x,y))` to `op(x, y)`.
2024-04-23 10:23:24 -07:00
Morten Borup Petersen d3f3163f41
[HandshakeToDC] Fix constant unit-rate op lowering (#6942)
Constant-like unit-rate operations didn't have any output tokens assigned. Fixed s.t. constant-like operations (with no inputs) are emitted using a `dc.source`.
2024-04-23 11:44:01 +02:00
Asuna 172b5eabb5 [FIRRTL][CAPI] Add function for getting mask type 2024-04-23 06:43:27 +08:00
Morten Borup Petersen db973f1319 [NFC][DC] Tidy 2024-04-22 14:40:14 +00:00
Morten Borup Petersen 7e34f27084 [DC] Don't restrict DC materialization to `FunctionOpInterface` 2024-04-22 12:13:57 +00:00
cepheus 61a18fe046
[Moore] Introduce a new operation - netOp for net declaration (#6884)
* [Moore] Add the netOp for net declaration in SV

NetOp is for variable declaration. Net Types defines different types of net connections in SV. There are twelve built-in net types defined
`supply0`, `supply1`, `tri`, `triand`, `trior`, `trireg`, `tri0`, `tri1`, `uwire`, `wire`, `wand`, `wor`, and three special net types:
`interconnect`, `userdefined`, `unknown`. The special ones are marked as unsupported because we have no plan to support them currently.
Corresponding test cases have been added to the parser/print and ImportVerilog pass tests. Add two expected failed netkind test cases -
`interconnect` & `user-defined`.

---------

Co-authored-by: Fabian Schuiki <fabian@schuiki.ch>
Co-authored-by: Hailong Sun <hailong.sun@terapines.com>
2024-04-22 13:08:54 +08:00
hailong 77a0808750 [ImportVerilog] Fix the types mismatch for variable declarations. 2024-04-22 10:29:14 +08:00
angel e2b0f3230b [ImportVerilog] Add case statement. 2024-04-22 10:00:32 +08:00
Hailong Sun 80c6602d37
[ImportVerilog] Add replicate and extract operations. (#6906) 2024-04-22 09:57:29 +08:00
Martin Erhart 7598a8e067
[circt-lec] Port to SMT dialect based compiler pipeline (#6908) 2024-04-21 08:06:39 +02:00
Martin Erhart da900a210b
[SMTToLLVM] Add support for most expressions (#6905) 2024-04-20 11:21:59 +02:00
Martin Erhart 5cf1ff57f4
[SMT] Add lowering to LLVM IR (#6902) 2024-04-20 10:11:47 +02:00
Martin Erhart 3a08dce574 [ExportSMTLIB] Fix printing of too many closing parentheses
The number of open parentheses should not be propagated to quantifier bodies and the first child expression of 'let' which declares the bound variable
2024-04-20 09:21:17 +02:00
Luisa Cicolini b4b4a7b6b1
[SMT] Added weight attribute support for ExportSMTLIB (#6920) 2024-04-20 08:57:46 +02:00
Mike Urbach b12695ab14
[FIRRTL] Disambiguate paths when possible in ResolvePaths. (#6937)
We would previously error if paths are contained in multiply
instantiated modules, because there is no unique path in this
case. However, we could expand out the path into multiple unique paths
in this case, but this is only safe to do if the path is already used
in a list where multiple paths are acceptable.

This relaxes the requirement and implements the path expansion in this
scenario. When we hit a multiply instantiated module, we expand out
all the instance paths to that module from the owning module, and
create multiple annotations and resolved paths.
2024-04-19 16:39:22 -06:00
Mike Urbach 0e781d48bf [InstanceGraph] Expose choice of top in getAbsolutePaths, NFC.
This exposes a new getAbsolutePaths API where the user may specify an
InstanceGraphNode to use as the top of the returned paths. The
existing API that does not expose this simply calls the new API using
getTopLevelNode(), preserving the previous behavior. An upcoming
change will use the new API to get absolute paths relative to a
different top.
2024-04-19 12:11:11 -07:00
Bea Healy 21b9395e25
[HWToBTOR2] Deduce resets from (Fir)RegOps (#6918)
* Fetch reset value from (Fir)RegOp instead of hardcoded signal name

* Add block arg check on reset

* Add test for multiple resets &non-block-arg resets

* Fix test module name

* Add EOF newline to test
2024-04-18 22:38:49 +01:00
Théo Degioanni 8c3250567e
[Arc] Fix segfault in SplitLoops (#6928)
There was an interesting segfault where unrelated calls to functions would confuse the SplitLoops pass into thinking it is a call to an Arc.
2024-04-18 09:24:01 +02:00
Aditya Naik 9ecd40e86c
Update annotation handling to fix partial field reset behavior (#6912)
Update annotation handling in InferResets and SFCCompat
2024-04-17 11:02:39 -07:00
Will Dietz ea77394a85
[FIRRTL] no back-prop for width of mux selectors, support narrower (#6917)
* Allow mux selectors to be zero-width or 1-bit (for mux4).

This is legal per FIRRTL spec.

* InferWidths: mux no back-prop.

Fixes https://github.com/llvm/circt/issues/5444

* canonicalizers for small mux selectors

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@gmail.com>
2024-04-17 07:43:17 -05:00
Will Dietz 936806f0f5
[FIRRTL] Gather intrinsic lowering via dialect interface. (#6923)
Make it easier to extend the set of intrinsic lowering patterns
by implementing the dialect interface for your dialect.

Current lowering patterns are implemented as part of the FIRRTL
implementation of this dialect interface.

This doesn't facilitate adding intrinsic implementations (lowerings)
unrelated to a different dialect but leave that sort of extensibility
as future work.
2024-04-16 19:58:45 -05:00
Prithayan Barua 442e886b8f
[LowerFirReg] Reimplement the mux reachability analysis (#6914)
This implements a new heuristic to determine if a Mux is reachable from a
FirReg. In general an operation is reachable from a register if its in the
fanout of the register. For FirReg lowering, an if/else structure is required
for proper enable inference, if a mux is within the fanout from the register.
The fanout path can only consist of MuxOp, ArrayGetOp or ArrayCreateOp.
Thus any ops other than MuxOp, ArrayGetOp or ArrayCreateOp block the
reachability. The analysis is built lazily when its queried and the result is
cached to avoid redundant traversal of the IR.
This fixes an issue that caused the merged commit for #6709 to be reverted.
The was to explicitly specify the default size of `SmallVector`.
2024-04-11 08:07:41 -07:00
Morten Borup Petersen 6d4939d89d
[Ibis] Divorce port name (hints) from port symbol names (#6909)
Port symbols now have no effect on the eventual port name of a module. This also implies that multiple ports can have the same namehint, and will be uniqued when lowering `ibis.container` to `hw.module` (see new test in `containers_to_hw.mlir`).
2024-04-11 10:27:01 +02:00
Will Dietz b649dd6d79
[FIRRTL][LowerIntmodules] Add stats, preserve if nothing changed. (#6910) 2024-04-10 10:06:58 -05:00
Will Dietz 3d890feb2c [FIRRTL][Intrinsics] Check for param count after for better diagnostic.
"You don't have enough parameters" vs "missing parameter FOO"
2024-04-10 07:47:05 -05:00
Will Dietz 239163abfd [FIRRTL][Intrinsics] Respect const output bundle in lowering.
Also, avoid ambiguous call to getElementType().
2024-04-10 07:44:53 -05:00
Will Dietz ca24267763
[FIRRTL] LowerIntrinsics: rewrite to lower generic ops. (#6877)
Move to module pass, and use rewriting framework for safety,
familiariy, and (with some help) simpler lowering code.

Add LowerIntmodules to the pipeline as this is now needed
for compatibility with designs not yet using the new intrinsic format.
2024-04-09 17:46:54 -05:00
Prithayan Barua 44b753d0fe Revert "[LowerFirReg] Reimplement the mux reachability analysis (#6709)"
This reverts commit ac8f7767e1.
2024-04-09 15:33:31 -07:00
Prithayan Barua ac8f7767e1
[LowerFirReg] Reimplement the mux reachability analysis (#6709)
The PR implements a new heuristic to determine if a Mux is reachable from a
 FirReg. In general an operation is reachable from a register if its in the
 fanout of the register. For FirReg lowering, an if/else structure is required
 for proper enable inference, if a mux is within the fanout from the register.
The fanout path can only consist of MuxOp, ArrayGetOp or ArrayCreateOp.
Thus any ops other than MuxOp, ArrayGetOp or ArrayCreateOp block the
 reachability. The analysis is built lazily when its queried and the result is
 cached to avoid redundant traversal of the IR.
2024-04-09 14:29:59 -07:00
Prithayan Barua fbef8b9778
[CreateSiFiveMetadata] Generate firrtl.class instead of om.class (#6736)
Update the object model generated by the CreateSiFiveMetadata pass to generate
 firrtl dialect, instead of om dialect. Ensure all firrtl.class associated with
 the metadata are instantiated inside a top level firrtl.class SiFive_Metadata,
 which is instantiated inside the top level firrtl.module. This is required for
 ensuring that subsequent passes can lower it correctly.
Also generate all the hierarchical paths to the memory and associates them with
 the path operation for the memory metadata.
2024-04-08 12:33:54 -07:00
Will Dietz d1a2f5eba2
[FIRRTL] Generic intrinsic parsing/emitter support (#6897)
Add parsing and emitter support for FIRRTL intrinsic.

Refactor parameter parsing on (ext/int)modules as these use same syntax.

See tests and PR for more details.

Thanks for the grammar fix, Rob!

Co-authored-by: Robert Young <rwy0717@gmail.com>
2024-04-08 11:42:00 -05:00
Andrew Lenharth a25118c067
[FIRRTL] Use a flag to implement scalarization of internal modules. This is precursor to making lower-types a module-pass and optional. This will deprecate the flags to lower-types and make aggregate preservation a function of NOT running lower-types, rather than having to control it to ensure ports are correct. (#6901) 2024-04-08 10:04:31 -05:00
Asuna 8868394e32 [FIRRTL][CAPI] Allow constructing integers larger than 64 bits 2024-04-07 05:04:23 +08:00
Felix Schneider 923a5ee13d
[LowerToHW] Wrap signed format string operands in `$signed()` (#6887) 2024-04-06 21:42:51 +02:00
fzi-hielscher 13ea7a51d7
[SMT] Minor width related fixes for BitVectorAttr (#6900)
Some minor changes to the construction of BitVector attributes in the SMT dialect:
- Fix parsing of smt.bv.constant #smt.bv<-1> : !smt.bv<1> which currently trips the width check due to odsParser.parseInteger creating an unnecessarily wide APInt. The new logic is copy-pasted from the FIRRTL ConstantOp parser. See #6794.
- Change the type of the attribute builder's value argument from unsigned to uint64_t matching the signature of the APInt constructor, to allow values up to 64 bits and avoid architecture dependent behavior.
- Prevent left-shifts wider than (or equal to) the shifted operand's number of bits in the width checking logic to avoid undefined behavior.
2024-04-05 14:51:12 +02:00
Will Dietz 7d96ea46ee
[FIRRTL] Drop support for long-unused subcircuit annotations. (#6899)
This is a functional change in that these presently are ignored
and will now be rejected.
2024-04-04 19:00:59 -05:00
Will Dietz be0843e5a5
[FIRRTL] Fixup visit ops miscategorized. (#6896)
FPGAProbeIntrinsicOp is not an expression (not pure and no results!),
mlir::UnrealizedConversionCast is only sometimes expression-like
(and FIRRTLVisitor is for visiting FIRRTL-dialect operations only),
and GenericIntrinsicOp is neither expression nor statement so just
add a special visitor for it.

Update passes using visitors to reflect these changes.
2024-04-04 11:33:45 -05:00
John Demme 83dd12ec37
[Ibis] Introduce 'ibis.design' (#6835)
* Revert "[Ibis] Split ContainerOp in two (#6739)"

This reverts commit d17f2f1a1b.

* [Ibis] Introduce 'ibis.design'

Encapsulate everything into a new op. It's an InnerSymbolTable so that
we can identify _everything_ with inner symbols.

Partial progress.

* Hopefully avoid some msvc warnings

* add topLevel attr to containerop

* bug fixes

* Nest createContainerizePass inside of <ibis::DesignOp>

* Work

* Work

* Working

* Self review

---------

Co-authored-by: Blake Pelton <blakep@microsoft.com>
Co-authored-by: Morten Borup Petersen <morten_bp@live.dk>
2024-04-04 11:55:02 +02:00
Fabian Schuiki 35e8aa5725
[Arc] Add statistics to SplitLoops; NFC 2024-04-03 16:43:11 -07:00
Nandor Licker 79f2728a53 [NFC][Seq] Normalize the names of divider op arguments 2024-04-03 04:45:25 -07:00
Nandor Licker ccd8f90a8c [NFC][Seq] Relax the divider with to 64 bits 2024-04-03 00:28:27 -07:00
Andrew Lenharth f77c00222c
[NFC] Cache common lookups in ModuleType (#6892)
Use custom storage for ModuleType to cache input/output <-> index mappings.  Speeds up many things in small ways.
2024-04-02 14:26:05 -05:00
Morten Borup Petersen 562f4d7cd2
[CFToHandshake] Move `Transforms` dependency to implementation (#6889)
Fixes #6693
2024-04-02 20:24:07 +02:00
Nandor Licker d84cf8c903
[FIRRTL] Expose clock dividers as a FIRRTL intrinsic (#6890)
This PR adds an intrinsic to expose `seq.clock_div` to FIRRTL.
2024-04-02 18:00:10 +03:00
Will Dietz 0b5bad3be3 [FIRRTL][NFC] Fix decl/def name for argument.
Caught by tidy.
2024-04-02 08:10:09 -05: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
Andrew Lenharth e55c5d56a6
[NFC] Massive Export Verilog Speedup (#6886)
Getting all the ports to lookup one attribute is very expensive.  Mainly from GetAllPortLocs requiring several lookups and allocations.  Just avoid doing this by not using the summary functions and looking up individual ports directly (as should generally be done to avoid the overly broad expensive functions).
2024-04-01 11:02:06 -05:00
Nandor Licker 33fb00af7b
[SeqToSV] Fix the ordering of the memory/register random init fragments (#6883) 2024-04-01 18:56:45 +03:00
Schuyler Eldridge aca154a607
[FIRRTL] Treat blackboxes in layers as "testbench" (#6881)
When determining which directory to place a blackbox into, make two
changes to get this working correctly with layers:

  1. Never change a directory if one is already specified.
  2. Treat any bound instance as not under the DUT.

Taken together, this preserves both the original behavior of grand central
blackbox extraction and causes blackboxes instantiated under layers to be
placed in the testbench directory.

Fixes #6880.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2024-03-29 12:36:10 -04:00
Hideto Ueno f065c5ed7a
[FIRRTL] Deprecate AssertAssume intrinsic and rename it to Assert (#6878)
As we moved companion assume generation to a pass, having `AssertAssume`
would not be necessary anymore. We still need assert instrinsic so
this PR just renames the intrinsic to `assert`
2024-03-29 12:58:24 +09:00
Andrew Lenharth 3cb709617c [NFC] guard a possibly redundant update 2024-03-28 13:24:43 -05:00
Andrew Lenharth f730dc11af
[NFC] Make fewer copies of directions (#6879)
use asArrayRef a couple places to reduce data churn.
2024-03-28 13:09:19 -05:00
Hideto Ueno 37fbe5e5f5
[FIRRTL] Add CreateCompanionAssume pass; Decouple UNROnlyAssume generation from AssertOp lowering (#6863)
This PR separates UNROnlyAssume generation from AssertOp lowering into a dedicate op.

This commit adds:
* LowerToHW support for `UnclockedPredicateIntrinsicOp` (added in https://github.com/llvm/circt/pull/6867).
* CreateCompanionAssume pass which explicitly introduces companion assumes to the IR. Normal assume and UnclockedPredicateIntrinsicOp are used based on the guard's content.

The commit is intended not to change semantics of generated verilog. This commit should only introduces cosmetic changes regarding guards(because now they are reused).
2024-03-28 19:08:04 +09:00
Hideto Ueno 1782d5dcf6
[FIRRTL] Add intrinsic for UNR only assume (#6867)
This adds UnclockedAssumeIntrinsicOp which generates a SV assume statement whose predicate is used in a sensitivity list of the enclosing always block.
2024-03-28 16:50:10 +09:00
Andrew Lenharth 00a33b3047
[FIRRTL] Change Port Direction attribute from an APInt to a DenseArray. (#6875)
* [FIRRTL] Change Port Direction attribute from an APInt to a DenseArray.

APInt requires an allocation to start large values.  Using apint for port directions requires copying the apint when inspecting port directions, thus introducing huge amount of copies throughout the code.  On large designs this allocation overhead amounted to over 25% of the time spent.  DenseArrays are less space efficient (by 8x as used), but can be accessed by reference, removing these allocations.
2024-03-27 17:05:38 -05:00
Will Dietz cd5e3b5616
[FIRRTL] Add LowerIntmodules pass. (#6876)
Add pass that converts instances of intmodules to the generic
intrinsic op (firrtl.int.generic).

Also add optional special-case handling for recognizing extmodule
with defname "EICG_wrapper" as encoding the clock gate intrinsic.

The pass is not included in the pipeline.
2024-03-27 15:21:19 -05:00
Will Dietz 0cff5d90dd
[FIRRTL] Add generic intrinsic op. (#6874)
Add generic intrinsic operation to FIRRTL. Not used anywhere, just adding to the IR to build on.
Re-use module parameter printing/parsing for use as custom printer on the op.

See PR for more context.
2024-03-27 09:17:38 -05:00
Martin Erhart 87020b2ed4
[SMT] Add SMT-LIB export translation (#6870) 2024-03-27 08:57:21 +01:00
Nandor Licker 9cbd4e7fd2
[LowerToHW] Set fragments outside the parallel region (#6872) 2024-03-27 08:07:49 +02:00
Mike Urbach c6325d287c [FIRRTL] Use cached circuit symbol table for option group lookup.
Now that we've added a cached symbol table at the circuit level, we
can use that to look up option groups as well. This didn't have a
major performance improvement on some large designs, but in the
presence of more instance choices, this could help. Regardless, this
is one minor piece to clean up for #6772.
2024-03-26 09:20:03 -07:00
Andrew Lenharth 8b9e87dc7f
[FIRRTL] Cache a symbol table instead of doing linear lookups every instance. (#6871)
roughly triples modules parsing performance on large designs. This is about a 2x speedup for overall parsing stage.  Mostly solves #6772 for now.
2024-03-25 16:58:29 -05:00
Andrew Lenharth 056d519468 [NFC] Reserve memory to save reallocations. Noted in performance profiling 2024-03-25 11:03:15 -05:00
Schuyler Eldridge 2b482b219d
[SV] Add namespace comment, nfc
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2024-03-24 00:54:47 -04:00
Schuyler Eldridge 08fb99b930
[SV][Verif] Extract verif ops in SVExtractTestCode (#6865)
Fix a bug where SVExtractTestCode was not extracting asserts, assumes, and
covers from the verif dialect.  This resulted in unexpected end-to-end
"failures" from Chisel where Chisel asserts, assumes, and covers were not
extracted and left in the design.

Fixes #6864.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2024-03-24 00:54:24 -04:00
Martin Erhart f8c7faec1e
[SMT] Add function application operation, function and uninterpreted sort types (#6847) 2024-03-22 17:13:18 +01:00
Martin Erhart 6f0fc3de79
[SMT] Add quantifier operations (#6842) 2024-03-22 16:56:50 +01:00
Fabian Schuiki 8ec05233d1
[ImportVerilog] Add assign and pre/post increment/decrement expressions (#6859)
Add support for pre and post increment and decrement expressions, like
`x++` and `--x`, as well as assign expressions, like `a += 5`. Slang
represents these assignments as `Assign(a, Add(LValueRef, 5))` in the
AST. The `LValueRef` node contextually refers to the parent assignment's
left-hand side. To deal with this, also add a corresponding lvalue stack
to the conversion context. Assignments push and pop their lvalues onto
and off of this stack.

These expressions require a mechanism in the IR to express _when_ a
variable is read. To capture this, add a new `moore.read_lvalue` op.
It currently looks like an identity operation with a `MemRead` side
effect. Further down the road, we may want to introduce a proper
reference type for variables, ports, nets, and other things, and have
`read_lvalue` and the various assigns operate on that type instead. This
sets the foundation for that.

Co-authored-by: Hailong Sun <hailong.sun@terapines.com>
Co-authored-by: ShiZuoye <albertethon@163.com>
Co-authored-by: hunterzju <hunter_ht@zju.edu.cn>
Co-authored-by: Anqi Yu <anqi.yu@terapines.com>
2024-03-22 00:28:24 -07:00
Andrew Lenharth 7a01c493b6 [NFC] silence unused warnings 2024-03-21 13:57:44 -07:00
Nandor Licker 92886e106e
[Seq] Erase memories with no read ports (#6861) 2024-03-21 17:44:24 +02:00
Will Dietz d5327de174
[FIRRTL] Make "intrinsic" name of intmodule mandatory. (#6858)
It's mandatory in the FIRRTL spec and only an error if it's missing,
so directly require this.

Add test for this and invalid intrinsic name.
2024-03-20 16:35:34 -05:00