mirror of
https://github.com/YosysHQ/yosys
synced 2025-05-13 02:34:44 +00:00
Add support for int stuff
This commit is contained in:
parent
1801bb966a
commit
db0317afc5
2 changed files with 11 additions and 0 deletions
|
@ -214,6 +214,16 @@ RTLIL::Const::Const(const std::string &str)
|
|||
}
|
||||
}
|
||||
|
||||
RTLIL::Const::Const(int val, int width)
|
||||
{
|
||||
flags = RTLIL::CONST_FLAG_NONE;
|
||||
bits.reserve(width);
|
||||
for (int i = 0; i < width; i++) {
|
||||
bits.push_back((val & 1) != 0 ? State::S1 : State::S0);
|
||||
val = val >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
RTLIL::Const::Const(long long val, int width)
|
||||
{
|
||||
flags = RTLIL::CONST_FLAG_NONE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue