Skip to content

Commit 823d5a8

Browse files
committed
xls/modules/zstd: Add rle block decoder
Adds RleBlockDecoder responsible for decoding Blocks of RLE_Block Block_Type as specified in RFC 8878, paragraph 3.1.1.2.2. https://datatracker.ietf.org/doc/html/rfc8878#section-3.1.1.2.2 RleBlockDecoder communicates through BlockDataPacket channels. It reuses existing RunLengthDecoder block which is interfaced through two seprate procs: * RleDataPacker * BatchPacker Which are responsible for converting input data into format accepted by RLE decoder and for gathering RLE decoder output symbols into batches which are then send out through BlockDataPacket. Internal-tag: [#51473] Signed-off-by: Pawel Czarnecki <[email protected]>
1 parent 1a12c5e commit 823d5a8

File tree

3 files changed

+434
-1
lines changed

3 files changed

+434
-1
lines changed

xls/modules/zstd/BUILD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,21 @@ xls_dslx_test(
155155
name = "raw_block_dec_dslx_test",
156156
library = ":raw_block_dec_dslx",
157157
)
158+
159+
xls_dslx_library(
160+
name = "rle_block_dec_dslx",
161+
srcs = [
162+
"rle_block_dec.x",
163+
],
164+
deps = [
165+
":buffer_dslx",
166+
":common_dslx",
167+
"//xls/modules/rle:rle_common_dslx",
168+
"//xls/modules/rle:rle_dec_dslx",
169+
],
170+
)
171+
172+
xls_dslx_test(
173+
name = "rle_block_dec_dslx_test",
174+
library = ":rle_block_dec_dslx",
175+
)

xls/modules/zstd/common.x

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414

1515
pub const DATA_WIDTH = u32:64;
1616
pub const MAX_ID = u32::MAX;
17+
pub const SYMBOL_WIDTH = u32:8;
18+
pub const BLOCK_SIZE_WIDTH = u32:21;
1719

1820
pub type BlockData = bits[DATA_WIDTH];
21+
pub type BlockPacketLength = u32;
22+
pub type BlockSize = bits[BLOCK_SIZE_WIDTH];
1923

2024
pub enum BlockType : u2 {
2125
RAW = 0,
@@ -29,5 +33,5 @@ pub struct BlockDataPacket {
2933
last_block: bool,
3034
id: u32,
3135
data: BlockData,
32-
length: u32
36+
length: BlockPacketLength,
3337
}

0 commit comments

Comments
 (0)