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

[bmv2] "Could not find declaration for cond" #230

Closed
vikramnathan opened this issue Jan 13, 2017 · 3 comments
Closed

[bmv2] "Could not find declaration for cond" #230

vikramnathan opened this issue Jan 13, 2017 · 3 comments

Comments

@vikramnathan
Copy link

vikramnathan commented Jan 13, 2017

I have the following P4-16 program:
test_bug.p4.txt

This gives the following error when compiled with -vvv:

<omitted>
MidEnd_21_Predication
error: Could not find declaration for cond
error: Could not find declaration for cond
error: Could not find declaration for cond
error: Could not find declaration for cond
error: Could not find declaration for cond

Note: there is no variable cond in my program. My guess is that this is something in the IR.

However, if I do any of the following, the program compiles:

  1. line 76 is changed from:
    iszero = (key.field1 == 0) ? true : false;
    to
    iszero = (key.field1 == 0);
    the program compiles.
  2. Remove line 83 (the repeated keyIsZero(key, done))
  3. The apply body is replaced with the contents of testKey

Why is the attached program rejected? Is there something about the limitations of actions in the spec that I'm missing? Either way, the compiler should print out a more helpful error.

@vikramnathan
Copy link
Author

Apologies for closing and reopening. This is still a bug.

@mihaibudiu
Copy link
Contributor

mihaibudiu commented Jan 13, 2017

I cannot reproduce this bug with the most recent version of the compiler.
The program compiles just fine for me.
(However, the generated code is pretty bad.)

@vikramnathan
Copy link
Author

You're correct - it does compile. My bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants