Added RTLIL::SigSpec::repeat()

This commit is contained in:
Clifford Wolf 2014-07-23 21:34:14 +02:00
parent 20a7965f61
commit 2a41afb7b2
2 changed files with 10 additions and 0 deletions

View File

@ -1796,6 +1796,14 @@ void RTLIL::SigSpec::extend_u0(int width, bool is_signed)
}
RTLIL::SigSpec RTLIL::SigSpec::repeat(int num) const
{
RTLIL::SigSpec sig;
for (int i = 0; i < num; i++)
sig.append(*this);
return sig;
}
void RTLIL::SigSpec::check() const
{
if (packed())

View File

@ -565,6 +565,8 @@ public:
void extend(int width, bool is_signed = false);
void extend_u0(int width, bool is_signed = false);
RTLIL::SigSpec repeat(int num) const;
bool operator <(const RTLIL::SigSpec &other) const;
bool operator ==(const RTLIL::SigSpec &other) const;
inline bool operator !=(const RTLIL::SigSpec &other) const { return !(*this == other); }