mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 14:13:23 +00:00
cxxrtl: emit debug information for constant wires.
Constant wires can represent a significant chunk of the design in generic designs or after optimization. Emitting them in VCD files significantly improves usability because gtkwave removes all traces that are not present in the VCD file after reload, and iterative development suffers if switching a varying signal to a constant disrupts the workflow.
This commit is contained in:
parent
d5c07e5b6f
commit
f2d7a18756
3 changed files with 44 additions and 17 deletions
|
@ -741,6 +741,17 @@ struct debug_item : ::cxxrtl_object {
|
|||
next = item.data;
|
||||
}
|
||||
|
||||
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) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue