aboutsummaryrefslogtreecommitdiffstats
path: root/gowin
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-08-10 18:58:22 +0100
committergatecat <gatecat@ds0.me>2022-08-10 18:58:22 +0100
commitc60fb94b6c45ca74632e972995555170063b3a03 (patch)
treeb6bc6fe3cecc6962e12e61b9febb5c85e06960ed /gowin
parenta20d21bd135aceb9155eaee714488d1d76c60898 (diff)
downloadnextpnr-c60fb94b6c45ca74632e972995555170063b3a03.tar.gz
nextpnr-c60fb94b6c45ca74632e972995555170063b3a03.tar.bz2
nextpnr-c60fb94b6c45ca74632e972995555170063b3a03.zip
refactor: Use IdString::in instead of || chains
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'gowin')
-rw-r--r--gowin/cells.cc5
-rw-r--r--gowin/gfx.cc2
-rw-r--r--gowin/globals.cc3
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;