Cull unnecessary dependences. Reduces the number of files which need to
be compiled for check-circt by ~20%. Compiles and links fine on my machine,
but we've had linking issues in the past, so this may be bumpy.
* circt-reduce: cleanup --help output, put options in category
Hides unrelated options from LLVM+co, and makes it easier
to find the most relevant options at glance.
When building CIRCT against LLVM built as shared libraries
(as preferred by many Linux distributions) this greatly
reduces the number of options printed.
* firtool: cleanup --help output, put options in category
Hides unrelated options from LLVM+co, and makes it easier
to find the most relevant options at glance.
When building CIRCT against LLVM built as shared libraries
(as preferred by many Linux distributions) this greatly
reduces the number of options printed.
* llhd-sim: group llhd-sim options in --help output
Hides unrelated options from LLVM+co, and makes it easier
to find the most relevant options at glance.
When building CIRCT against LLVM built as shared libraries
(as preferred by many Linux distributions) this greatly
reduces the number of options printed.
Even for the statically linked version more commonly used
with CIRCT, the help output is significantly reduced.
* llhd-sim: touchup optimizationLevel cl::opt to be static (NFCI)
* test/llhd-sim: Add commandline test
* circt-reduce: check categories in help test
* firtool: check categories in help test
* firtool: add new option to mainCategory too
Move singleton headers like circt/Conversion/LLHDToLLVM/LLHDToLLVM.h
up to circt/Conversion/LLHDToLLVM.h since that is the only thing in that
directory.
Co-authored-by: Andrew Lenharth <andrew@lenharth.org>
Co-authored-by: Fabian Schuiki <fabian@schuiki.ch>
Co-authored-by: Andrew Young <youngar17@gmail.com>
This includes a couple breaking changes:
* AttrDef has a new argument for attribure traits.
* Several includes we depended on appear to have been moved to forward
declarations, so add the explicit includes we needed.
This adds a -shared-libs option to llhd-sim that is analogous to the
same option for mlir-cpu-runner. If specified, those libraries are
passed to the ExecutionEngine to dynamically load and link.
Some changes in this bump:
* OpBuilderDag -> OpBuilder: github.com/llvm/llvm-project/commit/32c49c7
* Changes to Type getChecked and verification: github.com/llvm/llvm-project/commit/06e25d5
* Changes to Value internals, with minor public breakage: github.com/llvm/llvm-project/commit/3dfa861
* Changes to LLVM translation: github.com/llvm/llvm-project/commit/19db802
* .getAttrs() -> ->getAttrs():
* Adding llvm_unreachable after covered switch statements with returns
* Separating diagnostics tests from FileCheck tests
This combines all conversion passes into a single Passes.td similar to
MLIR. For some conversions, the passes were not specified using ODS.
These passes have been converted to use ODS which means they will show
up in generated documentation. Conversion passes have also been moved
out of dialect namespaces, it is normal for them to live under the CIRCT
namespace.
* Adding Windows build and test workflow
* ubuntu -> windows
* cmake paths
* Adding build parallelism
* Builds locally
* A large portion of the tests fail on Windows
* Remove release build
* Debug takes up waayyy too much space!
* Run in Release mode
* Add '-j 1' to disable parallelism
* Build LLVM separately
* Fixing build workflow
* Finally working!
* Update buildAndTestWindows.yml
Only cache object dirs
* Update buildAndTestWindows.yml
Fixing formatting issue
* Remove pre-build job
* change library name from libMLIRCAPIRTL to libCIRCTCAPIRTL
* change library name from liblibMLIRLLHDTransforms to libCIRCTLLHDTransforms
* change library name from liblibMLIRRTLToLLHD to libCIRCTRTLToLLHD
* rename library from liblibMLIRLLHDToLLVM to libCIRCTLLHDToLLVM
* rename library from libMLIRFIRRTLToLLHD to libCIRCTFIRRTLToLLHD
* rename library from libMLIRFIRRTLToRTL to libCIRCTFIRRTLToRTL
* rename library from libMLIRHandshakeToFIRRTL to libCIRCTHandshakeToFIRRTL
* rename library from libMLIRStandardToHandshake to libCIRCTStandardToHandshake
* rename library from libMLIRStandardToStaticLogic to libCIRCTStandardToStaticLogic
* rename library from libMLIRRTL to libCIRCTRTL
* rename library from libMLIRSV to libCIRCTSV
* rename library from libMLIRESI to libCIRCTESI
* rename library from libMLIRFIRRTL to libCIRCTFIRRTL
* rename library from libMLIRLLHD to libCIRCTLLHD
* rename library from libMLIRHandshakeOps to libCIRCTHandshakeOps
* rename library from libMLIRStaticLogicOps to libCIRCTStaticLogicOps
* alphabetically rearrange LIBS in CMakeLists.txt
* add LLVM license info to files header
* Add LLVM license info to files header
* Add LLVM license info to files header
* Add LLVM license info to file headers
* Revert "Add LLVM license info to files header"
This reverts commit 22869676ad.
* Add LLVM license info to file headers
* run git-clang-format
* add missing file descriptions
* run git clang-format
* Add LLVM license info to file headers
* Add LLVM license info to files header
* Gather current instance once; store lookup pointers
* Enable codegen optimization flag
* Reflect optimizations also when dumping LLVM IR
* Avoid copying slots multiple times per slot
* Use SmallVector in Slot and event queue
* Store JIT function pointers into instances' structs
* Avoid unnecessary Slot copying
* Simplify Slot structure
* Lookup instances through integer indexes
* Reuse slots, never sort queue
* Split slot change data to a seprate vector
* Reuse changes buffers instead of clearing them
* Pass APInt buffers by const reference
* Use const ref where no changes are needed
* Defer change APInt allocation as far as possible
* Directly pass changes to queue
* Track top slot and unused slots; avoid redundant queue iteration
* Pass the correct ArrayRef sizes when initializing APInts
* refactor cycle counter name;
* Fix unexpected trace entries and possible instance executions
Multiple drives to the same signals could erroneously trigger trace entries to be printed, and, in the worst case, unexpected instances to wakeup. This should fix the issue by processing one signal at a time, instead of one change at a time, triggering wakeups and trace entries only if the final result for the event represents a change.
* Sort top changes and process all changes for the same signal at once
* Map signal indexes to change indexes; switch to normal sort()
* Rebase fixes
* Make awkward for loop a while
* Adjust comments; remove comment artifacts
* Refactor variable names
* Remove unused includes
* Use existing signal reference instead of redundant vector access
* Remove unused and unimplemented method
* Add method to search instances by name
* Remove unnecessary includes
* Refactor Slot internal structures names
* Adjust comments
* Move dummy event insertion into simulate method
* Remove unused width annotation
* Comment artifact
* Use SmallVector<T, 0> for instances, signals, sensitivity lists
* Refactor variable name
* Refactor redundant code
* Remove unused constructor
* Comment
* Use llvm::sort
* Use empty() as check; use pop_back_val() to pop
* Make failure an assertion
* Add trace format interface
This adds a new class that makes it easier to add new dump formats (includes a couple of variations of the trace format used so far) to the simulator. This fully moves trace generation to the new itnerface, which also fixes:
* The signals within a time-step are properly sorted by their paths.
* Signals of arrays and tuples generate one trace entry for each of their element, instead of being printed as ints.
* Fix make_pair
* Parse mlir files through a SourceMgr
This changes how the mlir source files are parsed, making it more similar to what is done in MLIROptMain. This also enables piping a module into llhd-sim directly, which was previously not possible.
* Add option to stop simulation at a real-time step.
* Use sort vector + erase-unique for wakeupQueue
* Add named-only trace format
This introduces a new merged trace format that filters out default-named signals with name 'sig[0-9]*'. This is useful to compare the trace against converted vcd traces of the top-level signals.
* Remove unused variable
* Adapt signal name filtering for named-only trace
* Update completition message
* Rebase fixes
* clang-format
* Debug artifact
* Merge redundant change push code
* Fix typo
* Fix root instance map key
* Remove unnecessary map entry
* Refactor redundant code
* Simplify if statement; comments
* Define traced signals only once on initialization
* Don't trace structured signal elements that do not change, for all formats
* Refactor sort in a private function
* Add boilerplate headers
* Ensure nothing is printed when there is no change
* Add formats test
* Minor adjustments/comments
* Simplify `lastValue` map key
* Adjust formats descriptions
* clang-tidy
* Skip clang-tidy header-guard check
* Comment typo
Co-authored-by: Fabian Schuiki <fabian@schuiki.ch>
Co-authored-by: Fabian Schuiki <fabian@schuiki.ch>
* Update to MLIR d14cfe10341681
This MLIR commit includes a small fix for ODS custom directives.
We also need some minor updates to work with the latest MLIR:
1. Fully qualified `cppNamespace` for dialects using that
2. Update custom ODS builders to remove the `Builder` and
`OperationState` parameters, which are automatically inserted
* Move LLHD dialect into CIRCT namespace
This aligns LLHD with the other dialects. In some cases, a new
`using namespace mlir;` is added to ease the transition.
* Put generated Handshake and StaticLogic ops under ::circt namespace
This aligns with the other ODS generate operations, which use
a `cppNamespace` rooted under `::circt`.
* Use full `circt::llhd` namespace where it used to be `mlir::llhd`
This picks up some enhancements to ODS, as well as a few changes:
* Dialect registration is being updated. For now, the global dialect
registry is enabled for backwards compatibility while we update
the dialect registry mechanisms
* Kinds are removed from Types and Attributes. This is a mostly
mechanical change to use isa and TypeSwitch
* Generated passes are registered differently. The approach here is
to define the registerPasses function in an anonymous namespace
and call it from within the existing static helpers.
* Upstream LLVM dialect has updated how types are printed, and the
LLHDToLLVM tests are updated accordingly
* 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>