Skip to content

Commit 66f66d5

Browse files
celltypes: Comment pointing to ConstEval
`CellTypes::eval()` is more generic but also more limited. `ConstEval::eval()` requires more setup (both in code and at runtime) but has more complete support.
1 parent 78a6235 commit 66f66d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/celltypes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ struct CellTypes
334334
return v;
335335
}
336336

337+
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
337338
static RTLIL::Const eval(RTLIL::IdString type, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len, bool *errp = nullptr)
338339
{
339340
if (type == ID($sshr) && !signed1)
@@ -416,6 +417,7 @@ struct CellTypes
416417
log_abort();
417418
}
418419

420+
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
419421
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool *errp = nullptr)
420422
{
421423
if (cell->type == ID($slice)) {
@@ -503,6 +505,7 @@ struct CellTypes
503505
return eval(cell->type, arg1, arg2, signed_a, signed_b, result_len, errp);
504506
}
505507

508+
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
506509
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, bool *errp = nullptr)
507510
{
508511
if (cell->type.in(ID($mux), ID($_MUX_)))
@@ -522,6 +525,7 @@ struct CellTypes
522525
return eval(cell, arg1, arg2, errp);
523526
}
524527

528+
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
525529
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, const RTLIL::Const &arg4, bool *errp = nullptr)
526530
{
527531
if (cell->type == ID($_AOI4_))

0 commit comments

Comments
 (0)