veryl-lang / veryl

Veryl: A Modern Hardware Description Language
Other
532 stars 26 forks source link

Not check type mismatch between connected interface and port declaration #1088

Open taichi-ishitani opened 1 week ago

taichi-ishitani commented 1 week ago

Currently, Veryl compiler does not check type of connected interface. Following code includes type mismatch between connected interface and port declaration but no error is raised.

interface foo_if {
  var a: logic;
  modport mp {
    a: output
  }
}

interface bar_if {
  var a: logic;
  modport mp {
    a: output
  }
}

module sub (
  foo: modport foo_if::mp
){
  assign foo.a = 0;
}

module top (
  o_a: output logic
) {
  inst bar: bar_if;
  inst u_sub: sub (foo: bar); // type mismatch

  assign o_a = bar.a;
}
dalance commented 1 week ago

Related: #1017