projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
91b3201
)
Sort returned variables to make sure `overflow` is last
author
Jacob Lifshay
<programmerjake@gmail.com>
Mon, 5 Oct 2020 00:32:45 +0000
(17:32 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Mon, 5 Oct 2020 00:32:45 +0000
(17:32 -0700)
Fixes #509
src/soc/decoder/isa/caller.py
patch
|
blob
|
history
diff --git
a/src/soc/decoder/isa/caller.py
b/src/soc/decoder/isa/caller.py
index 703721436b35e24464b8dbaf47ddb1e4cc6ca17d..bf84e05a4f6e5e4f383e89f51c3c7a2852f0a43e 100644
(file)
--- a/
src/soc/decoder/isa/caller.py
+++ b/
src/soc/decoder/isa/caller.py
@@
-41,14
+41,34
@@
def swap_order(x, nbytes):
return x
return x
+REG_SORT_ORDER = {
+ # TODO (lkcl): adjust other registers that should be in a particular order
+ # probably CA, CA32, and CR
+ "RT": 0,
+ "RA": 0,
+ "RB": 0,
+ "RS": 0,
+ "CR": 0,
+ "LR": 0,
+ "CTR": 0,
+ "TAR": 0,
+ "CA": 0,
+ "CA32": 0,
+ "MSR": 0,
+
+ "overflow": 1,
+}
+
+
def create_args(reglist, extra=None):
def create_args(reglist, extra=None):
- args = OrderedSet()
- for reg in reglist:
- args.add(reg)
- args = list(args)
- if extra:
- args = [extra] + args
- return args
+ regset = OrderedSet(reglist)
+ retval = []
+ for reg in regset:
+ retval.append(reg)
+ retval.sort(key=lambda reg: REG_SORT_ORDER[reg])
+ if extra is not None:
+ return [extra] + retval
+ return retval
class Mem:
class Mem: