From 167d965bfc784a02a76555894a7968522778edcf Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Fri, 15 Mar 2024 17:36:13 +0100 Subject: [PATCH] py/placer: Don't place modules on non-existent mux If a mux position is non-existent because it hosts an analog bus, then don't try to place module on it ... Signed-off-by: Sylvain Munaut --- py/tt/placer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/py/tt/placer.py b/py/tt/placer.py index 58eff3f..b3b95a2 100644 --- a/py/tt/placer.py +++ b/py/tt/placer.py @@ -56,6 +56,12 @@ def __init__(self, cfg, mod_file, verbose=False): self.cfg = cfg self.verbose = verbose + # Extract analog muxes positions + self.mux_analog = set() + if hasattr(self.cfg.tt, 'analog'): + for grp in self.cfg.tt.analog: + self.mux_analog.update(grp['mux_id']) + # Run placement self.gen_grid() self.load_modules(mod_file) @@ -152,6 +158,11 @@ def _sites_for_module(self, mod, pos_x, pos_y): yield (pos_x+sx*ox, pos_y+sy*oy) def _site_suitable(self, mod, pos_x, pos_y): + # Check this is a connectable position + mux_id = self.p2l(pos_x, pos_y)[0] + if mux_id in self.mux_analog: + return False + # Check all positions exist and are free for (ox, oy) in self._sites_for_module(mod, pos_x, pos_y): if (ox, oy) not in self.pgrid_free: