This refactors ExportQuartusTcl to use the hw::GlobalRefs and arrays
of hw::InnerRefAttrs directly. This greatly simplifies the
implementation, and removes the need for SwitchInstanceAttr. That
attribute will be fully removed in a follow up.
* [HW] Use StringAttr instead of StringRef in FieldInfo, nfc
This commit changes to use use StringAttr instead of StringRef
in FieldInfo to avoid unnecessary copies of field names.
Changes are mainly about parser/printer and CAPI.
This commit also changes Struct/UnionTypeImpl to use ArrayRefParameter
instead of ArrayRefOfSelfAllocationParameter in their tablegen
definition. And this deletes unnecessary allocators too.
This add the necessary Python binding boilerplate to create
PhysicalBounds and PhysicalRegionRef attributes. A new API is added to
System, which inserts a PhysicalRegion. A wrapper class for
PhysicalRegion allows creating a region, adding bounds, and getting a
reference attribute suitable for use with the add_attribute API.
This is the preferred way to output design collatoral. Closes
https://github.com/llvm/circt/issues/2068.
The ExportQuartusTcl pass is removed, and the functionality is moved
into LowerMSFTToHW. The pass now populates a SymbolCache of the things
we care about in the export, namely instances. It produces verbatim
ops containing the Tcl, which can then be emitted from ExportVerilog.
The old Python API to run the export is removed in favor of the new
approach. PyCDE now exports both System Verilog and Tcl using the
exportSplitVerilog API to output files into a directory.
This keeps the existing functionality based on attributes, and exports
to llvm::outs as part of the pass, in order to keep the existing
tests. Further changes based on the approach in #2068 will follow.
With the new CMake functionality upstream, we need to set the
ENABLE_AGGREGATION option when we call add_mlir_library. The easiest
way to do this is to just rely on the upstream helper
add_mlir_public_c_api_library, which does this and other important
settings for us.
Also, ensure the MSFT dialect's CAPI marks all of the public functions
as being exported.
No functional changes. This PR simply renames DeviceDB to PlacementDB within the MSFT dialect. The "DeviceDB" name may be used in a future PR and live alongside the PlacementDB.
We've switched to Python-based generators. Ping-ponging between IR modifying
C++ and IR modifying Python was a massive mistake for pointer safety reasons.
Closes#1810
The changes to `hw.module` and `hw.instance` make them incompatible with `msft.module` and `msft.instance` as far as the python bindings are concerned. I'm not sure what I want to do here so I've marked that test as `xfail` for the moment.
A RootedInstancePath is just an instance path prepended with the root (aka top) module which the instance path is relative to. If we structure the placements based on this, we no longer have to walk the instance hierarchy while exporting TCL! This patch also removes support for locations not inside of instance switches. That use case required the design be fully elaborated which isn't really done.
There were some bits of the ESI and MSFT native pybind11 modules that
directly called into the CIRCT C++ libraries. This moves that
functionality out of the modules and behind the C-API. This proper
layering needs to be enforced before we can implement the upcoming
migration to use the improved upstream Python binding mechanism.
Also, this ensures all of the C-API functions used by the Python
bindings are annotated with MLIR_CAPI_EXPORTED, which will also become
required.
This adds straightforward support for the TypeAliasType, as it stands
today, in the CAPI, then layers the Bindings directly on top of that.
Later improvements to the TypeAliasType's builder will of course
require refactoring part of this, but for now, this opens it up for
use in PyCDE.
Previously, different parameterizations of the same module would end
up using the most-recently registered generator and the
parameterization used when it was registered.
This includes the parameterization in the registered mapping, and
looks for that same parameterization when looking up generators. This
is trivially supported since we already store the parameterization as
an attribute on the Operation.
Added a few lines to the polynomial integration test to ensure the
behavior.
Prototype of "generators". This version runs the generator for each and every op to lower and each time it is called, a new HWModuleOp is created at the top level. To fix this, I plan on unique'ing on the operation's attributes, result types, and operand types. This'll involve some refactoring since as of this PR the HWModuleOp creation and instantiation are both in the same callback.
This makes sure not to rename FIRRTL to HWRTL :-), and I spot checked a
many things to avoid changing general references to RTL (e.g. when referring
to external tools) but I suspect that I missed some. Please let me know (or
directly correct) any mistakes in this mechanical patch.
* C API fails to link on builds that have CAPNP disabled, since some of
the symbols in the C++ API get dropped. Make the corresponding uses in
the C API conditional on the presence of the same ifdef, so things
link again.