Skip to content
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

Add RLE encoder #974

Merged
merged 1 commit into from
Jul 19, 2023
Merged

Add RLE encoder #974

merged 1 commit into from
Jul 19, 2023

Conversation

rw1nkler
Copy link
Contributor

@rw1nkler rw1nkler commented May 23, 2023

This PR adds a simple implementation of the RLE Encoder (Run Length Encoding). The introduced changes contain the RLE encoder, tests for the module, rules for Verilog generation, and rules to build IR and Verilog benchmarks.

The changes rely on other features added in separate PRs:

Fixes #994

CC @proppy

xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
@rw1nkler rw1nkler force-pushed the 44586-rle-encoder branch 2 times, most recently from 17ad391 to 69909d5 Compare May 23, 2023 20:36
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
@rw1nkler
Copy link
Contributor Author

Please let me know when you are satisfied with the changes. Then, I will rebase the code to provide a clean git history.

xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
@proppy
Copy link
Member

proppy commented Jun 26, 2023

I think this is ready to import, most of the changes I requested are purely cosmetic.

@mtdudek mtdudek force-pushed the 44586-rle-encoder branch 2 times, most recently from 759ce52 to 058c04e Compare June 26, 2023 09:41
@mtdudek
Copy link
Contributor

mtdudek commented Jun 27, 2023

@proppy can you take a look? Unfortunately I can't mark comments as Resolved.

xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
xls/modules/rle/rle.x Outdated Show resolved Hide resolved
@proppy
Copy link
Member

proppy commented Jun 28, 2023

This is ready to copybara import (remaining comments are mostly cosmetic).

@mtdudek
Copy link
Contributor

mtdudek commented Jun 28, 2023

I'll change RLEEnc to RunLengthEncoder and squash all commits into single in preparations for merging

xls/modules/rle/BUILD Outdated Show resolved Hide resolved
Currently, only a simple implementation is provided,
which has no optimizations related to the RLE algorithm.

The provided tests check if:
* output of the encoder matches the expected values
* sum of received symbols adds up to the amount of sent symbols
* received symbols don't repeat unless the RLE counter overflowed or the
  end of transmission was requested (using `last` flag)

Additional bazel rules added in this commit include:
* Verilog code generation
* IR benchmark generation
* Verilog benchmark generation

Internal-tag: [#44560]

Co-authored-by: Maciej Dudek <mdudek@antmicro.com>

Signed-off-by: Robert Winkler <rwinkler@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
@proppy
Copy link
Member

proppy commented Jul 17, 2023

@mtdudek actually, I just realized that if we want to land this and #1006 concurrently we need to decouple the BUILD file too. Do you mind if we split this in separate directory and then unify them in a follow up PR (sorry for all the back and forth on this).

@copybara-service copybara-service bot merged commit 287d260 into google:main Jul 19, 2023
@mtdudek mtdudek deleted the 44586-rle-encoder branch July 19, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add DSLX sample for Run Length Encoding (RLE) encoder/decoder
3 participants