An internal user reported that BlackBoxes have started showing up in unexpected situations. The problem is that when an external module with a BlackBoxInlineAnno does not dedup for valid reasons, e.g., it has different parameters or the user doesn't run dedup, then the order in which the external modules are declared determines the file order.
Consider the following example. Here, whichever of BlackBox_1, BlackBox_2, or BlackBox_3 is declared first will determine if the blackbox is, respectively, created in the testbench/, ./ (main design/DUT), or gct/ directories.
Note: that this is ignoring a whole separate class of errors where the actual content of the BlackBoxInlineAnno annotation is not verified in any way. I placed a different comment in each of them. Put differently, it's dangerous to rely on defname with BlackBoxInlineAnno blindly. This should at least be checked that these are the same.
The solution here is to, in the BlackBoxReader pass, process each ExtModule with the same defname together and use the "strongest" output directory. E.g., the DUT module should "win" in the above example.
An internal user reported that BlackBoxes have started showing up in unexpected situations. The problem is that when an external module with a
BlackBoxInlineAnno
does not dedup for valid reasons, e.g., it has different parameters or the user doesn't run dedup, then the order in which the external modules are declared determines the file order.Consider the following example. Here, whichever of
BlackBox_1
,BlackBox_2
, orBlackBox_3
is declared first will determine if the blackbox is, respectively, created in thetestbench/
,./
(main design/DUT), orgct/
directories.The three possible results are:
Note: that this is ignoring a whole separate class of errors where the actual content of the
BlackBoxInlineAnno
annotation is not verified in any way. I placed a different comment in each of them. Put differently, it's dangerous to rely ondefname
withBlackBoxInlineAnno
blindly. This should at least be checked that these are the same.