Add source location directives in DSLX for trace/error logging
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
### What's hard to do? (limit 100 words)
In SystemVerilog (and similar constructs exist in various software languages), we can use `` `__FILE__`` and `` `__LINE__`` to access the current source location, which can be useful for traces and other logging.
The example given in LRM 22.13 is:
```
$display("Internal error: null handle at %s, line %d.",
`__FILE__, `__LINE__);
```
This would dump something like:
```
Internal error: null handle at platforms/deepsea/logic/gfc/rtl/foo.sv, line 7.
```
I don't think DSLX users currently have the ability to express this.
### Current best alternative workaround (limit 100 words)
As I don't think this can be expressed through DSLX currently, the source info will be omitted.
### Your view of the "best case XLS enhancement" (limit 100 words)
Provide similar directives in DSLX that users can use in `trace_fmt!` and possibly elsewhere to highlight where the dump is coming from.
Contributor guide
Assessment
This issue has not been assessed yet.