-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a better error message for a bitfield with a bits field
'bits' is used as the default name for all the bits in a bitfield, and this would create an error if the user tried to define it as a user-specified field. However this generated a confusing error message, as the failure happened when generating the various helper functions. This commit checks for this earlier and prints a better error
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[93mType error[0m: | ||
[96mfail/bitfield_bits_field.sail[0m:6.2-6: | ||
6[96m |[0m bits : 15 .. 0, | ||
[91m |[0m [91m^--^[0m | ||
[91m |[0m Field with name 'bits' found in bitfield definition. | ||
[91m |[0m | ||
[91m |[0m This is used as the default name for all the bits in the bitfield, so should not be overridden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
bitfield foo : bits(32) = { | ||
bits : 15 .. 0, | ||
} |