From 62b66e02085371c456dee95dc08d2cd41351c91f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 22 Jul 2018 10:59:21 +0200 Subject: Rename getWireBelPin to getBelPinWire Signed-off-by: Clifford Wolf --- ecp5/arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index bf36ef2f..234773e3 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -484,7 +484,7 @@ struct Arch : BaseCtx return locInfo(bel)->bel_data[bel.index].type; } - WireId getWireBelPin(BelId bel, PortPin pin) const; + WireId getBelPinWire(BelId bel, PortPin pin) const; BelPin getBelPinUphill(WireId wire) const { -- cgit v1.2.3 From 38431bd420ff2dcbaa9581571e6d0302dcfe2379 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 22 Jul 2018 16:55:10 +0200 Subject: ecp5: Fix regression following router update Signed-off-by: David Shah --- ecp5/arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index 234773e3..13b2c3b8 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -694,7 +694,7 @@ struct Arch : BaseCtx { DelayInfo delay; NPNR_ASSERT(pip != PipId()); - delay.delay = locInfo(pip)->pip_data[pip.index].delay; + delay.delay = locInfo(pip)->pip_data[pip.index].delay * 100; return delay; } -- cgit v1.2.3 From 987fdc1b29d9cb7478df49c72f68ce5f3f9f740c Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 22 Jul 2018 17:07:38 +0200 Subject: ecp5: Adding new Bel pin API Signed-off-by: David Shah --- ecp5/arch.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index 13b2c3b8..b6aec856 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -50,6 +50,7 @@ NPNR_PACKED_STRUCT(struct BelWirePOD { LocationPOD rel_wire_loc; int32_t wire_index; PortPin port; + int32_t type; }); NPNR_PACKED_STRUCT(struct BelInfoPOD { @@ -87,6 +88,9 @@ NPNR_PACKED_STRUCT(struct WireInfoPOD { int32_t num_bels_downhill; BelPortPOD bel_uphill; RelPtr bels_downhill; + + int32_t num_bel_pins; + RelPtr bel_pins; }); NPNR_PACKED_STRUCT(struct LocationTypePOD { @@ -486,7 +490,7 @@ struct Arch : BaseCtx WireId getBelPinWire(BelId bel, PortPin pin) const; - BelPin getBelPinUphill(WireId wire) const + BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED { BelPin ret; NPNR_ASSERT(wire != WireId()); @@ -500,7 +504,7 @@ struct Arch : BaseCtx return ret; } - BelPinRange getBelPinsDownhill(WireId wire) const + BelPinRange getBelPinsDownhill(WireId wire) const NPNR_DEPRECATED { BelPinRange range; NPNR_ASSERT(wire != WireId()); @@ -511,6 +515,19 @@ struct Arch : BaseCtx return range; } + BelPinRange getWireBelPins(WireId wire) const + { + BelPinRange range; + NPNR_ASSERT(wire != WireId()); + range.b.ptr = locInfo(wire)->wire_data[wire.index].bel_pins.get(); + range.b.wire_loc = wire.location; + range.e.ptr = range.b.ptr + locInfo(wire)->wire_data[wire.index].num_bel_pins; + range.e.wire_loc = wire.location; + return range; + } + + std::vector getBelPins(BelId bel) const; + // ------------------------------------------------- WireId getWireByName(IdString name) const; @@ -581,6 +598,7 @@ struct Arch : BaseCtx DelayInfo getWireDelay(WireId wire) const { DelayInfo delay; + delay.delay = 0; return delay; } @@ -739,6 +757,8 @@ struct Arch : BaseCtx BelId getPackagePinBel(const std::string &pin) const; std::string getBelPackagePin(BelId bel) const; + PortType getBelPinType(BelId bel, PortPin pin) const; + // ------------------------------------------------- GroupId getGroupByName(IdString name) const { return GroupId(); } -- cgit v1.2.3 From b9c413a5aa06a325de5c55e254441aee58143676 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 22 Jul 2018 19:58:17 +0200 Subject: Move to new API and remove deprecated --- ecp5/arch.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index b6aec856..cce9f09d 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -490,31 +490,6 @@ struct Arch : BaseCtx WireId getBelPinWire(BelId bel, PortPin pin) const; - BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED - { - BelPin ret; - NPNR_ASSERT(wire != WireId()); - - if (locInfo(wire)->wire_data[wire.index].bel_uphill.bel_index >= 0) { - ret.bel.index = locInfo(wire)->wire_data[wire.index].bel_uphill.bel_index; - ret.bel.location = wire.location + locInfo(wire)->wire_data[wire.index].bel_uphill.rel_bel_loc; - ret.pin = locInfo(wire)->wire_data[wire.index].bel_uphill.port; - } - - return ret; - } - - BelPinRange getBelPinsDownhill(WireId wire) const NPNR_DEPRECATED - { - BelPinRange range; - NPNR_ASSERT(wire != WireId()); - range.b.ptr = locInfo(wire)->wire_data[wire.index].bels_downhill.get(); - range.b.wire_loc = wire.location; - range.e.ptr = range.b.ptr + locInfo(wire)->wire_data[wire.index].num_bels_downhill; - range.e.wire_loc = wire.location; - return range; - } - BelPinRange getWireBelPins(WireId wire) const { BelPinRange range; -- cgit v1.2.3 From d0ed23d673013b4fc44f5e938bc74103d1268c13 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 23 Jul 2018 10:32:42 +0200 Subject: ecp5: Remove obsolete db entries, add Bel z-position Signed-off-by: David Shah --- ecp5/arch.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index cce9f09d..9d99da8c 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -56,6 +56,7 @@ NPNR_PACKED_STRUCT(struct BelWirePOD { NPNR_PACKED_STRUCT(struct BelInfoPOD { RelPtr name; BelType type; + int32_t z; int32_t num_bel_wires; RelPtr bel_wires; }); @@ -85,10 +86,6 @@ NPNR_PACKED_STRUCT(struct WireInfoPOD { int32_t num_uphill, num_downhill; RelPtr pips_uphill, pips_downhill; - int32_t num_bels_downhill; - BelPortPOD bel_uphill; - RelPtr bels_downhill; - int32_t num_bel_pins; RelPtr bel_pins; }); -- cgit v1.2.3 From 54d1b8adcee3d1a89bf86b87be281e683d1cea93 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 23 Jul 2018 10:53:07 +0200 Subject: ecp5: Implement new Grid APIs Signed-off-by: David Shah --- ecp5/arch.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index 9d99da8c..92240719 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -426,6 +426,20 @@ struct Arch : BaseCtx bel_to_cell[bel] = IdString(); } + Loc getBelLocation(BelId bel) const + { + Loc loc; + loc.x = bel.location.x; + loc.y = bel.location.y; + loc.z = locInfo(bel)->bel_data[bel.index].z; + return loc; + } + + BelId getBelByLocation(Loc loc) const; + BelRange getBelsByTile(int x, int y) const; + + bool getBelGlobalBuf(BelId bel) const { return false; } + bool checkBelAvail(BelId bel) const { NPNR_ASSERT(bel != BelId()); -- cgit v1.2.3 From a3864c2936dbb47af431e5c1b3dfa08f10666936 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 23 Jul 2018 13:02:37 +0200 Subject: ecp5: Add Add getGridDimX(), getGridDimY(), getTileDimZ() Signed-off-by: David Shah --- ecp5/arch.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index 92240719..f53817fd 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -388,7 +388,12 @@ struct Arch : BaseCtx IdString portPinToId(PortPin type) const; PortPin portPinFromId(IdString id) const; + // ------------------------------------------------- + int getGridDimX() const { return chip_info->width; }; + int getGridDimY() const { return chip_info->height; }; + int getTileDimZ(int,int) const { return 4; }; + // ------------------------------------------------- BelId getBelByName(IdString name) const; -- cgit v1.2.3 From bfa1137fe03a62bf4bcef1d039d520116cc5a13a Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 23 Jul 2018 13:02:57 +0200 Subject: clangformat Signed-off-by: David Shah --- ecp5/arch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index f53817fd..aada2079 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -392,8 +392,8 @@ struct Arch : BaseCtx int getGridDimX() const { return chip_info->width; }; int getGridDimY() const { return chip_info->height; }; - int getTileDimZ(int,int) const { return 4; }; - + int getTileDimZ(int, int) const { return 4; }; + // ------------------------------------------------- BelId getBelByName(IdString name) const; -- cgit v1.2.3 From 90fe002a36a9b90cd6d003d34398242a5d5affb6 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 23 Jul 2018 13:16:27 +0200 Subject: Remove getBelsByType() API Signed-off-by: Clifford Wolf --- ecp5/arch.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'ecp5/arch.h') diff --git a/ecp5/arch.h b/ecp5/arch.h index aada2079..b3ef5195 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -482,20 +482,6 @@ struct Arch : BaseCtx return range; } - BelRange getBelsByType(BelType type) const - { - BelRange range; -// FIXME -#if 0 - if (type == "TYPE_A") { - range.b.cursor = bels_type_a_begin; - range.e.cursor = bels_type_a_end; - } - ... -#endif - return range; - } - BelRange getBelsAtSameTile(BelId bel) const; BelType getBelType(BelId bel) const -- cgit v1.2.3