Skip to content

Commit

Permalink
Merge pull request #229 from craigjb/port_width
Browse files Browse the repository at this point in the history
Add customizable standalone user port data widths
  • Loading branch information
enjoy-digital committed Jan 30, 2021
2 parents 2f57844 + 5c32dc7 commit 17db757
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions litedram/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ def __init__(self, platform, core_config, **kwargs):
for name, port in core_config["user_ports"].items():
# Native -------------------------------------------------------------------------------
if port["type"] == "native":
user_port = self.sdram.crossbar.get_port()
user_port = self.sdram.crossbar.get_port(
data_width=port.get("data_width", None))
platform.add_extension(get_native_user_port_ios(name,
user_port.address_width,
user_port.data_width))
Expand All @@ -570,7 +571,8 @@ def __init__(self, platform, core_config, **kwargs):
]
# Wishbone -----------------------------------------------------------------------------
elif port["type"] == "wishbone":
user_port = self.sdram.crossbar.get_port()
user_port = self.sdram.crossbar.get_port(
data_width=port.get("data_width", None))
wb_port = wishbone.Interface(
user_port.data_width,
user_port.address_width)
Expand All @@ -593,7 +595,8 @@ def __init__(self, platform, core_config, **kwargs):
]
# AXI ----------------------------------------------------------------------------------
elif port["type"] == "axi":
user_port = self.sdram.crossbar.get_port()
user_port = self.sdram.crossbar.get_port(
data_width=port.get("data_width", None))
axi_port = LiteDRAMAXIPort(
user_port.data_width,
user_port.address_width + log2_int(user_port.data_width//8),
Expand Down

0 comments on commit 17db757

Please sign in to comment.