projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9cb0456
)
SigSpec::extract to take negative lengths
author
Eddie Hung
<eddie@fpgeh.com>
Fri, 19 Jul 2019 19:34:04 +0000
(12:34 -0700)
committer
Eddie Hung
<eddie@fpgeh.com>
Fri, 19 Jul 2019 19:34:04 +0000
(12:34 -0700)
kernel/rtlil.cc
patch
|
blob
|
history
diff --git
a/kernel/rtlil.cc
b/kernel/rtlil.cc
index a09f4a0d1cbfa81cb2edbf69a06f605684b95a63..85b013bdcf92f82172fc8b9cf578900cefc23ab1 100644
(file)
--- a/
kernel/rtlil.cc
+++ b/
kernel/rtlil.cc
@@
-3353,7
+3353,7
@@
RTLIL::SigSpec RTLIL::SigSpec::extract(int offset, int length) const
{
unpack();
cover("kernel.rtlil.sigspec.extract_pos");
- return std::vector<RTLIL::SigBit>(bits_.begin() + offset,
bits_.begin() + offset + length
);
+ return std::vector<RTLIL::SigBit>(bits_.begin() + offset,
length >= 0 ? bits_.begin() + offset + length : bits_.end() + length + 1
);
}
void RTLIL::SigSpec::append(const RTLIL::SigSpec &signal)