Open eddiehung opened 4 years ago
Found when debugging an inconsistent CI failure: https://travis-ci.org/YosysHQ/yosys/builds/658368799?utm_medium=notification&utm_source=github_status that was caused by the accidental use of an implicit signal that was fixed here: https://github.com/YosysHQ/yosys/commit/0930c00f038453685bf4d8f5366db7fe71f54cf8#diff-c8f274104b91615dd258e9b2c4e7c8c0L974-L1006
However, even the accidental use of a non-existent signal should not cause an invalid read.
Steps to reproduce the issue
Expected behavior
No valgrind errors.
Actual behavior
It appears that during AST processing, blackbox modules will have everything inside it -- except for ports, parameters, and specify cells -- deleted: https://github.com/YosysHQ/yosys/blob/6eb528277e73a978ace7d6f693215d9ff92f898d/frontends/ast/ast.cc#L1055-L1088 Any
AST_IDENTIFIER
-s used inside specify cells that are not input/output ports will thus hold a dangling pointer in itsid2ast
member.What is the best solution here? The LRM specifies that:
-- concerningly, a net connected to a port is also allowed.
The LRM also says the following about state dependent paths (e.g.
if (a) (i => o) = 10
):-- the second point of which really means that it could really be anything in the design, and throwing it all away may not be the best idea.