Author: Max

  • Native AI/ML Support in Software Defined Embedded Systems

    Native AI/ML Support in Software-Defined Embedded
    Systems: Leveraging Edge Computing, Intelligent
    Infrastructure, and Resource Optimization

    Author : Archana Sugumar

    Abstract: Software-Defined Embedded Systems (SDES) are evolving to natively support Artificial Intelligence
    (AI) and Machine Learning (ML), enabling real-time decision-making and adaptive control in complex
    environments. This paper explores the integration of AI/ML capabilities into SDES, focusing on sensor fusion,
    timing, trigger mechanisms, and scheduling methods. Additionally, we examine resource optimization
    techniques that enhance computational efficiency across memory, processing, and networking domains.
    Furthermore, the role of 5G Edge Compute, Intelligent Highways, Public Infrastructure, and cloud ecosystems
    in augmenting SDES is discussed. This study synthesizes recent advancements in edge AI, IoT integration, and
    real-time embedded intelligence, providing a roadmap for future research and implementation.

    1. Introduction The convergence of AI, ML, and embedded systems has led to the development of Software-
      Defined Embedded Systems (SDES) that offer enhanced intelligence, adaptability, and resource optimization.
      The integration of AI/ML in SDES allows inference engines to utilize granular services, dynamically allocating
      computing resources for efficient execution. This paper examines how SDES can natively support AI/ML by
      leveraging advanced resource management techniques and distributed computing paradigms such as edge and
      cloud computing.
    2. Sensor Fusion and Real-Time Processing Modern SDES require robust sensor fusion techniques to
      combine data from multiple sources, improving system accuracy and decision-making. AI-powered inference
      engines enable real-time processing by dynamically adjusting sensor fusion requirements based on
      environmental changes.
      Figure 1: AI-Driven Sensor Fusion in SDES (Adapted from Reference 1)
    3. AI/ML-Driven Scheduling and Trigger Mechanisms Efficient scheduling and event-trigger mechanisms
      are essential for optimizing computational workflows in SDES. AI-based scheduling algorithms enhance
      resource allocation, ensuring timely execution of tasks.
      Figure 2: AI-Based Task Scheduling Framework (Adapted from Reference 2)
    4. Resource Optimization in AI-Enabled SDES To maximize performance and efficiency, SDES employ AI-
      driven resource allocation strategies that dynamically manage compute, memory, and networking resources.
      Techniques such as model pruning, data compression, and hardware acceleration are examined to highlight
      their impact on embedded AI workloads.
      Figure 3: Resource Optimization Strategies for Edge AI (Adapted from Reference 3)
    5. Leveraging 5G Edge Compute and Intelligent Infrastructure 5G Edge Computing provides low-latency,
      high-bandwidth processing capabilities that are critical for AI-enabled SDES. The integration of edge AI with
      public infrastructure, such as intelligent highways and smart city frameworks, enhances real-time decision-
      making.
      Figure 4: Role of 5G in SDES AI Integration (Adapted from Reference 4)
    6. Cloud Ecosystem and AI Collaboration Cloud-based AI services provide scalable computing power for
      training and deploying AI models within SDES. This section explores cloud-edge hybrid models that balance
      computational load between embedded devices and cloud servers, optimizing overall efficiency.
    7. Future Directions and Conclusion The future of AI/ML-driven SDES lies in enhancing interoperability,
      security, and energy efficiency. Emerging technologies such as 6G, federated learning, and neuromorphic
      computing are expected to further revolutionize SDES capabilities. This paper concludes by outlining key
      challenges and potential research directions in AI-integrated embedded systems.References:
      • Edge Machine Learning for AI-Enabled IoT Devices: A Review.
        NCBI
      • Optimizing Edge AI: A Comprehensive Survey on Data, Model, and System Optimization Strategies.
        arXiv
      • Integrated Sensing and Edge AI: Realizing Intelligent Perception in 6G.
        arXiv
      • Internet of Intelligent Things: A Convergence of Embedded Systems, Artificial Intelligence, and Internet of
        Things. ScienceDirect
  • C Source code to Executable Instructions

    C Source code to Executable Instructions

    What does this post help you with ?

    Microprocessors only deal with 1s and 0s, and execute instructions at a speed unit of measurement (which is a topic of itself, performance of a processor is also a different topic), we just keep it simple to understand the journey of the source code.

    How does a piece of code written in C become instructions that a processor executes ?

    Let’s assume we are using a Linux based system with GCC to make this journey. The idea is to get a quick introduction, and this is stuff I have gathered over a period of time, so there may be some mistakes (disclaimer)

    High Level Steps

    Compile

    You need a compiler like GCC. What the compiler does : Reads the c code, and creates assembly code. Assembly code is the language that abstracts the actual microprocessor instructions from us. Its still another language sometimes called ASM, not the actual instructions that run on the microprocessor. Why is this step here ? High level language needs to be translated to a lower level language is the bottom line. Optimizations, being able to port the same code to multiple hardware targets (cross compilation), and there are many more reasons.

    GCC has 15Million+ LOC (mostly written in C, about 4GB, as of Jan 2025)

    Compiler does a lot of transformations, and optimizations before it spits out assembly code for the target hardware (the processor and the “Digital Computer Architecture”).

    Compiler internals – Logical units of a compiler – front-end, middle-end, and back-end processing software components.

    Compiler Front End – will read the source code (PARSER), and generate intermediate representation for optimizations

    AST – Abstract Syntax Tree is what the code gets “parsed” into, and the AST represents the entire program code with the nodes and edges representing the syntactic elements of C.

    (GENERIC. GIMPLE - a machine independent representation and
    RTL (Register Transfer Language) used to write machine description - usually determined by hardware architecture x86_64, Aarch64, RISCV, ARM etc)

    Compiler Middle End – 100s of optimizations

    The backend of the compiler – Linker that generates the actual assembly code

    The control flow graph connects these three logical layers of the compiler

    So concepts are good, how do I “see” things. Write your simple helloworld in C first.

    gcc -o helloworld.asm -S helloworld.c
    gedit helloworld.asm

    Assemble

    Use the assembler to generate instructions that can be executed. Okay here, Assembler, takes the different pieces of code you write in different files, folders, and convert them all into a files with instructions. So the Assembler just takes your code, and converts “just” key point, your code.

    Time to check things out for yourself

    as --version
    as -o helloworld.obj helloworld.asm
    objdump -d helloworld.obj

    Link

    Use the linker to do the actual linking and generating the binary executable. Why is this needed ? In your code you have not actually included so much other code that is needed to actually do what you have asked to do. For example, you want to print “Hello World” on the screen. You did not write code to call the display driver and ask it to do the work for you or even make an Operating System abstraction call to do that, you just simply said print ! The linker now has to find what all code (let’s say libraries here) needs to be added to your code to make it do the actual thing. Here is where libc comes into play. Libc is this massive library that does a lot of this for you. Its worth mentioning, as at least for me, that was a missing link, as I want to know all the dots that can connect to make a line, especially the last one.

    here is what you can do in your computer

    gcc -v -o helloworld helloworld.obj

    Linker her is actually not GCC, GCC just calls a program called collect2 which is the linker; and the actual call it made for me:

    /usr/lib/gcc/x86_64-linux-gnu/11/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnGfceH.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o helloworld /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. helloworld.obj -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o

    so here – the linker links to the libc so file – without that a binary cannot be produced.

    good files to review in gcc source code https://github.com/gcc-mirror/gcc.git

    git clone https://github.com/gcc-mirror/gcc.git
    cd gcc

    look for these files

    rtl.def ./gcc/rtl.def gimple.def ./gcc/gimple.def passes.def ./gcc/passes.def RTL based machine descriptors are in *.md files (not to be confused with Markdown files)

    Hope this helps you with whatever you were trying to get out of this page – especially if you are reading this line – leave a comment below, if you found some in accuracy or would like to know something else or just say something