Skip to content

Commit d28d81b

Browse files
committed
review: Update adv rle enc documentation
Signed-off-by: Maciej Dudek <[email protected]>
1 parent 66ff962 commit d28d81b

7 files changed

+23
-34
lines changed

xls/modules/rle/rle_dec.x

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ proc RunLengthDecoderZeroCountTest {
285285
(tok)
286286
}(tok);
287287
send(tok, terminator, true);
288-
()
289288
}
290289
}
291290

xls/modules/rle/rle_enc_adv.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ the last packet the encoder dumps all the data to the output stream.
2222
- symbol counter is 2 bits wide.
2323

2424
### Process
25-
1. Reduce step - this process takes incoming symbols and symbol_valid
26-
and reduces them into symbol count pairs. This step is stateless.
25+
1. Reduce step - this process takes incoming symbols, symbol_valid,
26+
last signal and reduces them into symbol count pairs. Last value is
27+
passed through, so it's omitted from the example IO. This step is stateless.
2728

2829
Example:
2930

@@ -38,7 +39,8 @@ Example:
3839

3940
2. Realign step - this process moves pairs emitted from the reduce step
4041
so that they are aligned to the left, it also calculates propagation
41-
distance for the first pair.
42+
distance for the first pair. This stage doesn't modify last signal value,
43+
so it's omitted in the example.
4244

4345
Example:
4446

@@ -54,9 +56,13 @@ the realign step, and combines them with its state to create multiple
5456
symbol/count pairs output. State is represented by following tuple
5557
`<symbol, count, last>`. It contains symbol and count from last pair
5658
received from the realign step, or current sum of repeating symbol spanning
57-
multiple input widths.
59+
multiple input widths.
5860

59-
Example:
61+
First set of examples assumes that state doesn't have last set nor
62+
was last received. Second set of examples will indicate value of last
63+
signal in the proc state or input data and how it's emitted to output.
64+
65+
Example set 1:
6066

6167
|||||
6268
|------|-----|-------|----------|
@@ -67,6 +73,17 @@ Example:
6773
|state |input|output |next state|
6874
|(A, 1)| [(A, 1), .., .., ..]|[.., .., .., ..]| (A, 2)|
6975

76+
Example set 2:
77+
78+
|||||
79+
|------|-----|-------|----------|
80+
|state: pair, last |input|output |next state|
81+
|(A, 2), false| [(A, 2), (B, 2), .., ..], true |[(A, 3), (A, 1), (B, 2), ..], true| (), false|
82+
|state: pair, last |input|output |next state|
83+
|(A, 1), false| [(B, 1), (C, 1), (D, 1), (A, 1)], true|[(A, 1), (B, 1), (C, 1), (D, 1)]| (A, 1), true|
84+
|state |input|output |next state|
85+
|(A, 1), true| no data taken from input |[(A, 1), .., .. , ..], true| (), false|
86+
7087
4. Adjust Width step - this step takes output from the core step.
7188
If output can handle more or equal number of pairs as
7289
input number of symbols. This step does nothing.
@@ -82,4 +99,4 @@ Example:
8299
|state|input|output | next state|
83100
|[]|[(A, 1), (B, 1), (C, 1), (D, 1)]|[(A, 1), (B, 1)]|[(C, 1), (D, 1)]|
84101
|state|input|output | next state|
85-
|[(C, 1), (D, 1)]|ignored|[(C, 1), (D, 1)]|[]|
102+
|[(C, 1), (D, 1)]|ignored|[(C, 1), (D, 1)]|[]|

xls/modules/rle/rle_enc_adv.x

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ proc ConsumeMultipleSymbolRepetitionsAtOnce {
208208
}(tok);
209209

210210
send(tok, terminator, true);
211-
()
212211
}
213212
}
214213

@@ -273,7 +272,6 @@ proc ConsumeMultipleSymbolsAtOnce {
273272
}(tok);
274273

275274
send(tok, terminator, true);
276-
()
277275
}
278276
}
279277

@@ -344,7 +342,6 @@ proc ConsumePacketWithInvalidSymbols {
344342
}(tok);
345343

346344
send(tok, terminator, true);
347-
()
348345
}
349346
}
350347

@@ -411,7 +408,6 @@ proc ConsumePacketWithAllDiffSymbols {
411408
}(tok);
412409

413410
send(tok, terminator, true);
414-
()
415411
}
416412
}
417413

@@ -480,6 +476,5 @@ proc ConsumePacketsWhereLastSymbolRepeats {
480476
}(tok);
481477

482478
send(tok, terminator, true);
483-
()
484479
}
485480
}

xls/modules/rle/rle_enc_adv_adjust_width_stage.x

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ proc PacketContainsOnlyLast {
210210
}(tok);
211211

212212
send(tok, terminator, true);
213-
()
214213
}
215214
}
216215

