Commit Graph

373 Commits

Author SHA1 Message Date
John Demme 562036cde8
[HWArith] Make `hwarith.icmp` result an `i1` (#7413)
As discussed in #7406. Resolves #7406.
2024-08-09 22:24:32 +02:00
Jack Koenig fa95071921
[FIRRTL][InferResets] Generalize FART to support sync reset (#7476)
The FullAsyncResetAnnotation is deprecated and replaced by
FullResetAnnotation which includes a resetType argument that must be
'sync' or 'async'.  IgnoreFullAsyncResetAnnotation is deprecated and
replaced by ExcludeFromFullResetAnnotation. The new annotations are in
package circt.

The behavior of FullResetAnnotation with resetType == 'async' is
identical to that of the old FullAsyncResetAnnotation. The behavior of
FullResetAnnotation with resetType == 'sync' is very similar, except the
type of the reset wired through will be UInt<1>, and any registers with
an existing reset at all (both sync or async) will be left unchanged
(resetType == 'async' will add async resets to registers with existing
sync resets).
2024-08-08 21:39:25 -07:00
Hideto Ueno a9436263bd
[ExportVerilog] Add a lowering option to fix up empty modules (#7454)
This commit adds a new lowering option to sanitize empty modules by
creating a dummy wire in it.
2024-08-08 15:39:05 +09:00
Asuna b35bc81fc0 [Docs][FIRRTL] Build and include docs for intrinsic ops 2024-08-06 10:36:05 +08:00
Hideto Ueno 461c63146e
[FIRRTL][LowerDPI] Lower FIRRTL vector to an open array type (#7305)
Previously a FIRRTL vector was lowered into a packed array and there was no way
to generate an open array. This PR changes to use unpacked open array which is
supported by several tools (at least verilator and vcs) by default.
2024-08-05 12:21:05 +09:00
Bea Healy 2dbab26c89
[docs] Remove confusing reset in Seq docs SV example (#7419) 2024-08-01 10:06:29 +01:00
Martin Erhart 2345382e67
[LLHD] Remove llhd-sim (#7351) 2024-07-19 17:54:14 +01:00
John Demme 462f6b5934
[ESI] Remove last references to capnp (#7315)
The cosim document was 90% out of date. Added a note regarding
documentation status.
2024-07-12 06:36:10 -07:00
Hideto Ueno 0bcfbdc599
[FIRRTL] Add input and output names to DPI intrinsic (#7265)
Fix https://github.com/llvm/circt/issues/7226. This adds support for specifying input and output names. This uses `;` separated string list following the same design as `guard` parameter of assert intrinsic.
2024-07-03 14:16:51 +09:00
John Demme 88eeb265f4
[ESI Runtime] Replace Cap'nProto with gRPC (#7217)
After spending a truly obnoxious amount of time fighting capnp and
libkj, we made the decision to switch to another RPC system. We're no
longer modeling and serializing message types in Capnp and we don't need
the performance which capnp/libkj RPC promises, so there's really no
need for the additional complexity. A slower system which is thread safe
should work fine.

This commit breaks the build in a pretty horrible way and is not
intended to be merged on its own. It simply breaks up the diff.
2024-06-21 14:22:54 -07:00
cepheus 560257cd4c
[Moore] Support unconnected behavior (#7202) 2024-06-20 11:12:31 +08: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
Hideto Ueno 523e9b4163
[FIRTRL][ExportVerilog] Emit small integers on DPI function as two state C-compatible types (#7163)
This PR modifies ExportVerilog to emit two state types (`bit` in general) for DPI import op. Furthermore, for specific bit width (8, 16, 32 and 64) it emits C-types (byte, shortint, int and longint). 

This PR also rejects small integer types other than 8, 16, 32 and 64 bit width since  otherwise we have to use`bit` but they are passed by references in DPI. So this PR defines the ABI as "small integers are passed by values, and larger integers are passed by references.
2024-06-13 23:08:30 +09:00
Hideto Ueno 44becae000
[FIRRTL] Add DPI call intrinsic and lowering pass (#7139)
This PR adds DPICallIntrinsicOp and its lowering pass. DPICallIntrinsicOp is lowered into sim.func.dpi.call and sim.func.dpi ops. At FIRRTL level DPICallIntrinsicOp doesn't have symbols and instead LowerDPI pass accumulates call sites and creates symbols for dpi functions. LowerDPI pass directly lowers FIRRTL intrinsic into Sim dialect since FIRRTL doesn't have DPI/Function construct. LowerDPI pass could be simplified (or migrated into LowerToHW) once FIRRTL gets 1st class support for Function. Unrealized conversion cast is used to mix FIRRTL and HW type values before LowerToHW.
2024-06-13 20:54:00 +09:00
Lenny Truong e0f884a450
[Docs] Update Python bindings pip instructions (#7147)
Fixes https://github.com/llvm/circt/issues/7115
This option no longer exists
2024-06-09 10:29:28 -06:00
Amelia Dobis 6e17eb004b
[Docs][LTL] Add SVA Encodings to LTL rationale (#7131)
* added sva.assertproperty ops

* added rationale for non-consecutive repetitions

* Added SVA encodings to LTL rationale

* undid stray changes

* removed comment about supporting function via frontend

* fixed typos

* Update LTL.md
2024-06-05 12:15:20 -07:00
Andrew Lenharth 0b5c8f5c35 [FIRRTL] Update wildly out-of-date rational doc 2024-06-05 10:21:34 -05:00
Andrew Lenharth 7e60fb9986
[NFC, FIRRTL] Rename StrictConnect to MatchingConnect. (#7116)
This is to reserve "Strict" for LHSType connects in the future.
2024-06-04 09:19:00 -05:00
liuyic00 d40f5283ba
[LTL] Add repeat and until operators (#6989) 2024-05-19 00:40:02 +08:00
Amelia Dobis c09a0ff163
[docs] Updated example test in GettingStarted.md 2024-05-10 09:59:39 -07:00
Amelia Dobis 0d120ca486
[docs] Add basic pass tutorial (#7012)
* Added small pass tutorial in getting started docs

* Added small pass tutorial in getting started docs

* Added basic pass tutorial

* Cleaned up pass in getting started doc and added links to better tutorials

* added tutorial pass

* fixed missing imports

* added a test

* added links to tutorial files

* udpated target flags

* nl@eof

* Update GettingStarted.md

* fixed typo in flags
2024-05-10 09:43:49 -07:00
Fabian Schuiki 6a2b628129
[Moore] Make simple bit vectors a proper MLIR type (#7011)
The core type most SystemVerilog expressions are interested in and
operate on is a "simple bit vector type". These are individual integer
atoms like `bit` or `logic`, integral types like `int`, or packed arrays
with a single dimension and an integer atom inner type, like
`bit [42:0]`. So in a nutshell, simple bit vector types are MLIR's `i42`
in the two-valued (`bit`) case, or the four-valued equivalent (`logic`).

Up until this point, the Moore dialect reflected this pattern by
providing and `IntType` for the integer atoms like `bit` and `int`, and
using the `PackedRangeDim` for single dimension vectors of `bit`. A
`SimpleBitVectorType` helper struct would then summarize the _actual_
bit vector that was expressed by the packed range and integer atom. This
makes working with the types in TableGen files very annoying, since the
thing you are actually interested in -- the simple bit vector -- is not
a propery MLIR type, but more like a helper struct on the side.

This commit rips out the existing `IntType` and its composition with a
packed array dimension, and replaces it with a proper simple bit vector
type that is actually an MLIR type. As a result, SystemVerilog types
like `int unsigned`, `bit [42:0]`, `reg`, `logic signed [31:0]`, or
`integer` are all translated into the same MLIR type. This new simple
bit vector MLIR type retains the `IntType` name, and prints as
`!moore.i42` or `!moore.l42`, depending on whether it is a two-valued or
four-valued integer. Single `bit` and `logic` atoms become `i1` and `l1`
respectively.

This makes the Moore type system a lot easier to work with and removes
a lot of unnecessary noise. Operations can now simply use
`llvm::isa<IntType>` to check if a value is a simple bit vector.
2024-05-09 15:52:20 -07:00
Amelia Dobis 12c44ada53
[docs] Add cmake flags that reduce memory usage (#7018)
* Added small pass tutorial in getting started docs

* Added small pass tutorial in getting started docs

* Added basic pass tutorial

* added cmake flags to reducs memory usage

* added cmake flags to reduce memory usage

* comments
2024-05-09 14:26:21 -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
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
Will Dietz ad4b1d390b
[FIRRTL][NFC] Use underscores in documentation. (#6860)
In the only supported mechanism for using intrinsics,
the name must be an identifier so just document that.

Periods are nice, we can adjust the FIRRTL grammar / syntax
to allow this in the future if we miss them.
2024-04-11 13:29:47 -05: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
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
Felix Schneider e1b437ef2f
[Docs] GettingStarted: Fix LLVM/MLIR contributing guide (#6873) 2024-03-28 22:31:17 +01: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
Martin Erhart 66f6369fb1 [Docs] Apply some review comments from PR 2024-03-21 21:19:28 +01:00
Martin Erhart 3d64bb5e92
[Docs] Extend formal verification documentation (#6854) 2024-03-21 12:43:22 +01:00
Will Dietz e4b78d771a
[FIRRTL] Remove support for circt.Intrinsic annotation. (#6857)
Documentation indicates this was intended to be removed once
FIRRTL language supports intrinsics, and we have intmodule's now.
2024-03-20 14:46:06 -05:00
Martin Erhart 2bf582c213 [Docs] Fix typo in filename 2024-03-13 11:15:26 +01:00
Martin Erhart 8b4e95de1e [SMT] Add Dialect rationale and boilerplate 2024-03-12 08:12:50 +01:00
Fabian Schuiki b726a32437
[Moore] Rename files, add dialect rationale, fix docs
Rename `MIROps.{cpp,h}` to `MooreOps.{cpp,h}`. This makes the dialect be
more inline with others. We can always create additional dialects or
groups of operations later.

Also add the missing `moore` dialect rationale doc and fix the generated
documentation. Non-functional change in terms of operations and types,
but the documentation changes.

This is a preparatory cleanup step for the Slang upstreaming work.
2024-02-24 22:01:09 -08:00
Asuna 4d28376342 [Docs] Add the missing JSON colon to the example of FIRRTL annotations 2024-02-24 10:29:00 +01:00
Nandor Licker 84a7c8b1b0
[Emit] Organize output files using the `emit` dialect (#6727) 2024-02-24 10:09:00 +02:00
Mike Urbach 6e1db86ba7
[OM] Add rationale for expressions. (#6702)
This adds some basic rationale for why it is valuable to be able to
represent computation in the OM dialect, with a couple examples
including arithmetic and container constructions.
2024-02-15 07:49:55 -07:00
Will Dietz d6ec48c09a
[FIRRTL] chisel_{assert_assume,assume,cover,ifelsefatal} intrinsics. (#6664)
Provide intrinsics to capture what today is encoded via printf + when/stop/verif-op pattern matching and XML + JSON parameters.

Compared to assert/assume/cover FIRRTL (textual/in-the-spec) ops, these allow specifying labels that are more than identifiers and have optional compilation guards.

These map to current FIRRTL ops directly, including the various special behaviors that means in practice today (as encoded in LowerToHW):

* Assert implies companion assume emission.  Hence `chisel_assert_assume`.
* If the guard `USE_UNR_ONLY_CONSTRAINTS` is present, this companion assume is different, see: https://github.com/llvm/circt/pull/5561 .

There is no "assert" because `firrtl.assert` "concurrent" (SVA) forms always "imply" a "companion assume" and presently there is no FIRRTL dialect encoding for just a concurrent assert without this implied assume.

These are all SVA/concurrent "type".

IfElseFatal:
chisel_ifelsefatal becomes a very specific pattern of verilog that is not concurrent but is modeled that way in the IR (special "assert").
Allow guards and label on the intrinsic but they don't do anything on normal emission flow (`-emit-chisel-asserts-as-sva` will see them however so expose them).
2024-02-08 10:22:15 -06:00
Andrew Lenharth 18499e954e [NFC] Linewrap fixes 2024-01-26 10:02:18 -06:00
Ahmet Ramazan Çapoğlu 8a41150c33
broken image src's fixed (#6578) 2024-01-15 11:31:04 -05:00
Nandor Licker 65a5ee5986
[Sim] Introduce the rationale for the `sim` dialect (#6536) 2024-01-10 17:24:49 +02:00
shuoer86 29ba8077af
[Docs] fix typos in Dialects/ (#6555) 2024-01-07 00:59:18 -05:00
leothaud 2a0deb37cb
[Scheduling] Define problem to model operator chaining in cyclic problem. (#6485)
This PR defines a ChainingCyclicProblem, which models a hybrid problem of ChainingProblem and CyclicProblem and adapts the simplex scheduler to solve this problem. It is mainly done by reusing and adapting codes from the two base problems. This problem represents the problem a static HLS tool will solve for loop pipelining.

---------

Co-authored-by: leothaud <dylan.leothaud@irisa.fr>
2023-12-12 09:43:26 +01:00
Fabian Schuiki 594b8f65df
[Debug] Add scope op (#6454)
Add the `dbg.scope` operation to the debug dialect. The op creates an
additional level of hierarchy in the DI, a "scope", which can be used to
group variables and other scopes.

Operations such as `hw.module` introduce an implicit scope. All debug
operations within a module are added to that implicit scope, unless they
have an explicit `scope` operand. Providing an explicit scope can be
used to represent inlined modules.

Scopes in DI do not necessarily have to correspond to levels of a module
hierarchy. They can also be used to model things like control flow
scopes, call stacks, and other source-language concepts.

This commit also introduces an optional `scope` operand on
`dbg.variable`. The `DebugInfo` analysis, which traverses the IR and
builds up a canonical representation of the DI, honors this operand and
adds the variables to the corresponding scope.
2023-12-08 09:38:46 -08:00
Tynan McAuley 12f3e41754
[Docs] Fix documentation typos, NFC (#6393) 2023-11-08 17:02:54 -05:00
Amelia 1ea76baa00
[Docs] Fixed typo in VerilogGeneration.md (#6394)
Fixed typo in VerilogGeneration.md
2023-11-08 17:02:43 -05:00
Morten Borup Petersen 903b876902
Update HLS.md 2023-11-03 10:08:43 +01:00