Commit Graph

8413 Commits

Author SHA1 Message Date
mingzheTerapines 00edb48ed5
[ImportVerilog][Moore] Support union type (#7084)
* [ImportVerilog]Support union types.

* [ImportVerilog]Rename structMember with structLikeMember

* [ImportVerilog] check the type of new Expressions.

* [ImportVerilog]Add value check for new Expressions.

* clang-format modify recommand

* [importVerilog]Remove useless inlcludes

* [ImportVerilog]Add union size and domain

* [ImportVerilog]Give more specefic errors
2024-05-29 13:23:20 +08:00
elhewaty 55610921c2
[Arc] Fix crashes in FindInitialVectors Pass (#7100) 2024-05-28 22:02:51 -07:00
Amelia Dobis e71ccb85f7
[firtool] Add an option to export SV without SVA (#7081)
* added a firtool option to export sv wihtout SVA

* folded no-sva option into verification flavor

* added namespace to call
2024-05-28 15:50:54 -07:00
Martin Erhart fe5e15502e
[CombToSMT] Register dependency on func (#7098) 2024-05-28 21:46:54 +02:00
Will Dietz 0806944a52
[FIRRTL] Drop Hoistpassthroughs pass. (#7097)
This has only been used for probes, but without input probes
this is no longer useful or necessary.

The HW-signal hoisting works well (if limited) and has no
known issues[1] but has yet to be used in practice due
primarily to passthroughs being intentional occasionally
and lacking a mechanism to capture or distill this intent
properly (it must be ""optimized"" yet not).

Since this is unused, and lacking traction on the above,
remove from pipeline and delete this for now instead of
having it bitrot and be a maintenance burden while
adding/completing new features.

Lives on in version control history!

[1] FWIW, see https://github.com/llvm/circt/pull/6115 for
both small example and before/after on chipyard, as well
as testing internally back when this was introduced.
2024-05-28 13:38:51 -05:00
John Demme aaca8bad71 [pycde] Fix race condition in test
Memory write may not be complete before the read happens.
2024-05-28 18:17:12 +00:00
John Demme ff89611259 [Verif] Removing unnecessary include
Was generating missing header includes. Turns out to be not needed.
2024-05-28 17:58:54 +00:00
Luisa Cicolini fa0e61420f
[SMT] Added support for :pattern attribute (#6976) 2024-05-28 11:13:15 +02:00
Fabian Schuiki 695e36e5d4
[Arc] Add prefix to FindInitialVectors pass option
Add an `arc-` prefix to FindInitialVectors's command line name.
2024-05-27 15:40:27 -07:00
elhewaty 030ad3d349
[Arc] Add pass to find seed vectors (#7061)
Add the `FindInitialVectors` pass to the Arc dialect which finds
isomorphic operations at the same topological rank and groups them into
`arc.vectorize` ops. This is going to be the starting point for later
canonicalizations and optimization steps to improve the vectors and
apply a cost model.
2024-05-27 15:10:49 -07:00
Fabian Schuiki b0dd65aeb8
[Moore] Move struct types into ODS (#7091)
Move the definitions of packed and unpacked struct types from C++ land
into `MooreTypes.td`. This removes a significant amount of complexity.

With all types moved into the TableGen file, a lot of redundant code can
finally be removed and the parsing/printing can be streamlined
significantly.

This change also drops the `StructKind` enum which was used to discern
structs, unions, and tagged unions, although the ImportVerilog
conversion never generated anything besides structs. Once we add support
for unions in the future, the intention is to define new types in ODS
for the unions and reuse the `StructMember`.
2024-05-27 09:57:48 -07:00
Fabian Schuiki 37e5ad9624
[Moore] Support stripped type parsing and printing (#7090)
Operations defined through TableGen will use a version of type parsing
and printing that strips away the dialect prefix in case this does not
lead to ambiguities. If an op specifies a type like `UnpackedType`, the
generated parser and printer will call `UnpackedType::parse` and
`UnpackedType::print` in order to parse and print that type. This method
usually prints the type without any dialect prefixes, and often also
without the type name itself (as it is obvious given the type).

Add an implementation for `parse` and `print` to `UnpackedType` which
performs this stripped printing. This makes the assembly more compact
and in-line with what MLIR would generate by default if a
TableGen-specified op would use a TableGen-specified type.

This makes the integer flavor of `IntType` look exactly like the builtin
integer type, which will facilitate a future change from Moore's integer
type to the builtin integer. Parsing is unambiguous, since the stripped
form is only used when the type is clear from the op context.
2024-05-27 09:31:39 -07:00
Fabian Schuiki a778922171
[Moore] Move array types into ODS (#7088)
Move the definitions of all array types from C++ land into
`MooreTypes.td`. This removes a significant amount of redundant code and
simplifies the dialect's type system.

Replace packed and unpacked ranges (`T [4:3]` or `T [2:4]`) with a new
type that discards the directionality and offset of the range. This
information is no longer needed at the IR level. Any meaning that the
offsets have can be encoded in the corresponding ops. Both ranges are
now represented as `array<2 x T>` and `array<3 x T>`, respectively.

Combine unpacked ranges (`T foo [6:2]`) and unpacked arrays
(`T foo [42]`) into a single `uarray<N x T>` type.
2024-05-26 09:25:55 -07:00
elhewaty 021c3c23fe
[Arc] Modify VectorizeOp to support AnyType (#7087) 2024-05-25 12:01:08 -07:00
Hideto Ueno 139c97bd90
[Seq] Fix incorrect folder (#7085)
If the register has a constant reset value, we can replace it but we cannot replace it with a non-constant reset value.
2024-05-24 18:26:16 +09:00
Amelia Dobis ba67aa42b9
[LTL] Add ops that allow for most of SVA to be modeled with LTL (#7065)
* Introduced new ltl ops

* added ops to visitor

* updated exportverilog

* added type inference for intersect

* updated tests

* added fold for trivial case

* Added FIRRTL intrinsics and test

* comments

* updated op requirements
2024-05-23 14:39:21 -07:00
Amelia Dobis efa6955a7d
[Verif] Add clocked Assert Assume Cover ops (#7022)
* added clocked assert assume cover opes

* added disable to clocked ops

* added disable to clocked ops

* updated exportVerilog to support new clocked assertlike opertaions

* added missing inlcude

* line breaks in verif.td

* added small test

* added return

* Fixed verilog export for clocked assertions

* added a verifier for the new verif ops

* added verifier tests

* updated verif ops summaries

* added deeply nested test

* Added verification pass for clocked_assert_like ops

* removed verifier and added verification pass to firtool

* removed verifier and added verification pass to firtool

* removed unnecessary dialect dependencey

* registered pass with circt-opt

* removed unnecessary imports

* clang-tidy

* clang tidy

* hoisted out the worklist from the pass

* reverted unwanted change

* Update CMakeLists.txt

* small comment changes
2024-05-23 13:14:25 -07:00
John Demme c840b39185 [esi-cosim] Fix file not found bug
Fixes issue introduced by 17449a7656
2024-05-23 19:22:42 +00:00
Prithayan Barua cdc623274f
[LowerClasses] Ensure classes are instantiated by an object. (#7072)
LowerClasses creates an object for a corresponding instance only if the
 instantiated module has property ports. But a class can be created for a
 corresponding module based on other conditions like, if the module is public,
 or instantiates other classes. This results in un-instantiated classes that
 donot correspond to the module hierarchy.
This change ensures that if a class is created for a module, the object is also
 created from the corresponding instance. Thus the module hierarchy is also
 preserved in the om IR. Downstream tools parsing the IR can assume a single
 top level class which is required for object model evaluation.
2024-05-23 09:58:21 -07:00
John Demme 17449a7656 [esi-cosim] Bunch of improvements to cosim runner
- Recursive source collection
- Run vlog on each file
- Run vlog in a Questa session to improve the speed
- Add no compile option
- Run vopt during compile so missing modules get reported
2024-05-23 09:03:47 +00:00
Anqi Yu 851a1de172
[ImportVerilog] Support set membership operator. (#7066) 2024-05-23 14:32:47 +08:00
mingzheTerapines 9006a44b07
[ImportVerilog] Support member-access expression (#7039)
* [ImportVerilog] Support member-access expression
Support member-access expression.
Add container multiSymbolValue for multi-symbols pointing one value.

Signed-off-by: mingzheTerapines <mingzhe.zhang@terapines.com>

* [ImportVerilog] Support member-access expression
Separate two containers and their annotations.

* [ImportVerilog] Support member-access expression3
use auto instead of const slang::ast::Expression *
declare concatName with expr.member.name

* [ImportVerilog] Support member-access expression4
Simplfy string allocation.

* [ImportVerilog] Support member-access expression
The signing of unpacked structures is not allowed.- IEEE Standard

* [ImportVerilog] Support member-access expression6
Add packed unsigned struct occasion for testing.

* [ImportVerilog] Support Union Type
Support Union Type
Modify uniont tyep to event type as error type example.

* [ImportVerilog]Add errors example
Add error example for unpacked union.

* [ImportVerilog] Add strucfield op
Define a struct field access op that can represent accesses into struct fields.

* [ImportVerilog] Add struct inject and extract op
Add struct inject and extract op.
Remove union support.

* [ImportVerilog] Support memberaccess

* Removed some useless include.

* fix test error

* Fix errors.sv

* remove space.

---------

Signed-off-by: mingzheTerapines <mingzhe.zhang@terapines.com>
2024-05-23 10:51:21 +08:00
Andrew Young 8a8fd29595 Replace uses of deprecated StringRef::equals with ==
StringRef::equals was was deprecated in LLVM de483ad in favor of
operator==.  This change moves away from the deprecated method.
2024-05-22 13:24:29 -07:00
Andrew Young ab2dfdaad1 Bump LLVM
TopplogicalSortUtils.h was moved from mlir/Transforms to mlir/Analysis.
2024-05-22 13:24:29 -07:00
Andrew Lenharth 946caf91a4
[FIRRTL] Limited invalid propagation. (#7074)
Now that invalid is better defined, we can start propagating it when we can preserver semantics.  This means not breaking the one-op-is-one-consistent-value (e.g. not duplicating).  The only bit mutating op which is touched by this change is not, which is a pure all-bits inversion, which should be safe (tm).
2024-05-22 11:37:10 -05:00
Hideto Ueno 9060f58dc8
[FIRRTL] Preserve all analysis if nothing happens (#7077)
LowerMatchesPass and MemOfVec should preserve analysis if nothing happens.
2024-05-23 00:30:40 +09:00
Hideto Ueno f62b8a69fe
[FIRRTL] Remove unused expensive API (#7076)
InstanceOp::getPortList is a foot-gun that walks the entire circuit. Apparently there is no user so just delete it.
2024-05-22 23:10:21 +09:00
Andrew Lenharth da2ca8cc9f
[FIRRTL] Register reset elimination based on invalid can look through nodes. (#7069)
This converts wires into nodes when there is one write to the wire and it dominates the reads.  By converting to nodes, this pass does not have to worry about symbols, references, or annotations.  Those are just copied to the node.
2024-05-21 22:57:18 -05:00
Andrew Lenharth 535f14703e [NFC] nest passes better 2024-05-21 17:18:22 -05:00
Andrew Lenharth fd491e1985
[FIRRTL] Convert Wires into Nodes (#7067)
This converts wires into nodes when there is one write to the wire and it dominates the reads.  By converting to nodes, this pass does not have to worry about symbols, references, or annotations.  Those are just copied to the node.
2024-05-21 12:26:35 -05:00
Andrew Lenharth 5077ca78c2 [NFC] Hand CSE a pointer wrapper in a performance ciritcal location 2024-05-21 09:43:56 -07:00
Andrew Lenharth 020bde31dd [NFC] hand CSE some pointers 2024-05-21 09:41:30 -07:00
Hideto Ueno 2b6184d40d
[FIRRTL][LowerClasses] Improve performance, NFC (#7060)
This PR fixes a regression caused by PortAnnotation mutation. We have to batch-update the port annotations to avoid compile time regression. Several other improves are added along with the fix:

* `shouldCreateClass` is slightly expensive since it walks entire IR to check instances. `shouldCreateClass` is already lazily evaluated but however `shouldCreateClass` is immediately called for every module. So this PR changes to compute the all results parallelly beforehand instead of lazy evaluation. 
* `std::distance(a, b) == 0` is replaced with `a == b` to avoid potential iterator traversals (maybe it is optimized by clang/gcc though). 
* `processPathTrackers` is refactored into a helper struct `PathTracker` so that we can process paths/annotations parallely. We update `pathInfoTable` sequentially afterwards. 
* Several operation walks were replaced with instance graph traversal. 

It should be NFC completely. Pass should behave exactly the same way.
2024-05-21 18:08:38 +09:00
John Demme 839af9f39d [pycde] Remove IbisClass
Bringing this internal for the time being
2024-05-21 01:58:09 +00:00
John Demme d3ebc7f19d [ESI][Runtime] Fix publishing job in workflow
Download and upload artifacts have to match
2024-05-21 01:14:42 +00:00
John Demme 49f663c373 [ESI][runtime] Run command in OS environment
Using the simulation environment was causing some applications to use
the shared objects distributed with the wheel. That's usually wrong
since the wheel shared objects are compiled with the "old" string C++
library for compatibility reasons. C++ applications which are compiled
against the ESI runtime don't use that.
2024-05-21 00:57:50 +00:00
John Demme 2ba19927f3
[PyCDE] Move build and publishing pipeline into repo (#7062)
Previously was built and published internally. Resolves #1509.
2024-05-20 17:37:07 -07:00
John Demme 536aa08fd1 [pycde] Fixing test parallelism error 2024-05-20 21:37:12 +00:00
John Demme 26947339c4 Revert "[OM] Adding missing depends"
This reverts commit 5491359b38.
2024-05-20 06:34:49 +00:00
John Demme 5491359b38 [OM] Adding missing depends 2024-05-20 06:13:35 +00:00
Will Dietz 3f6b9fa00f
[FIRRTL] Reject intrinsic modules >= 4.0.0 (#7009) 2024-05-19 14:10:28 -05:00
liuyic00 d40f5283ba
[LTL] Add repeat and until operators (#6989) 2024-05-19 00:40:02 +08:00
John Demme f0bd31ec7d [ESI][Runtime] Resolve warnings on publishing workflow 2024-05-18 03:21:37 +00:00
Andrew Lenharth d8f610b857 [NFC] fix some tidy warnings in ModuleSummary.cpp 2024-05-17 14:59:37 -05:00
Will Dietz 79148d8138
[FIRRTL][Folds] Fix patterns to use rewriter for RAUW (#7049)
Fix FoldUnusedPorts to use rewriter for RAUW.
Fix FoldReadWritePorts to use rewriter for RAUW.

Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc #7047.

Fix more RAUW's to use rewriter, inspection.
2024-05-17 14:14:06 -05:00
Andrew Lenharth a1a3b6ca78 [NFC] Convert a canonicalizer to a pattern 2024-05-17 13:34:40 -05:00
Will Dietz 5e2ad89fda
[FIRRTL][Import] Remove support for printf-encoded verif. (#7030)
Retain logic to recognize (but not parse or diagnose) printf's
of the various "flavors" previously supported so that we can reject
designs that rely on this removed support (emit error).
2024-05-17 13:21:10 -05:00
Will Dietz 5b41f2d8f8 [NFC] tools: remove unused iostream header. 2024-05-17 13:15:39 -05:00
Will Dietz bd49eb7829 [NFC] Touchup 80-col violations in commments. 2024-05-17 13:15:39 -05:00
John Demme cb5e09ac21 [pycde] Add publish pipeline to CIRCT repo
This is just a starting place for debugging. In order to get the
workflow added to the repo, it must exist in main. Debugging will happen
on a branch.
2024-05-17 18:08:09 +00:00