From 312699e590183d80e6dc4d1fbd74ea364c56baf3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 14 Jun 2018 15:09:13 +0200 Subject: Add route-ripup routing loop Signed-off-by: Clifford Wolf --- ice40/chip.h | 18 ++++++++++++------ ice40/main.cc | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'ice40') diff --git a/ice40/chip.h b/ice40/chip.h index 54e8e368..e2b54cdf 100644 --- a/ice40/chip.h +++ b/ice40/chip.h @@ -441,7 +441,7 @@ struct Chip std::vector bel_to_cell; std::vector wire_to_net; std::vector pip_to_net; - std::vector switches_locked; + std::vector switches_locked; Chip(ChipArgs args); ChipArgs args; @@ -592,18 +592,21 @@ struct Chip { assert(pip != PipId()); assert(pip_to_net[pip.index] == IdString()); - assert(!switches_locked[chip_info.pip_data[pip.index].switch_index]); + assert(switches_locked[chip_info.pip_data[pip.index].switch_index] == + IdString()); pip_to_net[pip.index] = net; - switches_locked[chip_info.pip_data[pip.index].switch_index] = true; + switches_locked[chip_info.pip_data[pip.index].switch_index] = net; } void unbindPip(PipId pip) { assert(pip != PipId()); assert(pip_to_net[pip.index] != IdString()); - assert(switches_locked[chip_info.pip_data[pip.index].switch_index]); + assert(switches_locked[chip_info.pip_data[pip.index].switch_index] != + IdString()); pip_to_net[pip.index] = IdString(); - switches_locked[chip_info.pip_data[pip.index].switch_index] = false; + switches_locked[chip_info.pip_data[pip.index].switch_index] = + IdString(); } bool checkPipAvail(PipId pip) const @@ -614,12 +617,15 @@ struct Chip if (x == 0 || x == (chip_info.width - 1)) return false; } - return !switches_locked[chip_info.pip_data[pip.index].switch_index]; + return switches_locked[chip_info.pip_data[pip.index].switch_index] == + IdString(); } IdString getPipNet(PipId pip, bool conflicting = false) const { assert(pip != PipId()); + if (conflicting) + return switches_locked[chip_info.pip_data[pip.index].switch_index]; return pip_to_net[pip.index]; } diff --git a/ice40/main.cc b/ice40/main.cc index 094e6a75..d4177fb1 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) "PCF constraints file to ingest"); options.add_options()("asc", po::value(), "asc bitstream file to write"); - options.add_options()("version,v", "show version"); + options.add_options()("version,V", "show version"); options.add_options()("lp384", "set device type to iCE40LP384"); options.add_options()("lp1k", "set device type to iCE40LP1K"); options.add_options()("lp8k", "set device type to iCE40LP8K"); -- cgit v1.2.3