arch: Allow named constants as decode case values.
Review Request #2505 - Created Nov. 16, 2014 and submitted
| Information | |
|---|---|
| Gabe Black | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10590:1c185336bb80 --------------------------- arch: Allow named constants as decode case values. The values in a "bitfield" or in an ExtMachInst structure member may not be a literal value, it might select from an arbitrary collection of options. Instead of using the raw value of those constants in the decoder, it's easier to tell what's going on if they can be referred to as a symbolic constant/enum. To support that, the ISA description language is extended slightly so that in addition to integer literals, the case value for decode blobs can also be a string literal. It's up to the ISA author to ensure that the string evaluates to a legal constant value when interpretted as C++.
Posted (Nov. 23, 2014, 6:20 a.m.)
Per the review process documentation on the wiki, if nobody comments on this or asks me to wait after 10 days, I'm going to commit this as is.
Posted (Nov. 23, 2014, 6:28 a.m.)
ISA is not a keyword at the moment (perhaps it should be), as per http://www.gem5.org/Commit_Access For the rest it looks good from my side.
Review request changed
Updated (Nov. 23, 2014, 6:54 a.m.)
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+35 -29) |
Posted (Nov. 23, 2014, 6:56 a.m.)
Please take a look at 2506 as well.
I'd suggest to wait and see what the others have to say as well.
Posted (Dec. 1, 2014, 9:44 p.m.)
Looks good, just some minor aesthetics
-
src/arch/isa_parser.py (Diff revision 2) -
update comment
-
src/arch/isa_parser.py (Diff revision 2) -
it would be nice to update this variable name too ('case_list'?) -
src/arch/isa_parser.py (Diff revision 2) -
same comment re: variable name
-
src/arch/isa_parser.py (Diff revision 2) -
seems like we could still use a comment about 'default', or maybe just take the comment above p_case_list_1 and move it up here and add a mention of 'default'
-
src/arch/isa_parser.py (Diff revision 2) -
do you really mean "C++ symbols" not "C++ strings"?
Review request changed
Updated (Dec. 3, 2014, 3:56 a.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+37 -30) |
Ship It!
