diff options
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r-- | ice40/arch.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index be38015a..ce45b051 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -122,33 +122,33 @@ PortPin Arch::portPinFromId(IdString type) const // ----------------------------------------------------------------------- +static const ChipInfoPOD *get_chip_info(const RelPtr<ChipInfoPOD> *ptr) +{ + return ptr->get(); +} + Arch::Arch(ArchArgs args) : args(args) { #ifdef ICE40_HX1K_ONLY if (args.type == ArchArgs::HX1K) { - chip_info = - reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_1k) - ->get(); + chip_info = get_chip_info( + reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_1k)); } else { log_error("Unsupported iCE40 chip type.\n"); } #else if (args.type == ArchArgs::LP384) { - chip_info = - reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_384) - ->get(); + chip_info = get_chip_info( + reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_384)); } else if (args.type == ArchArgs::LP1K || args.type == ArchArgs::HX1K) { - chip_info = - reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_1k) - ->get(); + chip_info = get_chip_info( + reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_1k)); } else if (args.type == ArchArgs::UP5K) { - chip_info = - reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_5k) - ->get(); + chip_info = get_chip_info( + reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_5k)); } else if (args.type == ArchArgs::LP8K || args.type == ArchArgs::HX8K) { - chip_info = - reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_8k) - ->get(); + chip_info = get_chip_info( + reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_8k)); } else { log_error("Unsupported iCE40 chip type.\n"); } |