From 03508faabfc2f5b76039cfd13d02a341baa848a4 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Tue, 17 Jul 2018 19:16:26 +0100 Subject: WIP. --- ice40/arch.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index 5dab414b..b89a0b54 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -373,6 +373,7 @@ struct Arch : BaseCtx bel_to_cell[bel.index] = cell; cells[cell]->bel = bel; cells[cell]->belStrength = strength; + refreshUiBel(bel); } void unbindBel(BelId bel) @@ -382,6 +383,7 @@ struct Arch : BaseCtx cells[bel_to_cell[bel.index]]->bel = BelId(); cells[bel_to_cell[bel.index]]->belStrength = STRENGTH_NONE; bel_to_cell[bel.index] = IdString(); + refreshUiBel(bel); } bool checkBelAvail(BelId bel) const @@ -475,6 +477,7 @@ struct Arch : BaseCtx wire_to_net[wire.index] = net; nets[net]->wires[wire].pip = PipId(); nets[net]->wires[wire].strength = strength; + refreshUiWire(wire); } void unbindWire(WireId wire) @@ -494,6 +497,7 @@ struct Arch : BaseCtx net_wires.erase(it); wire_to_net[wire.index] = IdString(); + refreshUiWire(wire); } bool checkWireAvail(WireId wire) const @@ -541,6 +545,8 @@ struct Arch : BaseCtx wire_to_net[dst.index] = net; nets[net]->wires[dst].pip = pip; nets[net]->wires[dst].strength = strength; + refreshUiPip(pip); + refreshUiWire(dst); } void unbindPip(PipId pip) @@ -557,6 +563,8 @@ struct Arch : BaseCtx pip_to_net[pip.index] = IdString(); switches_locked[chip_info->pip_data[pip.index].switch_index] = IdString(); + refreshUiPip(pip); + refreshUiWire(dst); } bool checkPipAvail(PipId pip) const -- cgit v1.2.3 From 1e96999863da24021c215a3706b5a442789ba3a7 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 22 Jul 2018 00:50:49 +0200 Subject: clangformat Signed-off-by: Clifford Wolf --- ice40/arch.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index b7e66414..9a8ec7bc 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -455,10 +455,7 @@ struct Arch : BaseCtx BelId getBelByLocation(Loc loc) const; BelRange getBelsByTile(int x, int y) const; - bool getBelGlobalBuf(BelId bel) const - { - return chip_info->bel_data[bel.index].type == TYPE_SB_GB; - } + bool getBelGlobalBuf(BelId bel) const { return chip_info->bel_data[bel.index].type == TYPE_SB_GB; } BelRange getBelsAtSameTile(BelId bel) const NPNR_DEPRECATED; -- cgit v1.2.3 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 --- ice40/arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index 9a8ec7bc..566f807a 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -465,7 +465,7 @@ struct Arch : BaseCtx return chip_info->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 b60c9485d2d324a221c7050aa6437b291b3dedf4 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 22 Jul 2018 11:56:51 +0200 Subject: Add Arch::getBelPinType() and Arch::getWireBelPins() in iCE40 arch Signed-off-by: Clifford Wolf --- ice40/arch.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index 566f807a..f3016424 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -46,6 +46,7 @@ template struct RelPtr NPNR_PACKED_STRUCT(struct BelWirePOD { int32_t wire_index; PortPin port; + int32_t type; }); NPNR_PACKED_STRUCT(struct BelInfoPOD { @@ -86,6 +87,9 @@ NPNR_PACKED_STRUCT(struct WireInfoPOD { BelPortPOD bel_uphill; RelPtr bels_downhill; + int32_t num_bel_pins; + RelPtr bel_pins; + int32_t num_segments; RelPtr segments; @@ -466,8 +470,9 @@ struct Arch : BaseCtx } WireId getBelPinWire(BelId bel, PortPin pin) const; + PortType getBelPinType(BelId bel, PortPin pin) const; - BelPin getBelPinUphill(WireId wire) const + BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED { BelPin ret; NPNR_ASSERT(wire != WireId()); @@ -480,7 +485,7 @@ struct Arch : BaseCtx return ret; } - BelPinRange getBelPinsDownhill(WireId wire) const + BelPinRange getBelPinsDownhill(WireId wire) const NPNR_DEPRECATED { BelPinRange range; NPNR_ASSERT(wire != WireId()); @@ -555,6 +560,15 @@ struct Arch : BaseCtx return delay; } + BelPinRange getWireBelPins(WireId wire) const + { + BelPinRange range; + NPNR_ASSERT(wire != WireId()); + range.b.ptr = chip_info->wire_data[wire.index].bel_pins.get(); + range.e.ptr = range.b.ptr + chip_info->wire_data[wire.index].num_bel_pins; + return range; + } + WireRange getWires() const { WireRange range; -- cgit v1.2.3 From e13fc7edabb449d21ad6473bab23d5c1b2cf3761 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 22 Jul 2018 12:08:52 +0200 Subject: Add Arch::getBelPins() to generic and iCE40 archs Signed-off-by: Clifford Wolf --- ice40/arch.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index f3016424..2e2018fb 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -494,6 +494,8 @@ struct Arch : BaseCtx return range; } + std::vector getBelPins(BelId bel) const; + // ------------------------------------------------- WireId getWireByName(IdString name) const; -- 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 --- ice40/arch.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index 2e2018fb..3ae6ce65 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -471,29 +471,6 @@ struct Arch : BaseCtx WireId getBelPinWire(BelId bel, PortPin pin) const; PortType getBelPinType(BelId bel, PortPin pin) const; - - BelPin getBelPinUphill(WireId wire) const NPNR_DEPRECATED - { - BelPin ret; - NPNR_ASSERT(wire != WireId()); - - if (chip_info->wire_data[wire.index].bel_uphill.bel_index >= 0) { - ret.bel.index = chip_info->wire_data[wire.index].bel_uphill.bel_index; - ret.pin = chip_info->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 = chip_info->wire_data[wire.index].bels_downhill.get(); - range.e.ptr = range.b.ptr + chip_info->wire_data[wire.index].num_bels_downhill; - return range; - } - std::vector getBelPins(BelId bel) const; // ------------------------------------------------- -- cgit v1.2.3 From 27c523682601e7b504c924a00bec98743fd3477c Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 23 Jul 2018 12:19:54 +0200 Subject: Add getGridDimX(), getGridDimY(), getTileDimZ() API Signed-off-by: Clifford Wolf --- ice40/arch.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index 3ae6ce65..cd699a0c 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -377,6 +377,12 @@ struct Arch : BaseCtx // ------------------------------------------------- + int getGridDimX() const { return 34; } + int getGridDimY() const { return 34; } + int getTileDimZ(int, int) const { return 8; } + + // ------------------------------------------------- + BelId getBelByName(IdString name) const; IdString getBelName(BelId bel) 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 --- ice40/arch.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'ice40/arch.h') diff --git a/ice40/arch.h b/ice40/arch.h index cd699a0c..d4d71cfc 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -439,20 +439,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; - } - Loc getBelLocation(BelId bel) const { Loc loc; -- cgit v1.2.3