fix(vitis): add xsct fallback for impact detection in Xilinx 2023.2
- vitis_checker: shutil.which() + xsct fallback for impact detection - flash_programmer: _get_impact_path now checks xsct as fallback - bitstream_programmer: _get_impact_path now checks xsct as fallback - GUI: show '(via xsct)' alias note when xsct replaces impact - ToolStatus: add 'alias' field for tracking which executable was found
This commit is contained in:
+14
-10
@@ -33,6 +33,7 @@ ProgressCallback = Callable[[str, str], None] | None
|
||||
def _get_impact_path(vitis_path: str) -> str | None:
|
||||
"""Find the impact executable path.
|
||||
|
||||
Tries 'impact' first, then falls back to 'xsct' (Xilinx 2023.2+).
|
||||
Uses shutil.which() for cross-platform compatibility,
|
||||
then falls back to common Vitis paths.
|
||||
|
||||
@@ -40,18 +41,21 @@ def _get_impact_path(vitis_path: str) -> str | None:
|
||||
vitis_path: Vitis installation path.
|
||||
|
||||
Returns:
|
||||
Path to impact executable, or None if not found.
|
||||
Path to impact or xsct executable, or None if not found.
|
||||
"""
|
||||
path = shutil.which("impact")
|
||||
if path:
|
||||
return path
|
||||
# Try shutil.which for impact, then xsct as fallback
|
||||
for tool in ("impact", "xsct"):
|
||||
path = shutil.which(tool)
|
||||
if path:
|
||||
return path
|
||||
if vitis_path:
|
||||
candidate = Path(vitis_path) / "bin" / "impact"
|
||||
if candidate.exists():
|
||||
return str(candidate)
|
||||
candidate = Path(vitis_path) / "bin" / "impact.exe"
|
||||
if candidate.exists():
|
||||
return str(candidate)
|
||||
bin_dir = Path(vitis_path) / "bin"
|
||||
if bin_dir.exists():
|
||||
for tool in ("impact", "xsct"):
|
||||
for ext in ("", ".exe"):
|
||||
candidate = bin_dir / f"{tool}{ext}"
|
||||
if candidate.exists():
|
||||
return str(candidate)
|
||||
common_paths = [
|
||||
"/opt/xilinx/bin/impact",
|
||||
os.path.expanduser("~/Xilinx/Vitis/bin/impact"),
|
||||
|
||||
Reference in New Issue
Block a user