Commit Graph

6 Commits

Author SHA1 Message Date
Martin Erhart 2345382e67
[LLHD] Remove llhd-sim (#7351) 2024-07-19 17:54:14 +01:00
Sprite 734f6262d8 [CMake] Fix option `CIRCT_LLHD_SIM_ENABLED` 2023-01-19 17:05:14 +08:00
Nandor Licker d0f1d99581 [NFC] Added newlines to the end of files 2022-03-28 18:58:23 +03:00
Chris Lattner fea28586bf [LLHD] remove the LLHD-specific Verilog printer.
We have one well tested and continuously refined verilog emitter
pass, lets use that instead of duplicating the logic.

This resolves Issue #2282, where it was approved by Martin Erhart.
2021-12-08 14:01:45 -08:00
Andrew Young 3f97ea344d Canonicalize all CIRCT translation libraries
The MLIR glossary says: `translation` is the transformation of code
represented in an external (non-MLIR) representation into a semantically
equivalent representation in MLIR (i.e. importing ), or the inverse
(i.e. exporting ).  This change tries to reflect that concept in our
directory structure and code.

Translation libraries were moved into dialect specific Translation
folders.  In the case of emitting FIRRTL/RTL/SV as Verilog, it was added
to a global Translation directory, as this code stretches across several
dialects.

Specfically:
- FIRRTL parser to `circt/Dialect/FIRRTL/Translation'
- LLHD verilog emitter to `circt/Dialect/LLHD/Translation/`
- Verilog emission to `circt/Translation/`

All CIRCT translation libraries are now declared using
`add_circt_translation_library`.  This adds each translation library to
the `CIRCT_TRANSLATION_LIBS` global property. This is used to simplify
linking for `circt-translate`.

`InitAllTranslations.h` was added to provide a way of easilly loading
all translations.  Differently than MLIR, this file includes every
translation header file.

`circt-translate` was updated to use an MLIR provided main function.
This had a side effect of omitting some diagnostic information when
running `circt-translate --verify-diagnostics`, and one test case had to
be updated.

In the future the `circt-translate` command switches should be updated
to express exporting or importing, instead of parsing and emitting.
Consistent use of this terminology will help different between MLIR IR
and external formats.
2020-12-21 14:45:56 -05:00
maerhart 8a82a81806
Merge LLHD project into CIRCT (#14)
* Merge LLHD project into CIRCT

* Split LLHDOps.td into multiple smaller files

* move LLHDToLLVM init definition and prune includes

* Format tablegen files with 2 space indent, 80 col width; move out trait helper function

* Move implementation logic from LLHDOps.h to cpp file

* Empty lines for breathing space; nicer operation separators

* Move simulator to Dialect/LLHD/Simulator

* move `State.h` and `signal-runtime-wrappers.h` to lib directory

* pass ModuleOp by value

* make getters const, return ModuleOp by value

* Use isa, cast, dyn_cast appropriately

* wrap struct in anon namespace; make helpers static

* [cmake] Fold into LINK_LIBS

* fix for loops

* replace floating point with `divideCeil`

* prune redundant includes

* make llhd-sim helpers static

* remove StandardToLLVM pass registration

* move verilog printer to cpp file, add global function as public API

* Move transformation pass base classes and registration to lib, add file header boilerplate

* Few improvements

* Return diagnostics directly
* isa instead of kindof
* Improve walks
* etc.

* add 'using namespace llvm;' again

* Always pass a location when creating new ops

* Improve cmake files

  * remove unnecessary `LLVMSupport` links.
  * add `PUBLIC` where missing.
  * move LLVMCore under `LINK_COMPONENTS`.

* Add file headers and improve simulator comments

* Some LLHDToLLVM improvements

* Fix walks.
* Use `std::array` instead of `SmallVector` when resize is not needed.
* Fix a potential sefgault by passing an ArrayRef with no data owner.
* Remove some unnecessary steps.
* Remove some unnecessary const strings.

* Add new LowerToLLVMOptions argument

The new argument was added in 10643c9ad85bf072816bd271239281ec50a52e31.

* Add missing file header boilerplate and newline

* Improve for-loop

* use static instead of anonymous namespace for functions

* fit to 80 columns, cast instead of dyn_cast

* Changes for LLVM update

* use llvm format instead of std::stringstream and iomanip

Co-authored-by: rodonisi <simon@rodoni.ch>
2020-07-02 11:04:33 -07:00