AI-Driven Software Design and Development for AURIX TC4x in MATLAB and Simulink - MATLAB & Simulink
Video Player is loading.
Current Time 0:00
Duration 18:09
Loaded: 0.90%
Stream Type LIVE
Remaining Time 18:09
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected
    Video length is 18:09

    AI-Driven Software Design and Development for AURIX TC4x in MATLAB and Simulink

    Mateusz Chmurski, Senior Engineer, Infineon

    The traditional approach to embedded software development is burdened with many potential pitfalls, such as vulnerability to errors and time-consuming development, due to manual peripherals configuration and interprocess communication. This presentation introduces a model-driven approach for embedded software development based on Simulink® models to overcome these disadvantages. Based on an automotive-based use case—trajectory control—we will demonstrate a best practice example of end-to-end development and deployment of AI-enhanced embedded applications. Using the SoC Blockset™ support package for Infineon AURIX™ TC4x, all necessary hardware components like CPUs, hardware accelerators, peripherals, memory units, and IPC components can be easily configured and simulated from the level of GUI. This example application can be easily distributed on several CPUs and parallel processing units, enabling efficient execution of the neural network. Learn how Simulink enables you to generate an optimized code and build the final software for the Infineon AURIX TC4x platform.

    Published: 3 Jun 2024

    Today, I am going to revolutionize your view on AI. Actually, on a development of AI-embedded applications. But before we get into the details, what is-- there is the question which you should-- which we should consider. What is your first thought when you are thinking about embedded software development? Of course, with particular emphasis on AI.

    So first of all, for sure, one of the first associations will be linear algebra. Then, of course, your AI algorithm need to be implemented using C+ or C++ programming languages-- language.

    Yes, and basically, it increases your engineering effort and it takes a lot of time. But let's assume we are forgetting about those challenges. Yes. And basically, we can streamline the whole process. Clicking several buttons, generate code, build, and flash. Yes. And watching this talk, actually, you're going to learn how to make your life easier and how to speed up-- how to reduce the time-to-market of your AI-embedded applications.

    So, let's start with a short introduction of the agenda. So first of all, we will discuss the challenges related to-- related to conventional embedded software development. And I will show you the proposed solution and advantages of the proposed solution. Next point will be, actually, you will learn how to do this. What are the tools enabling you to do this? And I will compare both approaches.

    And cherry on top. So stay tuned, will be actually practical example how to do this. It will be example based on automotive application. And in the end, we will summarize-- I will summarize my presentation.

    So, embedded software development. So, let's assume you want to develop trajectory controller. And you want to enhance this controller by some AI component, making this controller adaptable to different scenarios. Yes. But as I mentioned already, then you need to implement everything in C, C++. What implies-- and you need for sure, you need to spend a lot-- many hours on debugging and improving your software.

    So it implies for you and for your team substantial engineering effort, yes. But maybe you would like to use some peripherals on your microcontroller. Then you need to somehow talk to this hardware. And in this case, you need to-- for sure, you need to have some knowledge about this hardware, and you need to have experience with corresponding KPIs.

    In case of software development for AURIX, it will be experiencing in Infineon low level drivers. Yes. But when the number of functionalities in your project is increasing, then at some point, at some point, you can be in the middle of nowhere being burdened by high error rate and not being able to localize the potential source of errors.

    But let's assume, OK, you have your-- you developed your software, you tested it, but maybe you would like to test it on a different-- on different device. And testing-- and porting your software, porting your code to different device can be more challenging than expected. And it can be related with low reusability rate.

    And now we are forgetting about those disadvantages and we are proceeding to propose solution. So imagine yourself, you have some software components which can be easily converted into optimized C code or C++. It depends which programming language you will choose in the settings. So it will decrease your engineering effort, yours and your team.

    Imagine yourself, those components are available in the form of-- some components available from the level of graphical user interface. And they can be very easily configured. Yes, streamlining the whole process, and at the same time, contributing to lower error rate. But the most important is that you can test, you can regenerate your code with changing just one setting. We can-- you can regenerate your code for different target platform, and at the same time, you can maximize the reuse of your-- of already existing projects.

    And the vision of Infineon is to provide software components, Simulink components, enabling the simulation of your-- enabling the simulation of your software, and generation of optimized code for AURIX TC4X.

    OK. So far, so good. But what are the tools which are going to enable customers to do that? So there are several tools in the arsenal-- in the development arsenal. So, let's continue with this trajectory control example. But now we are forgetting for a while about AI. Let's assume you develop your controller, you validated it in the simulation environment, and then embedded code that is coming into the game.

    Embedded code, that is the tool which generates the C code, or C++. This code can be compliant with AUTOSAR or MISRA standards, yes. But this code is portable. So it's not optimized for the given microcontroller. Yes. And now, you are thinking yourself, OK, so I would like to make my solution adaptable, and I would like to test my solution on multi-core SoC.

    So SoC Blockset that is coming into the game, which is the plugin for Embedded Coder. And it enables simulation of algorithms on multi-core SoCs and code generation for multi-core SoCs. Yes.

    But in this situation, the code is still unoptimized. And then the next tool is coming into the game, Hardware Support Package. OK, so we developed our application, we generated the code. Yes. Without Hardware Support Package, code is basically not optimized. And it requires from you a lot integration effort. You need to integrate the generated code into some idea-- into some programming projects structure. So manual coding is required.

    And of course, it takes you a lot of time and increases the complexity of the whole project. So it leads to-- it can lead to errors. And with HSP, you can generate the code for-- which is optimized for AURIX. Yes. And the support-- and basically, the support for new peripherals in the Hardware Support Package will be added successively in new releases of MATLAB.

    It brings us to the next point. Yeah. We have already-- we can assume, we have already optimized code. And now, probably you would like to generate binary, which will be executed on hardware.

    So, there are several third-party compilers which are integrated into MathWorks' toolchain. In case of code compilation for TriCore, we are talking about tasking Green Hills and HighTec compiler. And when you want to compile the generated code for PPU, then we are talking about Synopsys ARC Compiler. Yes. And I will mention it again. Hardware Support Package is based on Infineon low-level drivers, so the code is always optimized.

    OK, so now the short comparison of both approaches. Yeah, so we can assume, we develop already our AI-enhanced trajectory controller in the form of Simulink model. Yes. Everything is ready. Everything is validated. Then, as SoC Blockset, as I already mentioned, is coming into the game. You generate the code for PPU and for TriCore. And using corresponding compilers, you generate the binary file, which you can execute on AURIX TC4X. Yes.

    And in the conventional software development pipeline, you need to implement everything from scratch. You need to sacrifice much more time for the first solution. And it brings us to the-- it brings us to the real-life example, which is indeed AI-enhanced trajectory controller.

    Yes. But before the appropriate example, I will explain you what trajectory controller really is. So imagine yourself, you have an autonomous car, and in this car, there are several modules. There is sensing module giving you information about surrounding objects. Then information about surrounding objects is sent to scene understanding module, which generates the planned maneuver.

    And this plant maneuver is input to planner module, which counts-- which generates the planned trajectory, which is the baseline for the trajectory controller. And trajectory controller keeps your vehicle on the trajectory which should be followed. Yes.

    And in our experiments, we proved that enhancement of trajectory control algorithms by AI can increase the tracking accuracy by roughly 50%. It will be shown on the next slide. And the energy efficiency of trajectory planning can be increased in case in ACC use case, by up to 10%. Yes.

    And it brings us to-- first of all, to conceptual example. So both applications, conventional control algorithm can be-- sorry, both applications, it means neural network tuner and conventional control algorithm can be partitioned between two cores, between our PPU vector processor and between TriCore. Yes. And then using corresponding tools, you can generate code and corresponding binaries. Yes.

    It was on the conceptual level. And now it brings us to the practical-- to the real-life tested example implemented in Simulink. So, as it was mentioned, the conventional control algorithm is executed on TriCore. It's on the left. Then the neural network tuner is executed on PPU on the vector processor. You can set inter-process communication between both cores. And, of course, you can set the cycling of both cores using task scheduler element.

    And regarding internals of both submodels-- of both reference models, in case of controller, it's nothing more than the PID controller. And regarding the AI component, it's block which loads the neural network trained in TensorFlow, Keras framework, or in any other framework supporting Open Neural Network Exchange format. Yes.

    And it's easy, as I said. Then you are just clicking configure, build, and flash. And you can validate your software, comparing the steering angle coming from execution on the left on silicone. This is a screenshot from Lauterbach debugger, and comparing it with execution in simulation environment. Yes.

    And the demonstrated example has been developed in the closed-loop simulation environment using CarMaker and MATLAB. Then it has been tested at Nurburgring. And maybe some information for you. And the performance of trajectory controllers-- main metric for performance measurement of trajectory controllers is so-called cross-track error, which is the lateral deviation of your car from the middle of the planned trajectory.

    And as you can see, the AI enhancement brings significant improvements because cumulative cross-track error is roughly 50% smaller. And regarding some performance measures, the memory footprint of the neural network is just 37 kilobytes. And single-inference time takes about 3.5 microseconds, which is several magnitudes below the safety limit. And execution of the standard PID controller is 0.63 microseconds. Yes.

    And when we compare both controllers, the non-AI and AI-enhanced controller, particularly between 600 and 1,000 second, you can see that AI enhancement-- AI-enhanced controller, behaves in, let's call it, more stable way. And the cross-track error is smaller.

    So summing up, summing up, with SoC Blockset, you can develop very advanced applications with particular emphasis on AI applications, on vectorization of your applications, on our vector processing parallel processing unit. Using model-based-driven development paradigm, you can maximize the re-usage of your existing projects because you can easily change the target platform.

    And at the same time, you do not need so much knowledge and so much experience. So the engineering effort can be significantly decreased. And the last point, Infineon offers basically the whole ecosystem for model-driven development. And it sums up my presentation. Thank you for your attention and thank you.

    [APPLAUSE]

    View more related videos