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

Mutual Exclusion Pass Creates Cycles #1716

Open
grebe opened this issue Nov 14, 2024 · 0 comments
Open

Mutual Exclusion Pass Creates Cycles #1716

grebe opened this issue Nov 14, 2024 · 0 comments
Labels
scheduler Scheduling algorithm for XLS IR operations

Comments

@grebe
Copy link
Collaborator

grebe commented Nov 14, 2024

Describe the bug
The mutual exclusion pass can create cycles when merging channel operations.

To Reproduce

proc A {
  cin0: chan<u32> in;
  cin1: chan<u32> in;

  config(cin0: chan<u32> in, cin1: chan<u32> in) {
    (cin0, cin1)
  }

  init { false }

  next(s: bool) {
    let (tok0, data) = recv_if(join(), cin0, !s, u32:0);
    let (tok_cin1, _) = recv_if(join(), cin1, !s, u32:0);

    let (tok1, _) = recv_if(tok_cin1, cin0, s, u32:0);
    let (tok_cin1, _) = recv_if(tok0, cin1, s, u32:0);

    data == u32:0
  }
}

This gives Cycle detected: [tuple_index.87 -> receive.86 -> after_all.83 -> tok0 -> tuple.102 -> tuple_index.98 -> receive.97 -> after_all.94 -> tuple_index.87];

Expected behavior
It should either fail to merge one of the receive pairs, or it should correctly merge them without adding a cycle.

@grebe grebe added the scheduler Scheduling algorithm for XLS IR operations label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scheduler Scheduling algorithm for XLS IR operations
Projects
None yet
Development

No branches or pull requests

1 participant