- Adds python bindings for MSFTModuleOp and InstanceOp.
- Re-use as much as possible from `circt.hw._hw_ops_ext`. Required changes to
ODS definitions.
- Found and fixed some bugs.
Add an integration test of Grand Central Views that uses Verilator to
lint and type-check the produced SystemVerilog output. This is
primarily done to test the following features:
- All necessary interfaces are generated
- All XMRs are valid (XMRs use the correct instance names)
Both single file ("firtool -verilog") and multi-file output ("firtool
-split-verilog" with an annotation file doing extraction) are tested.
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Fix more ESI tests and integration tests to use the new HW dialect
module/instance foramt.
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
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.
Schuyler points out in Issue #1600 that it isn't correctly implemented,
and there is only one place in the compiler that forms it ... in a
theoretical case. I added this a long time ago on a theoretical basis.
It is best to remove this until there is a real need for it.
This fixes Issue #1600.
* Added Tcl bindings for loading an MLIR file.
* Ran clang-format
* Updated Tcl library path
* Update simple.tcl
* Implemented Lenharth's suggestions
* Ran clang-format
* Fixed integration test
* Added checks to integration test
* Implemented some of Mike's suggestions
* Added another argument
* Added paths to Tcl debug output in CMAKE
This is mostly mechanical for us. Some notable changes:
* Require a unified build for Python in CMake, docs, and CI
* New CMake defaults for some variables in CMakeLists.txt
* Use the new CMake functions for Python bindings and PyCDE
* Update imports for generated Python and Python extension libraries
* Update PYTHONPATH to reflect the new location under unified builds
This test is probably too narrow to be part of the integration test
suite. It ensures the tool does what we expect, with the constructs we
emit from ExportVerilog. Closes
https://github.com/llvm/circt/issues/1368.
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.
This adds a create classmethod to the variadic and other Comb ops,
rounding out the Python bindings sugar for the Comb dialect.
Additionally, this removes the kwargs from the non-variadic Comb ops'
create classmethods. This presents the same API as the variadic ops
for the common case where all the operands are known at the time the
op is constructed.
Under the hood, non-variadic ops still use the NamedValueOpView to
continue supporting the less common case of constructing the operands
incrementally. Incremental construction is simply not possible for the
variadic ops, since we need to know how many operands to build at
construction time.
- Creating new frontends top level directory which contains frontends which are optionally included.
- Moving @module and @Generator into PyCDE frontend.
- Keeping connect in the bindings since it's used in the bindings tests.
- Fixing the integration tests.
Closes#1179.
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.
The comparators all return an i1, so we simply don't need a result
type there. The binary ops all have the SameOperandsAndResultType
trait, so we can check the operand types and infer the result type.
This refactors the NamedValueOpView to push all the complexity into a
shared constructor that works for a variety of ops like InstanceOp,
CompRegOp, and the non-variadic Comb ops.
To support this, subclasses must now define two hooks to retrieve the
list of operand names and result names. There is also a third hook to
create a backedge of an appropriate type for a given operand that was
left uninitialized. The default implementation works for ops that have
the same type for all operands.
The driver would previously hold the top level input valid signal high
until the result valid signal was asserted. This updates the behavior
to match handshake-runner, which only schedules the input arguments
once.
This also replaces the piecemeal examples with two proper integration
tests: a dot product and a 1-d matrix multiplication. These tests
cover the old ones, and too many simulations slow down the test
suite.
Create an `OutputOp` out of the return value from `body_builder`. Eliminate input ports as `construct` args. Move all of the `module.entry_block.arguments[1]` ugliness to the new `module.foo` syntax.
Make the @module annotation create a subclass which also inherits from OpView. When OpView is initialized, an unregistered MLIR operation gets created. Use the Input and Output classes as classmembers or instancemembers to create operands and results.
This breaks the construct based building. That'll be added back once we have a lowering API in python.
This adds `circt.connect` to "connect" two values. It sets the
destination OpOperand to the new value.
To integrate with the builder approach, this updates the
InstanceBuilder to return a wrapper BuilderValue around any Values
accessed through `__getattr__`. This works with the connect API to
pass around the needed index to ultimately set the Value and erase any
temporary backedges the builder created.
As the builder approach is generalized to other ops, the connect API
should work in exactly the same manner.
The most common use case for the `circt.design_entry` API is that a single
context is used throughout the lifetime of the application. This creates a
default context and default location and installs them into the defaults stack.
Since we don't want this behavior whenever someone imports circt, don't import
`design_entry` into the `circt` namespace.
This is no longer needed now that the BackedgeBuilder is implicit.
This change also includes some whitespace updates to line things up
after the RTL->HW name change.
The Handshake end-to-end tests were failing with assertions in
IMConstProp, so just disable that new pass for now.
The `set[BackedgeBuilder.Edge]()` type hint raises the following:
TypeError: Type Set cannot be instantiated; use set() instead
Divorces the support BackedgeBuilder from InstanceBuilder (so it can be used
elsewhere). Stores some extra information in the edge instead of digging it up
later in an InstanceBuilder-specific way.
Keep a stack of BackedgeBuilders in a contextvar. Provide a static method to
get the top.
Using the list[type] syntax fails for me with this error:
```TypeError: 'type' object is not subscriptable```
Using the typing.List for the same task resolves that.