Skip to content

Commit

Permalink
py/placer: Don't place modules on non-existent mux
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
smunaut committed Mar 15, 2024
1 parent 32f966e commit 167d965
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions py/tt/placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 167d965

Please sign in to comment.