diff --git a/mistral/arch.cc b/mistral/arch.cc index 516d1de8..cfa3e8b3 100644 --- a/mistral/arch.cc +++ b/mistral/arch.cc @@ -248,6 +248,8 @@ bool Arch::isValidBelForCellType(IdString cell_type, BelId bel) const return is_comb_cell(cell_type); else if (bel_type == id_MISTRAL_IO) return is_io_cell(cell_type); + else if (bel_type == id_MISTRAL_CLKENA) + return is_clkbuf_cell(cell_type); else return bel_type == cell_type; } @@ -258,6 +260,8 @@ BelBucketId Arch::getBelBucketForCellType(IdString cell_type) const return id_MISTRAL_COMB; else if (is_io_cell(cell_type)) return id_MISTRAL_IO; + else if (is_clkbuf_cell(cell_type)) + return id_MISTRAL_CLKENA; else return cell_type; } diff --git a/mistral/arch.h b/mistral/arch.h index c7d369f1..5913a615 100644 --- a/mistral/arch.h +++ b/mistral/arch.h @@ -480,6 +480,10 @@ struct Arch : BaseArch // ------------------------------------------------- + bool is_clkbuf_cell(IdString cell_type) const; // globals.cc + + // ------------------------------------------------- + static const std::string defaultPlacer; static const std::vector availablePlacers; static const std::string defaultRouter; diff --git a/mistral/bitstream.cc b/mistral/bitstream.cc index e31b94af..92d86410 100644 --- a/mistral/bitstream.cc +++ b/mistral/bitstream.cc @@ -201,7 +201,7 @@ struct MistralBitgen int bi = ctx->bel_data(ci->bel).block_index; if (ctx->is_io_cell(ci->type)) write_io_cell(ci, loc.x, loc.y, bi); - else if (ci->type == id_MISTRAL_CLKENA) + else if (ctx->is_clkbuf_cell(ci->type)) write_clkbuf_cell(ci, loc.x, loc.y, bi); } } diff --git a/mistral/constids.inc b/mistral/constids.inc index 4f7d3ecf..6bb45c3c 100644 --- a/mistral/constids.inc +++ b/mistral/constids.inc @@ -75,3 +75,4 @@ X(Y) X(LOC) X(MISTRAL_CLKENA) +X(MISTRAL_CLKBUF) diff --git a/mistral/globals.cc b/mistral/globals.cc index 9cbabbca..3203893b 100644 --- a/mistral/globals.cc +++ b/mistral/globals.cc @@ -38,4 +38,9 @@ void Arch::create_clkbuf(int x, int y) } } +bool Arch::is_clkbuf_cell(IdString cell_type) const +{ + return cell_type == id_MISTRAL_CLKENA || cell_type == id_MISTRAL_CLKBUF; +} + NEXTPNR_NAMESPACE_END