MIPS: move the CP0 config code to isa.cc
Review Request #994 - Created Jan. 15, 2012 and updated
| Information | |
|---|---|
| Deyuan Guo | |
| gem5 | |
| Reviewers | |
| Default | |
[--splitting the mips-fs patch--] We can do the CP0 initialization in configCP(), then make ISA::clear() function call the configCP() in isa.cc. After that, the setMipsOptions() function in fs.py will be no longer needed.
Posted (Jan. 16, 2012, 12:21 a.m.)
I don't know all the pros and cons of doing this initialization in python vs. c++... would anyone ever want to change it? If so, it should be left in python. I'd also lean toward leaving it in python from a "if it ain't broke don't fix it" perspective. What are the benefits of moving it to c++?
-
configs/example/fs.py (Diff revision 1) -
Code should never be just commented out; if it's not needed any more, it should be removed. We can always resurrect it from mercurial if necessary. Also, it looks like this is the only place where setMipsOptions gets called, so you should also delete that function instead of leaving dead code in the source.
-
src/arch/mips/isa.cc (Diff revision 1) -
This particular line of comment is not useful (we can always use mercurial if we care where the code came from).
Review request changed
Updated (Jan. 16, 2012, 12:45 a.m.)
Change Summary:
Follow your advide! I fixed the two places you mentioned. And I will think about if it is necessary to do this, thank you.
Diff: |
Revision 2 (+60 -4) |
|---|
Posted (Jan. 18, 2012, 2:16 a.m.)
-
configs/example/fs.py (Diff revision 2) -
Is it possible to move this code into makeLinuxMipsSystem instead of into isa.cc? Maybe even move the line setMipsOptions right under that function call. If the code is copied into isa.cc, then those values should really be hardcoded into the registers (since there isn't any configuration to be done here.)
-
src/arch/mips/isa.cc (Diff revision 2) -
Let's move configCP() to the constructor behind the clear() line (instead of in the clear() function). This way, the clear() function doesn't have two tasks: clear state and reset state.
