ARM: Implement majority of instructions and some initial full-system support
Review Request #20 - Created April 29, 2010 and submitted
Information | |
---|---|
Ali Saidi | |
gem5 | |
Reviewers | |
Default | |
Initial set of patches to improve the M5 support of the ARM ISA. Bundled into one large change for review. This change implements the majority of thumb, thumb2, and arm instructions and allows the running of all tested SPEC2000 benchmarks in atomic mode.
Posted (May 8, 2010, 4:08 a.m.)
Overall I'm kinda disappointed that most of the decode ended up in C++ and not in the ISA description language (I know the latter would have required some extensions)... now that it's in place and (presumably) working though, I guess there's no compelling reason to go back and do it that way.
-
src/arch/arm/faults.hh (Diff revision 1) -
Seems redundant to have 'Arm' in the name of a class that's inside the 'ArmISA' namespace... I can see where there might be some confusion if there's a base Fault that's outside the namespace as well, but maybe that's a sign that there's a larger renaming that should be done. Also, Fault:FaultBase seems more consistent with other naming than FaultVals:Fault; I'm curious what motivated the change.
-
src/arch/arm/insts/branch.cc (Diff revision 1) -
Is this file really empty now? If so, shouldn't we just get rid of it?
-
src/arch/arm/insts/macromem.hh (Diff revision 1) -
Be nice not to have deleted the comments describing these classes... or at least write new ones.
-
src/arch/arm/insts/mem.hh (Diff revision 1) -
seems like this should go in a .cc file
-
src/arch/arm/insts/mem.hh (Diff revision 1) -
this should go in a .cc file too
-
src/arch/arm/insts/static_inst.hh (Diff revision 1) -
don't you want these (incl. many more below) declared inline?
-
src/arch/arm/insts/vfp.hh (Diff revision 1) -
Some comments would be nice... I assume vfp is "vector floating point", but it would be good to say that explicitly.
-
src/arch/arm/insts/vfp.hh (Diff revision 1) -
does this need to be inline? seems like a lot of code (and the ones below are worse).
-
src/arch/arm/insts/vfp.hh (Diff revision 1) -
What's the purpose of these __asm__ statements?
-
src/arch/arm/insts/vfp.hh (Diff revision 1) -
zoinks, a 1200-line header?
-
src/arch/arm/interrupts.hh (Diff revision 1) -
I guess this is subjective, but effectively coding a boolean expression as control flow seems weird to me unless it's *really* complicated otherwise. So I'd write this as: return ((interrupts[INT_IRQ] && !cpsr.i) || (interrupts[INT_FIQ] && !cpsr.f) || (interrupts[INT_ABT] && !cpsr.a) || interrupts[INT_RST]);
-
src/arch/arm/isa.hh (Diff revision 1) -
This seems like a really big and rarely used function to be defined in the .hh file.
-
src/arch/arm/isa.hh (Diff revision 1) -
I don't get this comment... it sounds like you're explaining why cpacr isn't 0 even though it should be, but then you set it to 0 anyway.
-
src/arch/arm/isa/bitfields.isa (Diff revision 1) -
I assume these are all instances of your C++ bitfield class? Maybe we should add some first-class support in the ISA parser to get rid of this redundant-looking header. What are the advantages of doing it this way vs. the old way, anyway?
-
src/arch/arm/isa/decoder/decoder.isa (Diff revision 1) -
It would be clearer to do: decode THUMB default Unknown::unknown() { 0: ##include "arm.isa" 1: ##include "thumb.isa" } then get rid of the context-free 0:/1: in the included files... (add line breaks if necessary if we require the '##' to be at the beginning of a line)
-
src/arch/arm/isa/formats/data.isa (Diff revision 1) -
Is there a reason we can't use predefined bitfields here (and a ton of other places)?
-
src/arch/arm/pagetable.hh (Diff revision 1) -
'inline' is redundant here and on next method
-
src/arch/arm/predecoder.hh (Diff revision 1) -
Can we move all this code to a .cc file?
-
src/arch/arm/table_walker.hh (Diff revision 1) -
Should have a blank line between these function defs
-
src/arch/arm/table_walker.hh (Diff revision 1) -
What is N? Unless this is obvious to anyone who knows anything about ARM page tables (a set that doesn't include me) a longer name would be nice. In any case, a comment is called for.
-
src/arch/arm/utility.hh (Diff revision 1) -
What's the point of 'static' here (and on the previous function)? Also, this seems like a more generic "print binary" function... can we just add "%b" to cprintf?
Posted (May 11, 2010, 7:15 a.m.)
-
src/arch/arm/isa/formats/data.isa (Diff revision 1) -
It looks like cases 1 & 3 (and 9 and 0xb) are identical; right? If so, I think they should be merged; getting rid of redundant code trumps keeping the cases in numerical order.
Posted (May 11, 2010, 8:22 a.m.)
-
src/arch/arm/isa/formats/data.isa (Diff revision 1) -
In these cases they're all "return" statements, so there's no fall-through issue here.
Review request changed
Updated (May 26, 2010, 1:13 p.m.)
Posted (May 27, 2010, 1:35 p.m.)
-
src/arch/arm/faults.cc (Diff revision 2) -
I know that I'm being difficult here, but can you make the comment not be on the /* line, but on the following line? I have lots of copyright scripts with regular expressions in them and this would screw them up.
Posted (June 1, 2010, 1:39 a.m.)
-
src/arch/arm/insts/mem.cc (Diff revision 2) -
This is pretty minor, but I think this code is both more compact and expresses the intent better (for this case and similarly the following ASR case): ccprintf(os, " LSR #%d", (shiftAmt == 0) ? 32 : shiftAmt);
Posted (June 1, 2010, 4:31 a.m.)
My comments are very superficial, but I would appreciate the copyright fixes to make life easier if we ever have to do some copyright nonsense again (I sure hope not). I have one other minor request. Get rid of lines > 80 columns for at least the ARM stuff.
-
configs/common/cpu2000.py (Diff revision 2) -
No big deal, but python doesn't require parens for stuff like this.
-
src/arch/arm/SConscript (Diff revision 2) -
Unless you know that none of this was written by FSU, you probably shouldn't remove the copyright.
-
src/arch/arm/faults.hh (Diff revision 2) -
You're going to fix this for me, right?
-
src/arch/arm/faults.hh (Diff revision 2) -
Why are you specifying the values in this enum? Are they important? Do they come from some document? A comment might be nice to explain why. If the values don't matter, then they should probably be removed.
-
src/arch/arm/insts/macromem.hh (Diff revision 2) -
Fix please
-
src/arch/arm/insts/macromem.cc (Diff revision 2) -
Fix please
-
src/arch/arm/insts/mult.hh (Diff revision 2) -
Fix please
-
src/arch/arm/insts/pred_inst.hh (Diff revision 2) -
Fix please
-
src/arch/arm/insts/pred_inst.cc (Diff revision 2) -
Fix please
-
src/arch/arm/insts/static_inst.hh (Diff revision 2) -
Fix please
-
src/arch/arm/insts/static_inst.cc (Diff revision 2) -
Fix please
-
src/arch/arm/insts/vfp.cc (Diff revision 2) -
fix please
-
src/arch/arm/isa.hh (Diff revision 2) -
Another fix here please.
-
src/arch/arm/isa_traits.hh (Diff revision 2) -
This get resolved?
-
src/arch/arm/miscregs.hh (Diff revision 2) -
Another fix.
-
src/arch/arm/miscregs.cc (Diff revision 2) -
How often does this happen? Is there nothing more efficient than this insane implementation? A table lookup perhaps?
-
src/arch/arm/predecoder.hh (Diff revision 2) -
Fix please.
-
src/arch/arm/predecoder.cc (Diff revision 2) -
Fix please
-
src/arch/arm/process.cc (Diff revision 2) -
Spacing looks messed up at least in reviewboard
-
src/arch/arm/types.hh (Diff revision 2) -
Fix please
-
src/arch/arm/utility.hh (Diff revision 2) -
Fix please
-
src/cpu/simple/base.cc (Diff revision 2) -
This change really require copyright?
-
src/dev/arm/Versatile.py (Diff revision 2) -
Please remove ##
-
src/dev/arm/versatile.hh (Diff revision 2) -
Please fix