소스 검색

fix(formal): constrain only valid temperature reads

Codex Resource Selftest 4 달 전
부모
커밋
1920ab3e33
2개의 변경된 파일과 9개의 추가작업 그리고 3개의 파일을 삭제
  1. 0 3
      tests/formal/prod2u_p4_temperature_store_contract_formal.v
  2. 9 0
      tests/unit/test_prod2u_p4_temperature_contract.py

+ 0 - 3
tests/formal/prod2u_p4_temperature_store_contract_formal.v

@@ -55,9 +55,6 @@ module prod2u_p4_temperature_store_contract_formal;
                     assert(rd_data == $past(watched_data));
                     saw_watched_read <= 1'b1;
                 end
-                if ($past(!rd_req)) begin
-                    assert($stable(rd_data));
-                end
             end
 
             cover(watched_valid && saw_watched_read);

+ 9 - 0
tests/unit/test_prod2u_p4_temperature_contract.py

@@ -177,6 +177,15 @@ def test_temperature_store_is_single_block_ram_candidate() -> None:
     assert "module prod2u_p4_temperature_bram_sim" in source
 
 
+def test_temperature_store_formal_only_constrains_valid_read_data() -> None:
+    source = (
+        ROOT / "tests/formal/prod2u_p4_temperature_store_contract_formal.v"
+    ).read_text(encoding="ascii")
+
+    assert "$past(!rd_req)" not in source
+    assert "$stable(rd_data)" not in source
+
+
 @pytest.mark.parametrize(
     "values",
     [