From 6a3eacddd60713d9c0d470d13a54a0c42f7d87c9 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 28 Apr 2021 14:49:26 +0100 Subject: Add default base implementation of cluster API Signed-off-by: gatecat --- ice40/archdefs.h | 4 +++- ice40/chains.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ice40') diff --git a/ice40/archdefs.h b/ice40/archdefs.h index 038a3131..c2b7019c 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -22,6 +22,7 @@ #include +#include "base_clusterinfo.h" #include "idstring.h" #include "nextpnr_namespaces.h" @@ -122,7 +123,7 @@ struct ArchNetInfo struct NetInfo; -struct ArchCellInfo +struct ArchCellInfo : BaseClusterInfo { union { @@ -154,6 +155,7 @@ struct ArchCellInfo }; typedef IdString BelBucketId; +typedef IdString ClusterId; NEXTPNR_NAMESPACE_END diff --git a/ice40/chains.cc b/ice40/chains.cc index 7eb03105..2607959a 100644 --- a/ice40/chains.cc +++ b/ice40/chains.cc @@ -292,12 +292,14 @@ class ChainConstrainer // Place carry chain chain.cells.at(0)->constr_abs_z = true; chain.cells.at(0)->constr_z = 0; + chain.cells.at(0)->cluster = chain.cells.at(0)->name; + for (int i = 1; i < int(chain.cells.size()); i++) { chain.cells.at(i)->constr_x = 0; chain.cells.at(i)->constr_y = (i / 8); chain.cells.at(i)->constr_z = i % 8; chain.cells.at(i)->constr_abs_z = true; - chain.cells.at(i)->constr_parent = chain.cells.at(0); + chain.cells.at(i)->cluster = chain.cells.at(0)->name; chain.cells.at(0)->constr_children.push_back(chain.cells.at(i)); } } -- cgit v1.2.3