mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 01:54:10 +00:00
Added RTLIL::SigSpec is_chunk()/as_chunk() API
This commit is contained in:
parent
1834af5e53
commit
c762050e7f
|
@ -2007,6 +2007,14 @@ bool RTLIL::SigSpec::is_wire() const
|
||||||
return SIZE(chunks_) == 1 && chunks_[0].wire && chunks_[0].wire->width == width_;
|
return SIZE(chunks_) == 1 && chunks_[0].wire && chunks_[0].wire->width == width_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RTLIL::SigSpec::is_chunk() const
|
||||||
|
{
|
||||||
|
cover("kernel.rtlil.sigspec.is_chunk");
|
||||||
|
|
||||||
|
pack();
|
||||||
|
return SIZE(chunks_) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
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");
|
||||||
|
@ -2121,6 +2129,15 @@ RTLIL::Wire *RTLIL::SigSpec::as_wire() const
|
||||||
return chunks_[0].wire;
|
return chunks_[0].wire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RTLIL::SigChunk RTLIL::SigSpec::as_chunk() const
|
||||||
|
{
|
||||||
|
cover("kernel.rtlil.sigspec.as_chunk");
|
||||||
|
|
||||||
|
pack();
|
||||||
|
assert(is_chunk());
|
||||||
|
return chunks_[0];
|
||||||
|
}
|
||||||
|
|
||||||
bool RTLIL::SigSpec::match(std::string pattern) const
|
bool RTLIL::SigSpec::match(std::string pattern) const
|
||||||
{
|
{
|
||||||
cover("kernel.rtlil.sigspec.match");
|
cover("kernel.rtlil.sigspec.match");
|
||||||
|
|
|
@ -577,6 +577,8 @@ public:
|
||||||
inline bool operator !=(const RTLIL::SigSpec &other) const { return !(*this == other); }
|
inline bool operator !=(const RTLIL::SigSpec &other) const { return !(*this == other); }
|
||||||
|
|
||||||
bool is_wire() const;
|
bool is_wire() const;
|
||||||
|
bool is_chunk() const;
|
||||||
|
|
||||||
bool is_fully_const() const;
|
bool is_fully_const() const;
|
||||||
bool is_fully_def() const;
|
bool is_fully_def() const;
|
||||||
bool is_fully_undef() const;
|
bool is_fully_undef() const;
|
||||||
|
@ -587,6 +589,7 @@ public:
|
||||||
std::string as_string() const;
|
std::string as_string() const;
|
||||||
RTLIL::Const as_const() const;
|
RTLIL::Const as_const() const;
|
||||||
RTLIL::Wire *as_wire() const;
|
RTLIL::Wire *as_wire() const;
|
||||||
|
RTLIL::SigChunk as_chunk() const;
|
||||||
|
|
||||||
bool match(std::string pattern) const;
|
bool match(std::string pattern) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue