Team’s Status Report for 03/26/2022

This week, we made progress on two fronts. On the hardware front, Jeremy and Ziyi worked on getting the Vitis HLS build to work on the stripped down version of Scotty3D; on the software front, Alice worked on having Scotty3D read particle postions from a preloaded file for stepping through a simulation.

In terms of hardware, we managed to get the C simulation build option to work and run a small testbench. While this was a good start for getting the binary built, we realized that we still had a long way to go before we could get C synthesis to work. The biggest hurdle is that the C synthesis seems to run on an older version of C++, with a bunch more restrictions and caveats on what can actually get compiled into hardware. Many features that the C simulator readily worked with, the C synthesis just outright refused to cooperate with. Still, despite these setbacks, we believe that we are quite close to a breakthrough for the C synthesis. Once we finally get a working build, we will get the area estimates and also get some timing reports from putting the binary on the Ultra96 development board and running it. It is also worth noting that in our endeavors to get a working build, we  alsorefactored the par_for, seq_for, and for_n (for neighbors) lambda functions into separate, discrete for loops. Though this reduces code reuse, it is important in that it allows us to specifically reconfigure the different instances of these loops so that we can more deliberately assign hardware resources as opposed to accelerating all of the different loops with the same parameters (which would otherwise be hard coded in the lambda functions themselves).

In terms of the Scotty3D interface, we were successful in getting Scotty3D to run a precomputed set of points. Of course, this resulted in a lightning fast visual simulation within the Scotty3D engine, which provides a compelling example of the benefit of hardware accelerated precomputation. Nevertheless, though this is not as interesting as a real-time demo, it is a significant step in the right direction. The next major goal on the interface side is to enable UART communications between the FPGA and a host computer to transfer live simulation data. This will be an essential step to having  the real-time simulation. Of course, we will also have to investigate the UART bandwidth to see if we can keep up with frames per second latency demands of the simulator.

Jeremy’s Status Report for 03/26/2022

This week I was primarily working with Ziyi on getting the code in the C++ build environment to work well with the Vitis HLS build. We spent a while improving the portability of the code as Vitis has a set of specific requirements, and does not work well with very modern C++ code that is generic for many purposes. Vitis HLS has very cryptic error messages, so progress is steady but slow on getting this to work. There is a lot of trial and error involved in figuring out what is causing errors, and it is tricky to figure out how to redesign the code to fix it. We also began to work on optimizations for the fluid simulation, initially by starting to unroll loops, which creates larger parallelism and hardware utilization.

I think that we are on track to complete our project on time, but slightly behind where I would like to be at this point. It is good that we left ample slack in our schedule. Next week I want to continue to work on optimizing the implementation, and also work with Alice on communication between the FPGA and CPU to display the output of our renders.

Alice’s Status Report for 03/26/2022

In my last update, the main goal I wanted to tackle was getting Scotty3D to read from a text file of particle positions and be able to step through the simulation frames. I was able to fully accomplish this goal for this week, and additionally gained a good understanding of scene loading code in the codebase. I anticipate this will be handy for nice-to-have features if we have the time.

The next major goal for me is to get the FPGA to send the particle position data over UART (serial USB) to Scotty3D and step through the simulation. I realized once I got the simulation working from the text file that a real-time demo will be significantly more compelling, since a pre-computed simulation does not give an accurate visual perception of how much the FPGA can accelerate the fluid simulation. To clarify, real-time demo is not in our MVP, but since Ziyi and Jeremy are still working through build issues I believe this is the most important task that I can be working on right now.

However, since the Vitis HLS project is not working yet (which is necessary for me to do the above), my goal for next week will be to get the Chamfer Distance evaluation script working with the Scotty3D fluid simulation outputs.

I’ve had a really great two weeks so far with progress, and. I am a little concerned that build issues are still taking us this long to work through, but since we’ve stripped down Scotty3D to just the core simulation files on the FPGA I’m feeling OK about us getting the Vitis HLS build completely working in the near future.

Ziyi’s Status Report for 03/26/2022

At the start of this week, Jeremy and I managed to get the C simulation build to pass in Vitis HLS. While we were quite happy at this initial success, we quickly realized that we still needed a lot more work to get the C synthesis working. One thing that majorly complicated this task was that the C synthesis build script would fail pre-synthesis without actually printing any errors. However, after poking around on the Vitis forums and ticking some specific compilation boxes, we could finally read some of the error logs. As it turns out, most of our problems were just version and build conflicts with different C++ features. For instance, while we were able to get away with the auto function type for our lambda functions in simulation, the synthesis compiler got a bit angry at us. Right now, we are still trying to resolve these issues and hopefully synthesize some version of the kernel soon.