@@ -275,7 +274,6 @@ proc InputPairCountLessOrEqualOutputWidth {
275274
}(tok);
276275

277276
send(tok, terminator, true);
278-
()
279277
}
280278
}
281279

@@ -342,7 +340,6 @@ proc InputFullyFilled {
342340
}(tok);
343341

344342
send(tok, terminator, true);
345-
()
346343
}
347344
}
348345

@@ -412,7 +409,6 @@ proc CombineStateWithNextInputPairs {
412409
}(tok);
413410

414411
send(tok, terminator, true);
415-
()
416412
}
417413
}
418414

@@ -486,7 +482,6 @@ proc PairStateCombineWithStateUpdate {
486482
}(tok);
487483

488484
send(tok, terminator, true);
489-
()
490485
}
491486
}
492487

@@ -558,6 +553,5 @@ proc NoStateSipllAfterLast {
558553
}(tok);
559554

560555
send(tok, terminator, true);
561-
()
562556
}
563557
}

xls/modules/rle/rle_enc_adv_core.x

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ proc PacketOnlyWithLastSet {
281281
}(tok);
282282

283283
send(tok, terminator, true);
284-
()
285284
}
286285
}
287286

@@ -358,7 +357,6 @@ proc CombineWithoutOverflow {
358357
}(tok);
359358

360359
send(tok, terminator, true);
361-
()
362360
}
363361
}
364362

@@ -437,7 +435,6 @@ proc CombineWithOverflow {
437435
}(tok);
438436

439437
send(tok, terminator, true);
440-
()
441438
}
442439
}
443440

@@ -518,7 +515,6 @@ proc CombineAfterStateChange {
518515
}(tok);
519516

520517
send(tok, terminator, true);
521-
()
522518
}
523519
}
524520

@@ -593,7 +589,6 @@ proc CombineStateWithLastPacket {
593589
}(tok);
594590

595591
send(tok, terminator, true);
596-
()
597592
}
598593
}
599594

@@ -664,6 +659,5 @@ proc NoStateSipllAfterLast {
664659
}(tok);
665660

666661
send(tok, terminator, true);
667-
()
668662
}
669663
}

xls/modules/rle/rle_enc_adv_realign_stage.x

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub proc RunLengthEncoderAdvancedRealignStage<
6262
}
6363
} ((u32:0, symbols[u32:0], counts[u32:0] != bits[COUNT_WIDTH]:0));
6464
send(tok, output_s, (output, prop_count, end));
65-
()
6665
}
6766
}
6867

@@ -175,7 +174,6 @@ proc RunLengthEncoderAdvancedRealignStageNoPairs {
175174
(tok)
176175
}(tok);
177176
send(tok, terminator, true);
178-
()
179177
}
180178
}
181179

@@ -250,7 +248,6 @@ proc RunLengthEncoderAdvancedRealignStageAllPairsFilled {
250248
(tok)
251249
}(tok);
252250
send(tok, terminator, true);
253-
()
254251
}
255252
}
256253

@@ -325,7 +322,6 @@ proc RunLengthEncoderAdvancedRealignStageFarAwayPair {
325322
(tok)
326323
}(tok);
327324
send(tok, terminator, true);
328-
()
329325
}
330326
}
331327

@@ -400,6 +396,5 @@ proc RunLengthEncoderAdvancedRealignStagePropagataion {
400396
(tok)
401397
}(tok);
402398
send(tok, terminator, true);
403-
()
404399
}
405400
}

xls/modules/rle/rle_enc_adv_reduce_stage.x

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ pub proc RunLengthEncoderAdvancedReduceStage<
6363
let not_empty = input.last ||
6464
or_reduce(std::convert_to_bits_msb0(input.symbol_valids));
6565
send_if(tok, output_s, not_empty, output);
66-
()
6766
}
6867
}
6968

@@ -172,7 +171,6 @@ proc RunLengthEncoderAdvancedReduceStageNoSymbols {
172171
(tok)
173172
}(tok);
174173
send(tok, terminator, true);
175-
()
176174
}
177175
}
178176

@@ -239,7 +237,6 @@ proc RunLengthEncoderAdvancedReduceStageNonRepeatingSymbols {
239237
(tok)
240238
}(tok);
241239
send(tok, terminator, true);
242-
()
243240
}
244241
}
245242

@@ -306,7 +303,6 @@ proc RunLengthEncoderAdvancedReduceStageRepeatingSymbolsNoOverflow {
306303
(tok)
307304
}(tok);
308305
send(tok, terminator, true);
309-
()
310306
}
311307
}
312308

@@ -373,6 +369,5 @@ proc RunLengthEncoderAdvancedReduceStageRepeatingSymbolsOverflow {
373369
(tok)
374370
}(tok);
375371
send(tok, terminator, true);
376-
()
377372
}
378373
}

0 commit comments

Comments
 (0)