aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch.cc
diff options
context:
space:
mode:
authorEddie Hung <e.hung@imperial.ac.uk>2018-07-23 18:22:32 -0700
committerEddie Hung <e.hung@imperial.ac.uk>2018-07-23 18:22:32 -0700
commit9149012fd1555e4e47d65988612be8da514ec0fb (patch)
treeae837431fd8535c605e7aa30a7e6d225ba919056 /ecp5/arch.cc
parent30ec1cfbd7dd02578fa2a3e33612e863f01ea959 (diff)
parent139f7e0903b6c299b7c85bebfd7674933e952a50 (diff)
downloadnextpnr-9149012fd1555e4e47d65988612be8da514ec0fb.tar.gz
nextpnr-9149012fd1555e4e47d65988612be8da514ec0fb.tar.bz2
nextpnr-9149012fd1555e4e47d65988612be8da514ec0fb.zip
Merge remote-tracking branch 'origin/master' into redist_slack
Diffstat (limited to 'ecp5/arch.cc')
-rw-r--r--ecp5/arch.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index d887aa69..371dbb12 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -329,6 +329,44 @@ std::string Arch::getBelPackagePin(BelId bel) const
return "";
}
+int Arch::getPioBelBank(BelId bel) const
+{
+ for (int i = 0; i < chip_info->num_pios; i++) {
+ if (chip_info->pio_info[i].abs_loc == bel.location && chip_info->pio_info[i].bel_index == bel.index) {
+ return chip_info->pio_info[i].bank;
+ }
+ }
+ NPNR_ASSERT_FALSE("failed to find PIO");
+}
+
+std::string Arch::getPioFunctionName(BelId bel) const
+{
+ for (int i = 0; i < chip_info->num_pios; i++) {
+ if (chip_info->pio_info[i].abs_loc == bel.location && chip_info->pio_info[i].bel_index == bel.index) {
+ const char *func = chip_info->pio_info[i].function_name.get();
+ if (func == nullptr)
+ return "";
+ else
+ return func;
+ }
+ }
+ NPNR_ASSERT_FALSE("failed to find PIO");
+}
+
+BelId Arch::getPioByFunctionName(const std::string &name) const
+{
+ for (int i = 0; i < chip_info->num_pios; i++) {
+ const char *func = chip_info->pio_info[i].function_name.get();
+ if (func != nullptr && func == name) {
+ BelId bel;
+ bel.location = chip_info->pio_info[i].abs_loc;
+ bel.index = chip_info->pio_info[i].bel_index;
+ return bel;
+ }
+ }
+ return BelId();
+}
+
std::vector<PortPin> Arch::getBelPins(BelId bel) const
{