Skip to content

Commit eb5abf9

Browse files
test_cell: Add $bweqx, kinda
It fails in sat, and in `ConstEval::eval()`. But it's pseudo supported in test_cell at least. Also fix `RTLIL::Cell::fixup_parameters()` for $bweqx.
1 parent 1a3f6c9 commit eb5abf9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

kernel/rtlil.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4063,7 +4063,7 @@ void RTLIL::Cell::fixup_parameters(bool set_a_signed, bool set_b_signed)
40634063
type.begins_with("$verific$") || type.begins_with("$array:") || type.begins_with("$extern:"))
40644064
return;
40654065

4066-
if (type == ID($buf) || type == ID($mux) || type == ID($pmux) || type == ID($bmux) || type == ID($bwmux)) {
4066+
if (type == ID($buf) || type == ID($mux) || type == ID($pmux) || type == ID($bmux) || type == ID($bwmux) || type == ID($bweqx)) {
40674067
parameters[ID::WIDTH] = GetSize(connections_[ID::Y]);
40684068
if (type.in(ID($pmux), ID($bmux)))
40694069
parameters[ID::S_WIDTH] = GetSize(connections_[ID::S]);

passes/tests/test_cell.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,17 +429,20 @@ static RTLIL::Cell* create_gold_module(RTLIL::Design *design, RTLIL::IdString ce
429429
cell->setPort(ID::Y, wire);
430430
}
431431

432-
if (cell_type == ID($bwmux))
432+
if (cell_type.in(ID($bwmux), ID($bweqx)))
433433
{
434434
int a_size = GetSize(cell->getPort(ID::A));
435435
wire = module->addWire(ID::B);
436436
wire->width = a_size;
437437
wire->port_output = true;
438438
cell->setPort(ID::B, wire);
439-
wire = module->addWire(ID::S);
440-
wire->width = a_size;
441-
wire->port_output = true;
442-
cell->setPort(ID::S, wire);
439+
if (cell_type == ID($bwmux))
440+
{
441+
wire = module->addWire(ID::S);
442+
wire->width = a_size;
443+
wire->port_output = true;
444+
cell->setPort(ID::S, wire);
445+
}
443446
wire = module->addWire(ID::Y);
444447
wire->width = a_size;
445448
wire->port_output = true;
@@ -1112,6 +1115,8 @@ struct TestCellPass : public Pass {
11121115
cell_types[ID($pmux)] = "*";
11131116
if (noeval)
11141117
cell_types[ID($bwmux)] = "A";
1118+
if (nosat && noeval)
1119+
cell_types[ID($bweqx)] = "A";
11151120

11161121
cell_types[ID($slice)] = "A";
11171122
cell_types[ID($concat)] = "AB";

0 commit comments

Comments
 (0)