diff --git a/machxo2/arch.h b/machxo2/arch.h index 063eb164..ec7939f4 100644 --- a/machxo2/arch.h +++ b/machxo2/arch.h @@ -43,9 +43,107 @@ template struct RelPtr const T *operator->() const { return get(); } }; +// FIXME: All "rel locs" are actually absolute, naming typo in facade_import. +// Does not affect runtime functionality. + +NPNR_PACKED_STRUCT(struct BelWirePOD { + LocationPOD rel_wire_loc; + uint32_t wire_index; + uint32_t port; + uint32_t dir; +}); + +NPNR_PACKED_STRUCT(struct BelInfoPOD { + RelPtr name; + uint32_t type; + uint32_t z; + uint32_t num_bel_wires; + RelPtr bel_wires; +}); + +NPNR_PACKED_STRUCT(struct PipLocatorPOD { + LocationPOD rel_loc; + uint32_t index; +}); + +NPNR_PACKED_STRUCT(struct BelPortPOD { + LocationPOD rel_bel_loc; + uint32_t bel_index; + uint32_t port; +}); + +NPNR_PACKED_STRUCT(struct PipInfoPOD { + LocationPOD src; + LocationPOD dst; + uint32_t src_idx; + uint32_t dst_idx; + uint32_t timing_class; + uint16_t tile_type; + uint8_t pip_type; + uint8_t padding; +}); + +NPNR_PACKED_STRUCT(struct WireInfoPOD { + RelPtr name; + uint32_t tile_wire; + uint32_t num_uphill; + uint32_t num_downhill; + RelPtr pips_uphill; + RelPtr pips_downhill; + uint32_t num_bel_pins; + RelPtr bel_pins; +}); + +NPNR_PACKED_STRUCT(struct TileTypePOD { + uint32_t num_bels; + uint32_t num_wires; + uint32_t num_pips; + RelPtr bel_data; + RelPtr wire_data; + RelPtr pips_data; +}); + +NPNR_PACKED_STRUCT(struct PackagePinPOD { + RelPtr name; + LocationPOD abs_loc; + int32_t bel_index; +}); + +NPNR_PACKED_STRUCT(struct PackageInfoPOD { + RelPtr name; + int32_t num_pins; + RelPtr pin_data; +}); + +NPNR_PACKED_STRUCT(struct PIOInfoPOD { + LocationPOD abs_loc; + int32_t bel_index; + RelPtr function_name; + int16_t bank; + int16_t dqsgroup; +}); + +NPNR_PACKED_STRUCT(struct TileNamePOD { + RelPtr name; + int16_t type_idx; + int16_t padding; +}); + +NPNR_PACKED_STRUCT(struct TileInfoPOD { + int32_t num_tiles; + RelPtr tile_names; +}); NPNR_PACKED_STRUCT(struct ChipInfoPOD { - int32_t stub; + int32_t width, height; + int32_t num_tiles; + int32_t num_packages, num_pios; + int32_t const_id_count; + RelPtr locations; + RelPtr> tiletype_names; + RelPtr package_info; + RelPtr pio_info; + RelPtr tile_info; }); /************************ End of chipdb section. ************************/ diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h index 6c861a32..56b546da 100644 --- a/machxo2/archdefs.h +++ b/machxo2/archdefs.h @@ -60,6 +60,8 @@ enum ConstIds #include "constids.inc" #undef X +NPNR_PACKED_STRUCT(struct LocationPOD { int16_t x, y; }); + typedef IdString BelId; typedef IdString WireId; typedef IdString PipId;