Please rotate your tablet to be horizontal.

You can dismiss this notice but please note that this experience has not been designed for mobile devices and so will be less than optimal

Back To Schedule

Simulating Low-Level Hardware Devices

14:00 - 15:00 Thursday 15th September 2022 MDT Summit 6 & 7 / Online B
Intermediate
Advanced
Embedded

When developing software that will interact directly with hardware, embedded developers often find it more convenient to use simulated hardware rather than real hardware. Early in the project, the real hardware may still be under development. Later, using simulated hardware lets us avoid potential overhead costs of cross-development (e.g., uploading the program to the real hardware). Moreover, it’s often difficult to test error-recovery code for errors that occur only rarely; using simulated hardware, we can sidestep this problem by programming it to emit a failure signal consistently.

A simulator in C++ can mimic actual hardware remarkably well. In this session, we’ll show you how to use operator overloading, user-defined conversions, and other C++ features to simulate not just complete hardware devices, but individual hardware registers. With this approach, the code that interacts with simulated device registers can be nearly identical to the code that interacts with real hardware.

Ben Saks

Ben Saks

Ben Saks is the chief engineer of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. Ben represents Saks & Associates on the ISO C++ Standards committee as well as two of the committee’s study groups: SG14 (low-latency) and SG20 (education). He has spoken at industry conferences, including the C++ and System Software Summit, the Embedded Systems Conference, NDC Techtown, and CppCon, where he’s also chair of the Embedded Track and a member of the program committee. Ben previously worked as a software engineer for Vorne Industries, where he used C++ and JavaScript to develop embedded systems that help improve manufacturing productivity in factories all over the world. He’s also a contributing author on multiple Vorne patents.