projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sim: cr16: convert to common sim memory modules
[deliverable/binutils-gdb.git]
/
sim
/
cr16
/
gencode.c
diff --git
a/sim/cr16/gencode.c
b/sim/cr16/gencode.c
index de2a020b3c66708aa887be4a39500d2d86655688..6d569086fa29711ba2ffb5caceb8446509cc5755 100644
(file)
--- a/
sim/cr16/gencode.c
+++ b/
sim/cr16/gencode.c
@@
-1,5
+1,5
@@
/* Simulation code for the CR16 processor.
/* Simulation code for the CR16 processor.
- Copyright (C) 2008
, 2009, 2010, 2011
Free Software Foundation, Inc.
+ Copyright (C) 2008
-2015
Free Software Foundation, Inc.
Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
This file is part of GDB, the GNU debugger.
Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
This file is part of GDB, the GNU debugger.
@@
-22,12
+22,13
@@
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
+#include <string.h>
#include "ansidecl.h"
#include "opcode/cr16.h"
#include "ansidecl.h"
#include "opcode/cr16.h"
-static void write_header
PARAMS ((void)
);
-static void write_opcodes
PARAMS ((void)
);
-static void write_template
PARAMS ((void)
);
+static void write_header
(void
);
+static void write_opcodes
(void
);
+static void write_template
(void
);
int
main (int argc, char *argv[])
int
main (int argc, char *argv[])
@@
-43,7
+44,7
@@
main (int argc, char *argv[])
static void
static void
-write_header ()
+write_header (
void
)
{
int i = 0;
{
int i = 0;
@@
-52,9
+53,9
@@
write_header ()
/* Loop over instruction table until a full match is found. */
for ( ; i < NUMOPCODES; i++)
/* Loop over instruction table until a full match is found. */
for ( ; i < NUMOPCODES; i++)
- {
- printf("void OP_%X_%X PARAMS ((void));\t\t/* %s */\n",cr16_instruction[i].match, (32 - cr16_instruction[i].match_bits), cr16_instruction[i].mnemonic);
- }
+ printf("void OP_%lX_%X (SIM_DESC, SIM_CPU *);\t\t/* %s */\n",
+ cr16_instruction[i].match, (32 - cr16_instruction[i].match_bits),
+ cr16_instruction[i].mnemonic);
}
}
@@
-62,18
+63,20
@@
write_header ()
ready to be filled out. */
static void
ready to be filled out. */
static void
-write_template ()
+write_template (
void
)
{
int i = 0,j, k, flags;
{
int i = 0,j, k, flags;
- printf ("#include \"
cr16_sim
.h\"\n");
+ printf ("#include \"
sim-main
.h\"\n");
printf ("#include \"simops.h\"\n\n");
for ( ; i < NUMOPCODES; i++)
{
if (cr16_instruction[i].size != 0)
{
printf ("#include \"simops.h\"\n\n");
for ( ; i < NUMOPCODES; i++)
{
if (cr16_instruction[i].size != 0)
{
- printf("/* %s */\nvoid\nOP_%X_%X ()\n{\n",cr16_instruction[i].mnemonic,cr16_instruction[i].match,(32 - cr16_instruction[i].match_bits));
+ printf ("/* %s */\nvoid\nOP_%lX_%X (SIM_DESC sd, SIM_CPU *cpu)\n{\n",
+ cr16_instruction[i].mnemonic, cr16_instruction[i].match,
+ (32 - cr16_instruction[i].match_bits));
/* count operands. */
j = 0;
/* count operands. */
j = 0;
@@
-110,23
+113,25
@@
write_template ()
long Opcodes[512];
static int curop=0;
long Opcodes[512];
static int curop=0;
+#if 0
+static void
check_opcodes( long op)
{
int i;
for (i=0;i<curop;i++)
if (Opcodes[i] == op)
check_opcodes( long op)
{
int i;
for (i=0;i<curop;i++)
if (Opcodes[i] == op)
- fprintf(stderr,"DUPLICATE OPCODES: %
x\n",
op);
+ fprintf(stderr,"DUPLICATE OPCODES: %
lx\n",
op);
}
}
-
+#endif
static void
static void
-write_opcodes ()
+write_opcodes (
void
)
{
int i = 0, j = 0, k;
/* write out opcode table. */
{
int i = 0, j = 0, k;
/* write out opcode table. */
- printf ("#include \"
cr16_sim
.h\"\n");
+ printf ("#include \"
sim-main
.h\"\n");
printf ("#include \"simops.h\"\n\n");
printf ("struct simops Simops[] = {\n");
printf ("#include \"simops.h\"\n\n");
printf ("struct simops Simops[] = {\n");
@@
-134,7
+139,7
@@
write_opcodes ()
{
if (cr16_instruction[i].size != 0)
{
{
if (cr16_instruction[i].size != 0)
{
- printf (" { \"%s\", %
ld, %d, %d, %d, \"OP_%X_%X\", OP_%
X_%X, ",
+ printf (" { \"%s\", %
u, %d, %ld, %u, \"OP_%lX_%X\", OP_%l
X_%X, ",
cr16_instruction[i].mnemonic, cr16_instruction[i].size,
cr16_instruction[i].match_bits, cr16_instruction[i].match,
cr16_instruction[i].flags, ((BIN(cr16_instruction[i].match, cr16_instruction[i].match_bits))>>(cr16_instruction[i].match_bits)),
cr16_instruction[i].mnemonic, cr16_instruction[i].size,
cr16_instruction[i].match_bits, cr16_instruction[i].match,
cr16_instruction[i].flags, ((BIN(cr16_instruction[i].match, cr16_instruction[i].match_bits))>>(cr16_instruction[i].match_bits)),
@@
-170,5
+175,5
@@
write_opcodes ()
printf ("},\n");
}
}
printf ("},\n");
}
}
- printf (" { \"NULL\",1,8,0,0,\"OP_0_20\",OP_0_20,0,{
0,0,0
}},\n};\n");
+ printf (" { \"NULL\",1,8,0,0,\"OP_0_20\",OP_0_20,0,{
{0,0},{0,0},{0,0},{0,0}
}},\n};\n");
}
}
This page took
0.030812 seconds
and
4
git commands to generate.