Skip to content

Support backward function definition #2210

@taichi-ishitani

Description

@taichi-ishitani

Currently, backward function definition is not supported because wrong IT is generated for function call with such function.
Function prototype needs to be introduced for ease of generating IR.

module ModuleA (
    i_clk: input clock,
) {
    var a: logic;
    always_ff {
        if get_b() {
            a = '1;
        }
    }
    let b: logic = '1;
    function get_b() -> logic {
        return b;
    }
}

Wrong IR is generated for function call before defining the called function. Due to this, this error is happened.

I disccussed it with @dalance .
Backword function difinition is not supported for now because it is difficult to implement this feautre.

Originally posted by @taichi-ishitani in #2205

Metadata

Metadata

Assignees

No one assigned

    Labels

    langLanguage design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions