diff --git a/common/place/placer_static.cc b/common/place/placer_static.cc index ffdd9b52..d3cb4863 100644 --- a/common/place/placer_static.cc +++ b/common/place/placer_static.cc @@ -1267,7 +1267,7 @@ class StaticPlacer penalty *= 1.025; if (!legalised_ip) { float ip_overlap = 0; - for (int i = 2; i < int(groups.size()); i++) + for (int i = cfg.logic_groups; i < int(groups.size()); i++) ip_overlap = std::max(ip_overlap, groups.at(i).overlap); if (ip_overlap < 0.15) { legalise_step(true); @@ -1275,7 +1275,7 @@ class StaticPlacer } } else { float logic_overlap = 0; - for (int i = 0; i < 2; i++) + for (int i = 0; i < cfg.logic_groups; i++) logic_overlap = std::max(logic_overlap, groups.at(i).overlap); if (logic_overlap < 0.1) { legalise_step(false); diff --git a/common/place/placer_static.h b/common/place/placer_static.h index adce1f41..ac43920d 100644 --- a/common/place/placer_static.h +++ b/common/place/placer_static.h @@ -61,8 +61,9 @@ struct PlacerStaticCfg // estimate = c + mx*dx + my * dy delay_t timing_c = 100, timing_mx = 100, timing_my = 100; // groups of cells that should be placed together. - // group 0 must be LUTs and group 1 must be FFs, further groups for BRAM/DSP/misc + // groups < logic_groups are logic like LUTs and FFs, further groups for BRAM/DSP/misc std::vector cell_groups; + int logic_groups = 2; }; extern bool placer_static(Context *ctx, PlacerStaticCfg cfg); diff --git a/ice40/arch.cc b/ice40/arch.cc index 77261327..6f58cbbd 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -653,6 +653,7 @@ bool Arch::place() return false; } else if (placer == "static") { PlacerStaticCfg cfg(getCtx()); + cfg.logic_groups = 1; { cfg.cell_groups.emplace_back(); auto &comb = cfg.cell_groups.back(); @@ -671,6 +672,15 @@ bool Arch::place() comb.spacer_rect = StaticRect(1.0f, 2.0f); } + { + cfg.cell_groups.emplace_back(); + auto& comb = cfg.cell_groups.back(); + comb.name = getCtx()->id("DSP"); + comb.cell_area[id_ICESTORM_DSP] = StaticRect(0.9f, 5.0f); + comb.bel_area[id_ICESTORM_DSP] = StaticRect(0.9f, 5.0f); + comb.spacer_rect = StaticRect(0.9f, 5.0f); + } + { cfg.cell_groups.emplace_back(); auto &comb = cfg.cell_groups.back(); @@ -684,9 +694,9 @@ bool Arch::place() cfg.cell_groups.emplace_back(); auto &comb = cfg.cell_groups.back(); comb.name = getCtx()->id("WARMBOOT"); - comb.cell_area[id_SB_WARMBOOT] = StaticRect(1.0f, 1.0f); - comb.bel_area[id_SB_WARMBOOT] = StaticRect(1.0f, 1.0f); - comb.spacer_rect = StaticRect(1.0f, 1.0f); + comb.cell_area[id_SB_WARMBOOT] = StaticRect(0.5f, 1.0f); + comb.bel_area[id_SB_WARMBOOT] = StaticRect(0.5f, 1.0f); + comb.spacer_rect = StaticRect(0.5f, 1.0f); } { @@ -695,7 +705,7 @@ bool Arch::place() comb.name = getCtx()->id("IO"); comb.cell_area[id_SB_IO] = StaticRect(0.5f, 0.5f); comb.bel_area[id_SB_IO] = StaticRect(0.5f, 0.5f); - comb.spacer_rect = StaticRect(1.0f, 1.0f); + comb.spacer_rect = StaticRect(0.5f, 0.5f); } if (!placer_static(getCtx(), cfg)) return false;