SAMpLE: A SystemC-AMS Machine LEarning-based Framework for Virtual Prototyping
This paper introduces SAMpLE, an open-source SystemC-AMS framework that standardizes the integration of machine learning models into virtual prototypes via a plug-and-play Timed Dataflow interface and ONNX format, offering both native C++ training and offline execution backends to enhance reproducibility, reuse, and comparability in embedded system simulations.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the world of designing complex machines, from the tiny computers inside a smart thermostat to the massive control systems of a modern power grid, engineers face a persistent problem: how to predict how a system will behave before it is built. Traditional methods rely on mathematical formulas that describe every physical law at play, but these formulas often break down when systems become too messy, too old, or too influenced by unpredictable human habits. To fill this gap, designers have turned to a different kind of tool: machine learning. These are computer programs that learn patterns from data rather than following rigid rules. They can guess how much energy a house will use based on the weather, or predict when a sensor might fail. However, putting these learning programs into the simulation software engineers use to design their systems has been clumsy. Usually, it requires building custom bridges between different software tools, a process that is slow, prone to errors, and makes it hard to compare different learning methods fairly.
A team of researchers at Politecnico di Torino in Italy has introduced a new way to solve this, called SAMpLE. Think of it as a universal adapter that lets any machine learning model plug directly into the simulation environment, just like a standard electrical component. The researchers built a framework that treats these learning models as native parts of the system, allowing them to run smoothly alongside the rest of the design without needing special, one-off connections. This approach allows engineers to test how well a learning model works in a virtual environment, seeing if it can adapt to changing conditions in real-time or if it performs better when trained beforehand. The team demonstrated that this method works reliably, producing results that match the original learning programs almost exactly, while also allowing different types of learning algorithms to be tested side-by-side under the same conditions.
The core of the work lies in how the researchers organized the simulation. They used a specific type of digital logic called Timed Dataflow, which is a way of organizing computer tasks so they happen in a strict, predictable order, processing data in small, regular chunks. This structure happens to match how machine learning works perfectly: both take a set of inputs, process them, and produce an output at a specific moment. By recognizing this natural fit, the team created a system where a learning model does not need to be translated or wrapped in extra software layers. Instead, it becomes a standard block in the simulation, receiving data, making a prediction, and passing the result along, all within the same clock cycle as the rest of the system.
To make this work, the researchers designed a framework that supports two distinct ways of using these learning models. The first is an offline approach, where a model is trained separately using powerful computers and then exported into a standard format that the simulation can read. This allows engineers to use models built with popular, external tools without having to rewrite them from scratch. The second is an online approach, where the model learns directly inside the simulation as it runs. This is useful for systems that need to adapt to new information as it arrives, such as a power grid that must adjust to sudden changes in weather or usage. The framework handles both methods seamlessly, ensuring that whether a model was trained outside or inside the simulation, it behaves consistently and can be swapped in or out without breaking the rest of the design.
The team tested their system using real-world data from two different sources: one tracking electricity use in a group of homes and another monitoring the power demand of an entire city. They ran simulations using various types of learning models, including simple linear predictors and more complex tree-based systems. The results showed that the simulation could reproduce the predictions of the original learning programs with remarkable accuracy. For the city data, which followed a smooth, predictable pattern, the models were nearly perfect, matching the original results with almost no difference. For the home data, which was much noisier and harder to predict, the system still performed well, though the models struggled more with the unpredictability. Crucially, the researchers found that the online learning models, which adapted as they went, were significantly better at handling the messy home data than the static models trained beforehand.
One of the most important findings was the ability to compare different learning methods fairly. Because the framework treats every model as a standard component, engineers can switch from one type of learning algorithm to another simply by changing a setting in a configuration file. They do not need to rewrite code or rebuild the simulation. This allows for a direct comparison of how different algorithms perform under the exact same conditions, using the exact same data. The team measured how long each simulation took and how accurate the predictions were, finding that some methods were much faster than others, while some were more accurate depending on the type of data. This kind of direct comparison was difficult to achieve before, as different learning tools often required different setups that made fair comparison impossible.
The researchers also verified that the system works reliably across different scenarios. They showed that the same simulation code could be used for both the home data and the city data just by swapping the input files, without changing any of the underlying software. This portability suggests that the framework can be applied to many different types of engineering problems, from managing energy grids to designing autonomous vehicles. The system also includes tools to check the quality of the data and the performance of the models, providing clear reports on how well the predictions matched reality. This transparency helps engineers trust the results and understand where a model might be failing.
While the system is powerful, the researchers are clear about its current limits. It is designed to work with specific types of data and models, and it relies on the models being exported in a standard format. The team noted that while the online learning models were excellent for adapting to change, they required more careful setup than the offline models. They also pointed out that the system is a tool for evaluation and design, not a replacement for the actual physical hardware. The goal is to help engineers make better decisions before they build anything, reducing the risk of failure and saving time and money.
The work represents a significant step forward in how engineers integrate artificial intelligence into the design process. By removing the need for custom, ad-hoc connections between learning tools and simulation software, the framework makes it easier to experiment with new ideas and compare different approaches. It turns machine learning from a specialized, difficult-to-use add-on into a standard, reliable part of the engineering toolkit. As systems become more complex and data-driven, tools like this will become essential for ensuring that the designs of tomorrow are robust, efficient, and ready for the real world. The researchers have made their code and data available to others, inviting the wider community to build upon their work and explore new possibilities in virtual prototyping.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.