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] Compiler Error: Could not find type for <Mux> #216

Closed
vikramnathan opened this issue Jan 2, 2017 · 0 comments
Closed

[bmv2] Compiler Error: Could not find type for <Mux> #216

vikramnathan opened this issue Jan 2, 2017 · 0 comments
Assignees
Labels
fixed This topic is considered to be fixed.

Comments

@vikramnathan
Copy link

vikramnathan commented Jan 2, 2017

I'm compiling this stripped-down p4 program using p4c-bm2-ss and get the following error:
test_bug.p4.txt

terminate called after throwing an instance of 'Util::CompilerBug'
  what():  COMPILER BUG: ../frontends/p4/typeMap.cpp:82
Could not find type for <Mux>(72820)

Aborted (core dumped)

The culprit is the action at line 72, even though it seems permissible based on my reading of the spec. The code works if I do any of the following:

  1. Remove line 75
  2. Assign a compile-time known value to sub on line 73, i.e. bit<32> _sub = 32w1.
  3. Replace line 74 with a non-conditional assignment, i.e. _sub = 32w1.
  4. Replacing val[31:0] with val and adjusting the width of _sub accordingly.

Even if the action is invalid for some reason, the compiler should provide a helpful error message.

mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Jan 4, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Jan 6, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Jan 6, 2017
@ChrisDodd ChrisDodd added the fixed This topic is considered to be fixed. label Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed This topic is considered to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants