diff options
author | myrtle <gatecat@ds0.me> | 2022-08-11 07:26:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 07:26:20 +0100 |
commit | b653e39991429dc3350447f8b69030c454dd2ba7 (patch) | |
tree | b6bc6fe3cecc6962e12e61b9febb5c85e06960ed /gowin | |
parent | a20d21bd135aceb9155eaee714488d1d76c60898 (diff) | |
parent | c60fb94b6c45ca74632e972995555170063b3a03 (diff) | |
download | nextpnr-b653e39991429dc3350447f8b69030c454dd2ba7.tar.gz nextpnr-b653e39991429dc3350447f8b69030c454dd2ba7.tar.bz2 nextpnr-b653e39991429dc3350447f8b69030c454dd2ba7.zip |
Merge pull request #1012 from YosysHQ/gatecat/refactor-id-in
refactor: Use IdString::in instead of || chains
Diffstat (limited to 'gowin')
-rw-r--r-- | gowin/cells.cc | 5 | ||||
-rw-r--r-- | gowin/gfx.cc | 2 | ||||
-rw-r--r-- | gowin/globals.cc | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/gowin/cells.cc b/gowin/cells.cc index 0c027d38..fc5e7388 100644 --- a/gowin/cells.cc +++ b/gowin/cells.cc @@ -56,13 +56,12 @@ std::unique_ptr<CellInfo> create_generic_cell(Context *ctx, IdString type, std:: new_cell->addInput(id_CLK); new_cell->addInput(id_CE); new_cell->addInput(id_LSR); - } else if (type == id_MUX2_LUT5 || type == id_MUX2_LUT6 || type == id_MUX2_LUT7 || type == id_MUX2_LUT7 || - type == id_MUX2_LUT8) { + } else if (type.in(id_MUX2_LUT5, id_MUX2_LUT6, id_MUX2_LUT7, id_MUX2_LUT7, id_MUX2_LUT8)) { new_cell->addInput(id_I0); new_cell->addInput(id_I1); new_cell->addInput(id_SEL); new_cell->addOutput(id_OF); - } else if (type == id_IOB || type == id_IOBS) { + } else if (type.in(id_IOB, id_IOBS)) { new_cell->params[id_INPUT_USED] = 0; new_cell->params[id_OUTPUT_USED] = 0; new_cell->params[id_ENABLE_USED] = 0; diff --git a/gowin/gfx.cc b/gowin/gfx.cc index 9c9bc3fc..048ae62e 100644 --- a/gowin/gfx.cc +++ b/gowin/gfx.cc @@ -4969,7 +4969,7 @@ void gfxSetPipDefaultDecal(Arch *arch, PipInfo &pip) // create if absent if (arch->decal_graphics.count(active_id) == 0) { // clock? - if (dst_loc_id == id_GT00 || dst_loc_id == id_GT10) { + if (dst_loc_id.in(id_GT00, id_GT10)) { WireInfo &wi = arch->wire_info(pip.srcWire); if (wi.type.str(arch).substr(0, 3) != "UNK") { // create pip diff --git a/gowin/globals.cc b/gowin/globals.cc index 1794dd4c..21ee722a 100644 --- a/gowin/globals.cc +++ b/gowin/globals.cc @@ -32,8 +32,7 @@ NEXTPNR_NAMESPACE_BEGIN bool GowinGlobalRouter::is_clock_port(PortRef const &user) { - if ((user.cell->type == id_SLICE || user.cell->type == id_ODDR || user.cell->type == id_ODDRC) && - user.port == id_CLK) { + if ((user.cell->type.in(id_SLICE, id_ODDR, id_ODDRC)) && user.port == id_CLK) { return true; } return false; |