import os import sys import tempfile import unittest import yaml ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) sys.path.insert(0, ROOT) from scripts.export_technology_manifests import build_silterra_eom1_manifest, export_manifests class TechnologyManifestExportTest(unittest.TestCase): def test_silterra_manifest_contains_route_xsections(self): manifest = build_silterra_eom1_manifest() self.assertEqual(manifest["foundry"], "Silterra") self.assertEqual(manifest["technology"], "EMO1_2ML_CU_Al_RDL") self.assertEqual(manifest["defaults"]["xsection"], "strip") self.assertEqual(manifest["defaults"]["routing_type"], "euler_bend") self.assertIn("standard_bend", manifest["routing_types"]) self.assertEqual(manifest["xsections"]["strip"]["family"], "optical") self.assertEqual(manifest["xsections"]["rib_low"]["family"], "optical") self.assertEqual(manifest["xsections"]["metal_1"]["family"], "electrical") self.assertEqual(manifest["xsections"]["metal_2"]["family"], "electrical") self.assertIn("WG_STRIP", manifest["layers"]) def test_export_writes_eda_technology_yml(self): with tempfile.TemporaryDirectory() as temp_dir: export_manifests(temp_dir) output = os.path.join(temp_dir, "Silterra", "EMO1_2ML_CU_Al_RDL", "technology.yml") self.assertTrue(os.path.exists(output)) with open(output, "r", encoding="utf-8") as file: data = yaml.safe_load(file) self.assertEqual(data["xsections"]["metal_1"]["family"], "electrical") if __name__ == "__main__": unittest.main()