In the process of fixing these compilation errors, we also got started on our optimization work. One major task that we did this week was that we got rid of all instances of par_for, seq_for, and for_n, which – respectively – iterated a function over the particles parallelly, iterated over the particles sequentially, and iterated over the neighbors of each particle. This is a major step, as it allows us to manually control the unroll parameters of the kernel on a per-loop basis, rather than applying a single pragma en masse.

Other than slowly grinding through the myriad waves of compilation errors, there is nothing too much to schedule and to report. Still, once we get a working build of the binary, we’ll throw it onto the FPGA and get some timing values reported. We’ll also need to get a survey of the resource utilization of the base implementation. We envision that this will be done by next week.

Ziyi’s Status Report for 03/19/2022

Most of my effort this week was spent on getting a lightened version of the fluid simulation kernel to build on Vitis HLS. This comes as a transition in our priorities to better make an MVP target for our project. Specifically, we were interested in implementing a “headless” version of the simulation kernel, where the only thing that we would specifically need to run is the step2 function in the fluid simulation kernel. We decided that all of the rest of the rendering tasks are not as pressing and should thus be handled at a later point.

Much of the work of this week was setting up the Vitis HLS project on the ECE number machines. We were running into some significant build issues running on Alice’s computer, and the documentation online was frustratingly sparse. As such, in order to make some breakthroughs in our project, we decided to transition to the existing, working, setup that 643 uses. Setting up the project took a bit of work, but we were eventually able to resolve a lot of the bulid issues and get the C simulation task to build. A large part of this task was refactoring parts of the code to remove C++17 artefacts and using different versions of the different libraries that the Scotty3D library depends on.

Right now, we are still trying to figure out how to get the C synthesis to fully build. It is a bit difficult at the moment, as the synthesis log is not actually highlighting the error. However, I think it might have something to do with the tool inferring multiple TOP functions.

Obviously, the goal for next week is to get a working version of C synthesis running.

Alice’s Status Report for 03/19/2022

In my last update, the main goal I wanted to tackle was figuring out what to put on the FPGA, since we were discovering some crashing issues when loading the CPU too much and also installation issues regarding OpenGL. So we decided to make an architecture change, such that the FPGA platform will only perform the fluid simulation algorithm. In other words, it will take an array of 3D positions and output an array of 3D positions for each frame, and save that to a file such that a host computer that is able to run Scotty3D can load in the simulation file and play the fluid simulation.

The major task I accomplished for this week was stripping the fluid simulation code of extraneous dependencies such that the number of files loaded into the Vitis HLS would be minimal. I also worked with Jeremy and Ziyi to rewrite portions of the code that were using modern C++ features, and am currently working on loading a text file of 3D positions into keyframes for the animatino. I am making good progress already and am confident that I can finish this for next week.

Next week will be critical since we have a demo coming up, so in addition to getting the text file loaded into Scotty3D I will be working on figuring out the FPGA–> host computer communication. Since we have finally gotten the Vitis HLS project to build, I am feeling great about our progress going forward.

Team Status Report for 03/19/2022

At the moment, the most jeopardizing issue we have is figuring out how to integrate everything into one package on the board including a display output. As our efforts have been focused on building and accelerating the fluid simulator, we are still unsure about display. We have a variety of backup plans for this issue issue, such as producing a file of the rendered output, and producing the display from somewhere else. This still aligns with our project goals as we are not aiming for a real-time system, and are just trying to accelerate the fluid simulation process.

We decided to make a system change, such that the FPGA platform will only perform the fluid simulation algorithm. In other words, it will take an array of 3D positions and output an array of 3D positions for each frame, and save that to a file such that a host computer that is able to run Scotty3D can load in the simulation file and play the fluid simulation. This system change plays into the category of “request scheduler”, which is shown below.

Jeremy and Alice also swapped responsibilities since Jeremy is more experienced at C++ and digital hardware, and Alice’s knowledge of the Scotty3D codebase is helpful for adding additional features necessary to load the simulation into Scotty3D and getting the FPGA to send over the necessary data to the host computer. Below is the updated Gantt Chart:

Jeremy’s Status Report for 03/19/2022

This week I spent a lot of time trying to wrestle with C++ compilation errors, which were particularly cryptic in the Vitis HLS build environment. The Scotty3D code that we are basing our project on takes advantage of a lot of modern C++ features, and although these are good practice for general programming, they make stripping down the general codebase to what we need fairly tricky. But, after resolving several build errors and restructuring the code, we are able to build and run in the Vitis HLS environment. I also worked on beginning to implement some loop unrolling and allowing for parallelism in hardware.

I think that we are working at a steady pace, and are on track to complete our goals. Especially now that we have a steady build flow working, I think that we will be able to make smooth progress now. Next week I hope to make more progress on working on the acceleration, and also figure out a preliminary method for displaying our output, and work towards figuring out a final version of displaying output.