 So, hi everyone. My name is Tomášek Lozár, and I prepared a presentation about the disadvantages of Arduino and trying to fix them using LLVM. I am a high school student in the last grade, and I also work as an intern in the OSN application, OSN application modernization group at Redhead here in Bernal. This is the same team which develops LEAP, but I don't work on LEAP, I work on Divcamp, on which Viktor had a presentation today. And now briefly what exactly is Arduino. Arduino is an open source hardware and software company and project, and it's also the name of their AVR, mostly AVR-based microcontroller boards, and also the platform for developing software for those boards. The platform consists of three parts. One part is an IDE based on processing. The second part, they sometimes call it a programming language, but it's actually a library called wiring, and there is some preprocessing that adds something to the file, and then it goes normally to AVR-GCC. So, it's C++ compiled using GCC, it's not a special language. So, this is the most common board that's used. It's called an Arduino Uno, and you can see the chip here. It's an AVR chip. It's called an ATMEGA 328B, and now to the advantages of using Arduino. It's much easier to use for developers that are not familiar with AVR, because you don't have to have the knowledge of registers, interrupts, and the low-level things like that. And there are also plenty of tutorials online, and you can use object-oriented programming like C++, and you have the libraries prepared for that. Another great advantage is that many libraries for peripherals are available online, and you can't get them as easily for the components if you didn't use Arduino. And also, the board is designed that you don't need to have that much of knowledge of electronics. Of course, this has also some disadvantages. One disadvantage is that the library is quite large, and it feels a significant portion of the limited memory of the chip, but this disadvantage is mostly fixed by using link-time optimization that leaves out the unused functions. Another thing, and this is the thing I am optimizing in this project, is the calculation of port registers and masks from the pin number every time you want to write something to a pin. And this takes a lot of time. There are also some other disadvantages like the SD card library lacks some functions. You can't read continuously, and it's slow, but I won't be solving this thing here. So why use LLVM with Arduino? The main reason is that you can write LLVM passes, and you can optimize the code in the LLVM IR bytecode, and you can, it's possible to replace the calls to the IO functions that take a lot of time and make the IO much faster this way. And also, you can implement other languages like Rust. There is a project on GitHub, you can use Rust on AVR. And when developing this, there is also a possibility of improving the LLVM AVR backend. So the problem is that the backend is experimental, and you have to actually compile a custom compiler to get it, and it contains quite many bugs. Like it can't link AVR, so you have to use AVR GCC for that. And it's now merged into upstream. It was originally developed outside of the LLVM project. So using C-Lank with Arduino, C-Lank is a C compiler for LLVM. We have to disable link time optimization, because the linking doesn't work. And the link time optimization works like it compiles it to the IR first, and the AVR GCC can't handle that, so that has to be disabled. And also some parts of Arduino don't work because of bugs in LLVM. Like the interrupt table had to be removed because LLVM won't handle function pointers in an array. And as I already said that GCC is used for linking. So now to the optimization of IO. This concerns the function's digital read and digital write. And they take a pin number, which is numbered in some way using the Arduino numbering. And this has to be converted to the native way of writing to the pins. Here is a picture which shows that the digital pin numbers correspond to the ports. And it's implemented like there is a register which contains eight bits. And each bit is one of the pins, like PC0, PC1. That's one register. And when you write to the digital pins, the numbers, this has to be recalculated and this takes time. So I implemented an LLVM pass that removes the calls to the function digital write and translates them at the time of the compilation. And for the testing, I used this simple program which simply blinks the built-in LED at the maximum speed. And when you measure the frequency using an oscilloscope, you can see that in the picture on the left, this is the original function from the Arduino library or from wiring. The frequency is around 144 kilohertz, while with my optimization, the frequency is about two megahertz. There are other opportunities how to improve the library, like removing unused functions and variables from the binary, which is the link time optimization, which AVRGCC can do that too. But in LLVM, this doesn't work at this time because of the reasons I talked about earlier. And we can also optimize analog IO, not only the digital IO, and the problem with the SD card can be fixed by adding a function to the library and when you want to process the data, a function pointer can be used. So where you can find the project, I have uploaded it to GitHub. It has two parts. One is hardware directory inside the Arduino IDE, which is configured to use CLANK instead of GCC. And the second part is the pass which optimizes the IO. So that's all. And now it's time for your questions. It takes so much time because it has to take the number. It has to look in some table which port it is. Then it has to calculate it to a mask. It first reads the state of the port register. Then it needs to change only the one bit in it. It needs to calculate which bit it is. And then it can do the actual writing. And it's of course unnecessary to do this while running the application when you can do this in the compilation. So if you don't have any other questions, then...