Skip to content

Generic parameter can't be used as reset value #1872

@taichi-ishitani

Description

@taichi-ishitani

The invalid_reset_non_elaborative error is reported for a generic parameter used as a reset value.

Example

module ModuleA::<V: u32> (
  i_clk: input clock,
  i_rst: input reset,
){
  var _a: logic;
  always_ff {
    if_reset {
      _a = V;
    }
  }
}
�]8;;https://doc.veryl-lang.org/book/07_appendix/02_semantic_error.html#invalid_reset_non_elaborative�\invalid_reset_non_elaborative (link)�]8;;�\

  💥 Reset-value cannot be used because it is not evaluable at elaboration
  │ time
   ╭─[:8:12]
 7 │     if_reset {
 8 │       _a = V;
   ·            ┬
   ·            ╰── Error location
 9 │     }
   ╰────
  help: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions