Commit Graph

14 Commits

Author SHA1 Message Date
Jacques Pienaar 7f1c3399e4
Update to new builder format. (#8785)
Basically did

set(CMAKE_CXX_CLANG_TIDY local/clang-tidy -checks=-*,llvm-use-new-mlir-op-builder -fix)

and then fixed cases where temporary OpBuilders were used (as passed in
by reference now).
2025-07-26 04:55:06 -07:00
fzi-hielscher 2554a14234
[NFCI][Calyx] Refactor TableGen Pass includes (#7182) 2024-06-14 18:55:51 +02:00
Will Dietz 1cf91fc2ef
[Calyx][ESI[FIRRTL][SV] Use getAnalysis for SymbolTable and others. (#5733)
Let AnalysisManager provide cached copy if available,
and be open to it being preserved across passes.

Also unnecessary copying of SymbolTable (DenseMap).
2023-08-01 07:51:30 -05:00
Andrew Lenharth 1646243a27
[NFC] LLVM bump for 2022/09/14 (#3889)
Bump LLVM.
2022-09-15 08:49:33 -05:00
Richard Xia fdc1dc30cf
Bump LLVM (#3872)
* [Calyx][FIRRTL] Put explicit type hints for TypedValue where necessary.

With the introduction of TypedValue in upstream llvm commit
688c51a5acc53b456014e53663051476d825e896, there are now a few cases
where we need to explicitly write the types. In some cases, we need to
explicitly upcast to Value to be consistent with other Values in the
expression, and in other cases, we need to upcast the type parameter of
TypedValue when there are ambiguous implicit conversions.

* [FIRRTL] Replace llvm::GreatestCommonDivisor64 with std::gcd.

GreatestCommonDivisor64 was removed in upstream LLVM in
87c38323a2cff5b26023b24c36a7c01741aba834, and the recommended migration
path is to use std::gcd. This performs an explicit cast to uint64_t for
the same reasons described in 4a2377afd69bcf014492cb665ee955eab3121c4c,
which is that std::gcd may have different and unexpected semantics when
its arguments are of different types and signedness.

* [NFC] Explicitly set dialect accessor prefix to kEmitAccessorPrefix_Raw.

Upstream recently changed the default value of emitAccessorPrefix to
kEmitAccessorPrefix_Prefixed. This patch explicitly sets
emitAccessorPrefix to the previous default value of
kEmitAccessorPrefix_Raw, which will allow us to the new accessor prefix
style more gradually and at our own pace. Upstream will completely
remove the _Raw style in the next couple of months, so we will need to
make the migration soon, though.

See [1] for more information.

[1]: https://discourse.llvm.org/t/psa-ods-generated-accessors-will-change-to-have-a-get-prefix-update-you-apis/4476

* [firtool] Pass config object to new writeBytecodeToFile API.

The third argument to writeBytecodeToFile() now takes a
BytecodeWriterConfig object instead of just the producer string.

* Bump llvm to 13f1bc41888e7d6555c532ba5fa925b9fe3e6b2f.
2022-09-14 09:00:27 -07:00
Andrew Lenharth ed6640301a
[COMB] Add flag to assert binary behavior. (#3766)
Comb exists in a place where it might or might not need to deal with Verilog or VHDL weirdness.  Some transformations which are desirable might not be semantic preserving with respect to concepts such as 'x'.  This is overly strong for a number of languages.  An "bin" flag is added to most operations to allow flagging the comb operation as only requiring binary semantics.  Frontends by construction, or by analysis can enable this flag to enable richer comb-level optimizations.
2022-08-30 11:16:15 -05:00
Morten Borup Petersen 472cb848a7
[Calyx] Factor out various helper functions (#3055)
Factors out functions for building constants and registers in Calyx programs.

Note: For some reason, this change seems to partially apply canonicalization in the `compile-control.mlir` test wherein constants are moved to the cell-scope.
2022-05-06 16:46:09 +02:00
sinofp 727db57a3a
[Comb] Canonicalize using De Morgan's laws (#2668)
Resolves #2666.
2022-02-25 17:13:36 -06:00
Chris Gyurgyik c55f24984c
Cleanup. (#2140)
[Calyx] Remove duplicated accessor functions in Primitives ODS.
2021-11-10 21:48:34 -08:00
Chris Gyurgyik f9e89e7171
[Calyx] [SCFToCalyx] Change Cell instance name from StringAttr to FlatSymbolRefAttr. (#1924)
Changes a cell's instanceName argument from StringAttr to FlatSymbolRefAttr. This will be necessary for the 
addition of an InvokeOp, which needs to verify that the instance being invoked actually exists. Since primitives 
(namely multi-cycle ones) may also be invokeable, this is required for all cells. This also verifies there is no name
shadowing with symbol names for components and cells.
2021-10-04 13:02:52 -07:00
Chris Gyurgyik 3860557ded
[Calyx] [SCFToCalyx] Initialize bodies upon build. (#1914)
Adds builders to initialize bodies for IfOp, WhileOp, CombGroupOp, GroupOp, WiresOp, and ControlOp. 
This also removes their default builders, since it would be odd to want a Calyx container without a body. 
The rest is necessary clean-up in SCFToCalyx and CompileControl. Closes #1884.
2021-10-01 08:56:42 -07:00
Chris Gyurgyik 307debe3b0
[Calyx] Add helper functions to access RegisterOp ports. (#1634)
Add helper functions to access RegisterOp ports. Each RegisterOp port specifies a specific port value, e.g. `Result(0)` is the `in` port.
2021-08-25 10:28:06 -07:00
Morten Borup Petersen a00e3c1ea7
[Calyx] Add IR support for calyx::IfOp (#1582)
* [Calyx] Add IR support for calyx::IfOp

This commit adds support for the Calyx If control operation. The operation takes two arguments; a b boolean SSA value and a group name. The op has two regions, a mandatory 'then' and optional 'else' region.

This is solely for IR support and does not include:
- CalyxEmitter support (unsupported for all control ops as of now)
- CompileControl control FSM generation
2021-08-18 20:58:48 +01:00
Chris Gyurgyik fd615e8df6
[Calyx] Add CompileControl pass for single SeqOp. (#1403)
Add CompileControl pass for lowering the Calyx dialect to HDL. This pass generates 
latency-insensitive finite state machines to realize control flow. Currently, this pass is 
only able to compile a single, non-nested Sequential group.
2021-07-23 22:09:41 +02:00