Skip to content

Commit

Permalink
phy/us(p)pciephy: Add update_config support (similar to s7pciephy).
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed May 29, 2024
1 parent 5767a49 commit 7ec8355
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions litepcie/phy/uspciephy.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self, platform, pads, speed="gen3", data_width=64, cd="sys",
self.max_request_size = Signal(16)
self.max_payload_size = Signal(16)

self.config = {}
self.external_hard_ip = False

# # #
Expand Down Expand Up @@ -370,6 +371,9 @@ def add_ltssm_tracer(self):
self.ltssm_tracer = LTSSMTracer(self._link_status.fields.ltssm)

# Hard IP sources ------------------------------------------------------------------------------
def update_config(self, config):
self.config.update(config)

def add_sources(self, platform, phy_path=None, phy_filename=None):
if phy_filename is not None:
platform.add_ip(os.path.join(phy_path, phy_filename))
Expand Down Expand Up @@ -399,6 +403,11 @@ def add_sources(self, platform, phy_path=None, phy_filename=None):
# -----------------
"PF0_INTERRUPT_PIN" : "NONE",
}

# User/Custom Config.
config.update(self.config)

# Tcl generation.
ip_tcl = []
ip_tcl.append("create_ip -vendor xilinx.com -name pcie3_ultrascale -module_name pcie_us")
ip_tcl.append("set obj [get_ips pcie_us]")
Expand Down
9 changes: 9 additions & 0 deletions litepcie/phy/usppciephy.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(self, platform, pads, speed="gen3", data_width=64, cd="sys",
self.max_request_size = Signal(16)
self.max_payload_size = Signal(16)

self.config = {}
self.external_hard_ip = False

# # #
Expand Down Expand Up @@ -375,6 +376,9 @@ def add_ltssm_tracer(self):
self.ltssm_tracer = LTSSMTracer(self._link_status.fields.ltssm)

# Hard IP sources ------------------------------------------------------------------------------
def update_config(self, config):
self.config.update(config)

def add_sources(self, platform, phy_path=None, phy_filename=None):
if phy_filename is not None:
platform.add_ip(os.path.join(phy_path, phy_filename))
Expand Down Expand Up @@ -404,6 +408,11 @@ def add_sources(self, platform, phy_path=None, phy_filename=None):
# -----------------
"PF0_INTERRUPT_PIN" : "NONE",
}

# User/Custom Config.
config.update(self.config)

# Tcl generation.
ip_tcl = []
ip_tcl.append(f"create_ip -vendor xilinx.com -name {self.ip_name} -module_name pcie_usp")
ip_tcl.append("set obj [get_ips pcie_usp]")
Expand Down

0 comments on commit 7ec8355

Please sign in to comment.