Skip to content

Commit

Permalink
fix bugs in drivertools
Browse files Browse the repository at this point in the history
  • Loading branch information
aiju committed May 1, 2024
1 parent db720e9 commit cf4dd61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kernel/drivertools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,9 @@ void DriverMap::add(DriveBit const &a, DriveBit const &b)

// If either bit is just a wire that we don't need to keep, merge and
// use the other end as representative bit.
if (a_mode == BitMode::NONE)
if (a_mode == BitMode::NONE && !(b_mode == BitMode::DRIVEN_UNIQUE || b_mode == BitMode::DRIVEN))
connect_directed_merge(a_id, b_id);
else if (b_mode == BitMode::NONE)
else if (b_mode == BitMode::NONE && !(a_mode == BitMode::DRIVEN_UNIQUE || a_mode == BitMode::DRIVEN))
connect_directed_merge(b_id, a_id);
// If either bit requires a driven value and has a unique driver, merge
// and use the other end as representative bit.
Expand Down
4 changes: 2 additions & 2 deletions passes/cmds/example_dt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct ExampleDtPass : public Pass
node.append_arg(enqueue(driver));
}
} else {
DriveChunkWire whole_wire(wire_chunk.wire, 0, wire_chunk.width);
DriveChunkWire whole_wire(wire_chunk.wire, 0, wire_chunk.wire->width);
node.set_function(ExampleFn(ID($$slice), {{ID(offset), wire_chunk.offset}, {ID(width), wire_chunk.width}}));
node.append_arg(enqueue(whole_wire));
}
Expand Down Expand Up @@ -145,7 +145,7 @@ struct ExampleDtPass : public Pass

} else {
DriveChunkPort whole_port(port_chunk.cell, port_chunk.port, 0, GetSize(port_chunk.cell->connections().at(port_chunk.port)));
node.set_function(ID($$buf));
node.set_function(ExampleFn(ID($$slice), {{ID(offset), port_chunk.offset}}));
node.append_arg(enqueue(whole_port));
}
} else if (chunk.is_constant()) {
Expand Down

0 comments on commit cf4dd61

Please sign in to comment.