|
@@ -2367,6 +2367,45 @@ def td_process_env(
|
|
|
return env
|
|
return env
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def probe_td_tool() -> dict[str, Any]:
|
|
|
|
|
+ """Probe TD wrapper + real binary path/hash/version for receipts."""
|
|
|
|
|
+ wrapper = TD_EXE.resolve()
|
|
|
|
|
+ td_home = Path(os.environ.get("ANLOGIC_TD_HOME", "/data/anlogic/TD_Release_2026.1_SP2_NL"))
|
|
|
|
|
+ real_bin = (td_home / "bin" / "td").resolve()
|
|
|
|
|
+ version_text = ""
|
|
|
|
|
+ version = "unknown"
|
|
|
|
|
+ try:
|
|
|
|
|
+ completed = subprocess.run(
|
|
|
|
|
+ [str(TD_EXE), "-version"],
|
|
|
|
|
+ timeout=30,
|
|
|
|
|
+ text=True,
|
|
|
|
|
+ encoding="utf-8",
|
|
|
|
|
+ errors="replace",
|
|
|
|
|
+ stdout=subprocess.PIPE,
|
|
|
|
|
+ stderr=subprocess.PIPE,
|
|
|
|
|
+ check=False,
|
|
|
|
|
+ env=td_process_env(Path(os.environ.get("TMPDIR", "/tmp"))),
|
|
|
|
|
+ )
|
|
|
|
|
+ version_text = ((completed.stdout or "") + "\n" + (completed.stderr or "")).strip()
|
|
|
|
|
+ match = re.search(r"Build:\s*([0-9.]+)", version_text)
|
|
|
|
|
+ if match:
|
|
|
|
|
+ version = match.group(1)
|
|
|
|
|
+ elif "Release_" in version_text:
|
|
|
|
|
+ version = version_text.splitlines()[0].strip()
|
|
|
|
|
+ except (OSError, subprocess.SubprocessError) as exc:
|
|
|
|
|
+ version_text = f"probe_failed:{type(exc).__name__}"
|
|
|
|
|
+ return {
|
|
|
|
|
+ "path": str(wrapper),
|
|
|
|
|
+ "executable": wrapper.name,
|
|
|
|
|
+ "version": version,
|
|
|
|
|
+ "sha256": sha256_file(wrapper) if wrapper.is_file() else None,
|
|
|
|
|
+ "real_binary_path": str(real_bin) if real_bin.is_file() else None,
|
|
|
|
|
+ "real_binary_sha256": sha256_file(real_bin) if real_bin.is_file() else None,
|
|
|
|
|
+ "version_text": version_text,
|
|
|
|
|
+ "release": "Release_2026.1_SP2",
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def run_td_script(
|
|
def run_td_script(
|
|
|
run_dir: Path,
|
|
run_dir: Path,
|
|
|
script_name: str,
|
|
script_name: str,
|
|
@@ -3260,13 +3299,14 @@ def td_build_payload(
|
|
|
and source_binding_gate["status"] == "pass"
|
|
and source_binding_gate["status"] == "pass"
|
|
|
and not measurement_failures
|
|
and not measurement_failures
|
|
|
)
|
|
)
|
|
|
|
|
+ td_tool = probe_td_tool()
|
|
|
payload = {
|
|
payload = {
|
|
|
**metadata,
|
|
**metadata,
|
|
|
"status": "pass" if passed else "fail",
|
|
"status": "pass" if passed else "fail",
|
|
|
"generated_at": generated_at,
|
|
"generated_at": generated_at,
|
|
|
"run_id": run_id,
|
|
"run_id": run_id,
|
|
|
"command": " ".join([str(TD_EXE)] + [str(script) for script in TD_SCRIPTS.values()]),
|
|
"command": " ".join([str(TD_EXE)] + [str(script) for script in TD_SCRIPTS.values()]),
|
|
|
- "tool_version": "6.2.2.198412",
|
|
|
|
|
|
|
+ "tool_version": str(td_tool.get("version") or "unknown"),
|
|
|
**source_binding_fields(staged.source_state),
|
|
**source_binding_fields(staged.source_state),
|
|
|
"source_state": dict(staged.source_state),
|
|
"source_state": dict(staged.source_state),
|
|
|
"repository_state_after": state_after,
|
|
"repository_state_after": state_after,
|
|
@@ -3282,12 +3322,7 @@ def td_build_payload(
|
|
|
"phy": str(staged.phy),
|
|
"phy": str(staged.phy),
|
|
|
"bitgen": str(staged.bitgen),
|
|
"bitgen": str(staged.bitgen),
|
|
|
},
|
|
},
|
|
|
- "td_tool": {
|
|
|
|
|
- "path": str(TD_EXE.resolve()),
|
|
|
|
|
- "executable": TD_EXE.name,
|
|
|
|
|
- "version": "6.2.2.198412",
|
|
|
|
|
- "sha256": sha256_file(TD_EXE),
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ "td_tool": td_tool,
|
|
|
"pin_binding_gate": pins,
|
|
"pin_binding_gate": pins,
|
|
|
"post_route_pin_gate": routed_pins,
|
|
"post_route_pin_gate": routed_pins,
|
|
|
"binding_gate": {"status": "pass", "target_device": TARGET_DEVICE},
|
|
"binding_gate": {"status": "pass", "target_device": TARGET_DEVICE},
|
|
@@ -3309,6 +3344,11 @@ def td_build_payload(
|
|
|
"structural_gate": structural,
|
|
"structural_gate": structural,
|
|
|
"timing": timing,
|
|
"timing": timing,
|
|
|
"timing_gate": timing_result,
|
|
"timing_gate": timing_result,
|
|
|
|
|
+ "no_programming_safety_declaration": (
|
|
|
|
|
+ "No JTAG, cable, download, flash, SRAM, or board programming was performed. "
|
|
|
|
|
+ "Forbidden TD commands were absent from syn/phy/bitgen scripts. "
|
|
|
|
|
+ "Hardware validation remains not_run."
|
|
|
|
|
+ ),
|
|
|
"error_summary": {
|
|
"error_summary": {
|
|
|
"error_count": sum(
|
|
"error_count": sum(
|
|
|
int(bool(item and item.get("log_has_error")))
|
|
int(bool(item and item.get("log_has_error")))
|