fvutils / pyhdl-if

Python interface for cross-calling with HDL
https://fvutils.github.io/pyhdl-if/
Apache License 2.0
21 stars 6 forks source link

Error in SV generation for a task with no retval or param #1

Closed djoffe closed 2 months ago

djoffe commented 3 months ago

Hello,

I appreciate this tool; it has been saving me time with my Python-DPI interactions!

A task that lacks a return value or parameters is generated without a semicolon, leading to invalid SystemVerilog code.

@hif.api
class FooDPI(object):
    @hif.imptask
    async def say_foo(self):
        pass
    virtual task invokeTask(
        output pyhdl_if::PyObject retval,
        input string method,
        input pyhdl_if::PyObject args);

        retval = pyhdl_if::None;

        case (method)
            "say_foo": begin
                say_foo            end
            default: begin
                $display("Fatal: unsupported method call %0s", method);
            end
        endcase
    endtask
cmarqu commented 2 months ago

Closed by #2.