feat(shuttle): report missing muxes

When we have x4-tile high projects, some muxes will be missing. Report them as such in the shuttle index, so that the shuttle map on the website displays correctly.
This commit is contained in:
Uri Shaked
2025-08-15 20:12:32 +03:00
parent 62f5e45102
commit 10e2f1108c
+10 -6
View File
@@ -43,6 +43,12 @@ def copy_print_glob(pattern: str, dest_dir: str):
copy_print(file, os.path.join(dest_dir, os.path.basename(file))) copy_print(file, os.path.join(dest_dir, os.path.basename(file)))
def mux_id_to_xy(mux_id: int, total_mux_rows: int):
x = (mux_id >> 1) & 1
y = total_mux_rows // 2 - (2 * (mux_id & 1) - 1) * (mux_id >> 2) - (mux_id & 1)
return x, y
class ShuttleConfig: class ShuttleConfig:
def __init__(self, config: Config, projects: List[Project], modules_yaml_name: str): def __init__(self, config: Config, projects: List[Project], modules_yaml_name: str):
self.config = config self.config = config
@@ -61,13 +67,11 @@ class ShuttleConfig:
for item in self.mux_config["tt"]["analog"]: for item in self.mux_config["tt"]["analog"]:
mux_id: int mux_id: int
for mux_id in item["mux_id"]: for mux_id in item["mux_id"]:
x = (mux_id >> 1) & 1 x, y = mux_id_to_xy(mux_id, total_mux_rows)
y = (
total_mux_rows // 2
- (2 * (mux_id & 1) - 1) * (mux_id >> 2)
- (mux_id & 1)
)
self.layout["muxes"][x][y] = "analog" self.layout["muxes"][x][y] = "analog"
for item in self.mux_config["tt"].get("huge_modules", {}).get("mux_id", []):
x, y = mux_id_to_xy(item, total_mux_rows)
self.layout["muxes"][x][y] = ""
def read_mux_config_file(self): def read_mux_config_file(self):
with open( with open(