From 5c16c5024d33a4c5c16773ea780a77ec48d26575 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Mon, 1 Feb 2021 13:31:31 -0800 Subject: Debug BEL bucket data. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fpga_interchange/arch.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/fpga_interchange/arch.h b/fpga_interchange/arch.h index eb1e51c6..03a960d1 100644 --- a/fpga_interchange/arch.h +++ b/fpga_interchange/arch.h @@ -86,7 +86,7 @@ NPNR_PACKED_STRUCT(struct BelInfoPOD { int16_t category; int16_t padding; - RelPtr valid_cells; + RelPtr valid_cells; // Bool array, length of number_cells. }); enum BELCategory { @@ -183,14 +183,10 @@ NPNR_PACKED_STRUCT(struct NodeInfoPOD { }); NPNR_PACKED_STRUCT(struct CellMapPOD { - // BEL bucket constids. - int32_t number_bel_buckets; - RelPtr bel_buckets; - int32_t number_cells; // Cell names supported in this arch. - RelPtr cell_names; - RelPtr cell_bel_buckets; + RelPtr cell_names; // constids + RelPtr cell_bel_buckets; // constids }); NPNR_PACKED_STRUCT(struct ChipInfoPOD { @@ -212,10 +208,11 @@ NPNR_PACKED_STRUCT(struct ChipInfoPOD { int32_t num_nodes; RelPtr nodes; - RelPtr cell_map; - + // BEL bucket constids. int32_t number_bel_buckets; RelPtr bel_buckets; + + RelPtr cell_map; }); /************************ End of chipdb section. ************************/ @@ -306,7 +303,9 @@ struct FilteredBelIterator BelId operator*() const { - return *b; + BelId bel = *b; + NPNR_ASSERT(filter(bel)); + return bel; } }; @@ -318,11 +317,15 @@ struct FilteredBelRange b.e = bel_e; if(b.b != b.e && !filter(*b.b)) { - ++b.b; + ++b; } e.b = bel_e; e.e = bel_e; + + if(b != e) { + NPNR_ASSERT(filter(*b.b)); + } } FilteredBelIterator b, e; -- cgit v1.2.3