Commit Graph

2991 Commits

Author SHA1 Message Date
Fabian Schuiki f3e5bc9b3b
[Arc] Add option to observe registers and memories (#6477)
Instead of always making registers and memories observable for the user,
add dedicated `--observe-registers` and `--observe-memories` options to
`arcilator`. These allow the user to indicate whether they are
interested in observing or register and memory state. If these options
are set to false, don't attach "name" or "names" attributes to states
and memories, such that other parts of the pipeline have a chance to
delete unnecessary state.
2023-12-02 09:22:23 -08:00
Prithayan Barua faf4dbae25
[FIRRTL][NFC] Add clockgate instName to FirtoolOptions setters. (#6460)
Add clockgate instName field and a convenient setter.
2023-12-01 13:12:29 -08:00
Andrew Lenharth c6e80910d7
[FIRRTL] Passive Wires pass (#6475)
This pass converts wires with flips in their types to wires with passive types.  This expands connects to resolve flips effects on data flow.  After expansion, flips carry no more information and can be removed from wires (as wires have duplex flow).
2023-12-01 11:14:16 -06:00
Fabian Schuiki 6281f978e7 [Arc] Make pass constructors accept options struct; NFC
Instead of passing pass options as separate constructor function
arguments, use the `*Options` struct produced by TableGen.
2023-11-30 10:49:50 -08:00
Fabian Schuiki 0bc8055655
[Debug] Add option to only mention existing files in HGLDD (#6452)
Add an option to HGLDD file emission to only consider location
information in the IR if the corresponding file exists on disk. This can
help filter out placeholder filenames such as `<stdin>` or `<unknown>`.
Also add a corresponding `--hgldd-only-existing-file-locs` option to
firtool.
2023-11-30 07:36:58 -08:00
Sprite 3b7d738056 [FIRRTL][CAPI] Add the rest of setters for options 2023-11-30 16:26:55 +08:00
John Demme eea08bd13c
[ESI] Add std service name to manifest (#6472)
Make the std service (if any) show up in the manifest. Allows the runtime to instantiate special support for std services.
2023-11-29 15:03:12 -08:00
Fabian Schuiki 878303a1fe
[Python] Add debug dialect bindings (#6471)
Add basic Python bindings for the debug dialect.
2023-11-29 15:02:59 -08:00
John Demme a9c43bc407
[ESI] Function call std service (#6465)
Function calls will eventually be recognized by the runtime and expose a function call interface.
2023-11-29 13:27:43 -08:00
Andrew Lenharth bba96b53c8
[FIRRTL] Create LowerSignatures to handle module signatures. (#6359)
This pass corrects just the module signatures according to the chosen lowering convention.
2023-11-29 15:25:38 -06:00
Fabian Schuiki 1d7ee186c1
[NFC] Homogenize file headers in CAPI/Python bindings
Adjust the header comments in the CAPI and Python bindings files such
that they are more in-line with the rest of CIRCT.
2023-11-29 13:19:38 -08:00
Aditya Naik a9f35c20a2
Add lowering for ILA Probe Intrinsic (#6415)
Co-authored-by: Fabian Schuiki <fabian@schuiki.ch>
2023-11-29 02:05:58 -08:00
John Demme 2310234eb8
[ESI][Manifest] Make service records required (#6461)
Build them before calling the generator then let the generator modify
it. Ensures that it is always present even if the generator ignores it.
2023-11-28 19:58:22 -08:00
Schuyler Eldridge e4cf203aa1
[firrtl] Remove CircuitOp::getMainModule
In preparation for FIRRTL 4.0.0, remove CircuitOp's "getMainModule" member
function.  This no longer makes sense in FIRRTL 4.0.0 where a circuit may have
any number of public modules and not just one "main" (or top) module.

Reviewed in: https://github.com/llvm/circt/pull/6449

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-28 15:48:40 -05:00
Andrew Lenharth 12c35d96b4 [NFC] clean up a few attributes which should be symbols attributes 2023-11-28 14:21:46 -06:00
Schuyler Eldridge 80b3edbcde
[firtool] Change scalarize-top-module option
Remove the -scalarize-top-module option to firtool (and the parser).
Replace this with -scalarize-public-modules.  This is done in preparation
for FIRRTL 4.0.0.  This is also largely unnecessary once FIRRTL 4.0.0
figures out how to attach the ABI to each public module.

Co-authored-by: Will Dietz <will.dietz@sifive.com>
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-28 15:10:55 -05:00
Will Dietz bf13e40143 [CAPI] Drop C++ include from C header. 2023-11-28 14:06:43 -06:00
Prithayan Barua 02f7a5067f
[HW][FlattenIO] Fix extern module instances (#6441)
There was a bug in FlattenIO, it was crashing for instances of hwModuleExternOp.
If an instance op is flattened before the corresponding module op, then it results in an inconsistent IR.
Fix this issue, by using an explicit InstanceOp builder that doesn't rely on the module op.
Add a flag to control the external module flattening and also enable recursive by default.
2023-11-28 09:38:13 -08:00
John Demme 0ca237ae7d [ESI][Python] Allow AppIDAttr to have null idx 2023-11-28 07:21:20 +00:00
Nandor Licker 35f5d51943 [NFC][HW] Fix nits related to instance_choice 2023-11-27 23:13:30 -08:00
Nandor Licker afea047286
[HW] Introduce the hw.instance_choice op (#6447) 2023-11-28 09:12:13 +02:00
Andrew Lenharth ae62ffdbc5 [CAPI] Fix broken build 2023-11-27 12:48:51 -06:00
Andrew Lenharth 57aff18faf
[FIRTOOL] Make firtool options behave like the rest of llvm. (#6435)
Move firtool pipeline configuration over to the same mechanism the rest of llvm and mlir use. Export this via the CAPI. Add a couple examples of methods to change options to the CAPI. Interested parties are encouraged to finish out the set of functions.

Since the CAPI has no tests, this breaks nothing.

As an aside, the configuration space of the firrtl pipeline is WAY too big.
2023-11-27 10:57:18 -06:00
Nandor Licker 87cd31536c [NFC][HW] Move more methods to the instance base 2023-11-27 06:03:22 -08:00
Nandor Licker ddbd72565e [NFC][HW] Move more methods to the instance declaration 2023-11-27 05:38:29 -08:00
Nandor Licker 3715a41330 [NFC][HW] Add a base TableGen class for HW instances 2023-11-27 05:19:52 -08:00
Nandor Licker e5185e0361 [NFC][HW] Move instance port list construction to its own method 2023-11-27 01:23:27 -08:00
Schuyler Eldridge 17bfb2b934
[firrtl] Rename GroupSink -> LayerSink
Rename the "GroupSink" pass to "LayerSink" to reflect new language in the
FIRRTL 4.0.0 specification.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-22 22:25:52 -05:00
Schuyler Eldridge 41cb3db05a
[firrtl] Rename GroupMerge -> LayerMerge
Rename the "GroupMerge" pass to "LayerMerge" to reflect the new language
in the FIRRTL 4.0.0 specification.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-22 22:25:51 -05:00
Schuyler Eldridge 0d7d73cb94
[firrtl] Change LowerGroups -> LowerLayers
Change the pass name to reflect the new FIRRTL 4.0.0 specification
language of "layers" instead of "groups".

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-22 22:25:51 -05:00
Schuyler Eldridge 15ff8c1f67
[firrtl] Change GroupOp -> LayerBlockOp
Change the FIRRTL Dialect operation GroupOp to be called LayerBlockOp.
This is done to align FIRRTL Dialect with version 4.0.0 of the FIRRTL
Specification.  This makes no changes to parsing or emitting FIRRTL.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-22 22:25:51 -05:00
Schuyler Eldridge f4d6e2b476
[firrtl] Change GroupDeclOp -> LayerOp, Convention
Rename GroupDeclOp to LayerOp and GroupConvention to LayerConvention.
This is the first piece of applying the FIRRTL 4.0.0 Specification name
change of "group" to "layer".

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-22 22:25:51 -05:00
Nandor Licker ccc71df7d3 [NFC][InstancePath] De-templatize the print method 2023-11-22 03:52:04 -08:00
Nandor Licker 0e31fd715e
[InstanceGraph] Remove the module lookup helper (#6425)
The instance graph is transitioning towards supporting multiple possible targets for instance operations.
As a consequence, it can no longer assume that there are instance operations with a single target and it will expose a generic interface returning a list of targets.

This PR removes the lookup helper from the graph and instead provides the users (`firrtl::InstanceOp` in particular) with helpers to fetch the unique referenced instance.
2023-11-21 17:49:56 +02:00
Nandor Licker 2711dd5a95 [NFC][InstanceGraph] Remove the slow target getter helper 2023-11-21 06:44:22 -08:00
Nandor Licker 1aa8ff5071 [FIRRTL] Group instance-like ops using FInstanceLike 2023-11-21 06:40:43 -08:00
John Demme 19be7e55fd
[ESI] Cosim: punt endpoint naming to users (#6427)
Rather than identifying cosim endpoints by "%m", have them specified entirely upstream. The easiest way to ensure uniqueness then is to only allow cosim endpoints at the top level. This solves a number of issues, and also makes cosim look a lot more like other ESI services.
2023-11-17 17:51:55 -08:00
Hideto Ueno bca67e6452
Bump LLVM (#6424)
Bump llvm to ae7fb21b5ad434e920fe394587ac13c899d8ee84.
2023-11-17 15:26:12 +09:00
Nandor Licker fa29411eef
[Seq] Move register & memory macro headers to SeqToSV (#6419)
There is no longer need to keep the definitions in `LowerToHW`. Duplicated some helpers as it is awkward to find a place in `sv` for them.
2023-11-17 08:23:10 +02:00
Andrew Young ef7184d1bd [FIRRTL][OM] Root paths at their owning module 2023-11-16 21:27:48 -08:00
Andrew Young 5206b27a92 InstanceGraphInterface: use const references where possible 2023-11-16 21:27:48 -08:00
fzi-hielscher f37fe720e6
[Firtool][CAPI] Remove dedup option (#6423) 2023-11-17 00:14:53 +01:00
Schuyler Eldridge cac97104a0
[firtool] Remove -dedup option
Fuilly remove deprecated -dedup option.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-16 13:32:42 -05:00
Fabian Schuiki 045af5e5fb
[HW] Move getPortVerilogName helper into HW PortInfo; NFC (#6421)
Pull the `getPortVerilogName` helper out of `ExportVerilog` and move it
into the `hw::PortInfo` struct as `getVerilogName`. This allows other
passes that run after Verilog emission to query a port's Verilog name
without duplicating that piece of code.
2023-11-16 09:26:44 -08:00
Nandor Licker 4f1b8b26bc
[HWMemSimImpl] Add a mode to set disabled outputs to zero (#6414) 2023-11-14 20:48:55 +02:00
Sprite e118358778 [FIRRTL][CAPI] Add functions for property types 2023-11-14 22:50:26 +08:00
Schuyler Eldridge 4cd1f1031c
[FIRRTL] Add GroupMerge pass
Add a pass that merges optional groups which reference the same
declaration.  This exposes additional optimization opportunities and
produces better Verilog output for groups.

Fixes #6228.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-11-13 10:05:14 -05:00
Morten Borup Petersen 6a4849d043
[Seq] Add shiftreg op (#6038)
Adds a shift register operation to the seq dialect. The operation has an interface similar to a `seq.compreg.ce` operation, with an additional `size` to specify the number of stages.

Included is a default lowering to `seq.compreg.ce` operations. The main intention of introducing this operation is to be able to emit shift registers using target-specific resources.

I don't see a reason to add a non-clock-enabled shift reg operation in addition to this. If users need a non-clock-enabled shift register, it should suffice to emit a shift register with constant 1 clock-enable, whereafter (if lowered to e.g. `seq.compreg.ce`), the lowered primitive should have a canonicalization that considers the constant clock enable signal.
2023-11-13 15:57:16 +01:00
Nandor Licker 53cf75911a
[Seq] Move the HWMemSimImpl pass to seq (#6409)
The pass relies on `seq` items, creating a circular dependency between SV and Seq.
It better belongs to the seq dialect, alongside options and ops it related to.
Moving forward, this should be merged into FIR memory lowerings.
2023-11-13 11:19:21 +02:00
Mike Urbach bbf0575414
[FIRRTL] Remove Map property type and expressions. (#6407)
The Map property type was not necessary in the end. A Map can easily
be represented by a list of object with two fields, and this is how
its been done downstream. Remove this to simplify FIRRTL and reduce
maintainence burden.
2023-11-10 10:35:19 -07:00
Mike Urbach 57a28110c3
[OM] Remove enum type. (#6408)
This type wasn't needed after all. We may eventually want some form of
this, but there is no immediate need. Removing this for now reduces
maintainence burden until we are sure what we want.
2023-11-09 23:04:37 -07:00
Nandor Licker 04260957c6 [NFC][InstanceGraph] Move a default implementation into the trait 2023-11-09 13:54:16 -08:00
Nandor Licker c7d5e31d1b
[Seq] Add the `Clocked` trait to FIR mem read/write ops (#6401)
The ops are consumers of clock signals, so the trait is added.
Additionally, the `clock` operand is renamed into `clk` to keep it consistent with other `seq` ops.
2023-11-09 18:31:47 +02:00
John Demme e8681eb883
[ESI][Runtime] Create a 'trace' accelerator backend (#6396)
Trace recording and playback could be very useful. Could also be used for design introspection and runtime testing (without cosim). This is the start of that system.
2023-11-08 20:52:11 -08:00
Tynan McAuley 12f3e41754
[Docs] Fix documentation typos, NFC (#6393) 2023-11-08 17:02:54 -05:00
John Demme aca2fc57d0
[ESI] Major cosim fixup/cleanup/update (#6365)
- Changes terminology: send -> fromHost, recv -> toHost.
- Makes ops and SV unidirectional.
- Declares external modules using parameters.
- Updates Capnp schema to use string type IDs.
- Ditch the typed Capnp endpoint interface.
2023-11-01 17:59:14 -07:00
John Demme 55045fc33d
[HW] Resolve parametric types in the InstanceOp builder (#6364)
Have the instance op builder try to resolve any parametric types in the module. If it fails, fallback to the parameterized module types and don't print an error message.
2023-11-01 17:44:08 -07:00
fzi-hielscher b8d69d5cc0
[HW] Reference struct/union fields by index (#6266)
This PR changes the HW StructExtract, StructInject, UnionCreate and UnionExtract ops to reference their accessed field by the respective aggregate type's field index instead of the field name. This allows us to access the field's FieldInfo struct directly instead of having to traverse the array to find the matching name.
2023-11-01 22:29:22 +01:00
Morten Borup Petersen 1277406c3b
[Ibis] Refactor to use inner symbols (#6369)
- Symbol-defining operations nested within `ibis.class` and `ibis.container` ops are now declared as `InnerSymbol`s.
- `ibis.class` is now an `NestedSymbolTable`s.
- `ibis.method` can no longer inherit from `FunctionLike` since that interface is built around an assumption of the function inheriting from `Symbol`.
- Containers are NOT `InnerSymbolTable`s yet - we cannot yet support nested symbol tables; see #6330; given that `ibis.container` needs to be able to still be able to be placed inside an `ibis.class` op.

Given the latter point, this is not a perfect implementation. As such, some parts of the implementation is still underperformant (e.g. `ScopeOpInterface::lookupInnerSym` which essentially does a scan of `InnerSymbol` ops inside the scope to facilitate symbol-lookup-like capability).

However, the implementation solves the immediate goals of:
1. not misusing MLIR by having nested symbol tables and looking across them
2. allowing the use of `hw.instance` operations inside containers nested in classes.
2023-11-01 13:33:45 -07:00
John Demme bae95f570d
[ESI] Compressed manifest lowering for cosim (#6358)
CompressedModuleOp lowers to an instance of the Cosim_Manifest external module.
2023-10-31 16:46:29 -07:00
John Demme 6ef2489cdb [ESI] Incorporating port-review feedback on #6358 2023-10-31 22:38:20 +00:00
Mike Urbach 6e1ae3c390
[OM] Add Python bindings for path types. (#6361)
In order to use the types in Python with isinstance, etc., we need to
provide the mlir_type_subclass bindings. This adds the C API
boilerplate and binds the types.
2023-10-31 15:43:37 -06:00
John Demme ba1cda97b9 [ESI] Add compressed manifest op
Intended so different BSPs can easily lower this to various hardware
implementations. Op serializes binary data to ASM with base64 encoding.
2023-10-30 23:32:24 +00:00
John Demme 4d179e4826 [ESI] Remove redundant 'esi.' from ops 2023-10-30 23:25:03 +00:00
John Demme 1927491cff
[ESI] Move Cap'nProto into ESI runtime (#6354)
Simplifies the CIRCT proper build. Also mitigates a runtime binary distribution problem by requiring users to compile the runtime themselves.
2023-10-30 13:45:17 -07:00
Will Dietz ca43fab3d6 [OM][Evaluator][NFC] Unused dyn_cast result -> isa. 2023-10-30 08:11:24 -05:00
devins2518 055fe75ae2
[CAPI][MSFT]: Remove include of C++ header in C-API (#6353)
The inclusion of "circt/Dialect/MSFT/MSFTDialect.h" included
  "llvm/Support/type_traits.h" which is a C++ header and causes issues
  when included from a C compiler.

---------

Co-authored-by: John Demme <john.demme@microsoft.com>
2023-10-27 14:54:38 -07:00
John Demme 03e1d94d5c
[ESI] Rip out Cap'nProto schema generation (#6349)
This turned out to be a bad idea. We're still using Cap'nProto for Cosim, just with the message being a blob which is already encoded by the client. This is nearly identical to what happens in hardware, just Cap'nProto/DPI as the transport layer.

Goodbye old frenemy.
2023-10-26 19:58:24 -07:00
John Demme bf49e13e75 [ESI] Load more dependant dialects 2023-10-26 23:40:48 +00:00
John Demme 07ec222033
[ESI] Include designer-specified and service info in manifest (#6346)
Adds new op for designers to attach metadata to any symbol.
2023-10-26 14:58:11 -07:00
Fabian Schuiki a50b0bb1cc
[Debug] Add debug-only value/op analysis (#6335)
Add the `DebugAnalysis` which marks values and operations that only feed
into debug info. This will later allow ExportVerilog to skip expressions
and statements that are exclusively used by debug ops and are irrelevant
for synthesis and simulation.

The analysis is fairly straightforward at the moment. In the future, we
may want to be more clever about what we mark as debug-only. For
example, certain debug info output formats may allow us to emit entire
expressions and state machines, such that those can be stripped from the
Verilog output. In that case, we'd want to look through expressions,
wires, and registers when marking ops as debug-only. But some other
formats may only allow us to point at named signals in the Verilog, such
that any expression or register has to remain in Verilog, and possibly
be visible under a name for the debug info to make use of it.

This commit also bundles the `DebugInfo` analysis, which extracts the
source language hierarchy and variable layout from the IR, together with
this new `DebugAnalysis`, which marks ops as debug-only.
2023-10-26 13:53:49 -07:00
Fabian Schuiki 34c320f474
Bump LLVM to 7ce613fc77af092dd6e9db71ce3747b75bc5616e (#6342) 2023-10-26 13:53:12 -07:00
John Demme 58662f4415
[ESI] Add AppID design hierarchy manifest data to the manifest (#6345)
Serialize the IR representation into JSON as part of the manifest.
2023-10-26 13:45:20 -07:00
Prithayan Barua c11a1f856a
[FIRRTL] Add argument to detect flipped fields with walkGroundTypes (#6344)
Add an argument to the callback of walkGroundTypes to indicate if the ground type is flipped.
This is required for dataflow analysis of connections of flipped aggregate fields, which is used in #5647
2023-10-26 13:26:12 -07:00
Prithayan Barua cd2d195684
[FIRRTL] Add a new pass to detect ops that will fail simulation (#6341)
This PR adds a new pass called `Lint` to the `FIRRTL` pipeline, that checks for
 operations that are guaranteed to fail a simulation.
Currently the pass detects static asserts, that is an assert which is enabled
 and the predicate is either a constant false or a reset. The pass emits an
 error on the assert that is guaranteed to fail in simulation.
The pass can later be extended to include more such checks.
2023-10-25 18:39:33 -07:00
John Demme 684fb5efca
[ESI] Build AppID hierarchy for building manifest (#6338)
Mirrors the AppID index hierarchy. Clone manifest data into it.
2023-10-25 13:40:34 -07:00
John Demme 00ed987a67
[ESI] Add `HasAppID` op interface (#6337)
Some ops have an AppID as an inherent attribute. This (along with the
`getAppID` function) covers those cases.
2023-10-24 16:44:56 -07:00
Rachit Nigam e5586e0cd4
Rename `sel` on calyx.mux to `cond` (#6333) 2023-10-24 18:15:11 -04:00
John Demme 194a598f32
[ESI][Services] Leave breadcrumbs while connecting services (#6331)
When running the service connection pass, leave a record of the original designer intent. Will be used later on for the manifest. Rename AppID.td to Manifest.td.
2023-10-24 12:03:38 -07:00
Fabian Schuiki 3136ae5ecd
[firtool] Move -g option into firtool library (#6332)
Move the `-g` option from `firtool` the tool to `Firtool` the library.
See discussion in #6309.
2023-10-24 11:44:18 -07:00
Fabian Schuiki 097e0a60b4
[FIRRTL] Add debug info materialization pass (#6309)
Add the `MaterializeDebugInfo` pass, which creates debug ops to track
FIRRTL-level ports, nodes, wires, registers, and instances throughout
the pipeline. This is a fairly simple first attempt at tracking
higher-level source language information through the compilation using
the debug dialect.

Also add the `-g` option to firtool, which causes this pass to run very
early on in the pipeline where all the high-level information is still
available. Enabling this option will currently cause `ExportVerilog` to
fail because of the additional operations in the IR -- to be rectified
by a later PR.
2023-10-24 09:52:33 -07:00
John Demme beb9c36acd [ESI][MSFT] Move dialects over properties for attributes 2023-10-24 01:50:19 +00:00
John Demme d89f7d825b
[ESI] Service requests now track AppIDs rather than instance hierarchy (#6328)
This makes for far more sensible hierarchies. Also makes the index field of AppIDs optional.
2023-10-23 14:00:08 -07:00
Hideto Ueno c1d84a8510
[FIRRTL] LowerAnnotations: Allow annotationRecords to be extended externally (#6296)
This PR factors out some of LowerAnnotation helpers to a header and introduces registerAnnotationRecord method so that downstream user can extend the table. 

Fixes #4933.
2023-10-23 11:44:35 +09:00
Andrew Young 4ec8cb388d
[OM] Add evaluator support for paths (#6320)
This change adds evaluator support for frozen paths.

Two new EvaluatorValues have been added, one for BasePaths, which
represent fragments of paths through the instance hiearchy, and one for
Paths, which represent a full path to a hardware component.

When the evaluator instantiates an OM class, it is expected that it will
usually have to pass in an empty basepath, which signifies that the
class is at the top of the hierarchy. To facilitate this, we exposed the
ability to create an empty basepath value in the python API.

Path values can be transformed in to strings, where in they are printed
as FIRRTL style target paths. In the future, we may want a richer API.
Deleted paths are represented as Path values with the targetKind
attribute nulled out, which is handled specially in the string
serializer.
2023-10-20 09:56:39 -07:00
Fabian Schuiki a9a07b70d2
[Debug] Add debug dialect (#6308)
Add the `dbg` dialect, alongside a rationale document, basic types, and
the three essential `dbg.variable`, `dbg.struct`, and `dbg.array`
operations.

The goal is for this dialect to be a home for all the machinery needed
to track debug information in the IR. After discussions with a few
people in the LLVM/MLIR space, I chose to create dedicated operations to
track debug info in the IR, as opposed to an attribute/metadata based
approach. The details are outlined in the rationale document.

Subsequent PRs add simple debug info tracking to FIRRTL and firtool, and
extend debug info emission to consider these operations.
2023-10-20 09:51:37 -07:00
George Lyon 55505ebcb9
firtoolPopulateCHIRRTLToLowFIRRTL doesn't need a module (#6304) 2023-10-19 12:38:03 -07:00
John Demme db6112698d
[ESI] Move services over to bundles (#6302)
Services now only support bundle ports. Bundles pretty significantly simplify services at the expense of some nomenclature complexity.
2023-10-19 12:03:49 -07:00
John Demme bb95048f92
[ESI] Misc improvements for bundle ops (#6312)
- Builders
- Printing should never fail
2023-10-18 20:56:07 -07:00
John Demme 62050a39cd
[ESI] Ditching service metadata (#6301)
This functionality will be replaced at some point with a more holistic
scheme.
2023-10-18 20:27:16 -07:00
John Demme c085fd1e70
[ESI] Rip out C++ API generator for cosim (#6300)
This functionality will be revived at some point.
2023-10-18 20:26:54 -07:00
John Demme 77ab38628c
[ESI] Start of system manifest: types (#6290)
An ESI system manifest is intended to describe the parts of a particular
accelerator which may be relevant to software.  It will eventually
replace the services metadata json.

This first PR only outputs types on cosim ports.
2023-10-17 13:27:45 -07:00
Morten Borup Petersen c26204ac84
[MSFT] Add multicycle path op (#6262)
Adds a new operation to the MSFT dialect which specifies a multicycle path constraint in between two symbols.

This implementation does not opt in to the whole dynamic instance hierarchy specification of MSFT; do we want to do that? Would have to require some thinking about what it means that a PD constraint refrences two dynamic instances, wherein `msft.instance.dynamic` currently expects all nested pd constraints to reference the parent instance exclusively.
To this, i don't think it will be needed in our immediate usecase, anyways (assuming we're going to use `hw.path.to_this` which itself will generate the `hw.hierpath` and _not_ use the dynamic instance hierarchy support in MSFT).

Also splits `DynInstDataOpInterface` into a two interfaces; one base interface (anything that pertains to dynamic instance data) and the `UnaryDynInstDataOpInterface` which refers to all data ops which access a single location - some additional boilerplate is introduced since the current implementation of OpInterface's doesn't seem to support inheriting interfaces implementing parent interfaces (everything is expected to be defined by the implementing op).

Exported TCL example:
```tcl
proc reg_0_multicycle_config { parent } {
  set_multicycle_path -hold 1 -setup 2 -from [get_registers {$parent|reg_0}] -to [get_registers {$parent|reg2}]
}
```
2023-10-17 09:46:25 +02:00
John Demme 82504d0ffb [ESI][Python] Use ODS enum in Python bindings
This is safe since it's just an enum from a header. Better since it
avoids duplication.
2023-10-14 03:19:57 +00:00
Hideto Ueno e83993015c
[FIRRTL] [FIRRTLFolds] Remove RecursiveMemoryEffects and RecursivelySpeculatable from When op, add canonicalizers (#6236)
RecursiveMemoryEffects and RecursivelySpeculatable traits provides automatic derivation of side-effects of operations but these effects are computed by recursive IR walk. This is problematic for firrtl.when since when operations are often deeply nested, which prevents us from running canonicalizers before ExpandWhens. This PR just removes these traits and add canonicalizers for whens manually.
2023-10-13 18:29:32 +09:00
Rachit Nigam 8765933dc7
Add emission for calyx std_signext (#6285)
* add emission for Calyx std_signext

* fix tests
2023-10-12 12:17:44 -04:00
Hideto Ueno 74e9f45378
[FIRRTL] Add strip option to DropName (#6281)
This commit adds strip option to drop name pass. Even though there is none option but none option does keep existing names. strip explicitly strips all names to remove variable names form Chisel.
2023-10-12 19:26:20 +09:00
Hideto Ueno 080f275376
[Namespace] Return an empty string for empty string. (#6284)
Previously Namespace::newName could return empty string for empty string.
This is a problematic behaivor since primary use cases of Namespace is
symbol generation but empty string cannot be used a symbol.

For example HWExportModuleHierarchy crashed with an instance with an
empty name.

This commit fixes the issue by pre-registering empty string in a constructor of
Namespace.
2023-10-12 05:25:56 +09:00
Andrew Young 8e4992be35
[OM] Overhaul of path operations (#6253)
This PR does an overhaul of how path related operations work in the OM dialect.

When OM classes are created from FIRRTL, a base path is now fed through the
class hieararchy.  All paths to hardware objects are now created relative to
the base path.  The `path` op has been renamed to `path_create`, and now takes
a basepath SSA parameter, which means that it is impossible to create a path
which is not relative to some base.

A second set of operations to create "frozen paths" have been added.  In
FreezePaths, we lower all path operations to hard-coded strings, which allows
us to remove the hardware from the OM IR and still be valid.  These operations
have been changed to return `FrozenPathType`, which is to make sure that people
don't try to inter-mix the two kinds of path types.  The intention is that the
evaluator will only understand frozen paths.

The PathAttr in OM no longer represents the entire target path, but just the
list of instances which lead up to it.

This also adds an OM utility for parsing FIRRTL style target strings, which is
used in the `frozenpath_create` MLIR assembly format.  The existing APIs
contained in FIRRTL were not suitable since these new strings do not include
the circuit name, and we need some restrictions for parsing base paths, which
can not target components. The new parser is a bit more resilient to badly
formed path strings. In the future it may be possible to reunite these two
bodies of code.

The existing python support for paths had to be removed.
2023-10-11 12:33:10 -07:00
Nandor Licker dadf87b742 [NFC][firtool] Fix CAPI 2023-10-11 04:24:33 -07:00