mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
rle: increase dw automatically when needed
This commit is contained in:
parent
2a2c3af380
commit
d3486dba91
2 changed files with 1 additions and 2 deletions
|
@ -28,8 +28,6 @@ class LiteScopeRunLengthEncoderUnit(Module):
|
|||
def __init__(self, dw, length):
|
||||
self.dw = dw
|
||||
self.length = length
|
||||
if dw < (log2_int(length) + 1):
|
||||
raise ValueError("Not enough bits to encode RLE length, increase dw or reduce RLE length")
|
||||
|
||||
self.sink = sink = Sink(data_layout(dw))
|
||||
self.source = source = Source(data_layout(dw))
|
||||
|
|
|
@ -13,6 +13,7 @@ class LiteScopeLA(Module, AutoCSR):
|
|||
self.data = Cat(*layout)
|
||||
self.dw = flen(self.data)
|
||||
if with_rle:
|
||||
self.dw = max(self.dw, log2_int(rle_length))
|
||||
self.dw += 1
|
||||
self.depth = depth
|
||||
self.clk_domain = clk_domain
|
||||
|
|
Loading…
Reference in a new issue