From 720f64ea6017fa3e42f80eba64cc615c64788914 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 23 Mar 2021 09:41:45 -0700 Subject: [FPGA interchange] Add support for global buffers from chipdb. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fpga_interchange/arch.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'fpga_interchange/arch.h') diff --git a/fpga_interchange/arch.h b/fpga_interchange/arch.h index 1f0eb80d..25f3dbfe 100644 --- a/fpga_interchange/arch.h +++ b/fpga_interchange/arch.h @@ -344,7 +344,19 @@ struct Arch : ArchAPI bool getBelGlobalBuf(BelId bel) const final { - // FIXME: This probably needs to be fixed! + auto &bel_data = bel_info(chip_info, bel); + IdString bel_name(bel_data.name); + + // Note: Check profiles and see if this should be something other than + // a linear scan. Expectation is that for most arches, this will be + // fast enough. + for (int32_t global_bel : chip_info->cell_map->global_buffers) { + IdString global_bel_name(global_bel); + if (bel_name == global_bel_name) { + return true; + } + } + return false; } -- cgit v1.2.3