mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 12:46:08 +01:00
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:
+10
-6
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user