From 09535a95caef465cae025d1184167eee43a55e72 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 17 Feb 2021 15:57:31 +0000 Subject: gowin: Fix IdStrings being overwritten by wireToGlobal Signed-off-by: gatecat --- gowin/arch.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gowin') diff --git a/gowin/arch.cc b/gowin/arch.cc index 58df773c..2e742693 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -589,14 +589,14 @@ Arch::Arch(ArchArgs args) : args(args) const PairPOD pip = pips[p][j]; int destrow = row; int destcol = col; - IdString destid(pip.dest_id); - IdString gdestname = wireToGlobal(destrow, destcol, db, destid); + IdString destid(pip.dest_id), gdestid(pip.dest_id); + IdString gdestname = wireToGlobal(destrow, destcol, db, gdestid); if (wires.count(gdestname) == 0) addWire(gdestname, destid, destcol, destrow); int srcrow = row; int srccol = col; - IdString srcid(pip.src_id); - IdString gsrcname = wireToGlobal(srcrow, srccol, db, srcid); + IdString srcid(pip.src_id), gsrcid(pip.src_id); + IdString gsrcname = wireToGlobal(srcrow, srccol, db, gsrcid); if (wires.count(gsrcname) == 0) addWire(gsrcname, srcid, srccol, srcrow); } @@ -701,12 +701,12 @@ Arch::Arch(ArchArgs args) : args(args) const PairPOD pip = pips[p][j]; int destrow = row; int destcol = col; - IdString destid(pip.dest_id); - IdString gdestname = wireToGlobal(destrow, destcol, db, destid); + IdString destid(pip.dest_id), gdestid(pip.dest_id); + IdString gdestname = wireToGlobal(destrow, destcol, db, gdestid); int srcrow = row; int srccol = col; - IdString srcid(pip.src_id); - IdString gsrcname = wireToGlobal(srcrow, srccol, db, srcid); + IdString srcid(pip.src_id), gsrcid(pip.src_id); + IdString gsrcname = wireToGlobal(srcrow, srccol, db, gsrcid); snprintf(buf, 32, "R%dC%d_%s_%s", row + 1, col + 1, srcid.c_str(this), destid.c_str(this)); IdString pipname = id(buf); -- cgit v1.2.3 From 18113ff43d318047fe166dcff91588bc9a195bd0 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 17 Feb 2021 15:58:00 +0000 Subject: gowin: Use base bel bucket/cell type methods Signed-off-by: gatecat --- gowin/arch.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gowin') diff --git a/gowin/arch.h b/gowin/arch.h index 3a1b2534..cdc011aa 100644 --- a/gowin/arch.h +++ b/gowin/arch.h @@ -243,7 +243,7 @@ struct CellTiming std::unordered_map> clockingInfo; }; -struct ArchRanges +struct ArchRanges : BaseArchRanges { using ArchArgsT = ArchArgs; // Bels @@ -269,10 +269,6 @@ struct ArchRanges using GroupGroupsRangeT = const std::vector &; // Decals using DecalGfxRangeT = const std::vector &; - // Placement validity - using CellTypeRangeT = std::vector; - using BelBucketRangeT = std::vector; - using BucketBelRangeT = std::vector; }; struct Arch : BaseArch -- cgit v1.2.3 From a8c55728e2f10ef2d92369ee120640b76cbe3ff2 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 17 Feb 2021 16:03:03 +0000 Subject: gowin: Fix archcheck errors and add to CI Signed-off-by: gatecat --- gowin/arch.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gowin') diff --git a/gowin/arch.cc b/gowin/arch.cc index 2e742693..b817dae0 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -89,6 +89,16 @@ void Arch::addPip(IdString name, IdString type, IdString srcWire, IdString dstWi if (int(tilePipDimZ[loc.x].size()) <= loc.y) tilePipDimZ[loc.x].resize(loc.y + 1); + // Needed to ensure empty tile bel locations + if (int(bels_by_tile.size()) <= loc.x) + bels_by_tile.resize(loc.x + 1); + if (int(bels_by_tile[loc.x].size()) <= loc.y) + bels_by_tile[loc.x].resize(loc.y + 1); + if (int(tileBelDimZ.size()) <= loc.x) + tileBelDimZ.resize(loc.x + 1); + if (int(tileBelDimZ[loc.x].size()) <= loc.y) + tileBelDimZ[loc.x].resize(loc.y + 1); + gridDimX = std::max(gridDimX, loc.x + 1); gridDimY = std::max(gridDimY, loc.y + 1); tilePipDimZ[loc.x][loc.y] = std::max(tilePipDimZ[loc.x][loc.y], loc.z + 1); @@ -124,7 +134,7 @@ void Arch::addBel(IdString name, IdString type, Loc loc, bool gb) tileBelDimZ[loc.x].resize(loc.y + 1); gridDimX = std::max(gridDimX, loc.x + 1); - gridDimY = std::max(gridDimY, loc.x + 1); + gridDimY = std::max(gridDimY, loc.y + 1); tileBelDimZ[loc.x][loc.y] = std::max(tileBelDimZ[loc.x][loc.y], loc.z + 1); } -- cgit v1.2.3