mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-26 22:17:55 +00:00
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.
This commit is contained in:
parent
78a6235200
commit
66f66d51ee
1 changed files with 4 additions and 0 deletions
|
@ -334,6 +334,7 @@ struct CellTypes
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
|
||||||
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)
|
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)
|
||||||
{
|
{
|
||||||
if (type == ID($sshr) && !signed1)
|
if (type == ID($sshr) && !signed1)
|
||||||
|
@ -416,6 +417,7 @@ struct CellTypes
|
||||||
log_abort();
|
log_abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
|
||||||
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool *errp = nullptr)
|
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool *errp = nullptr)
|
||||||
{
|
{
|
||||||
if (cell->type == ID($slice)) {
|
if (cell->type == ID($slice)) {
|
||||||
|
@ -503,6 +505,7 @@ struct CellTypes
|
||||||
return eval(cell->type, arg1, arg2, signed_a, signed_b, result_len, errp);
|
return eval(cell->type, arg1, arg2, signed_a, signed_b, result_len, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
|
||||||
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, bool *errp = nullptr)
|
static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, bool *errp = nullptr)
|
||||||
{
|
{
|
||||||
if (cell->type.in(ID($mux), ID($_MUX_)))
|
if (cell->type.in(ID($mux), ID($_MUX_)))
|
||||||
|
@ -522,6 +525,7 @@ struct CellTypes
|
||||||
return eval(cell, arg1, arg2, errp);
|
return eval(cell, arg1, arg2, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
|
||||||
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)
|
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)
|
||||||
{
|
{
|
||||||
if (cell->type == ID($_AOI4_))
|
if (cell->type == ID($_AOI4_))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue