Add micromips support to the MIPS simulator

Message ID 0DA23CC379F5F945ACB41CF394B9827721126A60@LEMAIL01.le.imgtec.org
State Committed
Headers

Commit Message

Andrew Bennett Sept. 25, 2015, 12:06 p.m. UTC
  > > No, they are required for some of the macros used in the file so they need

> to

> > stay in.

> 

> this needs to be documented as to why.  other ports don't need this, and

> it sounds like something wrong with the mips port that should be fixed at

> some point.


The definitions come from the *_support.h files generated by igen and are required 
because they are used in some of the macros in the micromipsrun.c file.  
Unfortunately we can not just blindly include the *_support.h files to get these 
definitions because some of the defines in these files are specific for a particular 
configuration of the simulator for example instruction word size is 16 bits for 
micromips16 and 32 bits for micromips32.  This means we could break future code 
changes by doing this, so a safer approach is to just extract the defines that 
we need to get the file to compile.  

I have added a comment above the defines which explains this.  The diff from my
previous patch is below.

Ok to commit?

Many thanks,



Andrew
  

Comments

Mike Frysinger Sept. 25, 2015, 2:07 p.m. UTC | #1
On 25 Sep 2015 12:06, Andrew Bennett wrote:
> Ok to commit?

OK, thanks !
-mike
  
Andrew Bennett Sept. 25, 2015, 8:22 p.m. UTC | #2
> On 25 Sep 2015 12:06, Andrew Bennett wrote:
>> Ok to commit?
> OK, thanks !

This has now been committed.  Once I did the committing I realised that
I only have Binutils write access permissions.  Is this ok, or do I need
to get GDB write access as well?

Many thanks,


Andrew
  
Mike Frysinger Sept. 25, 2015, 8:57 p.m. UTC | #3
On 25 Sep 2015 20:22, Andrew Bennett wrote:
> > On 25 Sep 2015 12:06, Andrew Bennett wrote:
> >> Ok to commit?
> > OK, thanks !
> 
> This has now been committed.  Once I did the committing I realised that
> I only have Binutils write access permissions.  Is this ok, or do I need
> to get GDB write access as well?

binutils & gdb are the same repo now, and thus there's a single set
of acls controlling `git push`.  your patch has been approved, so
that's all you need.
-mike
  

Patch

diff --git a/sim/mips/micromipsrun.c b/sim/mips/micromipsrun.c
index 7dd10d7..c39138b 100644
--- a/sim/mips/micromipsrun.c
+++ b/sim/mips/micromipsrun.c
@@ -26,6 +26,14 @@ 
 #include "bfd.h"
 #include "sim-engine.h"
 
+/* These definitions come from the *_support.h files generated by igen and are
+   required because they are used in some of the macros in the code below.
+   Unfortunately we can not just blindly include the *_support.h files to get
+   these definitions because some of the defines in these files are specific
+   for a particular configuration of the simulator for example instruction word
+   size is 16 bits for micromips16 and 32 bits for micromips32.  This means we
+   could break future code changes by doing this, so a safer approach is to just
+   extract the defines that we need to get this file to compile.  */
 #define SD sd
 #define CPU cpu