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.
The origins of the design are in this wip note: https://hackmd.io/TKbiV5rwSQGB8-XxItUS2A
The API still has Adapter vs Core, where there is a separately of the row slice between the two. However we now opt to give more control flow to CoreChip, so it can directly access VM state and use the results locally via several notions of transactions:
All namings are up for debate/revision.
Differences to the old API:
VmAdapterChip
andVmAdapterAir
.I provide some traits for transactions, which is the interface for Core chips that need to be re-used for different adapters. But my perspective is that actually most of our Core chips (with exception of ALU) don't really need to have generic adapters. So I've shown how to do the generic version for BaseAlu, but for most Core chips I envision that we can implement everything for a specific adapter, which will make life a lot easier. The framework is also flexible that you can always introduce new traits when needed if you want to expose additional interfaces from the adapter transaction (the MaybeRead for immediate handling is an example of this).
My todos:
Working thoughts on Rv32VecHeapAdapter:
address.address_space
passed in.AirTx::end
, it will override theoperand.e
value to always be2
(I couldn't think of a better interface so far)Working thoughts on other Rv32IM core chips:
Rv32RegisterAdapter
Rv32RegisterAdapter
and provides address space 2 memory access operations. This does not need to implement the various Adapter / Tx traits, because the core chip should just be specialized to this custom adapter.