mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-21 13:23:40 +00:00
Refactoring {SigSpec|SigChunk}(RTLIL::Wire *wire, ..) constructor -- step 1/3
This commit is contained in:
parent
c61467a32c
commit
260c19ec5a
4 changed files with 45 additions and 7 deletions
|
@ -1324,6 +1324,13 @@ RTLIL::SigChunk::SigChunk(const RTLIL::Const &value)
|
|||
offset = 0;
|
||||
}
|
||||
|
||||
RTLIL::SigChunk::SigChunk(RTLIL::Wire *wire)
|
||||
{
|
||||
this->wire = wire;
|
||||
this->width = wire->width;
|
||||
this->offset = 0;
|
||||
}
|
||||
|
||||
RTLIL::SigChunk::SigChunk(RTLIL::Wire *wire, int width, int offset)
|
||||
{
|
||||
this->wire = wire;
|
||||
|
@ -1331,6 +1338,15 @@ RTLIL::SigChunk::SigChunk(RTLIL::Wire *wire, int width, int offset)
|
|||
this->offset = offset;
|
||||
}
|
||||
|
||||
RTLIL::SigChunk RTLIL::SigChunk::grml(RTLIL::Wire *wire, int offset, int width)
|
||||
{
|
||||
RTLIL::SigChunk chunk;
|
||||
chunk.wire = wire;
|
||||
chunk.width = width;
|
||||
chunk.offset = offset;
|
||||
return chunk;
|
||||
}
|
||||
|
||||
RTLIL::SigChunk::SigChunk(const std::string &str)
|
||||
{
|
||||
wire = NULL;
|
||||
|
@ -1432,6 +1448,13 @@ RTLIL::SigSpec::SigSpec(const RTLIL::SigChunk &chunk)
|
|||
check();
|
||||
}
|
||||
|
||||
RTLIL::SigSpec::SigSpec(RTLIL::Wire *wire)
|
||||
{
|
||||
chunks_.push_back(RTLIL::SigChunk(wire));
|
||||
width_ = chunks_.back().width;
|
||||
check();
|
||||
}
|
||||
|
||||
RTLIL::SigSpec::SigSpec(RTLIL::Wire *wire, int width, int offset)
|
||||
{
|
||||
chunks_.push_back(RTLIL::SigChunk(wire, width, offset));
|
||||
|
@ -1439,6 +1462,15 @@ RTLIL::SigSpec::SigSpec(RTLIL::Wire *wire, int width, int offset)
|
|||
check();
|
||||
}
|
||||
|
||||
RTLIL::SigSpec RTLIL::SigSpec::grml(RTLIL::Wire *wire, int offset, int width)
|
||||
{
|
||||
RTLIL::SigSpec sig;
|
||||
sig.chunks_.push_back(RTLIL::SigChunk::grml(wire, offset, width));
|
||||
sig.width_ = sig.chunks_.back().width;
|
||||
sig.check();
|
||||
return sig;
|
||||
}
|
||||
|
||||
RTLIL::SigSpec::SigSpec(const std::string &str)
|
||||
{
|
||||
chunks_.push_back(RTLIL::SigChunk(str));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue