mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-02-06 08:35:08 +00:00
ice40: Lock out mutually exclusive pips
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
@@ -97,6 +97,7 @@ Chip::Chip(ChipArgs args) : args(args)
|
||||
bel_to_cell.resize(chip_info.num_bels);
|
||||
wire_to_net.resize(chip_info.num_wires);
|
||||
pip_to_net.resize(chip_info.num_pips);
|
||||
pips_locked.resize(chip_info.num_pips);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
14
ice40/chip.h
14
ice40/chip.h
@@ -404,7 +404,7 @@ struct Chip
|
||||
vector<IdString> bel_to_cell;
|
||||
vector<IdString> wire_to_net;
|
||||
vector<IdString> pip_to_net;
|
||||
|
||||
vector<bool> pips_locked;
|
||||
Chip(ChipArgs args);
|
||||
|
||||
ChipArgs args;
|
||||
@@ -561,6 +561,11 @@ struct Chip
|
||||
assert(pip != PipId());
|
||||
assert(pip_to_net[pip.index] == IdString());
|
||||
pip_to_net[pip.index] = net;
|
||||
// Optimise?
|
||||
for (int i = 0; i < chip_info.num_pips; i++) {
|
||||
if (chip_info.pip_data[i].switch_index == chip_info.pip_data[pip.index].switch_index)
|
||||
pips_locked[i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
void unbindPip(PipId pip)
|
||||
@@ -568,12 +573,17 @@ struct Chip
|
||||
assert(pip != PipId());
|
||||
assert(pip_to_net[pip.index] != IdString());
|
||||
pip_to_net[pip.index] = IdString();
|
||||
// Optimise?
|
||||
for (int i = 0; i < chip_info.num_pips; i++) {
|
||||
if (chip_info.pip_data[i].switch_index == chip_info.pip_data[pip.index].switch_index)
|
||||
pips_locked[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool checkPipAvail(PipId pip) const
|
||||
{
|
||||
assert(pip != PipId());
|
||||
return pip_to_net[pip.index] == IdString();
|
||||
return !pips_locked[pip.index];
|
||||
}
|
||||
|
||||
IdString getPipNet(PipId pip) const
|
||||
|
||||
Reference in New Issue
Block a user