mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-30 05:09:04 +00:00
kernel: Add known_driver method to Wire/SigSpec
This commit is contained in:
parent
22423b97c1
commit
c4f435569f
2 changed files with 13 additions and 0 deletions
|
@ -5534,6 +5534,15 @@ bool RTLIL::SigSpec::is_chunk() const
|
||||||
return GetSize(chunks_) == 1;
|
return GetSize(chunks_) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RTLIL::SigSpec::known_driver() const
|
||||||
|
{
|
||||||
|
pack();
|
||||||
|
for (auto &chunk : chunks_)
|
||||||
|
if (chunk.is_wire() && !chunk.wire->known_driver())
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool RTLIL::SigSpec::is_fully_const() const
|
bool RTLIL::SigSpec::is_fully_const() const
|
||||||
{
|
{
|
||||||
cover("kernel.rtlil.sigspec.is_fully_const");
|
cover("kernel.rtlil.sigspec.is_fully_const");
|
||||||
|
|
|
@ -1329,6 +1329,8 @@ public:
|
||||||
bool is_chunk() const;
|
bool is_chunk() const;
|
||||||
inline bool is_bit() const { return width_ == 1; }
|
inline bool is_bit() const { return width_ == 1; }
|
||||||
|
|
||||||
|
bool known_driver() const;
|
||||||
|
|
||||||
bool is_fully_const() const;
|
bool is_fully_const() const;
|
||||||
bool is_fully_zero() const;
|
bool is_fully_zero() const;
|
||||||
bool is_fully_ones() const;
|
bool is_fully_ones() const;
|
||||||
|
@ -2059,6 +2061,8 @@ public:
|
||||||
int width, start_offset, port_id;
|
int width, start_offset, port_id;
|
||||||
bool port_input, port_output, upto, is_signed;
|
bool port_input, port_output, upto, is_signed;
|
||||||
|
|
||||||
|
bool known_driver() const { return driverCell_ != nullptr; }
|
||||||
|
|
||||||
RTLIL::Cell *driverCell() const { log_assert(driverCell_); return driverCell_; };
|
RTLIL::Cell *driverCell() const { log_assert(driverCell_); return driverCell_; };
|
||||||
RTLIL::IdString driverPort() const { log_assert(driverCell_); return driverPort_; };
|
RTLIL::IdString driverPort() const { log_assert(driverCell_); return driverPort_; };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue