Skip to content

Commit b73c3e0

Browse files
committed
docs(report): explain that users can override the report format
1 parent 0fae693 commit b73c3e0

File tree

1 file changed

+20
-1
lines changed
  • source/SpinalHDL/Other language features

1 file changed

+20
-1
lines changed

source/SpinalHDL/Other language features/report.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ will result in:
4545
Including Scala Source Location
4646
-------------------------------
4747

48-
After 1.13.0, You can optionally include the Scala call-site location (file and line) in the report output, which allows most IDEs to jump to the source when clicking the log line.
48+
After 1.13.0, you can optionally include the Scala call-site location (file and line) in the report output, which allows most IDEs to jump to the source when clicking the log line.
4949

5050
There are two ways to enable it:
5151

@@ -59,6 +59,25 @@ There are two ways to enable it:
5959
6060
Example generated output (Verilog):
6161

62+
.. code-block:: verilog
63+
64+
$display("NOTE(path/to/MyTopLevel.scala:123) HELLO");
65+
66+
You can customize the location prefix format globally using `SpinalConfig.reportSourceLocationFormat`, with the following placeholders:
67+
68+
- `$SEVERITY` (NOTE/WARNING/ERROR/FAILURE)
69+
- `$FILE` (Scala file path)
70+
- `$LINE`
71+
72+
Example (IDE-friendly clickable output):
73+
74+
.. code-block:: scala
75+
76+
SpinalConfig(
77+
reportIncludeSourceLocation = true,
78+
reportSourceLocationFormat = "$FILE:$LINE: $SEVERITY "
79+
).generateVerilog(new TopLevel)
80+
6281
.. code-block:: verilog
6382
6483
$display("path/to/MyTopLevel.scala:123: NOTE HELLO");

0 commit comments

Comments
 (0)