Great! My blog is in its third decade now.
Happily declaring that the project is getting close to the end. This week the final main functionality has been added to it. The project now has the ability to compile the user C++ code, synthesize the top module and finally merge the bistream file and the elf file. Although everything is running correctly, the code has some small bugs here and there. So this week I had to fix things up, modify some part of the code, and start documenting what I have been doing so far. So in next few paragraphs I’ll try to describe the things I modified or added to the code… Let’s get started!
Have you ever written a piece of code and then got back to it after couple of months and after that wondered What the hell you were thinking of when you first wrote it ? hhhhh… that exactly what happened to me this week !!! The code was kinda messy and sometimes there’s some simpler way to work around the problem and I found myself took the complicated way to do it. Any way this could consider a good sign… The way I do programming now is different from the way I used to… Meaning that there’s some kind of improvement! Nice.
The most significant contribution I added this week was regarding the generation of the SOC function. I found that I had missed very important thing which was setting the “select bit”-selbitm parameter- for each 1-4 switch. Each switch will select certain bits in the address that comes from the processor to choose between the devices connected to it. The selection bits is actually based on the layer the switch resides on. Simply put, if we have for example 16 I/Os, five 1-4 switches are needed. The first switch will select between the 4 switches (first layer) and the rest of the switches will select between the the I/os they are connected to.(second layer). In this case the first switch will pick 2 bits from the address for selection(say bit 15 and 14) and the switches in the second layer will pick the lower two (say bit 13 and 12) and so on. So these switches parameters should be set in the top module automatically as the user defined more and more I/os and that what my code has currently the ability to do . 🙂
The rest of changes were not really that significant. They were more into following good coding practice. Just like if you ever open a file for reading or writing you have to make sure that it’s open correctly then you can process it. Test the return of you functions. Process them accordingly and so on.
That is it for this week. Next week I’ll complete the documentation and carry out the rest of issues that might appear.
So ..till next week STAY SAFE.