TOPLLab / WARDuino

📟 A dynamic WebAssembly VM for embedded systems
https://topllab.github.io/WARDuino/
Mozilla Public License 2.0
73 stars 7 forks source link

Feat/virtual address (old) #152

Closed carllocos closed 1 year ago

carllocos commented 1 year ago

added the base functionality to start working with virtual addresses. However, currently when requesting state through interrupts as wooddump, dump, dumpfull, etc. The VM still prints physical addresses. And saving state via interruptRecvState also expects physical address via payload.

Also interruptOffset got removed which makes the interruptRecvState temporarily unusable. The reason is that we cannot push state to a VM without knowing the start address to calculate the physical address. Fixing this essentially corresponds with finishing the integration of issue https://github.com/TOPLLab/WARDuino/issues/127, which is best done in a separate PR to keep this PR relatively small.

tolauwae commented 1 year ago

So this PR needs to wait until #127 gets fixed, correct? Since we want to release version 0.3.0 this week, this feature won't be finished I guess?

carllocos commented 1 year ago

@tolauwae Actually I need this PR to be first accepted in order for me to start on https://github.com/TOPLLab/WARDuino/issues/127. Otherwise, I end up doing double work.

Alternatively, I could implement https://github.com/TOPLLab/WARDuino/issues/127 as part of this PR but I fear then that the PR will become lengthy; something that we wanted to avoid.

If this PR gets accepted, I can certainly finish https://github.com/TOPLLab/WARDuino/issues/127 in time. I already have most of the needed code.

tolauwae commented 1 year ago

@carllocos Ok I'll look at the changes and make a review in that case. One last questions: is interruptRecvState broken right now? and does this break EDWARD?

carllocos commented 1 year ago

interruptRecvState is broken because right now it does not work with virtual addresses it expects the state to be offset with the physical address of the receiving VM that we would get by sending an interruptOffset, which I removed for this PR.

Restoring the interruptOffset would unbreak interruptRecvState, but this would be temporary since implementing https://github.com/TOPLLab/WARDuino/issues/127 would again make the interruptOffset obsolete.

Note that this PR will break the VSCode plugin side, the reason is that the plugin needs to account for the use of virtual addresses when setting, and removing breakpoints, as well as, to react correctly on breakpoint reach notifications.

carllocos commented 1 year ago

This PR is deprecated in favour of https://github.com/TOPLLab/WARDuino/pull/178