Skip to content

Commit

Permalink
core: define max_payload_size, use dynamic max_request_size/payload_s…
Browse files Browse the repository at this point in the history
…ize for DMA
  • Loading branch information
enjoy-digital committed Nov 4, 2019
1 parent b85c721 commit 04f099f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion litepcie/core/tlp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"ca": 0b011
}

max_payload_size = 512
max_request_size = 512


# headers
tlp_common_header_length = 16
tlp_common_header_fields = {
Expand Down
6 changes: 3 additions & 3 deletions litepcie/frontend/dma.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def __init__(self, endpoint, port, table_depth=256):

# requests from table are splitted in chunks of "max_size"
self.table = table = LitePCIeDMARequestTable(table_depth)
splitter = LitePCIeDMARequestSplitter(max_request_size)
splitter = LitePCIeDMARequestSplitter(max_size=endpoint.phy.max_request_size)
self.submodules += table, BufferizeEndpoints({"source": DIR_SOURCE})(ResetInserter()(splitter))
self.comb += [
splitter.reset.eq(~enable),
Expand Down Expand Up @@ -284,7 +284,7 @@ def __init__(self, endpoint, port, table_depth=256):

enable = self.enable.storage

max_words_per_request = max_request_size//(endpoint.phy.data_width//8)
max_words_per_request = max_payload_size//(endpoint.phy.data_width//8)
fifo_depth = 4*max_words_per_request

# Data FIFO
Expand Down Expand Up @@ -313,7 +313,7 @@ def __init__(self, endpoint, port, table_depth=256):

# requests from table are splitted in chunks of "max_size"
self.table = table = LitePCIeDMARequestTable(table_depth)
splitter = LitePCIeDMARequestSplitter(endpoint.phy.max_payload_size)
splitter = LitePCIeDMARequestSplitter(max_size=endpoint.phy.max_payload_size)
self.submodules += table, BufferizeEndpoints({"source": DIR_SOURCE})(ResetInserter()(splitter))
self.comb += [
splitter.reset.eq(~enable),
Expand Down

0 comments on commit 04f099f

Please sign in to comment.