aboutsummaryrefslogtreecommitdiffstats
path: root/backends/cxxrtl/cxxrtl.h
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-06-08 18:24:32 +0000
committerGitHub <noreply@github.com>2020-06-08 18:24:32 +0000
commit4ef9ee3c4210a9d0c3b6491a0c89ee3365c77779 (patch)
tree30718823222080e46abc4bd9f33606127b7b060d /backends/cxxrtl/cxxrtl.h
parent369dcb4e824ea18957b4ad989f50f757674799c3 (diff)
parent467152d79fd4c8e25b48481f742fe318b1395728 (diff)
downloadyosys-4ef9ee3c4210a9d0c3b6491a0c89ee3365c77779.tar.gz
yosys-4ef9ee3c4210a9d0c3b6491a0c89ee3365c77779.tar.bz2
yosys-4ef9ee3c4210a9d0c3b6491a0c89ee3365c77779.zip
Merge pull request #2121 from whitequark/cxxrtl-debug-aliases
cxxrtl: improve design visibility
Diffstat (limited to 'backends/cxxrtl/cxxrtl.h')
-rw-r--r--backends/cxxrtl/cxxrtl.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/backends/cxxrtl/cxxrtl.h b/backends/cxxrtl/cxxrtl.h
index 5f74899fd..30f4667c5 100644
--- a/backends/cxxrtl/cxxrtl.h
+++ b/backends/cxxrtl/cxxrtl.h
@@ -742,6 +742,17 @@ struct debug_item : ::cxxrtl_object {
}
template<size_t Bits>
+ debug_item(const value<Bits> &item) {
+ static_assert(sizeof(item) == value<Bits>::chunks * sizeof(chunk_t),
+ "value<Bits> is not compatible with C layout");
+ type = VALUE;
+ width = Bits;
+ depth = 1;
+ curr = const_cast<uint32_t*>(item.data);
+ next = nullptr;
+ }
+
+ template<size_t Bits>
debug_item(wire<Bits> &item) {
static_assert(sizeof(item.curr) == value<Bits>::chunks * sizeof(chunk_t) &&
sizeof(item.next) == value<Bits>::chunks * sizeof(chunk_t),