aboutsummaryrefslogtreecommitdiff
path: root/sim/mips/sim-main.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-11-12 06:42:34 +0000
committerAndrew Cagney <cagney@redhat.com>1998-11-12 06:42:34 +0000
commitd1cbd70abba43c47cbbbf759e225bd946538325a (patch)
tree8f6c98c595892a4a3ed48c0e3c7b5ba29506b06a /sim/mips/sim-main.c
parent93db5513ee4fd5bfd3e556638cc1331d8d0a9533 (diff)
downloadgdb-d1cbd70abba43c47cbbbf759e225bd946538325a.zip
gdb-d1cbd70abba43c47cbbbf759e225bd946538325a.tar.gz
gdb-d1cbd70abba43c47cbbbf759e225bd946538325a.tar.bz2
Add configury for mips-lsi-elf target (32 bit MIPS16).
Fix numerous problems with PENDING_* code. In old gencode simulator, don't double tick each cycle. Add BREAK instruction to MIPS16 gencode simulator.
Diffstat (limited to 'sim/mips/sim-main.c')
-rw-r--r--sim/mips/sim-main.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/sim/mips/sim-main.c b/sim/mips/sim-main.c
index 9e2ea40..f82b182 100644
--- a/sim/mips/sim-main.c
+++ b/sim/mips/sim-main.c
@@ -791,7 +791,7 @@ pending_tick (SIM_DESC SD,
address_word cia)
{
if (PENDING_TRACE)
- sim_io_printf (SD, "PENDING_DRAIN - pending_in = %d, pending_out = %d, pending_total = %d\n", PENDING_IN, PENDING_OUT, PENDING_TOTAL);
+ sim_io_eprintf (SD, "PENDING_DRAIN - 0x%lx - pending_in = %d, pending_out = %d, pending_total = %d\n", (unsigned long) cia, PENDING_IN, PENDING_OUT, PENDING_TOTAL);
if (PENDING_OUT != PENDING_IN)
{
int loop;
@@ -799,17 +799,26 @@ pending_tick (SIM_DESC SD,
int total = PENDING_TOTAL;
if (PENDING_TOTAL == 0)
sim_engine_abort (SD, CPU, cia, "PENDING_DRAIN - Mis-match on pending update pointers\n");
- for (loop = 0; (loop < total); loop++)
+ for (loop = 0, index = PENDING_OUT;
+ (loop < total);
+ loop++, index = (index + 1) % PSLOTS)
{
if (PENDING_SLOT_DEST[index] != NULL)
{
PENDING_SLOT_DELAY[index] -= 1;
if (PENDING_SLOT_DELAY[index] == 0)
{
+ if (PENDING_TRACE)
+ sim_io_eprintf (SD, "PENDING_DRAIN - drained - index %d, dest 0x%lx, bit %d, val 0x%lx, size %d\n",
+ index,
+ (unsigned long) PENDING_SLOT_DEST[index],
+ PENDING_SLOT_BIT[index],
+ (unsigned long) PENDING_SLOT_VALUE[index],
+ PENDING_SLOT_SIZE[index]);
if (PENDING_SLOT_BIT[index] >= 0)
switch (PENDING_SLOT_SIZE[index])
{
- case 32:
+ case 4:
if (PENDING_SLOT_VALUE[index])
*(unsigned32*)PENDING_SLOT_DEST[index] |=
BIT32 (PENDING_SLOT_BIT[index]);
@@ -817,7 +826,7 @@ pending_tick (SIM_DESC SD,
*(unsigned32*)PENDING_SLOT_DEST[index] &=
BIT32 (PENDING_SLOT_BIT[index]);
break;
- case 64:
+ case 8:
if (PENDING_SLOT_VALUE[index])
*(unsigned64*)PENDING_SLOT_DEST[index] |=
BIT64 (PENDING_SLOT_BIT[index]);
@@ -825,30 +834,36 @@ pending_tick (SIM_DESC SD,
*(unsigned64*)PENDING_SLOT_DEST[index] &=
BIT64 (PENDING_SLOT_BIT[index]);
break;
- break;
}
else
switch (PENDING_SLOT_SIZE[index])
{
- case 32:
+ case 4:
*(unsigned32*)PENDING_SLOT_DEST[index] =
PENDING_SLOT_VALUE[index];
break;
- case 64:
+ case 8:
*(unsigned64*)PENDING_SLOT_DEST[index] =
PENDING_SLOT_VALUE[index];
break;
}
+ if (PENDING_OUT == index)
+ {
+ PENDING_SLOT_DEST[index] = NULL;
+ PENDING_OUT = (PENDING_OUT + 1) % PSLOTS;
+ PENDING_TOTAL--;
+ }
}
- if (PENDING_OUT == index)
- {
- PENDING_SLOT_DEST[index] = NULL;
- PENDING_OUT = (PENDING_OUT + 1) % PSLOTS;
- PENDING_TOTAL--;
- }
+ else if (PENDING_TRACE && PENDING_SLOT_DELAY[index] > 0)
+ sim_io_eprintf (SD, "PENDING_DRAIN - queued - index %d, delay %d, dest 0x%lx, bit %d, val 0x%lx, size %d\n",
+ index, PENDING_SLOT_DELAY[index],
+ (unsigned long) PENDING_SLOT_DEST[index],
+ PENDING_SLOT_BIT[index],
+ (unsigned long) PENDING_SLOT_VALUE[index],
+ PENDING_SLOT_SIZE[index]);
+
}
}
- index = (index + 1) % PSLOTS;
}
}