@@ -300,19 +300,31 @@ counted to get statistics on disabled log messages.
300300 disable(get_logger("memory_ip:timing_check"), warning);
301301
302302
303- Log Location Preprocessing
304- --------------------------
303+ Log Location
304+ ------------
305+
306+ For simulators supporting VHDL-2019 VUnit adds file name
307+ and line number location information to all log entries. Currently
308+ only Riviera-PRO supports VHDL-2019 and it restricts the feature
309+ to **debug compiled files **. You can compile all files or just the ones
310+ using logging. For example,
311+
312+ .. code-block :: python
305313
306- The optional VUnit location preprocessor can be used to add file name
307- and line number location information to all log calls. This
308- functionality is enabled from the ``run.py `` file like this:
314+ testbenches = lib.get_source_files(" *tb*" )
315+ testbenches.set_compile_option(" rivierapro.vcom_flags" , [" -dbg" ])
316+
317+
318+ For earlier VHDL standards there is an optional location preprocessor that can
319+ be used to serve the same purpose. The preprocessor is enabled from
320+ the ``run.py `` file like this:
309321
310322.. code-block :: python
311323
312324 ui = VUnit.from_argv()
313325 ui.enable_location_preprocessing()
314326
315- and will change the output to something like this.
327+ Regardless of method the location information is appended to the end of the log entry:
316328
317329.. code-block :: console
318330
@@ -322,8 +334,25 @@ and will change the output to something like this.
322334 If you've placed your log call(s) in a convenience procedure you most
323335likely want the location of the calls to that procedure to be in the
324336output and not the location of the log call in the definition of the
325- convenience procedure. You can do that by adding the ``line_num `` and
326- ``file_name `` parameters to the **end ** of the parameter list for that
337+ convenience procedure. For VHDL-2019 you can use the ``path_offset ``
338+ parameter to specify a number of steps earlier in the call stack. For
339+ example,
340+
341+ .. code-block :: vhdl
342+
343+ procedure my_convenience_procedure(
344+ <my parameters>) is
345+ begin
346+ <some code>
347+ info("Some message", path_offset => 1);
348+ <some code>
349+ end procedure my_convenience_procedure;
350+
351+ When ``path_offset `` is set to 1 the location of the caller to
352+ ``my_convenience_procedure `` will be used in the log output.
353+
354+ With earlier VHDL standard you can add the ``line_num `` and
355+ ``file_name `` parameters to the **end ** of the parameter list for the
327356convenience procedure
328357
329358.. code-block :: vhdl
0 commit comments