diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-20 17:13:26 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-07-20 17:13:26 +0200 |
commit | e16b4a325e2b0721e29cba93804923dedf74a68c (patch) | |
tree | a80aa31ed8be848d460cd90410a91f24da14cea9 /ecp5/arch.cc | |
parent | c0f1af87f6c1c6843e536a87ef88e39fa3428c5b (diff) | |
parent | 6c835d76f27af79813299419780c039eb2a8b02e (diff) | |
download | nextpnr-e16b4a325e2b0721e29cba93804923dedf74a68c.tar.gz nextpnr-e16b4a325e2b0721e29cba93804923dedf74a68c.tar.bz2 nextpnr-e16b4a325e2b0721e29cba93804923dedf74a68c.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into gridapi
Diffstat (limited to 'ecp5/arch.cc')
-rw-r--r-- | ecp5/arch.cc | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 0ffede3b..1510a27f 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -118,6 +118,16 @@ Arch::Arch(ArchArgs args) : args(args) log_error("Unsupported ECP5 chip type.\n"); } #endif + package_info = nullptr; + for (int i = 0; i < chip_info->num_packages; i++) { + if (args.package == chip_info->package_info[i].name.get()) { + package_info = &(chip_info->package_info[i]); + break; + } + } + + if (!package_info) + log_error("Unsupported package '%s' for '%s'.\n", args.package.c_str(), getChipName().c_str()); id_trellis_slice = id("TRELLIS_SLICE"); id_clk = id("CLK"); @@ -282,9 +292,28 @@ IdString Arch::getPipName(PipId pip) const // ----------------------------------------------------------------------- -BelId Arch::getPackagePinBel(const std::string &pin) const { return BelId(); } +BelId Arch::getPackagePinBel(const std::string &pin) const +{ + for (int i = 0; i < package_info->num_pins; i++) { + if (package_info->pin_data[i].name.get() == pin) { + BelId bel; + bel.location = package_info->pin_data[i].abs_loc; + bel.index = package_info->pin_data[i].bel_index; + return bel; + } + } + return BelId(); +} -std::string Arch::getBelPackagePin(BelId bel) const { return ""; } +std::string Arch::getBelPackagePin(BelId bel) const +{ + for (int i = 0; i < package_info->num_pins; i++) { + if (package_info->pin_data[i].abs_loc == bel.location && package_info->pin_data[i].bel_index == bel.index) { + return package_info->pin_data[i].name.get(); + } + } + return ""; +} // ----------------------------------------------------------------------- void Arch::estimatePosition(BelId bel, int &x, int &y, bool &gb) const |