Commit Graph

59 Commits

Author SHA1 Message Date
John Demme 17ada21d60 [Integration tests] Partially revert last commit
Looks like this test really does require Questa.
2023-10-03 21:57:44 +00:00
John Demme e016843e4c [Integration tests] Update broken test to new module asm syntax
Wasn't getting caught by Github CI since this required questa. Changed
to any IEEE simulator and fixed test.
2023-10-03 21:54:40 +00:00
Andrew Lenharth 164dbaf9cd
[HW] Change printer for modules (#6205)
This is quite invasive.  This converts from the functiontype printer to the moduletype printer.

---------

Co-authored-by: Mike Urbach <mikeurbach@gmail.com>
2023-09-28 16:30:15 -05:00
Schuyler Eldridge 00761cd8db
[FIRRTL] Remove validif from integration test
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2023-01-11 17:27:56 -05:00
Nandor Licker 83f1608f6e
[HW] Pretty-print uniform arrays (#4160)
Lower `hw.array_create` to an array replication operator if elements are uniform.
2022-10-23 08:44:28 +03:00
John Demme f45ba4426d
[ESI] [Integration tests] [Tests] Switch from 'rstn' to 'rst' (#3618)
Rst seems more common, but the integration tests and ESI use 'rstn'.
Switch to the more common 'rst'.
2022-07-28 10:55:58 -07:00
Richard Xia 9127a771d2
Update LLVM to 1aa4f0bb (#2901)
* [Conversions][Transforms] Add missing includes due to refactoring in upstream MLIR.

LLVM commit 36d3efea15e6202edd64b05de38d8379e2baddb2 removed a few
include statements from mlir/Pass/Pass.h, so we have to update a few of
the files here to add back in some includes.

* [Handshake][SV] Migrate from StrEnumAttr to EnumAttr.

StrEnumAttr was removed in upstream LLVM commit
60e34f8dddb4a3ae5b82e8d55728c021126c4af8. It has been replaced with
EnumAttr, which can do everything that StrEnumAttr could do but more
efficiently.

This affected two specific attributes: Handshake's BufferType, and SV's
ModportDirectionAttr. Both have been converted over to EnumAttrs. Their
parsers had to be updated, since the new EnumAttr no longer likes having
double quotes around the enum value in the assembly format.
Consequently, the tests were also updated.

* Bump llvm to 1aa4f0bb6cc21b7666718f5534c88d03152ddfb1.
2022-04-15 16:07:46 -07:00
John Demme 275f7c9336 Fixing Questa integration test and misc. warnings 2022-03-19 16:37:03 -07:00
Nandor Licker 1967695815
[SV] Add a File Descriptor parameter to FWriteOp (#2737)
* Add a File Descriptor parameter to FWriteOp

`sv.fwrite` now accepts an i32 argument pointing to an arbitrary file descriptor.

```
%0 = hw.constant 0x80000002
fwrite %0, "write to stderr"

```

resolves llvm/circt#2062
2022-03-10 09:16:05 +02:00
Jiuyang Liu 7458b95ed7
[HW] Change HW.array_slice syntax (#2600)
This may fix #2176:

These are logically equivalent operations. array_slice should use the same syntax (but have the additional return type).

I think this issue is proposing changing array_slice syntax to use square bracket?
I did some small change to td file, but not so sure if this is the syntax that @lattner originally want.

Additionally, I also have a question about the type assembly format for hw.array_slice and hw.array_get:
hw.array_slice serialize the input parameter type, while hw.array_get doesn't. I thought types of ODS format should always be explicit, while this seems to be a counter example. Just curious the originally design purpose here.


Co-authored-by: Andrew Lenharth <andrew@lenharth.org>
2022-02-15 12:04:07 -06:00
John Demme 91e7297d5e [FIRRTL] Fix Questa lint integration test 2022-01-04 17:38:40 -08:00
Andrew Lenharth 196a3f2999
make firtool output options and pipeline structure a bit more sensible (#2358)
make firtool output options and pipeline structure a bit more sensible
2021-12-17 10:14:43 -06:00
John Demme 41432eb2d2 Fix the integrations tests broken by "[Comb] Remove the now-unused comb.sext operator." 2021-12-03 07:31:37 +00:00
Prithayan Barua 7420a49d4e
[IntegrationTest] Disable verilator lint width warning (#2193)
A temporary fix for integration tests, to disable verilator width warning.

As a followup we need to respect `disallowPackedArrays `
to not generate packed arrays and lower them accordingly.
2021-11-16 12:34:08 -08:00
John Demme 57119ebc41 [Integration Tests] Fixing an EmitVerilog test which wasn't running
`sv-interfaces.mlir` had an old `REQUIRES` line so it wasn't running and
wasn't correct. Updated.
2021-11-12 23:55:08 +00:00
Andrew Lenharth bbdcdddbd1 [NFC] Split test for each tool 2021-10-28 16:36:53 -05:00
John Demme e7990b8a65 [CI] Fix tests by not printing IR to stdout 2021-10-05 15:06:54 -07:00
Andrew Young 7e6464b77b
Properly use `circt-opt` for `export-verilog` (#1930)
Verilog exporting was moved from a translation to a proper pass.  As a
part of this change, it should be invoked by `circt-opt` instead of
`circt-translate`. This change should fix the integration build.
2021-10-05 11:18:10 -07:00
Daniel Resnick 4f21e44d52
[Comb] Simplify comb.concat signature to omit result type (#1880)
Removes the result type from the comb.concat type signature since it can be
deduced from the inputs.

For example, this previous signature:
```mlir
%0 = comb.concat %false, %b : (i1, i4) -> i5
```

is simplified to:
```mlir
%0 = comb.concat %false, %b : i1, i4
```

Address #1623.
2021-10-01 13:30:25 -06:00
Andrew Young 2829895862
[Tests] Add equiv-rtl.sh as a Lit tool (#1816)
`equiv-rtl.sh` is a utility script used to test formal equivalence in
our integration tests.  This change adds it as a tool which Lit knows
how to find instead of using a relative path to invoke the script.
2021-09-20 13:35:37 -07:00
Schuyler Eldridge d91ccd294b
[HW] Fix Integration Tests, NFC
Update integration tests to use new hw.module and hw.instance textual
formats.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-09-13 11:41:41 -04:00
Chris Lattner 96d2c55530 Make this test print out the problem to the build log if there is one. 2021-08-15 16:08:58 -07:00
Mike Urbach 6de54965fe [ExportVerilog] Remove sv-structs.mlir integration test.
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.
2021-07-05 11:34:20 -06:00
mikeurbach dbf83459c1
[ExportVerilog] Special case register of struct or array of struct. (#1361)
Don't print `reg` if the reg holds a struct or array of struct. See
the spec, section 6.8 for the syntax of variable declarations.
2021-07-01 15:25:53 -06:00
Chris Lattner 0f5bda6f72 [integration-test] Revert d7cca9529f 2021-06-02 17:01:54 -07:00
Chris Lattner d7cca9529f [integration-test] Properly init a reg, fixing Issue #1188. 2021-06-02 12:19:54 -07:00
John Demme f2fd7fbdc9 Fixing integration tests 2021-05-16 21:09:34 -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 e31e8a3e3d [RTL->HW] Rename the rtl dialect to hw dialect in MLIR syntax. 2021-05-15 14:24:43 -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
Andrew Lenharth 7e09dbe75d [NFC] Add a self-contained firrtl simulation test. 2021-04-08 13:44:47 -05:00
Chris Lattner 1429a9dd80 Update some tests to modern syntax, Issue #887 2021-04-05 14:59:17 -07:00
Prithayan Barua e9c90ae54a
[integration_test] Update golden verilog (#858)
* Update the golden verilog with the latest firrtl
* firrtl output for neg, for signed and unsigned operand must respect the sign.
* This should fix the yosys integration_test failure https://github.com/llvm/circt/issues/842
* The firrtl bug fix that updates the golden: 49b8232447
2021-03-31 10:39:49 -07:00
John Demme e81169f3aa Fixing both unit test and integration test failures
- The ESI export verilog test is too fragile. Making more resilient to
  ExportVerilog changes.
- Missed some bitcast dialog changes in the integration tests
2021-03-04 01:20:46 -08:00
Hideto Ueno 30668d990a
[RTL] [Comb] Move comb.constant to rtl (#673)
* Move comb.constant to rtl

* add missing

* fix

* fix ExportVerilog and example

* format

* format

* remove unnecessary header

* materialize constant

* format

* rebase

* fix

* clang-format
2021-02-27 17:29:15 +09: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
Prithayan Barua 4e25ee7c29
[Comb] Rename XorROp to ParityOp (#653)
Rename the "reduction Xor" operator to "Parity" in Comb dialect.
Semantics remain exactly same and export verilog also doesnot change.
Discussed in: https://github.com/llvm/circt/issues/598
2021-02-23 19:52:46 -08:00
Prithayan Barua 097ad68cab
[Comb] Replace comb.AndROp with "==-1" (#652)
* Remove comb.OrROp and replace with == -1

Remove "reduction and" from the comb dialect, and instead use "== -1".
Update lowering from FIRRTL to use "== -1"
Also update verilog export to emit "&" whenever "==-1" is encountered.
Remove the specific tests for "and or ", like the folding and canonicalization ones.
Add tests for FIRRTL lowering and Verilog emitting
2021-02-23 14:43:29 -08:00
Andrew Lenharth 6f00aa7c30 [NFC] Start of verilog/systemverilog language conformance test case. 2021-02-23 11:43:17 -06:00
Andrew Lenharth 4934ced5a7 [NFC] fix integration tests from orr removal 2021-02-23 09:51:17 -06:00
Hideto Ueno 5237190d22
[Comb] Fix constant syntax (#637)
* [Comb] Fix constant syntax

* Fix doc and missed tests

* fix
2021-02-23 12:10:58 +09:00
John Demme 6bd0b93ab9
[RTL] Create new 'comb' dialect and move all the RTL combinational ops into it (#599) 2021-02-16 16:04:52 -08:00
John Demme 8cebdd197c [RTL] [Integration Test] Add integration test for #439 2021-02-14 17:09:45 -08:00
Andrew Lenharth 08a04091f6
Rename externmodule to module.extern in preparation for other module types (#577) 2021-02-11 13:22:57 -06:00
Andrew Young 9b632269d5 Rename all translate command line flags to use import and export
This change changes all command line options to use the import and
export nomenclature as described in the MLIR glossary[0].  This is a
a continuation of the renaming work which occured in #341.

[0] https://mlir.llvm.org/getting_started/Glossary/
2021-01-21 12:01:29 -08:00
Andrew Young 6bd6993ef7 Bump LLVM submodule
The MLIR printer has been modified to print enumerations without quotes
when they are not needed.  This provides a nice upgrade to readability.

```mlir
// from:
%1 = cmpi "slt", %0, %c42 : index
// to:
%1 = cmpi slt, %0, %c42 : index
```
2021-01-15 20:25:07 -08:00
John Demme 568c0b4e50
[RTL] Bitcasts (#400)
* Cast(To|From)Bits

* ExportVerilog support

* No valid cast syntax which I could find

* Adding support for structs

* I think this is everything except for the documentation.

* Changing back unrelated, spurious comment formatting

* Fixing test

* Specify bit layout of types

* Incorporating Chris' feedback
2021-01-15 15:42:37 -08:00
Andrew Lenharth b58124a460 Update verilog equiv yosys test to have golden firrtl output from the current upstream firrtl. 2021-01-12 14:20:25 -06:00
Andrew Lenharth 0610b5f16a Switch yosys equiv test over to lower-to-rtl path 2021-01-12 14:09:19 -06:00
John Demme ebaa8692db [Integration test] Fixing two recent breakages
Causes:
- ZExt removal
- Commandline test didn't account for capnp builds
2021-01-11 12:23:08 -08:00