Coarse-grain reconfigurable architectures (CGRAs) offer an attractive tradeoff between performance, energy efficiency, and flexibility, making them promising accelerators for loop-intensive workloads. However, their adoption is hindered by limited support for safe execution. Existing CGRA toolchains primarily compile kernels written in C, inheriting C’s lack of memory safety. While unsafe memory accesses on CPUs may be detected by hardware or the OS, equivalent accesses on CGRAs can occur silently, with little visibility into such errors during execution. Our key insight is that Rust’s safety and error-handling semantics can be leveraged when mapping kernels to CGRAs. Rust’s compile-time guarantees and lightweight runtime checks make it well suited to addressing memory safety challenges in dataflow architectures. To enable safe memory accesses, we propose Sāmaya, a CGRA compilation and execution framework that integrates a Rust-based compilation pipeline into the Morpher framework, extends dataflow graph generation with safety metadata and multiple error exits, and propagates this information through widened datapaths and registers. We implement Sāmaya on the HyCUBE CGRA architecture and evaluate it using a diverse set of kernels.

