veryl-lang / veryl

Veryl: A Modern Hardware Description Language
Other
446 stars 20 forks source link

Undefined identifier error for generic type argument #754

Open taichi-ishitani opened 1 month ago

taichi-ishitani commented 1 month ago

Veryl reports an undefined identifier error for a generic type argument pointing a type locally defined. For exmaple:

package PackageA {
  function FuncA::<T> -> T {
    var a: T;
    a = 0;
    return a;
  }
}

module ModuleA {
  type my_logic = logic;
  let _a: logic = PackageA::FuncA::<my_logic>();
}

image

taichi-ishitani commented 1 month ago

To get valid generated SV code, the original type declaration need to be copied to the generated package declaration.