diff options
author | gatecat <gatecat@ds0.me> | 2022-08-10 18:58:22 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2022-08-10 18:58:22 +0100 |
commit | c60fb94b6c45ca74632e972995555170063b3a03 (patch) | |
tree | b6bc6fe3cecc6962e12e61b9febb5c85e06960ed /ice40/cells.cc | |
parent | a20d21bd135aceb9155eaee714488d1d76c60898 (diff) | |
download | nextpnr-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 'ice40/cells.cc')
-rw-r--r-- | ice40/cells.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ice40/cells.cc b/ice40/cells.cc index 9166b41b..fc24caaf 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -502,13 +502,13 @@ bool is_clock_port(const BaseCtx *ctx, const PortRef &port) if (port.cell->type == id_ICESTORM_LC) return port.port == id_CLK; if (is_ram(ctx, port.cell) || port.cell->type == id_ICESTORM_RAM) - return port.port == id_RCLK || port.port == id_WCLK || port.port == id_RCLKN || port.port == id_WCLKN; + return port.port.in(id_RCLK, id_WCLK, id_RCLKN, id_WCLKN); if (is_sb_mac16(ctx, port.cell) || port.cell->type == id_ICESTORM_DSP) return port.port == id_CLK; if (is_sb_spram(ctx, port.cell) || port.cell->type == id_ICESTORM_SPRAM) return port.port == id_CLOCK; if (is_sb_io(ctx, port.cell)) - return port.port == id_INPUT_CLK || port.port == id_OUTPUT_CLK; + return port.port.in(id_INPUT_CLK, id_OUTPUT_CLK); return false; } @@ -517,11 +517,11 @@ bool is_reset_port(const BaseCtx *ctx, const PortRef &port) if (port.cell == nullptr) return false; if (is_ff(ctx, port.cell)) - return port.port == id_R || port.port == id_S; + return port.port.in(id_R, id_S); if (port.cell->type == id_ICESTORM_LC) return port.port == id_SR; if (is_sb_mac16(ctx, port.cell) || port.cell->type == id_ICESTORM_DSP) - return port.port == id_IRSTTOP || port.port == id_IRSTBOT || port.port == id_ORSTTOP || port.port == id_ORSTBOT; + return port.port.in(id_IRSTTOP, id_IRSTBOT, id_ORSTTOP, id_ORSTBOT); return false; } |