test_6400_v1_source_closure.py 1.3 KB

123456789101112131415161718192021222324252627282930
  1. import json
  2. from pathlib import Path
  3. ROOT = Path(__file__).resolve().parents[2]
  4. def test_production_closure_excludes_legacy_and_stimulus_wrapper() -> None:
  5. closure = json.loads((ROOT / "products/6400-control/source-closure.json").read_text())
  6. sources = "\n".join(closure["sources"])
  7. assert "identification" not in sources
  8. for forbidden in ("door_", "motor", "host_watchdog", "EF2_PHY_PLL"):
  9. assert forbidden not in sources
  10. assert closure["top_module"] == "prod2u_6400_v1_top"
  11. def test_known_pins_are_unique_and_ttl_is_explicitly_unbound() -> None:
  12. project = json.loads((ROOT / "products/6400-control/project.json").read_text())
  13. assert project["ttl_pin_status"] == "unbound"
  14. adc = (ROOT / project["constraints"]).read_text()
  15. assert "host_ttl" not in adc
  16. locations = [line.split("LOCATION = ", 1)[1].split(";", 1)[0] for line in adc.splitlines() if "LOCATION = " in line]
  17. assert len(locations) == len(set(locations))
  18. def test_no_host_watchdog_or_pll_in_6400_sources() -> None:
  19. closure = json.loads((ROOT / "products/6400-control/source-closure.json").read_text())
  20. text = "\n".join((ROOT / source).read_text(errors="ignore") for source in closure["sources"] if source.endswith(".v"))
  21. assert "host_watchdog" not in text
  22. assert "EF2_PHY_PLL" not in text