diff options
Diffstat (limited to 'generic/viaduct/fabulous/validity_check.cc')
-rw-r--r-- | generic/viaduct/fabulous/validity_check.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/generic/viaduct/fabulous/validity_check.cc b/generic/viaduct/fabulous/validity_check.cc index 91dba689..30b21f29 100644 --- a/generic/viaduct/fabulous/validity_check.cc +++ b/generic/viaduct/fabulous/validity_check.cc @@ -33,6 +33,7 @@ CLBState::CLBState(const LogicConfig &cfg) if (cfg.split_lc) { ff = std::make_unique<CellInfo *[]>(cfg.lc_per_clb * cfg.ff_per_lc); } + mux = std::make_unique<CellInfo *[]>(cfg.lc_per_clb); // TODO: mux } @@ -173,6 +174,26 @@ bool CLBState::check_validity(const LogicConfig &cfg, const CellTagger &cell_dat } } } + // don't allow mixed MUX types in the classic fabulous arch where ctrl sigs are shared + int tile_mux_type = 0; + for (unsigned z = 0; z < cfg.lc_per_clb; z++) { + const CellInfo *m = mux[z]; + if (!m) + continue; + int this_mux = 0; + if (m->type == id_FABULOUS_MUX2) + this_mux = 2; + else if (m->type == id_FABULOUS_MUX4) + this_mux = 4; + else if (m->type == id_FABULOUS_MUX8) + this_mux = 8; + else + NPNR_ASSERT_FALSE("unknown mux type"); + if (tile_mux_type == 0) + tile_mux_type = this_mux; + else if (tile_mux_type != this_mux) + return false; + } // TODO: other checks... return true; } |