|
|
@@ -2123,10 +2123,21 @@ def td_forbidden_script_markers(script_text: str) -> list[str]:
|
|
|
return sorted(markers)
|
|
|
|
|
|
|
|
|
-def td_log_has_error(*chunks: str) -> bool:
|
|
|
+def td_log_has_cdc_gate_failure(*chunks: str) -> bool:
|
|
|
text = "\n".join(chunks)
|
|
|
return bool(
|
|
|
re.search(
|
|
|
+ r"(?i)(?:\bPROD2U_P4_NORMAL_V3_CDC_GATE_FAIL\b|\bCDC_GATE_(?:FAIL|FAILED)\b|\bCDC_GATE_STATUS\s*=\s*(?:FAIL|FAILED)\b)",
|
|
|
+ text,
|
|
|
+ )
|
|
|
+ )
|
|
|
+
|
|
|
+
|
|
|
+def td_log_has_error(*chunks: str) -> bool:
|
|
|
+ text = "\n".join(chunks)
|
|
|
+ return bool(
|
|
|
+ td_log_has_cdc_gate_failure(*chunks)
|
|
|
+ or re.search(
|
|
|
r"(^|\n)\s*(?:[A-Z]+-\d+\s+)?(?:error|fatal)\s*[:|]",
|
|
|
text,
|
|
|
re.IGNORECASE,
|
|
|
@@ -2599,6 +2610,7 @@ def td_stage_artifact_usable(
|
|
|
completed is not None
|
|
|
and completed.returncode == 0
|
|
|
and not td_log_has_error(completed.stdout, completed.stderr)
|
|
|
+ and not td_log_has_cdc_gate_failure(completed.stdout, completed.stderr)
|
|
|
and artifact.is_file()
|
|
|
and artifact.stat().st_size > 0
|
|
|
)
|
|
|
@@ -2648,11 +2660,17 @@ def _stage_result(completed: subprocess.CompletedProcess[str] | None) -> dict[st
|
|
|
if isinstance(completed.args, Sequence) and not isinstance(completed.args, (str, bytes))
|
|
|
else [str(completed.args)]
|
|
|
)
|
|
|
+ cdc_gate_failure = td_log_has_cdc_gate_failure(completed.stdout, completed.stderr)
|
|
|
return {
|
|
|
- "status": "fail_timeout" if timed_out else ("pass" if completed.returncode == 0 else "fail"),
|
|
|
+ "status": (
|
|
|
+ "fail_timeout"
|
|
|
+ if timed_out
|
|
|
+ else ("fail" if completed.returncode != 0 or cdc_gate_failure else "pass")
|
|
|
+ ),
|
|
|
"timed_out": timed_out,
|
|
|
"returncode": completed.returncode,
|
|
|
"log_has_error": td_log_has_error(completed.stdout, completed.stderr),
|
|
|
+ "cdc_gate_failure": cdc_gate_failure,
|
|
|
"critical_warning_count": td_critical_warning_count(completed.stdout, completed.stderr),
|
|
|
"command": command,
|
|
|
"stdout_tail": _tail(completed.stdout),
|
|
|
@@ -2837,6 +2855,7 @@ def td_build_payload(
|
|
|
syn_ok = (
|
|
|
syn.returncode == 0
|
|
|
and not td_log_has_error(syn.stdout, syn.stderr)
|
|
|
+ and not td_log_has_cdc_gate_failure(syn.stdout, syn.stderr)
|
|
|
and td_critical_warning_count(syn.stdout, syn.stderr) == 0
|
|
|
and syn_cdc["status"] == "pass"
|
|
|
and "CDC_GATE_PASS=1" in syn.stdout
|
|
|
@@ -2853,6 +2872,7 @@ def td_build_payload(
|
|
|
phy
|
|
|
and phy.returncode == 0
|
|
|
and not td_log_has_error(phy.stdout, phy.stderr)
|
|
|
+ and not td_log_has_cdc_gate_failure(phy.stdout, phy.stderr)
|
|
|
and td_critical_warning_count(phy.stdout, phy.stderr) == 0
|
|
|
)
|
|
|
route_artifact_usable = td_stage_artifact_usable(
|
|
|
@@ -2907,6 +2927,7 @@ def td_build_payload(
|
|
|
bitgen
|
|
|
and bitgen.returncode == 0
|
|
|
and not td_log_has_error(bitgen.stdout, bitgen.stderr)
|
|
|
+ and not td_log_has_cdc_gate_failure(bitgen.stdout, bitgen.stderr)
|
|
|
and td_critical_warning_count(bitgen.stdout, bitgen.stderr) == 0
|
|
|
)
|
|
|
bitstream = staged.bitgen / f"{PROFILE}.bit"
|