Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Integer type restricted to positive value #564

Open
taichi-ishitani opened this issue Mar 15, 2024 · 1 comment
Open

[Feature] Integer type restricted to positive value #564

taichi-ishitani opened this issue Mar 15, 2024 · 1 comment
Labels
lang Language design

Comments

@taichi-ishitani
Copy link
Contributor

There are many cases that parameter values need to be restricted to positive value.
For example, bit width, FIFO depth.

I think integer type restricted to positive value is useful for these cases so I'd like veryl to suuprt such type.
SystemVerilog does not have such type so following code needs to be inserted to generated SV code.

generate
  if (W < 0) begin : g_veryl_check_W
    $error("parameter W should be positive value");
  end
endgenerate

In addition, Pkl has a feature to add constraints to the given value.
I'd like Veryl to support such feature.
https://pkl-lang.org/main/current/language-reference/index.html#type-constraints

@nblei
Copy link
Contributor

nblei commented Mar 15, 2024

I like this idea, and I think it fits more broadly into a discussion on what metadesign support should Veryl provide.

@dalance dalance added the lang Language design label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang Language design
Projects
None yet
Development

No branches or pull requests

3 participants