Commit Graph

94 Commits

Author SHA1 Message Date
Andrew Lenharth 00a1c209d0 [NFC] generate compile_commands.json. LLVM does this by default also 2021-09-05 15:36:46 -05:00
mikeurbach 8744cf222d
[CMake] Remove setting CMAKE_CXX_VISIBILITY_PRESET. (#1544)
Previously, this would always set visibility=hidden for static,
unified builds. This configuration is great for packaging Python
artifacts, but setting visibility=hidden doesn't always make sense.

Instead, this removes that, leaving visibility=default as the default,
and allowing users or build bots to override it on the cmake command
line when necessary.

The sanity check is left in place to prevent visibility=hidden with a
BUILD_SHARED_LIBS=ON build. MLIR needs significant changes to support
such a configuration.
2021-08-11 15:09:30 -06:00
Laura Gallo 0649d308d8
Added Tcl bindings for loading an MLIR file. (#1529)
* 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
2021-08-10 09:36:46 -04:00
Mike Urbach 7f7c30b557 [CMake] Update MLIR_TABLEGEN_OUTPUT_DIR for unified builds.
Before, this would fail if including circt in a project that itself
includes llvm-project (vs llvm-project being the root project). Fixes
https://github.com/llvm/circt/issues/1533.
2021-08-08 11:18:10 -06:00
mikeurbach a2ccc01f14
[CMake] Only tweak linking settings when doing a unified build. (#1493)
When building CIRCT standalone, it isn't safe to assume these
configurations can be applied, since the build of LLVM may have used a
different configuration. These keeps the same recommended defaults,
but only for a unified build via LLVM_EXTERNAL_PROJECTS.
2021-07-29 15:24:57 -06:00
Mike Urbach 76d984414a [CMake] Always set CMAKE_CXX_STANDARD* options for CIRCT.
Previously these were only set during a standalone build of
CIRCT. This sets the options at the start of CMakeLists.txt, so they
will apply during a standalone or unified build. This follows how
Flang sets these options, for example.
2021-07-29 11:16:46 -06:00
mikeurbach 8a792f8b59
[Python] Re-work Python bindings using upstream improvements. (#1484)
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
2021-07-29 09:49:58 -06:00
Hanchen Ye da0216bda0
Upgrade C++ standard to C++17 (#1482) 2021-07-27 11:38:23 -05:00
Andrew Young 65c72e5856
Disable llhd-sim tests when the executable is not built (#1425) 2021-07-14 18:42:45 -04:00
John Demme 51639cad29
[PyCDE] Moving the most opinionated python out of bindings (#1179) (#1195)
- 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.
2021-06-03 09:43:02 -07:00
Fabian Schuiki 3ef1f3fbd2
[Python] Add Python guidance to README and fix a few things (#1074)
* Use the `Python3_EXECUTABLE` found by CMake itself (alongside the libs
  and includes) to execute integration tests. This should no longer
  require explicitly specifying a python executable in most cases. Where
  needed, users can always override `Python3_EXECUTABLE`.

* Add `capnp` requirement on ESI tests. Otherwise the test fails on
  systems that build the Python bindings but have no capnp.

* Add some guidance for users that are mainly interested in the Python
  bindings of CIRCT. Fixes #1072.
2021-05-18 19:09:39 +02:00
mikeurbach 8f57a05cf5
Add support for Vivado to circt-rtl-sim. (#903)
This does not include DPI support.

Tested locally with Vivado 2020.2.
2021-04-12 21:50:24 -06:00
Schuyler Eldridge de1ed756b9
Up Verilator requirement to v4.110, $urandom_range (#878)
Change the Verilator requirement in cmake from 4.034 to 4.110 since
the integration tests use `$urandom_range` which was added to
Verilator in 4.100 and there's a known bug that was fixed in 4.110.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-04-02 21:21:22 -04:00
John Demme b14f791115
[cmake] Adding an option to produce a standalone install (#786)
Enables producing binary packages (e.g. tars) which do not require installation
into the system. Sets the binaries' RPATHs to point to the 'lib' directory
within said package.
2021-03-18 15:07:24 -07:00
mikeurbach d6930641f5
[Python] Set up initial Python bindings for CIRCT. (#727)
This is the first step towards #710. This should be the minimal amount
of boilerplate to set up a Python module such that we can write
`import circt`. Note that this module does not actually bind to or
expose any API at the moment; this is just the boilerplate, and that
will follow.

The setup here is based on both the upstream MLIR Python bindings, as
well as what NPComp does.
2021-03-09 20:03:40 -07:00
Andrew Lenharth e7bdace08f Add vivado discovery to cmake 2021-03-03 09:56:45 -06:00
Andrew Lenharth cff33d3d5a
Intel tools for integration tests (#683)
Intel tools for integration tests
Intel tools include a stripped down questa flavor too.
2021-02-26 08:36:10 -06:00
Shivam Gupta dc2cae4d48
Fix Windows warning about -fno-exceptions -fno-rtti (#592) 2021-02-14 08:26:01 +05:30
George Lyon 365f6ba576
[CMake] Configure unified build in CI (#411)
* Configure unified build in CI

* Fix unified build

Co-authored-by: George <989903+GeorgeLyon@users.noreply.github.com>
2021-01-06 13:21:07 -08:00
John Demme 565bfa2b06
[ESI] Separate out the Cap'nProto code into separate library (#382)
* Scaffolding for Capnp-dependent ESI code

* Adding 'capnp' feature

* Replicated functionality

* Just missing the complex part: schema parsing

* Parse the generated schema, get the size out of that

* Documentation

* Adding NOLINT
2020-12-30 23:20:03 -08:00
Shivam Gupta dfd6d44140
Default build with -fno-exceptions -fno-rtti + minor formatting (#359)
* default build with -fno-exceptions -fno-rtti

* minor formatting
2020-12-29 07:54:08 +05:30
Shivam Gupta 9c1bbaef14
[DOC] Add Doxygen documentation support (#362)
* [DOC] Add Doxygen documentationsupport

* minor fix

* remove LLVM_INCLUDE_DOCS and MLIR_INCLUDE_DOCS variable

* remove unnessary set(Dot dot)
2020-12-27 09:44:58 +05:30
John Demme c9ccc4de01
[lit] RTL simulation script with Verilator and Questa support (#334)
* [Tests] [Questa] If found, provide feature and path

* Abstraction script and moving existing test

* Default sim

* Passing default simulator through env var

* Adding default driver.sv

* Various bug fixes

* Argparse wasn't working properly

* Don't touch files in test/

* Creating a default for commercial simulation

* Making circt-rtl-sim a tool not a util script

* Removing old comment

* Adding 'rtl-sim' feature and renaming 'comsim' to 'ieee-sim'
2020-12-22 14:30:25 -08:00
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
Andrew Lenharth 3eef7df131
[FIRRTL] yosys equiv checking infrastructure and FIRRTL primatives testcase (#291)
Yosys formal equivalence checking infrastructure.
2020-12-02 14:18:23 -06:00
John Demme 68114369f0
Improves build environment flexibility (#253)
* Adds script to ease local, clean environment testing

* Env change

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@gmail.com>

* Not fully tested, but pushing for testing.

* Use build_llvm.sh script

* Removing the `cd` after MLIR build -- no longer necessary

* Adding ability to specify paths

* Adding cmake headers

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@gmail.com>
2020-11-21 22:08:48 -08:00
John Demme 56bf379cd7
[ESI] [Cosim DPI] RTL (#219)
* [ESI] [Cosim DPI] RTL

This is the fourth in a series to merge #213 -- RTL. Adds the
SystemVerilog code which will interface with the DPI library.

Is this the right place for SystemVerilog distributables? I put them
here since the 'include' directory is shipped with the install. Should
we have a top level "support" directory which goes into /usr/share?

* Fixing comment line lengths

* Fixing style issues
2020-11-11 15:35:10 -08:00
George Lyon 7ad7ced63a
Enable building using `LLVM_EXTERNAL_PROJECTS` (#227)
* Enable building using LLVM_EXTERNAL_PROJECTS

* Tabs-to-spaces

* Add missing test dependencies

Co-authored-by: George <>
2020-11-10 16:33:25 -08:00
John Demme 37f809c5e9
[ESI] [Cosim DPI] Cap'nProto install and schema generation (#216)
* [ESI] [Cosim DPI] Capn'Proto install and schema generation

This is the second in a series to merge #213. This is the capnp schema
generation component.

* Added header comment.
2020-11-09 11:15:02 -08:00
George Lyon f785f17ff6
Enable installing circt tools (#210)
Co-authored-by: George <>
2020-11-06 13:07:58 -08: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
John Demme 0363e23c95
[EmitVerilog] Lint and simulation integration tests (#198)
* First integration test: lint w/ Verilator

* Running a test simulation.

* Update README

* Editing the README based on feedback.
2020-11-03 16:46:17 -08:00
John Demme dc3b57de7e
Adding Verilator and a basic Verilator unit test (#179) 2020-10-30 13:12:15 -07:00
Stephen Neuendorffer 92e4fcd7bc [cmake] add set(CMAKE_CXX_STANDARD_REQUIRED YES) 2020-06-28 22:52:29 -07:00
Chris Lattner c633a4ec87 Make sure to build CIRCT with C++'14 features enabled. 2020-06-21 15:27:12 -07: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 7ff6ffdf2f Rename include/spt -> include/cirt, NFC. 2020-04-29 11:34:22 -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 7783a53c8e Push the cmake files far enough along to make spt-opt be able to link in
MLIR libraries, parsing and printing the output, running passes, etc.
2020-03-06 16:42:00 -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