开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Bluespec evaluation-time error: unhandled case


 
Edited

I was trying to do some fancy stuff by composing an FSM using functions that return Stmt to capture sequences. Looks like I broke something along the way.
Any help in understanding the error message and how to fix it is appreciated.
?
This is with Bluespec Compiler, version 2024.07 (build b4f31dbe)

Compilation message: "StmtFSM.bs", line 220, column 72: Case: [SNamed sendbytes_l102c63 [[Par_l102c63 ([Action_l103c54] [Action_l104c57] [Seq_l105c49 ([While_l106c57 [SNamed sendbits_l106c76 [[Par_l106c76 ([Action_l107c73] [SExprS _l108c77])]]]] [SExprS _l110c65])])]]]
Error: "StmtFSM.bs", line 964, column 13: (S0015)
? Bluespec evaluation-time error: unhandled case
? During elaboration of `c0' at "StmtFSM.bs", line 942, column 7.
? During elaboration of `c1' at "StmtFSM.bs", line 943, column 7.
? During elaboration of `c_no_action' at "StmtFSM.bs", line 642, column 8.
? During elaboration of `_rfsm' at "StmtFSM.bs", line 1140, column 8.
? During elaboration of `fsm' at "I2C.bsv", line 134, column 21.
? During elaboration of `mkI2CMaster' at "I2C.bsv", line 26, column 8.
?


 

This looks like a bug in the StmtFSM library.? Sorry for that.? Are you able to submit an example to a GitHub issue?

In the library "StmtFSM.bs", there is a function "getNoActionCondition" that has case-arms for the different kinds of statements, but seems to be missing an arm, because execution has fallen through to the default at line 964, that reports the message and error that you're seeing.? The message prints the statement, so we can see what's not handled, and in this case it appears that statements wrapped in "SNamed" are not handled.? Unfortunately, I don't know if that's intentional; perhaps SNamed should not exist at this point.? Given that "labelActions" handles SNamed, it's possible that "getNoActionCondition" probably should -- but someone who knows the library more would need to say.? You could see if adding these lines to the library (around like 961) allows your code to compile:

getNoActionCondition (SNamed _ _ Nil) = return True

getNoActionCondition (SNamed _ _ (Cons st Nil)) = getNoActionCondition st


Otherwise, an example would help.? Sorry again!

J


On Wed, Mar 26, 2025 at 4:31?AM vijayvithal jahagirdar via <jahagirdar.vs=[email protected]> wrote:
I was trying to do some fancy stuff by composing an FSM using functions that return Stmt to capture sequences. Looks like I broke something along the way.
Any help in understanding the error message and how to fix it is appreciated.
?
This is with Bluespec Compiler, version 2024.07 (build b4f31dbe)

Compilation message: "StmtFSM.bs", line 220, column 72: Case: [SNamed sendbytes_l102c63 [[Par_l102c63 ([Action_l103c54] [Action_l104c57] [Seq_l105c49 ([While_l106c57 [SNamed sendbits_l106c76 [[Par_l106c76 ([Action_l107c73] [SExprS _l108c77])]]]] [SExprS _l110c65])])]]]
Error: "StmtFSM.bs", line 964, column 13: (S0015)
? Bluespec evaluation-time error: unhandled case
? During elaboration of `c0' at "StmtFSM.bs", line 942, column 7.
? During elaboration of `c1' at "StmtFSM.bs", line 943, column 7.
? During elaboration of `c_no_action' at "StmtFSM.bs", line 642, column 8.
? During elaboration of `_rfsm' at "StmtFSM.bs", line 1140, column 8.
? During elaboration of `fsm' at "I2C.bsv", line 134, column 21.
? During elaboration of `mkI2CMaster' at "I2C.bsv", line 26, column 8.
?


 

Filed issue at
Regards
Vijay

On Wed, 26 Mar 2025 at 01:33, Julie Schwartz via <quark=[email protected]> wrote:
This looks like a bug in the StmtFSM library.? Sorry for that.? Are you able to submit an example to a GitHub issue?

In the library "StmtFSM.bs", there is a function "getNoActionCondition" that has case-arms for the different kinds of statements, but seems to be missing an arm, because execution has fallen through to the default at line 964, that reports the message and error that you're seeing.? The message prints the statement, so we can see what's not handled, and in this case it appears that statements wrapped in "SNamed" are not handled.? Unfortunately, I don't know if that's intentional; perhaps SNamed should not exist at this point.? Given that "labelActions" handles SNamed, it's possible that "getNoActionCondition" probably should -- but someone who knows the library more would need to say.? You could see if adding these lines to the library (around like 961) allows your code to compile:

getNoActionCondition (SNamed _ _ Nil) = return True

getNoActionCondition (SNamed _ _ (Cons st Nil)) = getNoActionCondition st


Otherwise, an example would help.? Sorry again!

J


On Wed, Mar 26, 2025 at 4:31?AM vijayvithal jahagirdar via <jahagirdar.vs=[email protected]> wrote:
I was trying to do some fancy stuff by composing an FSM using functions that return Stmt to capture sequences. Looks like I broke something along the way.
Any help in understanding the error message and how to fix it is appreciated.
?
This is with Bluespec Compiler, version 2024.07 (build b4f31dbe)

Compilation message: "StmtFSM.bs", line 220, column 72: Case: [SNamed sendbytes_l102c63 [[Par_l102c63 ([Action_l103c54] [Action_l104c57] [Seq_l105c49 ([While_l106c57 [SNamed sendbits_l106c76 [[Par_l106c76 ([Action_l107c73] [SExprS _l108c77])]]]] [SExprS _l110c65])])]]]
Error: "StmtFSM.bs", line 964, column 13: (S0015)
? Bluespec evaluation-time error: unhandled case
? During elaboration of `c0' at "StmtFSM.bs", line 942, column 7.
? During elaboration of `c1' at "StmtFSM.bs", line 943, column 7.
? During elaboration of `c_no_action' at "StmtFSM.bs", line 642, column 8.
? During elaboration of `_rfsm' at "StmtFSM.bs", line 1140, column 8.
? During elaboration of `fsm' at "I2C.bsv", line 134, column 21.
? During elaboration of `mkI2CMaster' at "I2C.bsv", line 26, column 8.
?



--