aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/site_lut_mapping_cache.h
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-03-04 18:17:08 +0000
committerGitHub <noreply@github.com>2022-03-04 18:17:08 +0000
commit285325ad5bf60b5230789b9e64b4dc76a406c04d (patch)
tree4b65cf1e01ca5657bc2625ad252292648d67f64f /fpga_interchange/site_lut_mapping_cache.h
parent2c8062bdb396682a558ecbdc574620e4121b7faf (diff)
parentb5d6fc8ed7bc446b1d810c82029e7b327bea5049 (diff)
downloadnextpnr-285325ad5bf60b5230789b9e64b4dc76a406c04d.tar.gz
nextpnr-285325ad5bf60b5230789b9e64b4dc76a406c04d.tar.bz2
nextpnr-285325ad5bf60b5230789b9e64b4dc76a406c04d.zip
Merge pull request #932 from antmicro/remove-hardcoded-values-from-lut-mapping-cache
interchange: lut map cache: remove hardcoded values
Diffstat (limited to 'fpga_interchange/site_lut_mapping_cache.h')
-rw-r--r--fpga_interchange/site_lut_mapping_cache.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/fpga_interchange/site_lut_mapping_cache.h b/fpga_interchange/site_lut_mapping_cache.h
index 7b1d60a4..3efd040f 100644
--- a/fpga_interchange/site_lut_mapping_cache.h
+++ b/fpga_interchange/site_lut_mapping_cache.h
@@ -29,12 +29,6 @@ NEXTPNR_NAMESPACE_BEGIN
// Key structure used in site LUT mapping cache
struct SiteLutMappingKey
{
-
- // Maximum number of LUT cells per site
- static constexpr size_t MAX_LUT_CELLS = 8;
- // Maximum number of LUT inputs per cell
- static constexpr size_t MAX_LUT_INPUTS = 6;
-
// LUT Cell data
struct Cell
{
@@ -44,7 +38,7 @@ struct SiteLutMappingKey
// Port to net assignments. These are local net ids generated during
// key creation. This is to abstract connections from actual design
// net names. the Id 0 means unconnected.
- std::array<int32_t, MAX_LUT_INPUTS> conns;
+ std::vector<int32_t> conns;
bool operator==(const Cell &other) const
{
@@ -60,7 +54,7 @@ struct SiteLutMappingKey
int32_t tileType; // Tile type
int32_t siteType; // Site type in that tile type
size_t numCells; // LUT cell count
- std::array<Cell, MAX_LUT_CELLS> cells; // LUT cell data
+ std::vector<Cell> cells; // LUT cell data
unsigned int hash_; // Precomputed hash
@@ -80,7 +74,7 @@ struct SiteLutMappingKey
const auto &cell = cells[j];
hash_ = mkhash(hash_, cell.type.index);
hash_ = mkhash(hash_, cell.belIndex);
- for (size_t i = 0; i < MAX_LUT_INPUTS; ++i) {
+ for (size_t i = 0; i < cell.conns.size(); ++i) {
hash_ = mkhash(hash_, cell.conns[i]);
}
}