Closed alikates closed 3 months ago
That's a good catch and thanks for minimizing this.
From what I understand there's isn't any branch in the codepath between the AST dump and the check for the failed elaboration. So maybe we are passing a different configuration to slang in each case, and depending on that it reports the errors or not?
Some facts on the AST are derived on demand (e.g. in the getType()
method of symbols), and my bet is that the forceElaborate
call is not strong enough to have everything elaborated ahead of the hasIssuedErrors
check, so dumping the AST helped. As I see it this may be a bug in the forceElaborate()
method.
As I see it this may be a bug in the
forceElaborate()
method.
It looks like forceElaborate()
purposefully doesn't enter instance bodies so we are using it wrong (it can only be used on one instance at a time).
I changed the way we are using forceElaborate
in f65e737.
I'm replicating the issues being faced when parsing BSC
core_tile
by writing small tests for them. I noticed some errors are only reported when I specify--dump-ast
. Otherwise the frontend goes past the elaboration and hard-fails in the middle of generating the netlist.For example, this code:
Without
--dump-ast
:With it:
I'm not sure if this really belongs here or it's an error with slang. From what I understand there's isn't any branch in the codepath between the AST dump and the check for the failed elaboration. So maybe we are passing a different configuration to slang in each case, and depending on that it reports the errors or not? Btw, this is with the
staging
branch.