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

Clock domain annotation support #789

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Clock domain annotation support #789

merged 1 commit into from
Jun 21, 2024

Conversation

dalance
Copy link
Collaborator

@dalance dalance commented Jun 14, 2024

Migration guide

Add clock domain annotatins if there are some clocks in a module.
Add unsafe (cdc) blocks to boundaries between clock domains.

  • From
module ModuleA (
    i_clk_a: input  clock,
    i_dat_a: input  logic,
    o_dat_a: output logic,
    i_clk_b: input  clock,
    i_dat_b: input  logic,
    o_dat_b: output logic,
) {
   // from i_clk_a domain to i_clk_b domain
   assign o_dat_b = i_dat_a;
}
  • To
module ModuleA (
    i_clk_a: input  'a clock,
    i_dat_a: input  'a logic,
    o_dat_a: output 'a logic,
    i_clk_b: input  'b clock,
    i_dat_b: input  'b logic,
    o_dat_b: output 'b logic,
) {
    unsafe (cdc) {
        assign o_dat_b = i_dat_a;
    }
}

Description

This PR introduces clock domain annotation and unsafe (cdc) block to specify clock domain crossing explicitly.
By the annotation, Veryl compiler detects unexpected clock domain crossing which is not specified by unsafe (cdc).

Closes #713

@dalance dalance force-pushed the clock_domain branch 16 times, most recently from 97d1fa0 to 291e31a Compare June 19, 2024 07:55
@dalance dalance marked this pull request as ready for review June 20, 2024 07:03
@dalance dalance merged commit d39923b into master Jun 21, 2024
6 checks passed
@dalance dalance deleted the clock_domain branch August 22, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clock domain annotation
1 participant