Commit Graph

587 Commits

Author SHA1 Message Date
Andrew Young 5ccc7ac937
Ignore all files beginning with build in the top level (#303)
- leading slash matches only in the top level directory
- asterisk allows matching build2, build-sharedlibs, or others

This is useful if you need more than one build directory for testing
with different cmake options.
2020-12-09 09:59:42 -05:00
John Demme 37de8c96ef
[ESI] Ops to inter-operate with SV interfaces (#308)
* [ESI] Ops to inter-operate with SV interfaces

This'll be useful in lowering to RTL/SV.

* Add error checks
2020-12-08 21:47:55 -08:00
John Demme babbb2a070 [SV] Wrapping a comment line to 80 cols 2020-12-08 21:23:45 -08:00
Andrew Lenharth 6e4cbda20c
Inferred memory port type doesn't match firrtl spec (#305) 2020-12-08 13:24:26 -06:00
mikeurbach 38cf6760a1
[SV] Change InterfaceModportType to ModportType. (#301)
This seems more inline with the assembly name, `sv.modport<...>`.
2020-12-05 11:33:41 -07:00
John Demme 72ed2d2141
[SV] Types and ops to allow InterfaceOps to be instantiated and passed around (#294)
* SV interface types working

* Improving the extract op syntax

* Adding documentation

* Removing unnecessari include

* Wrong type error

* Renaming extract to getmodport and switching to decl asm

* Adding interface.instance and renaming getmodport

* Cleanup changes

* Cleaning up #includes

* Adding verification to instance op

* Returns modport

* Cleanups based on Mike's feedback
2020-12-03 21:21:59 -08:00
mikeurbach 38150d7706
[SV] Add basic Visitor and EmitVerilog support for InterfaceOps. (#298) 2020-12-03 15:32:49 -07: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
Andrew Lenharth 3f819c0c77
CVT lowering crash (#295) 2020-12-02 10:26:42 -06:00
mikeurbach 3418efc99c Update dialects diagrams, NFC.
After the addition of the LowerTypes pass to the FIRRTL dialect, the
lowering passes within FIRRTL are no longer hypothetical, and the path
from high/mid-FIRRTL to low-FIRRTL is a solid (albeit thin) line.
2020-11-30 15:45:49 -08:00
Chris Lattner 83dfe1cc6c [FIRRTL] Change BundleType::BundleElement to a struct instead of pair
This makes the client side code a lot more clear, NFC.
2020-11-30 12:46:44 -08:00
mikeurbach dbcdd62a2e
Update LLVM to 5f0c1e38 (#288)
This picks up some changes to sync the Python bindings with the
updated C API that uses MlirStringRef.
2020-11-30 12:02:54 -08:00
Hollow Man 2228c69092
Fix typo in Charter.md (#289)
* Fix typos in Charter.md
2020-11-28 08:51:44 -08:00
mikeurbach fc8f534fd7
[FIRRTL] Implement initial verifications for ConnectOp. (#278)
This is part of https://github.com/llvm/circt/issues/232. This checks
that the connected values have equivalent types, as defined by Section
4.5 of the FIRRTL spec, with some CIRCT-specific exceptions.
2020-11-27 11:43:15 -08:00
Andrew Lenharth 86c0be773a
[RTL] Signed Math and comparisons (#279)
Add signed comparisons, arithmetic (signed) shift right, and signed math ops
firrtl to rtl should use the fancy new signed ops
match firrtl lowering semantics: had to check with the firrtl expert about the truncate in rem lowering for signed types
2020-11-25 13:05:49 -06:00
Chris Lattner 1cdeeb783d Remove some unneeded boilerplate now that ODS is smarter, NFC. 2020-11-25 10:52:37 -08:00
Chris Lattner 3727cc98c8 [EmitVerilog] Improve naming of verilog wires produced by instances
This includes the instance name into the wire name which makes it easier
to read the verilog and reduces likelihood of collisions.
2020-11-25 10:33:50 -08:00
John Demme 9ffef9c2a9
[ESI] Lowering code cleanup (#287)
* [ESI] Lowering code cleanup

Based on Mike's post-merge comments.

* Avoid implicit int cast on some platforms
2020-11-24 17:33:26 -08:00
John Demme 66b7e12c32
[ESI] ChannelBuffer lowering to new PipelineStage op (#281)
* Getting the ESI lowering pass stubbed out.

* Consolidating ESI code

* Start of physical pass

* Lowering to physical ESI ops

* Documentation

* Code documentation

* Cleanup based on Chris' review

* Fixing test for new syntax
2020-11-24 16:39:45 -08:00
Chris Lattner 0eba89a76a [RTL] Rework result name handling for rtl.instance.
Instead of trying to preserve names from the MLIR file, get them from
the module definition.  This is more stable and works better in
practice than using a names attribute.
2020-11-24 13:48:48 -08:00
Andrew Young b2a0d1e420
Ignore broken clang-tidy rule in header file (#285) 2020-11-24 13:03:46 -08:00
Andrew Young 4de8ad595a
[FIRRTL] Move RTL lowering into a conversion library (#273) 2020-11-24 10:01:52 -08:00
John Demme 46c3e00bc3
[ESI] Makes wrap/unwrap expose control signals (#280)
* Add valid/ready to wrap/unwrap

* Simplified syntax

* Clarify the op documentation.

* Rename asm op name

* Change method for getting I1 type

* DialectImplementation -> OpImplementation
2020-11-23 21:26:28 -08:00
George Lyon 902877cf0a
[WIP] Update LLVM (#275)
* Update LLVM

* Update LLVM

* Add @mikeurbach's change that I accidentally force-pushed away

* Update LLVM

* Make functions which declare symbols have private visibility

* Fix verilog-basic

* Fix firrtl/lower-types.mlir

* Use terser syntax for sym_visibility = private

Co-authored-by: George <>
2020-11-23 19:27:16 -08:00
Andrew Lenharth f8aac8a86a comprehensive rtl op emission test 2020-11-23 11:31:15 -06:00
Andrew Lenharth de9709ef41 missing test for firrtl.or 2020-11-23 10:22:27 -06:00
Andrew Lenharth 2ac5dd6103 Add some simple tests for comparison 2020-11-23 10:20:56 -06:00
Andrew Lenharth a6d2b8565d bump llvm 2020-11-23 10:03:11 -06:00
Andrew Young 45747ad6e7
[RTL] add `sext` and `zext` constant folding (#269)
Adds some simple constant folding for `sext` and `zext`.  RTL's
extension ops require the result width to be larger, so there is no
folding of idempotent operations.
2020-11-22 20:19:48 -08:00
Chris Lattner db69d62b54 fix a weird clang-format issue that snuck in, NFC. 2020-11-22 19:37:07 -08:00
Chris Lattner d8f7e5f1a2 [RTL] Improve the syntax of rtl.module port and results, implementing #174
This makes use of the declared port syntax like the FIRRTL dialect, and
adds support for named result operations as well.  This makes the output
of rtl module dumps much more readable.
2020-11-22 17:31:45 -08:00
Chris Lattner bd042c3d44 [RTL] Implement the rtl.read_inout operation, incl EmitVerilog support.
This turns a value of inout<T> type into T, doing a conceptual "load"
of the value.  The syntax here can be improved, I filed issue #276 to
track the improvement.
2020-11-22 16:18:59 -08:00
Chris Lattner 09a4dd3bb6 [RTL] add EmitVerilog support for rtl::InOutType as a module port.
Rename InOutType's "innerType" to "elementType" for consistency with
other types.
2020-11-22 15:52:10 -08:00
Chris Lattner 5305cfbaaa [RTL] remove redundant error in type parser.
This also fixes a clang tidy issue I introduced in a previous patch.
2020-11-22 15:41:25 -08:00
John Demme b8bdfed633
Adds badges of professionalism (#274)
Green boxes make me happy.
2020-11-22 14:17:21 -08:00
Chris Lattner e2f1a7d8c7 [RTL] Add support for an "inout" type in the RTL dialect.
This runs into some limitations and issues with the ODS TypeDef support,
filed as https://bugs.llvm.org/show_bug.cgi?id=48262
2020-11-22 12:01:55 -08:00
Chris Lattner 8612153972 [RTL] Some minor tidying up after PR171 2020-11-22 10:57:40 -08:00
John Demme 460f4b7dfd
[RTL] Adding 'array' type (#171) 2020-11-22 09:21:22 -08: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 b2b1549b1a
[ESI] Fix cosimulation lit format runner (#272)
Pycapnp complains if the 'PWD' env var doesn't match the actual cwd.
This ONLY manifests in Docker cmake. Not locally or in Docker running
llvm-lit manually. Odd.

Set the PWD for python test script execution before launching.
2020-11-21 15:46:24 -08:00
John Demme 90812fe552
Switching to v2 image for nightlies (#271)
v2 adds the psutil python package which is required to timeouts in lit.

This is an obvious change.
2020-11-21 14:48:08 -08:00
John Demme 113ee95719
[ESI] Cosimulation integration tests (#259)
* [ESI] Cosimulation integration tests

* Fixes

* Set an integration test timeout.
2020-11-21 14:05:45 -08:00
John Demme ac8ea5d10c
[LLVM] Creates llvm build script to avoid replication (#267)
Closes #265.
2020-11-20 13:10:49 -08:00
mikeurbach 887513f8cb
[FIRRTL] Handle flipped bundle types in LowerTypes (#263)
The canonical representation of a BundleType with every field flipped
is a FlipType that wraps the whole bundle. There were places where
LowerTypes assumed a BundleType, which caused crashes for
a FlipType wrapped around a BundleType. To address this:

* LowerTypes will default to disabled in firtool, and can be enabled by
passing the -enable-lower-types flag.
* The instance op verifier was updated to guarantee the result type is a
BundleType or a FlipType wrapped around a BundleType. 
* LowerTypes was updated to check for both scenarios in the places it
previously assumed it was working with a BundleType.
2020-11-20 11:55:07 -08:00
John Demme 5225d65e9f
[Verilator] Make the error check more flexible (#264)
Verilator changed its error reporting message format since 4.0 to
include the column number. This change is to make the tests backwards
compatible to 4.028 (at least).
2020-11-20 11:37:13 -08:00
John Demme 8a6d010f6b
Adds an integration testing workflow (#251)
Runs nightly or by request.
2020-11-19 16:35:57 -08:00
Andrew Young 4306c78b54
[FIRRTL] Allow firrtl.instance in the body of firrtl.when (#258)
firrtl.instance must be enclosed by a firrtl.module, but it may not be
the direct parent op. When verifying, using parentOfType will search all
parents of the firrtl.instance op during verification.  This allows a
firrtl.instance op to appear in the body of ops other than a module,
such as firrtl.when.

firrtl.when is still not handled during lowering to RTL.  Any
firrtl.instance occuring in the body will not be properly lower to an
rtl.instance.  This will cause verification to fail.
2020-11-19 13:37:21 -08:00
John Demme a33a89647e
[ESI] [Cosim DPI] DPI plugin (#244)
* [ESI] Cosimulation DPI plugin

This is PR 6 of 7 for #213. This code is the actual DPI plugin and RPC
server -- the main chunk.

* Code cleanup.

* Clang-format fixes

* Clang-tidy fixes.

* Changes based on Mike's feedback.

* Missed one

* Changes based on Chris' feedback

* Fixing a clang-format issue

* Moving the capnp stuff out of the public headers!

* Final round of changes based on code review

* More locking and a formatting fix
2020-11-19 01:58:00 -08:00
mikeurbach 4264b1a373
[FIRRTL] Fix LowerTypes to respect flow when connecting to instances (#256)
* [FIRRTL] Fix LowerTypes to respect flow when connecting to instances

This fixes #255. When connecting to instances that have their bundles
flattened, we need to make sure the flattened destination is in fact a
sink, or else connect in the other direction. Incidentally, this would
have been caught by #232.
2020-11-18 22:09:27 -07:00
Chris Lattner 93d1adfb56 [FIRRTL] Improve AsPassivePrimOp builder/folder a bit.
We now fold noops and have a builder that doesn't require specifying
the destination type, this simplifies code by making it unconditional.
2020-11-18 20:36:42 -08:00