[ArcRuntime] Add runtime library implementation for arcilator #9356
+642
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tackle #8484 again: This PR adds a runtime library for arcilator which should provide common support functionality for both JIT and AOT compiled models. It doesn't do much at this point. The relevant functions for now are:
allocInstance: Allocates and initializes the state for an instance of a hardware model and the associated context for the runtime library.deleteInstance: Tears it down again.onEval: Housekeeping before each step of the model. At the moment just increases a counter.Among other things, this should hopefully provide a more solid base for VCD tracing than the haphazard implementation in #8986.
An unfortunate amount of complexity comes from the various environments which the library has to interact with. Essentially, it has three interfaces:
IRInterface.h.JITBind.h.ArcRuntime.hand needs to be shipped to users. It is deliberately kept in pure C to allow interfacing with non-C++ environments.The whole linking strategy for the runtime library is a bit mad, but based on my previous experience it is the least likely to break variant I could come up with:
This PR is the first of a series and only contains the runtime library itself. #9357 does the necessary changes on the MLIR side and #9358 makes it usable.