mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 09:35:32 +00:00
test_cell: Support more cell types
Still unsupported: - wide muxes (`$_MUX16_` and friends) Partially supported types have comments in `test_cell.cc`. Fix `CellTypes::eval() for `$_NMUX_`. Fix `RTLIL::Cell::fixup_parameters()` for $concat, $bwmux and $bweqx.
This commit is contained in:
parent
c08bdee42c
commit
9399c0cfd5
3 changed files with 157 additions and 13 deletions
|
@ -507,6 +507,8 @@ struct CellTypes
|
|||
{
|
||||
if (cell->type.in(ID($mux), ID($_MUX_)))
|
||||
return const_mux(arg1, arg2, arg3);
|
||||
if (cell->type == ID($_NMUX_))
|
||||
return eval_not(const_mux(arg1, arg2, arg3));
|
||||
if (cell->type == ID($bwmux))
|
||||
return const_bwmux(arg1, arg2, arg3);
|
||||
if (cell->type == ID($pmux))
|
||||
|
|
|
@ -4242,9 +4242,9 @@ void RTLIL::Cell::fixup_parameters(bool set_a_signed, bool set_b_signed)
|
|||
type.begins_with("$verific$") || type.begins_with("$array:") || type.begins_with("$extern:"))
|
||||
return;
|
||||
|
||||
if (type == ID($buf) || type == ID($mux) || type == ID($pmux) || type == ID($bmux)) {
|
||||
if (type == ID($buf) || type == ID($mux) || type == ID($pmux) || type == ID($bmux) || type == ID($bwmux) || type == ID($bweqx)) {
|
||||
parameters[ID::WIDTH] = GetSize(connections_[ID::Y]);
|
||||
if (type != ID($buf) && type != ID($mux))
|
||||
if (type.in(ID($pmux), ID($bmux)))
|
||||
parameters[ID::S_WIDTH] = GetSize(connections_[ID::S]);
|
||||
check();
|
||||
return;
|
||||
|
@ -4299,7 +4299,7 @@ void RTLIL::Cell::fixup_parameters(bool set_a_signed, bool set_b_signed)
|
|||
parameters[ID::B_WIDTH] = GetSize(connections_[ID::B]);
|
||||
}
|
||||
|
||||
if (connections_.count(ID::Y))
|
||||
if (connections_.count(ID::Y) && type != ID($concat))
|
||||
parameters[ID::Y_WIDTH] = GetSize(connections_[ID::Y]);
|
||||
|
||||
if (connections_.count(ID::Q))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue