Skip to content

Allow selection of verbosity level for vtrace_fmt! messages#3932

Open
joannabrozek wants to merge 20 commits intogoogle:mainfrom
antmicro:max_trace_verbosity
Open

Allow selection of verbosity level for vtrace_fmt! messages#3932
joannabrozek wants to merge 20 commits intogoogle:mainfrom
antmicro:max_trace_verbosity

Conversation

@joannabrozek
Copy link
Copy Markdown
Contributor

@joannabrozek joannabrozek commented Mar 10, 2026

Add support for excluding vtrace_fmt! messages according to max_trace_verbosity flag for:

  • DSLX interpreter:

    • Added the max_trace_verbosity flag with the default value set to 100 (see xls/dslx/interpreter_main.cc)
    • Added a new private member verbosity_ to the TraceData class to be able to pass the verbosity of vtrace_fmt!() messages (see xls/dslx/bytecode/bytecode.h)
    • Added max_trace_verbosity flag propagation using BytecodeInterpreterOptions to the bytecode interpreter, where the vtrace messages are filtered (see xls/dslx/bytecode/bytecode_interpreter.cc)
    • Added a bytecode interpreter test for vtrace_fmt!() (see xls/dslx/bytecode/bytecode_interpreter_test.cc)
  • IR interpreter:

    • Added code position propagation (by adding the emit_positions flag, which is enabled by default, as it was previously hardcoded as enabled as well - see xls/dslx/ir_convert/ir_converter_main.cc)
    • Restored displaying messages from trace_fmt!() and vtrace_fmt!() (see the xls/dslx/run_routines/run_routines.cc file)
    • Added a fix to populate SourceInfo inside Trace so that the displayed logs include information about which file they came from and their location (row and column) - see xls/dslx/ir_convert/function_converter.cc
    • Added two tests (one for a function and the second for a process) to verify if messages are filtered - see xls/dslx/interpreter_test.py
    • Added displaying messages for processes by adding a DslxInterpreterEvents pointer and populating it (see xls/dslx/run_routines/run_routines.cc and xls/dslx/run_routines/ir_test_runner.cc)
    • Added vtrace_fmt!() messages filtering (see xls/interpreter/ir_interpreter.cc)
    • Updated the test (see xls/interpreter/ir_evaluator_test_base.cc)
  • JIT and AOT:

    • Added a new private member max_trace_verbosity_ to the EvaluatorOptions and JitEvaluatorOptions classes to be able to propagate the max_trace_verbosity flag (see xls/interpreter/evaluator_options.h and xls/jit/jit_evaluator_options.h)
    • Added the max_trace_verbosity flag and passed it using JitEvaluatorOptions (see xls/jit/aot_compiler_main.cc)
    • Enabled max_trace_verbosity flag propagation using EvaluatorOptions for function and block wrappers (see xls/jit/jit_function_wrapper_cc.tmpl, xls/jit/function_base_jit_wrapper.h and xls/jit/block_base_jit_wrapper.h)
    • Added vtrace_fmt!() messages filtering (see xls/jit/jit_callbacks.cc)
    • Added an example with JIT tests and defined wrappers (see xls/examples/vtrace_fmt.x, xls/examples/vtrace_fmt_block_jit_test.cc, xls/examples/vtrace_fmt_jit_test.cc, xls/examples/vtrace_fmt_proc_jit_test.cc)
    • Added support for JIT functions (see xls/jit/function_jit.cc) and a test (see xls/jit/function_jit_test.cc)
    • Added support for JIT blocks (see xls/jit/block_jit.cc) and updated the test (see xls/interpreter/block_evaluator_test_base.cc)
    • Added support for JIT processes (see xls/jit/proc_jit.cc) and a test (see xls/interpreter/proc_evaluator_test_base.cc)
    • Updated the AOT test (see xls/jit/function_jit_aot_test.cc)
  • eval_ir_main tool:

    • Added the max_trace_verbosity flag and passed it using JitEvaluatorOptions (see xls/tools/eval_ir_main.cc)
    • Added a test (see xls/tools/eval_ir_main_test.py)
  • eval_proc_main tool:

    • Added the max_trace_verbosity flag and passed it using BlockEvaluator (see xls/tools/eval_proc_main.cc)
    • Added a test (see xls/tools/eval_proc_main_test.py)
  • codegen_main tool:

@joannabrozek joannabrozek changed the title Add max_trace_verbosity flag Allow selection of verbosity level for vtrace_fmt! messages Mar 10, 2026
@joannabrozek joannabrozek marked this pull request as ready for review April 21, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant