🤖 AI Summary
This study addresses the problem of erroneous data transmission in dynamic topology networks, where node additions and deletions invalidate local states. We propose a morphology-aware computation model featuring MorphLang, a dedicated programming language, and MorphC, its compiler. A novel compile-time enforcement mechanism is introduced to automatically insert guard code, ensuring that repair logic executes with priority following topology changes. Furthermore, the reliability of destination checking within the core language is formally verified using the Rocq theorem prover. The system is implemented on a RISC-V bare-metal architecture and deployed on FPGAs. Experimental results demonstrate that this approach completely eliminates erroneous transmission defects while introducing only 12 cycles of overhead per loop, with hardware latency closely matching simulation predictions.
📝 Abstract
In wireless sensor and mesh networks, modular robots, and shape-adaptive computers, computing modules attach, detach, or are replaced while the others keep running with their local state. A value computed under the old arrangement, such as a cached next hop, stays in memory but may no longer describe the current one, so a program can send to a neighbor that has left without any runtime errors. We present morph-aware computing, a programming model in which the application specifies a corrective update of such state, called a repair, and the compiler decides when it runs. In MorphLang, the repair is a Reconfigure branch next to the ordinary branches that handle sends, receives, and sensor samples. MorphC compiles MorphLang to bare-metal RISC-V and inserts a guard before every ordinary branch, so that each module repairs its state before any other branch sees a new topology. Relying on this order, MorphC also rejects sends whose target may be a literal or a value the repair does not always refresh. For a model of the code MorphC generates, we prove in Rocq that the repair precedes every later ordinary branch for any number of roles and topology changes. This shows that send-target checking is sound for a core language. On 19 MorphLang programs derived from seven network stacks, removing the repair worsens destination validity in ten of the 13 programs that declare one and never improves it. In a reduced reproduction of a released Contiki-NG defect, a callback-based version sends to a departed parent after 60 of 384 changes and the MorphLang version after none. The guards cost 12 cycles per loop in a microbenchmark, and on an FPGA the delay from each commit to the first send to the new neighbor matches RTL simulation.