-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring of C code for encoding and decoding #8
Comments
Just one correction: if what we discussed on Thursday hasn't changed, then I will fix the RTL for the custom instruction Can you assign Adam to this task then? |
Pefectly fine for me. |
@kstrohmayer @mole99 I have a separate repository for RLE algorithm testing in Visual Studio. If you want to run a test while I'm away, just check out the 'rle_encoding' branch and run the 'rle.vcxproj' file. This should open Visual Studio for debugging. If you encounter issues, it might be due to the project not being in Console mode, and you can refer to this article for help: https://www.codeproject.com/Questions/5289599/How-do-I-resolve-my-LNK2019-error-in-my-program |
One of the reasons the data in the buffer wasn't changing correctly is that Mario was rewriting the content of the buffer with Even though I am generating random data bits for each iteration, I only observe some minor changes in the data buffer. However, the data being sent to the |
Might be the case because he only changes the "data word" of the SPI transfer he emulates. |
Does it work now? |
Unfortunately, not yet. The prepare_data function uses a data pointer as a buffer to store the clock, sync, data, and clear signals. However, from my tests, it seems like the data buffer is not handled correctly and doesn't return the correct data to the compression algorithm..
|
Is the required memory for the data buffer allocated? |
Not in the original code. I did add a memory allocation before calling the prepare data function |
The |
Hi Adam, |
That's fine, but I think it would be better to do this either in person or when I can share my screen so we could go through my test results. |
Update: Moved the comment. I mistakenly posted this comment to the wrong issue. Summary of changes There were multiple issues in the encoding process, including incorrect count values, faulty buffer loading, and inaccuracies in tracking the start position and bit values. The incorrect max count values left most signals uncompressed, and the uncompressed signals weren't loaded correctly into the buffer. Inaccuracies in the start position were leading to missing bits and incorrect count values. The handling of last bits between blocks also caused further errors in the count values. To address these issues, I made changes to the counting function, allowing us to count a total of 32 values, from 0 to 31. The tracking of the start position for cntb was also changed to correctly read all bits for each signal and block. It can now accurately count consecutive bits, determine if the signal is compressed, and update the bit values accordingly. However, there's a potential issue with the read function. This function returns the encoded data from a bitstream. While it correctly returns the count value, there might be an error in retrieving the bit value and the not_compressed value. This error could affect the decoding process as well. My next steps involve investigating whether the problem lies within the read function or the way we handle the encoded data buffer. |
I have updated the RLE algorithm to achieve a better compression ratio. Currently, the algorithm no longer relies on the not_compressed flag for storing or decompressing data accurately. This modification has led to a reduced number of bits stored in the bitstream/memory, resulting in an improved compression ratio. With the given sample data, the following reductions have been achieved:
It's important to note that these results are subjective, as they depend on the consecutive bits found in each signal. The CLK signal demonstrates the best result due to its all-one's nature. |
The current implementation of the RLE algorithm, running on the ULX3S FPGA, gives the following results. Measured with Saleae Logic 8 logic analyser. Test Case 1
Test Case 2
Test Case 3
|
CC: @kstrohmayer @mole99 @adam-hrvth
Refactoring of actual C code for testing the custom instruction.
Encoding / Decoding algorithm
Testing
Implement without instruction set extensions
Implement with instruction set extensions
Status
Actual status of the block wise run length algorithm.
C-implementation running on the PC
Implementation without any custom instruction. A function is considered working if it is verified with a self-checking test running at least 10 times with different data.
C-implementation running on the CV32E40X using FPGA
tbd
The text was updated successfully, but these errors were encountered: