mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-22 14:17:27 +02:00
Replaced more old SigChunk programming patterns
This commit is contained in:
@@ -1999,6 +1999,14 @@ bool RTLIL::SigSpec::operator ==(const RTLIL::SigSpec &other) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RTLIL::SigSpec::is_wire() const
|
||||
{
|
||||
cover("kernel.rtlil.sigspec.is_wire");
|
||||
|
||||
pack();
|
||||
return SIZE(chunks_) == 1 && chunks_[0].wire && chunks_[0].wire->width == width_;
|
||||
}
|
||||
|
||||
bool RTLIL::SigSpec::is_fully_const() const
|
||||
{
|
||||
cover("kernel.rtlil.sigspec.is_fully_const");
|
||||
@@ -2104,6 +2112,15 @@ RTLIL::Const RTLIL::SigSpec::as_const() const
|
||||
return RTLIL::Const();
|
||||
}
|
||||
|
||||
RTLIL::Wire *RTLIL::SigSpec::as_wire() const
|
||||
{
|
||||
cover("kernel.rtlil.sigspec.as_wire");
|
||||
|
||||
pack();
|
||||
assert(is_wire());
|
||||
return chunks_[0].wire;
|
||||
}
|
||||
|
||||
bool RTLIL::SigSpec::match(std::string pattern) const
|
||||
{
|
||||
cover("kernel.rtlil.sigspec.match");
|
||||
|
||||
Reference in New Issue
Block a user