Commit Graph

27 Commits

Author SHA1 Message Date
Will Dietz e117ac3a0b
cmake: circt install directory for CAPI (#7028) 2024-05-13 19:10:34 -05:00
Fabian Schuiki 719bbfde79
[CAPI] Add circt-capi target and build it in CI (#7017)
Add a `circt-capi` target that depends on all C API libraries. Introduce
a new `add_circt_public_c_api_library` CMake function that wraps around
the MLIR equivalent, but also adds a dependency from `circt-capi`. Make
at least the short integration tests CI job build the `circt-capi`
target to ensure it has a bit of CI coverage.
2024-05-09 11:21:33 -07:00
George Lyon 821ab87320
Re-add install targets for CIRCT libraries (#6347) 2023-10-26 15:43:07 -07:00
George Lyon cde4642799
Disable MLIR install of CIRCT projects (#6340) 2023-10-25 10:47:39 -07:00
Hideto Ueno 2f4af25eac
[firtool] Add infra for pass plugins (#6254)
This PR ads MLIR pass plugin functionality to firtool pipeline to dynamically load pass plugins and execute passes. 
`*.so` file is load with`--load-pass-plugin` option. Currently we can insert passes to 4 places in the pipeline: (1) after FIRRTL parsing (2) before LowerToHW (3) after HW lowering (4) after SV lowering.
2023-10-10 00:06:47 +09:00
Vito Gamberini 11d61f80a5
[CMake] Implement add_circt_tool() (#5821)
- Adds/renames the associated CMake variables:
   * CIRCT_BUILD_TOOLS
   * CIRCT_INCLUDE_TOOLS
   * CIRCT_TOOLS_INSTALL_DIR

- Actually uses the CIRCT_INCLUDE_TOOLS variable now
2023-08-10 18:37:45 -05:00
Bea Healy 6723ec62de
[circt-lec] Move `circt-lec` files to CIRCT library (#4544)
This moves most of the circt-lec code into a CIRCT library. No existing library directories seemed appropriate, hence the addition of the Verification directories.

---------

Co-authored-by: frog-in-the-well <106834163+frog-in-the-well@users.noreply.github.com>
2023-05-24 08:46:28 -07:00
Will Dietz 9f240a8329
[CMake] Run git describe from the source dir, fix out-of-tree builds (#3199)
Don't rely on build being same or underneath the source directory.

Fixes #3175.
2022-05-25 17:26:20 -05:00
Hideto Ueno fe1ddfc6e3
[CMake] Make version generation opt-out (#3178)
This commit disables the version generation by default since it creates
unnecessary warnings in out-of-tree builds.
2022-05-24 16:40:55 +09:00
sinofp b7e1ad378e
[ExportVerilog] Include Build Information in Output Files (#2613)
This PR adds a functionality to include build information in output files. 
The format of the version string is  `<releases tag name>-
<how many commits since the tag>-g(means git)<current commit hash>[-dirty]`

Two cmake flags are added to control version strings, 
`CIRCT_RELEASE_TAG_ENABLED` (default is On) and 
`CIRCT_RELEASE_TAG` (default is `circtorg`). 
If `CIRCT_RELEASE_TAG_ENABLED` is false, the version string becomes 
"unknown" and cmake script is ran only at the first cmake configuration.  Example,
 
```
$ cmake .. -DCIRCT_RELEASE_TAG=pycde
// Generated by CIRCT pycde-0.0.5-28-ge846cf26e
module Bar(

$ cmake .. -DCIRCT_RELEASE_TAG=sifive
// Generated by CIRCT sifive/0/9/0-31-ge846cf26e
module Bar(

$  cmake .. -DCIRCT_RELEASE_TAG_ENABLED=Off
// Generated by CIRCT unknown git version
```

Co-authored-by: Hideto Ueno <uenoku.tokotoko@gmail.com>
2022-05-24 02:31:08 +09:00
Fabian Schuiki 68280a1426
[llvm] Bump LLVM to latest main (#3132)
Changes:

- Add `return failure()` where necessary now that `ParseResult` has
  gained the `LLVM_NODISCARD` attribute.

- Adapt to new MLIR type alias syntax (no longer needs "type"), e.g.
  `!foo = !hw.struct ...` instead of `!foo = type !hw.struct ...`

- Adapt to new attribute self-type parsing. Attributes now derive the
  self-type from syntax like `#attr : !hw.some_type`. No longer need
  an explicit type param `<T>` in stuff like `#firrtl.invalidvalue<T>`.

- Improve `add_circt_doc` to allow for multiple tablegen parameters and
  add `add_circt_dialect_doc` to unify the way dialect documentation is
  generated. The latter also passes the `-dialect` option to tablegen to
  sort out issues in the generated documentation if a dialect
  transitively includes another dialect. (This used to show up as
  multiple doc files having the name of another dialect.)

- Add `let useDefaultTypePrinterParser = 1` and
  `let useDefaultAttributePrinterParser = 1` to the dialect definitions
  where appropriate, since these have become off-by-default upstream.
2022-05-20 20:05:53 +02:00
Fabian Schuiki e7be36f307 [CMake] Produce a proper CIRCTTargets.cmake file
Ensure that during installation we produce a `CIRCTTargets.cmake` file
to allow out-of-tree users to link against CIRCT more easily. This
requires adding an `install(TARGETS ...)` command to
`add_circt_library_install`, and an `install(EXPORT CIRCTTargets ...)`
to `cmake/modules/CMakeLists.txt`.
2022-01-13 11:19:03 +01:00
Fabian Schuiki 416560123e [CMake] Align CIRCTConfig.cmake more closely with MLIR
Update the `cmake/modules/CMakeLists.txt` file and friends such that the
config file also includes the `CIRCT_TOOLS_BINARY_DIR` variable, and the
generation of that file resembles that in MLIR more closely. This should
make it easier in the future to use some of LLVM's cmake utilities.
2022-01-13 11:19:03 +01:00
Fabian Schuiki 486ec2223d
[CMake] Install CIRCTConfig and AddCIRCT cmake files
Add the `CIRCTConfig.cmake` and `AddCIRCT.cmake` files to the list of
installed files. This mimics the behaviour implemented in MLIR, and
allows for CIRCT to be used out of tree (e.g. as part of the Moore
compiler, among other things).
2022-01-12 19:02:19 +01:00
Morten Borup Petersen 35c09f2d65
Partially revert #1688 in favor of style used in upstream MLIR (#1698) 2021-09-02 12:32:07 +01:00
Morten Borup Petersen c227f5c3d3
Add boilerplate for an "Analysis" library (#1688)
This commit adds necessary files and code for adding new code under an "Analysis" folder.
2021-09-01 18:12:55 +01:00
Morten Borup Petersen 92a47a7f0d Fix typo in add_circt_interface CMake function 2021-08-27 21:03:18 +01:00
Shivam Gupta e1cbdc3c86
Fix circt-doc target (#385)
* Fix circt-doc target

* minor fix

* remove includes from tblegen command
2021-01-07 14:03:44 +05:30
Andrew Young 77f9520ea1
[CMAKE] Add circt library declaration helpers (#304) 2020-12-10 14:53:04 -05:00
Andrew Young 29e2f43cab
[CMAKE] Properly export CIRCT targets (#306) 2020-12-10 13:12:00 -05:00
stephenneuendorffer 6e8df0f39a
Add cmake export information so that out-of-tree projects can properly call "find_package(CIRCT)" (#242)
Generally speaking, this should allow

cake -DCIRCT_DIR="<something>/lib/cmake/circt" myprojectdirectory, where <something> is
either a build or install area.  Then in your project cmake file you can have:
find_package(CIRCT REQUIRED CONFIG)
2020-11-18 11:00:00 -08:00
Stephen Neuendorffer 7d03c27a82 Fix CMakeFiles to include information from LLVM.
Also: fix 'check-circt' and 'install' rules.  Linkage was broken for
most of the tools.
2020-06-17 13:27:14 -07:00
Chris Lattner 3202062646 Mechanical rename of cirt -> circt. 2020-06-17 10:19:08 -07:00
Chris Lattner c216617817 Move the remaining references of SPT to CIRT. NFC. 2020-04-29 11:57:17 -07:00
Chris Lattner 5411096ddd Move macro-like SPT_ names to CIRT_. NFC. 2020-04-29 11:41:42 -07:00
Chris Lattner 24c3b33447 Create the sketch of a FIRRTL dialect, with a single type (firrtl.uint) and a
single registered operations (firrtl.add).  Add a testcase showing that these
are now being properly checked.
2020-03-07 15:47:08 -08:00
Chris Lattner 64cec97240 Introduce a CMakefile scaffolding to build and test an executable.
This also updates the README to include some building information.

Lots of caveats:
 - This is all experimental
 - The actual tool isn't interesting yet.
 - The naming is arbitrary and will likely change.
 - Much of the cmake files were cargo culted from other places
   because I don't know what I'm doing.
2020-03-05 15:16:55 -08:00