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] clock/reset type cast #709

Open
taichi-ishitani opened this issue May 9, 2024 · 0 comments
Open

[Feature] clock/reset type cast #709

taichi-ishitani opened this issue May 9, 2024 · 0 comments
Labels
tools Tools feature

Comments

@taichi-ishitani
Copy link
Contributor

taichi-ishitani commented May 9, 2024

refs: #622 (comment)

To connect clock/reset signals having different types, we need to introduce clock/reset type cast.
When an operand and a cast type have different polarity, an inverter logic will be inserted.

Veryl code

var rst_a: reset;
var rst_b: reset_async_high;
var rst_c: reset_async_low;

always_comb {
  rst_b = rst_a as reset_async_high;
  rst_c = rst_a as reset_async_low;
}

Generated SV code

logic rst_a;
logic rst_b;
logic rst_c;

always_comb begin
  rst_b = rst_a;
  rst_c = ~rst_a;
end
@dalance dalance added the tools Tools feature label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Tools feature
Projects
None yet
Development

No branches or pull requests

2 participants