diff options
Diffstat (limited to 'gowin/cells.h')
-rw-r--r-- | gowin/cells.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gowin/cells.h b/gowin/cells.h index dbd86106..cb1c7aba 100644 --- a/gowin/cells.h +++ b/gowin/cells.h @@ -43,6 +43,40 @@ inline bool is_lut(const BaseCtx *ctx, const CellInfo *cell) } } +// Return true if a cell is a wide LUT mux +inline bool is_widelut(const BaseCtx *ctx, const CellInfo *cell) +{ + switch (cell->type.index) { + case ID_MUX2_LUT5: + case ID_MUX2_LUT6: + case ID_MUX2_LUT7: + case ID_MUX2_LUT8: + return true; + default: + return false; + } +} + +// is MUX2_LUT5 +inline bool is_mux2_lut5(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_MUX2_LUT5); } + +inline bool is_gw_mux2_lut5(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_GW_MUX2_LUT5); } + +// is MUX2_LUT6 +inline bool is_mux2_lut6(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_MUX2_LUT6); } + +inline bool is_gw_mux2_lut6(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_GW_MUX2_LUT6); } + +// is MUX2_LUT7 +inline bool is_mux2_lut7(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_MUX2_LUT7); } + +inline bool is_gw_mux2_lut7(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_GW_MUX2_LUT7); } + +// is MUX2_LUT8 +inline bool is_mux2_lut8(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_MUX2_LUT8); } + +inline bool is_gw_mux2_lut8(const BaseCtx *ctx, const CellInfo *cell) { return (cell->type.index == ID_GW_MUX2_LUT8); } + // Return true if a cell is a flipflop inline bool is_ff(const BaseCtx *ctx, const CellInfo *cell) { |