aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-23 12:09:01 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-23 12:09:01 +0200
commit289fca0976071eabaeccedb7caf9125f70740ef8 (patch)
treefa182d79e8dc25625fce57dac7756a093a6cf730 /ice40/arch.cc
parent2e6916ecabeb9b4e4df23e68378a0c4fc608c6ec (diff)
downloadnextpnr-289fca0976071eabaeccedb7caf9125f70740ef8.tar.gz
nextpnr-289fca0976071eabaeccedb7caf9125f70740ef8.tar.bz2
nextpnr-289fca0976071eabaeccedb7caf9125f70740ef8.zip
ice40: Move global net test to Arch
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index ce45b051..78d4c29c 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -168,6 +168,9 @@ Arch::Arch(ArchArgs args) : args(args)
wire_to_net.resize(chip_info->num_wires);
pip_to_net.resize(chip_info->num_pips);
switches_locked.resize(chip_info->num_switches);
+
+ // Initialise regularly used IDStrings for performance
+ id_glb_buf_out = id("GLOBAL_BUFFER_OUTPUT");
}
// -----------------------------------------------------------------------
@@ -501,4 +504,11 @@ bool Arch::isClockPort(const CellInfo *cell, IdString port) const
return false;
}
+bool Arch::isGlobalNet(const NetInfo *net) const
+{
+ if (net == nullptr)
+ return false;
+ return net->driver.cell != nullptr && net->driver.port == id_glb_buf_out;
+}
+
NEXTPNR_NAMESPACE_END