sunflower-embedded-system-emulator
sunflower-embedded-system-emulator copied to clipboard
Behavior of .m files and parsing in the presence of `setnode`
If you load a Sunflower command file like the following, the behavior will not be as you expect (e.g., Sunflower will complain about an invalid command and you will not see the output of version
):
newnode riscv
setnode 1
version
dumphist 0
q
There are several things happening here. First, the entire load.m is parsed by the parser for the current node's type. The first node created at startup is a superH, so the entire run.m will get parsed with the variant of the parser for superH. See related issues #125, #127, #129. Second thing happening here is that Sunflower prints output for the current "node" only, so that when you are running a simulation with multiple processors each printing out output, you only see the output of the processor to which the interface is currently "connected". You change the current connected processor / node by using setnode
. But again, because the interface only displays output from the current node, but the parser instance that runs is tied to the processor that was alive at the time the load
sunflower command was issued, the output of version
(which is for node 1) does not get printed to the console.
If you run the GUI version of Sunflower, the outputs are stored in separate buffers (by mprint
) and you can switch between panels showing their output.