Import spine data

This commit is contained in:
Miodrag Milanovic 2023-04-06 12:29:42 +02:00 committed by myrtle
parent 9121880c5f
commit c04c961949
3 changed files with 19 additions and 0 deletions

View File

@ -626,4 +626,13 @@ std::vector<std::pair<IdString, std::string>> Arch::getWireAttrs(WireId wire) co
return ret; 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 NEXTPNR_NAMESPACE_END

View File

@ -133,6 +133,8 @@ NPNR_PACKED_STRUCT(struct VariantInfoPOD {
RelSlice<SuffixeSupportedPOD> suffixes; RelSlice<SuffixeSupportedPOD> suffixes;
}); });
NPNR_PACKED_STRUCT(struct SpineInfoPOD { int32_t row; });
NPNR_PACKED_STRUCT(struct ChipInfoPOD { NPNR_PACKED_STRUCT(struct ChipInfoPOD {
RelPtr<char> family; RelPtr<char> family;
RelPtr<char> device_name; RelPtr<char> device_name;
@ -145,6 +147,7 @@ NPNR_PACKED_STRUCT(struct ChipInfoPOD {
RelSlice<PIOInfoPOD> pio_info; RelSlice<PIOInfoPOD> pio_info;
RelSlice<TileInfoPOD> tile_info; RelSlice<TileInfoPOD> tile_info;
RelSlice<VariantInfoPOD> variants; RelSlice<VariantInfoPOD> variants;
RelSlice<SpineInfoPOD> spines;
}); });
/************************ End of chipdb section. ************************/ /************************ End of chipdb section. ************************/
@ -960,6 +963,7 @@ struct Arch : BaseArch<ArchRanges>
NPNR_ASSERT_FALSE_STR("no tile with type " + type); NPNR_ASSERT_FALSE_STR("no tile with type " + type);
} }
bool is_spine_row(int row) const;
// Apply LPF constraints to the context // Apply LPF constraints to the context
bool apply_lpf(std::string filename, std::istream &in); bool apply_lpf(std::string filename, std::istream &in);

View File

@ -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_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.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.l("chip_info")
bba.s(chip.info.family, "family") bba.s(chip.info.family, "family")
bba.s(chip.info.name, "device_name") 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("pio_info", len(pindata), "pio_info")
bba.r_slice("tiles_info", (max_col + 1) * (max_row + 1), "tile_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("variant_data", len(variants), "variant_info")
bba.r_slice("spine_info", len(spines), "spine_info")
bba.pop() bba.pop()
return bba return bba