Open stevenmburns opened 7 years ago
There are a few places where source locators get destroyed, the primary one being ExpandWhens. This has been a known issue for a while but it seems we really ought to do something about it. People also have requested seeing the source locators as comments in the emitted Verilog.
There is a question of how to combine source locators, for example:
a <= foo @[Source.scala 17:8]
when cond : @[Source.scala 23:2]
a <= bar @[Source.scala 37:3]
->
a <= mux(cond, bar, foo) @[Source.scala 17:8, Source.scala 23:2, Source.scala 37:3]
Perhaps we can do better by not repeating Source.scala, although these won't always be the same file obviously...
There may be a related discussion here about whether the combination of Info
should be a reversible operation.
I'd like to add my name to the list of those wishing for this. I'd like treadle to be able to give source information in a number of places but it appears to be destroyed by the lowering passes
It seems that most but not all FIRRTL statements have an informative "info" field. Some don't. High FIRRTL has many annotations, but some assignments aren't annotated with the source filename, line, and character position. For example
_T_20 <= u
in the code below:In low FIRRTL, some of the generated statements are unannotated (for example, the last seven lines in the following code)
How hard will it be to attach meaningful source code information to (all) the lines? It seems to be available in the node defining the temporary variable (for example,
_GEN_10
above.)I don't know if this is all of the missing cases, but fixing these two will be very helpful to me. I've built something that traces paths and displays source code so you can understand timing issues and now the connect statements don't point anywhere.