Condtional Branch Type Verification #279
murphe67
started this conversation in
Change proposal
Replies: 1 comment 1 reply
-
If we enforce trait-like constraints for single-entity constraints, then simple types ( The challenge is that type and constraint are continuous concepts. Even basic types inherently constrain whether an operand or result has a data signal, for example. To me, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all- @Jiahui17 @AyaElAkhras @pcineverdies @ebosnjak @shundroid
We are currently discussing the type verification for conditional branches.
Currently they look like this-
![image](https://private-user-images.githubusercontent.com/45939330/410978304-4b523ed1-3a09-495f-95f6-4cb5ae2d3244.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjIxNjgsIm5iZiI6MTczOTM2MTg2OCwicGF0aCI6Ii80NTkzOTMzMC80MTA5NzgzMDQtNGI1MjNlZDEtM2EwOS00OTVmLTk1ZjYtNGNiNWFlMmQzMjQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEyMDQyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0ZDZiNDExNzlmM2FhN2E1NGQ1NjFlMzFkMzI2Y2VjYTNkMGM1YTlhMjU3MzkwYTcwMDQxZTM2OTMwMGY1NmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.XsbV-93Q7lnfNe4p-YTo9HCrCapYm_h2V-m94wF4DhQ)
The data input and the outputs must have exactly the same types, and all ports (including the condition) must have the same extra signals.
My immediate thought looking at this is: why aren't we constraining the data type of the condition to i1?
It turns out we are, but with a different mechanism, slightly lower in the tablegen declaration. Strictly speaking, this section of the constraints should only be used for multi-entity constraints, where two or more variables interact.
The condition type is a single variable constraint, and so uses a different mechanism (one we also use for making sure arithmetic units get the right type of data)-
Are we happy to follow these rules on the conditional branch, or does it make sense to put all of its constraints in one location?
Beta Was this translation helpful? Give feedback.
All reactions