Commit Graph

291 Commits

Author SHA1 Message Date
John Demme aa5c574d2a
[MSFT] Make `PassCommon` public (#3493)
`PassCommon` contains `getAndSortModules`, which is generally useful. Make it general by implementing `HWModuleLike` and `HWInstanceLike` and targeting those OpInterfaces instead. Involves a bit of ugliness when converting to/from the OpInterfaces to concrete module ops, but hopefully that'll go away as we add more functionality to said OpInterfaces.
2022-07-08 15:53:26 -07:00
Morten Borup Petersen 44712fb117
[HW][CAPI] Support ParamDeclRefAttr and hw::IntType in CAPI (#3302) 2022-07-02 08:22:17 +02:00
John Demme cad8cd5be7
[MSFT] AppID attribute (#3425)
An 'AppID' is intended to make browsing the instance hierarchy easier.
Instead of having to reason about instance names, users can specify an
'AppID' consisting of a (name, index) pair and browse the hierarchy that
way. Said browsing also looks through the instance hierarchy (with
several rules about transparency) to mask implementation details at
various levels of the hierarchy.

This commit adds an `AppID` attribute and exposes it through Python.
2022-06-27 15:05:32 -07:00
Morten Borup Petersen d66cbfe9ea
[PyCDE,CAPI] Add support for the FSM dialect (#3400)
This is an initial commit for adding a CAPI for FSM as well as PyCDE support for constructing these.

See `test_fsm.py` for usage.

FSMs are constructed in a similar manner to PyCDE modules through a decorator on a class describing the FSM.
The FSM class may contain inputs (no outputs for now) and must provide
- A dictionary containing the states and their transitions
- A default state

State transitions may be either always taken, or taken based on some guard. This guard is defined by a function provided to the transition, which (like `@generator` functions) acts on the ports of the FSM.

The FSM will then be constructed with an output for each state, asserted when that state is active.

One important implementation note is the fact that the `fsm.machine` operation is treated as a PyCDE Module - there was surprisingly little friction slotting it into the current code and everything works as expected wrt. referencing `fsm.machine` in/out arguments through the transition guard functions.
However, modules instantiating the FSM expect a hardware-like interface, this being the ports of the `fsm.machine` operation + clock and reset signals. An `fsm.machine` op does not have these signals at the top level, since these are added during hardware lowering. To me, this is a sensible design choice, seeing that the FSM dialect should be applicable to both software and hardware representations (...eventually).

To get around this, the user will specify the intended name of the `clock` and optional `reset` signal of an FSM. A wrapper module is then created that provides the correct interface to the instantiating module, as well as instantiating the FSM through a `fsm.hw_instance` operation, doing the proper hoop-jumping to attach the clock signal (see `fsm_wrapper_class`).

There's still some work to do on the CIRCT side of the FSM dialect to clean it up a bit + make it a viable target for a front-end, but this commit represents the brunt of work on the PyCDE side.
2022-06-27 16:14:38 +02:00
John Demme c39757fc81
[Python] Add support for SV attributes (#3349)
Lots of boilerplate which should _really_ be autogenerated. Added support for SystemVerilog attributes to the python bindings for the SV and Seq dialects.
2022-06-14 16:08:42 -07:00
John Demme 6349f22583
[PyCDE] [Python] Teach `LocationVector` bindings about 'None' for optional locations (#3165)
Use `None` to indicate that the location is not specified to/from Python. Also updates `PlacementDB` to deal with empty locations.
2022-05-23 15:07:48 -07:00
John Demme e65aba5117
[MSFT] [Python] Expose LocationVector to Python (#3163)
Add support for LocationVectorAttr to PlacementDB. Tests in subsequent
PRs.
2022-05-20 20:20:56 -07:00
John Demme 41bc38e35a
[MSFT] Teach PlacementDB about LocationVectors (#3162)
Add support for LocationVectorAttr to PlacementDB. Tests in subsequent
PRs.
2022-05-20 20:12:45 -07:00
Nandor Licker 72838a205c
[Seq] Moved pass definition to a separate header (#3143)
Moved the definiton of `Seq` passes to a separate `SeqPasses.h`, similarly to other dialects.
Exposed the `createSeqLowerToSV` function to be used by other clients.
2022-05-19 10:42:27 +03:00
John Demme 86c98bc864 [Python] [HW] Add name and module accessors to InnerRefAttr 2022-04-30 01:59:54 -07:00
John Demme bbd571b9f1 [PyCDE] Cleanups enabled by new MLIR features
MLIR upstream added:
- Default MlirLocations
- C API and Python functions to move blocks
2022-04-15 19:45:49 -07:00
John Demme c270a5af34
[PyCDE] Infer the result type of a SystolicArray PE (#2844)
To simplify the ownership model, MLIR core python bindings don't support
building a block before the operation. So we build a dummy operation
first, build the block, construct the array, move the block, then delete
the dummy op. The core MLIR C API doesn't have a region editing API, so
we need to add a specialized one in the MSFT C API.
2022-04-04 17:56:46 -07:00
John Demme 1722fde995 [MSFT] Removing unused 'getInstance' calls
This was used to refer to dynamic instances, but this was replaced by
the DynamicInstanceOp paradigm.
2022-04-01 13:41:45 -07:00
Martin Erhart 927629810c
[Moore] Add types to C API (#2827)
A first step to have proper support of the Moore types in the C API. This focusses on the functions to create types and some SBV type functions needed to support the already existing moore operations in the external moore frontend compiler.
2022-03-31 12:33:52 +02:00
John Demme 1041dfdab4
[MSFT] [PyCDE] Make placement DB global rather than rooted (#2804)
Since we are generating only pieces of a design (and FPGA resources are
obviously a property of the entire design), the devdb should be
independent of the 'top' module.

Also, since the devdb is supposed to act as an 'alternative view' of the
IR, load the IR's placements by default.
2022-03-25 16:35:01 -07:00
Fabian Schuiki 246d4fdd34
Bump LLVM to 61814586 (#2758) 2022-03-14 14:13:45 +01:00
John Demme 050063d299
[PyCDE] Implement new DynamicInstance operation methodology (#2683) 2022-02-28 13:30:35 -07:00
Fabian Schuiki 312184bd28 [CAPI] Add moore dialect C API
Add the boilerplate code to have the Moore dialect exposed through the
C API.
2022-02-27 09:06:00 +01:00
Andrew Lenharth 2755c0630c [NFC] Move SymCache to its own header 2022-02-24 16:23:32 -06:00
John Demme e2c7151935
[MSFT] [PlacementDB] Refactor around new dynamic instance op (#2637)
- Use the new dynamic instance op and its children to simplify the PlacementDB.
- Switch to new paradigm wherein all placements are done through the device db and get reflected in the IR. So for the life of PlacementDB, it "owns" all the placements.
2022-02-18 21:09:10 -08:00
John Demme 361abefdba
[MSFT] Move physical region to op and rename ops (#2629)
- Rename "PhysicalRegionOp" to "DeclPhysicalRegionOp" to be more
  descriptive of what it does.
- Rename "PhysLocationOp" to be more consistent with asm name.
- Add "PDPhysRegionOp" to eliminate random attribute from globalRef.
- Ditch old ref attribute since it's no longer necessary.
2022-02-14 22:56:24 -08:00
John Demme 0b1c0b15fd
[MSFT] Create PhysLocation operation and use it instead of an attribute on GlobalRef (#2620)
Keep the PhysLocation attribute for the actual physical location. Create
an op to refer to a global ref with the location attribute and the
subpath. Incremental change towards a new approach to dynamic instances.

This PR breaks tcl placement output in the way the integration test and pycde
enters the placements. Will be fixed shortly with the dynamic instance PR.
2022-02-13 15:03:58 -08:00
John Demme 4e79c88a39
[MSFT] [PyCDE] Register the canonicalizer pass (#2594)
Register the canonicalizer pass and add `cleanup` call in PyCDE.
2022-02-07 11:17:55 -08:00
mikeurbach f1f24e6300
[MSFT] Add PlacementDB APIs for removing and moving entities. (#2534)
These complement the main add* APIs for putting entities into the
database and support moving entities around or removing entities
entirely after any initial placements.
2022-01-28 17:31:26 -07:00
mikeurbach 0a0e15c8e6
[MSFT] Add walk order option when walking placements. (#2475)
This allows the user to specify a walk order through the placements'
columns and rows. If specified, the order is used to sort the indices
into the placements' maps. Else, the order is undefined as before.
2022-01-20 15:12:31 -07:00
mikeurbach c9c50d2889
[MSFT] Add optional sub-path to PhysLocationAttr. (#2421)
Previously, a sub-path could be specified by encoding it in the name
of the attribute using a certain scheme. This is brittle and
non-standard. To make this more natural and robust, the sub-path is
added as a field of the attribute definition as a StringRef. It is not
required, in which case an empty StringRef can be used. The attribute
name for placement attributes is no longer used in any logic.
2022-01-05 18:39:54 -07:00
Mike Urbach 13948d32d8 [MSFT] Remove SwitchInstanceAttr and RootedInstancePathAttr.
These attributes and their use cases are now replaced by
hw::GlobalRefOp and hw::InnerRefAttr, respectively.
2021-12-27 13:52:14 -07:00
Mike Urbach a2a058b70e [MSFT] Refactor placement export to use hw::GlobalRefs.
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.
2021-12-27 13:51:57 -07:00
Mike Urbach 6d7e0e9118 [HW] Add Python bindings for GlobalRefAttr.
This adds the necessary CAPI boilerplate and a basic Python type for
holding GlobalRefAttr.
2021-12-27 11:32:05 -07:00
Mike Urbach 9f7a01a865 [HW] Add Python bindings for InnerRefAttr.
This adds the necessary CAPI boilerplate and a basic Python type for
holding InnerRefAttr.
2021-12-27 11:32:05 -07:00
Hideto Ueno 6c5e0ce771
[HW] Use StringAttr instead of StringRef in FieldInfo, nfc (#2325)
* [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.
2021-12-12 15:52:52 +09:00
Fabian Schuiki 58279f46dc
[LLHD] Add time attribute C API
Extend the LLHD C API to allow for `TimeAttr` to be created and
inspected.
2021-11-21 13:11:47 +01:00
Fabian Schuiki 36c2d395d2
[LLHD] Add type C API
Add a few functions to LLHD's C API to interact with the LLHD dialect
types.
2021-11-21 13:11:47 +01:00
mikeurbach bd05d96c11
[PyCDE] Add entry method for PhysicalRegions and their references. (#2174)
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.
2021-11-15 10:02:34 -08:00
mikeurbach a002a849b3
[MSFT] Re-work ExportQuartusTcl to export into verbatim nodes. (#2077)
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.
2021-11-09 19:25:16 -07:00
Mike Urbach 0d864829da [Python] Expose exportSplitVerilog API to Python.
This just needed to be plumbed through the CAPI.
2021-11-09 13:28:54 -07:00
mikeurbach e43d978a56
[MSFT] Move ExportQuartusTcl from a translation to a pass. (#2075)
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.
2021-11-03 21:31:21 -06:00
mikeurbach c5bda61046
[Python] Add bindings for hw::ParamVerbatimAttr. (#2051)
This just needs to be plumbed up to Python.
2021-10-28 17:57:44 -06:00
Mike Urbach 8be26b7c9b [Python] Fix bindings after upstream changes to aggregate building.
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.
2021-10-20 16:51:26 -07:00
John Demme 960e624d7f
[MSFT] [DeviceDB] Teach `walkPlacements` about boundaries (#2000)
`walkPlacements` now takes a bounding rectangle and a primitive type
upon which to filter.
2021-10-15 13:29:53 -07:00
John Demme 07c2778fa7
[MSFT] [DeviceDB] Add bindings to walk functions (#1942) 2021-10-06 21:46:15 -07:00
John Demme 5a4445ec3e [MSFT] [NFC] DeviceDB -> PrimitiveDB, combine all DB code
- Renames DeviceDB to PrimitiveDB.
- Puts both PrimitiveDB and PlacementDB in DeviceDB.h.
- Moves PlacementDB implementation into DeviceDB.cpp.
2021-10-06 14:23:55 -07:00
John Demme d488343996
[MSFT] [DeviceDB] Find nearest free location in column (#1937)
Find the nearest primitive in a column to the desired row. Said primitive should be of a given primitive type, and be unoccupied.
2021-10-06 11:12:01 -07:00
Chris Lattner 0de4aac499 [ExportVerilog] Move into Conversions/ tree.
ExportVerilog was an outlier living as the only child of the Translations
tree, move it into Conversions to be more similar to other passes.
2021-10-04 16:24:12 -07:00
John Demme 12720afe41
[MSFT] Use a DeviceDB to seed a PlacementDB (#1922)
Just checks validity of placements for now.
2021-10-02 17:40:40 -07:00
John Demme ee2a93886c
[MSFT] Adding DeviceDB (#1921)
Created a DeviceDB which doesn't do anything yet. The `devType` to
`primitiveType` change got wrapped up in this change.
2021-10-02 01:28:24 -07:00
John Demme ede291cdd5 [MSFT] Rename `devType` to `primitiveType` on PhysLocation attribute 2021-10-01 23:13:06 -07:00
John Demme daa5dc503e [MSFT] Rename DeviceType enum to PrimitiveType 2021-10-01 22:09:52 -07:00
Parker Mitchell f76fadad6e
[MSFT] Rename DeviceDB to PlacementDB (#1894)
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.
2021-10-01 18:24:10 -07:00
John Demme d046e6a7ec
[MSFT] Removing C++ generator code (#1918)
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.
2021-10-01 16:24:15 -07:00
John Demme 99f0092cac
[Python] Fix Python Bindings (#1858)
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.
2021-09-23 02:14:14 -07:00
John Demme 730b157be5
[MSFT] DeviceDB C API and Python bindings (#1717) 2021-09-03 20:12:16 -07:00
John Demme 0066f6dc79
[MSFT] Introduce `RootedInstancePath` and re-factor based on it (#1689)
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.
2021-09-01 17:41:06 -07:00
John Demme 221e2db01c
Update LLVM submodule (#1687)
Co-authored-by: Andrew Young <youngar17@gmail.com>
2021-09-01 12:46:54 -07:00
John Demme 3ad8be3d88
[MSFT] [Python] Add a function to get an instance (#1613)
Given a root module and an instance path, find the corresponding instance from
the instance hierarchy. Return 'None' if the path wasn't found.
2021-08-20 13:57:35 -07:00
Fabian Schuiki 499cd357ca
[LLHD] Add C API
Add a minimal C API for the LLHD dialect.
2021-08-19 17:11:43 +02:00
John Demme 43ccc6584e
[MSFT] [Py] Add physical location and switch instance attributes to python module (#1606) 2021-08-18 20:03:07 -07:00
John Demme f537e0faba
[ESI] [Python] Move functionality through the C API (#1595)
Necessary to avoid linking issues on Windows.
2021-08-17 15:40:14 -07:00
Mike Urbach c9af2e1a44 [Python] Move remaining functionality behind the C-API, NFC.
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.
2021-07-27 13:55:15 -06:00
John Demme 2a7505c33f
[Py] [PyCDE] Add `get_fields` to struct type and use it in pycde (#1364)
PyCDE uses this for error checking and `.` access.
2021-07-05 20:36:54 -07:00
John Demme b57223d21b [C API] HWStructFieldInfo::Attribute -> ::Type 2021-07-05 18:42:01 -07:00
mikeurbach 8325991fbe
[CAPI][Python] Add support for TypeAliasType in CAPI and Bindings. (#1362)
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.
2021-07-01 17:36:22 -06:00
mikeurbach 9dd73b174f
[PyCDE] Include parameters in generator registration and lookup. (#1298)
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.
2021-06-17 19:59:48 -06:00
John Demme 8b525e879b
[Py] Create syntactic sugar for some Array and Struct ops (#1234)
Recreating the C++ logic for ArrayCreateOp, ArrayGetOp, StructCreateOp, and StructExtractOp.
2021-06-10 11:46:09 -07:00
John Demme cc3d74cf69
[Py] Design entry language: generators (#1169)
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.
2021-06-01 15:21:26 -07:00
Chris Lattner 53b1c077d6 [RTL->HW] Rename C++ namespace, command line flags and a bunch of other stuff. 2021-05-15 14:33:45 -07:00
Chris Lattner 4d43103122 [RTL->HW] Rename the string "RTL" to "HW"
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.
2021-05-15 12:44:05 -07:00
Chris Lattner 84c94e8920 Correct a header comment. 2021-05-15 12:31:54 -07:00
Chris Lattner f922d2d9fb [RTL->HW] Move one more file I missed. 2021-05-15 12:28:31 -07:00
Chris Lattner 61e70086c6 [RTL->HW] Move a few more files in conversions and documentation. NFC. 2021-05-15 12:23:45 -07:00
Chris Lattner 91f77cf64b [RTL->HW] Move RTL directory structure/filenames to HW. NFC
This doesn't change the types or stuff declared in the file, just moves
things into place.
2021-05-15 12:07:47 -07:00
John Demme b26c078849
[ESI] Fix ESI integration tests (#1028) 2021-05-07 15:13:08 -07:00
Fabian Schuiki c180d6a29d
[CAPI] Guard esi::exportCosimSchema by CAPNP ifdef (#1023)
* 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.
2021-05-07 08:24:49 +02:00
John Demme 510d46e815
[ESI] [Python] Adding a call for export capnp (#1015) 2021-05-06 15:56:58 -07:00
mikeurbach 68dee0e70b
[Python] [RTL] Add RTL pybind module with array and struct type. (#1002) 2021-05-06 11:38:32 -06:00
mikeurbach faa0e1827a
[Seq] Add C API for Seq dialect and pass registration. (#1006) 2021-05-04 19:06:12 -06:00
Stella Laurenzo cdc0dc114d
[POC] Create a python facility for custom/out of tree types. (#996)
* Uses it to create a sample ChannelType.
* Requires: https://reviews.llvm.org/D101734
* See https://gist.github.com/stellaraccident/4a73e395e5cc68a5244c8d88dd291396 for a hacky sample of this working.
* Attributes would be incremantal on top of this.

With this, defining a custom type is pretty simple:

```
  mlir_type_subclass(m, "ChannelType", circtESITypeIsAChannelType)
      .def_static("get",
                  [](MlirType inner) {
                    return py::cast(circtESIChannelTypeGet(inner));
                  })
      .def_property_readonly(
          "inner", [](MlirType self) { return circtESIChannelGetInner(self); });
```

I feel good enough about this mechanism to suggest that we just upstream it as a public header and then refactor the builtin types to use it, deprecating PyConcreteType and PyConcreteAttribute. It isn't necessary to couple these together, though, and landing in circt could let us get some mileage on it first.

I'm aware that to the uninitiated, some of the pybind goo may seem magic, but this is actually the *less* magical way to do this: it isn't using any spooky Pybind11/C++ level sharing and is doing the exact same thing as if you literally spelled out "class MyType(mlir.ir.Type):" in Python -- but of course, meta-programming that in C++ is a bit thicker :) It also interops pretty well with the existing CAPI<->Python casters, making this (I think) a strict improvement over even what we have upstream.

One thing I didn't get to is a `DefaultingMlirContext` helper (ended up not needing it), but this would be pretty easy to add.
2021-05-03 15:08:18 -07:00
John Demme 8183b7a961
[MSFT] [Python] Export tcl API call (#939)
* [MSFT] [Python] Export tcl API call

* clang-format
2021-04-21 10:50:24 -07:00
John Demme c15faa7fc4
[MSFT] [Python] Physically locate an op (#937)
Adds an API call to physically place an op's sub-entity.
2021-04-20 16:20:22 -07:00
John Demme ac14de2630
[Python] Register passes, export_verilog, and stack traces (#930)
- Registers the SV passes when the 'circt' Python module is imported and the ESI passes when 'circt.esi' is imported.
- Adds a Python 'export_verilog' call.
- Enables LLVM 'pretty' stack traces for easier debugging. Makes assertion messages appear in Python instead of just crashing with no output.
2021-04-19 22:05:40 -07:00
John Demme d3cfca3c6b
[ESI] C API and Python bindings (#870)
Just the ability to 'import' ESI into Python.
2021-04-02 14:09:20 -07:00
mikeurbach ca20bd3617
[CAPI] Add CAPI for RTL InOutType getters and isa. (#845) 2021-03-30 10:26:02 -06:00
George Lyon 2343f692d0
Bind more API to C (#705) 2021-03-02 09:38:29 -08:00
Andrew Young e1ca6eaaf9 Remove `using namespace mlir` from header files
This change aims to remove all instances of `using namespace mlir` from
our header files.  Many types have been manually imported into the
`circt` namespace in `circt/Support/LLVM.h`.  These types include all
core MLIR functionality types (IR, Diagnostic), utility types, rewrite
patterns and conversions, builtin IR types and attrs, and the module op.

Not imported were any operations (other than ModuleOp), matchers (e.g.
m_Zero), anything in the `impl` namespace, and interfaces.  There are
some problems with interface code generation from ODS, so some
interfaces were imported.

Some further cleanup would be useful to remove the `mlir::` namespace
qualifier where we no longer need it.
2021-02-16 02:25:06 -08:00
George Lyon b03db32b0f
[CAPI] Modernize dialect registration (#560) 2021-02-10 10:41:18 -08:00
George Lyon eb092323e6
[ExportVerilog][SV] C API (#481)
Co-authored-by: George <989903+GeorgeLyon@users.noreply.github.com>
2021-01-20 15:42:02 -08:00
Shivam Gupta fa58cbc431
Make dialects naming consistence by having foo/foobar.cpp rather than foo/bar.cpp (#372)
* make consistency in FIRRTL naming
* make consistency in RTL naming
* make consistency in StaticLogic naming
* make consistency in SV naming
* header naming correction
* minor fix
* run clang-format
* clang-format
* td format and fix lib/SV/ naming
* clang-format on /SV/
2020-12-27 09:42:19 -08:00
Shivam Gupta d98d2a1364
Rename library from libMLIRfoo to libCIRCTfoo (#357)
* change library name from libMLIRCAPIRTL to libCIRCTCAPIRTL

* change library name from liblibMLIRLLHDTransforms to libCIRCTLLHDTransforms

* change library name from liblibMLIRRTLToLLHD to libCIRCTRTLToLLHD

* rename library from liblibMLIRLLHDToLLVM to libCIRCTLLHDToLLVM

* rename library from libMLIRFIRRTLToLLHD to libCIRCTFIRRTLToLLHD

* rename library from libMLIRFIRRTLToRTL to libCIRCTFIRRTLToRTL

* rename library from libMLIRHandshakeToFIRRTL to libCIRCTHandshakeToFIRRTL

* rename library from libMLIRStandardToHandshake to libCIRCTStandardToHandshake

* rename library from libMLIRStandardToStaticLogic to libCIRCTStandardToStaticLogic

* rename library from libMLIRRTL to libCIRCTRTL

* rename library from libMLIRSV to libCIRCTSV

* rename library from libMLIRESI to libCIRCTESI

* rename library from libMLIRFIRRTL to libCIRCTFIRRTL

* rename library from libMLIRLLHD to libCIRCTLLHD

* rename library from libMLIRHandshakeOps to libCIRCTHandshakeOps

* rename library from libMLIRStaticLogicOps to libCIRCTStaticLogicOps

* alphabetically rearrange LIBS in CMakeLists.txt
2020-12-24 23:16:37 +05:30
Shivam Gupta 9f34d3742b
Add missing LLVM license info to file headers (#352)
* add LLVM license info to files header

* Add LLVM license info to files header

* Add LLVM license info to files header

* Add LLVM license info to file headers

* Revert "Add LLVM license info to files header"

This reverts commit 22869676ad.

* Add LLVM license info to file headers

* run git-clang-format

* add missing file descriptions

* run git clang-format

* Add LLVM license info to file headers

* Add LLVM license info to files header
2020-12-24 23:11:01 +05:30
Andrew Young 77f9520ea1
[CMAKE] Add circt library declaration helpers (#304) 2020-12-10 14:53:04 -05:00
George Lyon 2a9eb3506d
Create a minimal C API (#196)
* Enable cloning llvm submodule over HTTP

* Introduce C API

* Undo unrelated changes

* clang-format

* More format

* Add Header Comments

* Format

* Add basic test

* Add missing incantation

* Format

Co-authored-by: George <>
2020-11-04 11:37:51 -08:00