Skip to content

Riscv debug

riscv_debug

RiscvDebugFunctions dataclass

Bases: InterpreterFunctions

Source code in xdsl/interpreters/riscv_debug.py
14
15
16
17
18
19
20
21
22
23
24
25
26
@dataclass
@register_impls
class RiscvDebugFunctions(InterpreterFunctions):
    @impl(riscv_debug.PrintfOp)
    def run_printf(
        self,
        interpreter: Interpreter,
        op: riscv_debug.PrintfOp,
        args: tuple[Any, ...],
    ):
        args = RiscvFunctions.get_reg_values(interpreter, op.operands, args)
        print(op.format_str.data.format(*args), end="", file=interpreter.file)
        return ()

__init__() -> None

run_printf(interpreter: Interpreter, op: riscv_debug.PrintfOp, args: tuple[Any, ...])

Source code in xdsl/interpreters/riscv_debug.py
17
18
19
20
21
22
23
24
25
26
@impl(riscv_debug.PrintfOp)
def run_printf(
    self,
    interpreter: Interpreter,
    op: riscv_debug.PrintfOp,
    args: tuple[Any, ...],
):
    args = RiscvFunctions.get_reg_values(interpreter, op.operands, args)
    print(op.format_str.data.format(*args), end="", file=interpreter.file)
    return ()