Skip to content

Commit 40740d3

Browse files
committedJul 22, 2015
litepcie: use optional platform.misoc_path to add litepcie phy wrapper verilog files
We should eventually try to use python package_data or data_file for that.
1 parent 84514cf commit 40740d3

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed
 

Diff for: ‎misoclib/com/litepcie/example_designs/targets/dma.py

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def __init__(self, platform, with_uart_bridge=True):
6969
with_timer=False
7070
)
7171
self.submodules.crg = _CRG(platform)
72+
platform.misoc_path = "../../../../"
7273

7374
# PCIe endpoint
7475
self.submodules.pcie_phy = S7PCIEPHY(platform, link_width=2)

Diff for: ‎misoclib/com/litepcie/phy/s7pciephy.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,13 @@ def convert_size(command, size):
151151
convert_size(dcommand[12:15], self.max_request_size),
152152
convert_size(dcommand[5:8], self.max_payload_size)
153153
]
154-
155-
extcores_path = "extcores"
156-
# XXX find a better way to do this?
157-
current_path = os.getcwd()
158-
current_path = current_path.replace("\\", "/")
159-
if "litepcie/example_designs" in current_path:
160-
extcores_path = os.path.join("..", "..", "..", "..", extcores_path)
161-
platform.add_source_dir(os.path.join(extcores_path, "litepcie_phy_wrappers", "xilinx", "7-series", "common"))
154+
if hasattr(platform, "misoc_path"):
155+
misoc_path = platform.misoc_path
156+
else:
157+
misoc_path = "./"
158+
litepcie_phy_wrapper_path = os.path.join(misoc_path, "extcores", "litepcie_phy_wrappers")
159+
platform.add_source_dir(os.path.join(litepcie_phy_wrapper_path, "xilinx", "7-series", "common"))
162160
if device[:4] == "xc7k":
163-
platform.add_source_dir(os.path.join(extcores_path, "litepcie_phy_wrappers", "xilinx", "7-series", "kintex7"))
161+
platform.add_source_dir(os.path.join(litepcie_phy_wrapper_path, "xilinx", "7-series", "kintex7"))
164162
elif device[:4] == "xc7a":
165-
platform.add_source_dir(os.path.join(extcores_path, "litepcie_phy_wrappers", "xilinx", "7-series", "artix7"))
163+
platform.add_source_dir(os.path.join(litepcie_phy_wrapper_path, "xilinx", "7-series", "artix7"))

0 commit comments

Comments
 (0)
Please sign in to comment.