diff --git a/machxo2/arch.cc b/machxo2/arch.cc index 55d3a845..a69f97cb 100644 --- a/machxo2/arch.cc +++ b/machxo2/arch.cc @@ -626,4 +626,13 @@ std::vector> Arch::getWireAttrs(WireId wire) co return ret; } +// ----------------------------------------------------------------------- +bool Arch::is_spine_row(int row) const +{ + for (auto &spine : chip_info->spines) { + if (row==spine.row) return true; + } + return false; +} + NEXTPNR_NAMESPACE_END diff --git a/machxo2/arch.h b/machxo2/arch.h index e7614582..1ef91ebc 100644 --- a/machxo2/arch.h +++ b/machxo2/arch.h @@ -133,6 +133,8 @@ NPNR_PACKED_STRUCT(struct VariantInfoPOD { RelSlice suffixes; }); +NPNR_PACKED_STRUCT(struct SpineInfoPOD { int32_t row; }); + NPNR_PACKED_STRUCT(struct ChipInfoPOD { RelPtr family; RelPtr device_name; @@ -145,6 +147,7 @@ NPNR_PACKED_STRUCT(struct ChipInfoPOD { RelSlice pio_info; RelSlice tile_info; RelSlice variants; + RelSlice spines; }); /************************ End of chipdb section. ************************/ @@ -960,6 +963,7 @@ struct Arch : BaseArch NPNR_ASSERT_FALSE_STR("no tile with type " + type); } + bool is_spine_row(int row) const; // Apply LPF constraints to the context bool apply_lpf(std::string filename, std::istream &in); diff --git a/machxo2/facade_import.py b/machxo2/facade_import.py index e07c1921..04b16b31 100644 --- a/machxo2/facade_import.py +++ b/machxo2/facade_import.py @@ -394,6 +394,11 @@ def write_database(dev_name, chip, rg, endianness): bba.r_slice("supported_speed_grades_%s" % name, len(var_data["speeds"]), "supported_speed_grades") bba.r_slice("supported_suffixes_%s" % name, len(var_data["suffixes"]), "supported_suffixes") + bba.l("spine_info", "SpineInfoPOD") + spines = chip.global_data_machxo2.spines + for spine in spines: + bba.u32(spine.row, "row") + bba.l("chip_info") bba.s(chip.info.family, "family") bba.s(chip.info.name, "device_name") @@ -408,6 +413,7 @@ def write_database(dev_name, chip, rg, endianness): bba.r_slice("pio_info", len(pindata), "pio_info") bba.r_slice("tiles_info", (max_col + 1) * (max_row + 1), "tile_info") bba.r_slice("variant_data", len(variants), "variant_info") + bba.r_slice("spine_info", len(spines), "spine_info") bba.pop() return bba