aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorD. Shah <dave@ds0.me>2021-01-29 11:11:08 +0000
committerD. Shah <dave@ds0.me>2021-02-02 16:59:40 +0000
commitff92d19fed274c6469720cc726e80dc777fa767f (patch)
tree6e99ceddd946c086b727a662812c828e97b3f899
parent90edf33c95de975b7f8204624a995c4826c52b84 (diff)
downloadnextpnr-ff92d19fed274c6469720cc726e80dc777fa767f.tar.gz
nextpnr-ff92d19fed274c6469720cc726e80dc777fa767f.tar.bz2
nextpnr-ff92d19fed274c6469720cc726e80dc777fa767f.zip
arch: Add getNameDelimiter API for string lists
Signed-off-by: D. Shah <dave@ds0.me>
-rw-r--r--common/arch_pybindings_shared.h3
-rw-r--r--docs/archapi.md5
-rw-r--r--ecp5/arch.h1
-rw-r--r--generic/arch.h1
-rw-r--r--gowin/arch.h1
-rw-r--r--ice40/arch.h1
-rw-r--r--nexus/arch.h1
7 files changed, 12 insertions, 1 deletions
diff --git a/common/arch_pybindings_shared.h b/common/arch_pybindings_shared.h
index 5295c6ab..1cd70c99 100644
--- a/common/arch_pybindings_shared.h
+++ b/common/arch_pybindings_shared.h
@@ -10,6 +10,9 @@ readonly_wrapper<Context, decltype(&Context::hierarchy), &Context::hierarchy, wr
readwrite_wrapper<Context, decltype(&Context::top_module), &Context::top_module, conv_to_str<IdString>,
conv_from_str<IdString>>::def_wrap(ctx_cls, "top_module");
+fn_wrapper_0a<Context, decltype(&Context::getNameDelimiter), &Context::getNameDelimiter, pass_through<char>>::def_wrap(
+ ctx_cls, "getNameDelimiter");
+
fn_wrapper_1a<Context, decltype(&Context::getNetByAlias), &Context::getNetByAlias, deref_and_wrap<NetInfo>,
conv_from_str<IdString>>::def_wrap(ctx_cls, "getNetByAlias");
fn_wrapper_2a_v<Context, decltype(&Context::addClock), &Context::addClock, conv_from_str<IdString>,
diff --git a/docs/archapi.md b/docs/archapi.md
index 49183c63..6b9b0913 100644
--- a/docs/archapi.md
+++ b/docs/archapi.md
@@ -92,6 +92,10 @@ Get Z dimension for the specified tile for bels. All bels with at specified X an
Get Z dimension for the specified tile for pips. All pips with at specified X and Y coordinates must have a Z coordinate in the range `0 .. getTileDimZ(X,Y)-1` (inclusive).
+### char getNameDelimiter() const
+
+Returns a delimiter that can be used to build up bel, wire and pip names out of hierarchical components (such as tiles and sites) to avoid the high memory usage of storing full names for every object.
+
Cell Methods
-----------
@@ -99,7 +103,6 @@ Cell Methods
Get list of cell types that this architecture accepts.
-
Bel Methods
-----------
diff --git a/ecp5/arch.h b/ecp5/arch.h
index 18a70fe8..6b32f284 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -471,6 +471,7 @@ struct Arch : BaseCtx
int getGridDimY() const { return chip_info->height; };
int getTileBelDimZ(int, int) const { return max_loc_bels; };
int getTilePipDimZ(int, int) const { return 1; };
+ char getNameDelimiter() const { return '/'; }
// -------------------------------------------------
diff --git a/generic/arch.h b/generic/arch.h
index f3e26bb5..3ec9dc5d 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -187,6 +187,7 @@ struct Arch : BaseCtx
int getGridDimY() const { return gridDimY; }
int getTileBelDimZ(int x, int y) const { return tileBelDimZ[x][y]; }
int getTilePipDimZ(int x, int y) const { return tilePipDimZ[x][y]; }
+ char getNameDelimiter() const { return '/'; }
BelId getBelByName(IdString name) const;
IdString getBelName(BelId bel) const;
diff --git a/gowin/arch.h b/gowin/arch.h
index f12c604e..6337255a 100644
--- a/gowin/arch.h
+++ b/gowin/arch.h
@@ -323,6 +323,7 @@ struct Arch : BaseCtx
int getGridDimY() const { return gridDimY; }
int getTileBelDimZ(int x, int y) const { return tileBelDimZ[x][y]; }
int getTilePipDimZ(int x, int y) const { return tilePipDimZ[x][y]; }
+ char getNameDelimiter() const { return '/'; }
BelId getBelByName(IdString name) const;
IdString getBelName(BelId bel) const;
diff --git a/ice40/arch.h b/ice40/arch.h
index fd92d988..b9934dad 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -407,6 +407,7 @@ struct Arch : BaseCtx
int getGridDimY() const { return chip_info->height; }
int getTileBelDimZ(int, int) const { return 8; }
int getTilePipDimZ(int, int) const { return 1; }
+ char getNameDelimiter() const { return '/'; }
// -------------------------------------------------
diff --git a/nexus/arch.h b/nexus/arch.h
index ee66599a..3063ce67 100644
--- a/nexus/arch.h
+++ b/nexus/arch.h
@@ -909,6 +909,7 @@ struct Arch : BaseCtx
int getGridDimY() const { return chip_info->height; }
int getTileBelDimZ(int, int) const { return 256; }
int getTilePipDimZ(int, int) const { return 1; }
+ char getNameDelimiter() const { return '/'; }
// -------------------------------------------------