From 733cfc784bc8d7264598ac045e3619aaf52f466b Mon Sep 17 00:00:00 2001 From: Ian Carmichael Date: Tue, 24 Feb 1998 23:37:20 +0000 Subject: [PATCH] * A bunch of changes which get us closer to running the sample. --- sim/mips/sky-pke.c | 12 ++++++------ sim/mips/sky-vu1.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sim/mips/sky-pke.c b/sim/mips/sky-pke.c index 456cbafb4ac..aec68c4c8cd 100644 --- a/sim/mips/sky-pke.c +++ b/sim/mips/sky-pke.c @@ -883,6 +883,11 @@ pke_check_stall(struct pke_device* me, enum pke_check_target what) void pke_flip_dbf(struct pke_device* me) { + /* compute new ITOP and TOP */ + PKE_REG_MASK_SET(me, ITOP, ITOP, + PKE_REG_MASK_GET(me, ITOPS, ITOPS)); + PKE_REG_MASK_SET(me, TOP, TOP, + PKE_REG_MASK_GET(me, TOPS, TOPS)); /* flip DBF */ PKE_REG_MASK_SET(me, DBF, DF, PKE_REG_MASK_GET(me, DBF, DF) ? 0 : 1); @@ -892,11 +897,6 @@ pke_flip_dbf(struct pke_device* me) (PKE_REG_MASK_GET(me, BASE, BASE) + (PKE_REG_MASK_GET(me, DBF, DF) * PKE_REG_MASK_GET(me, OFST, OFFSET)))); - /* compute new ITOP and TOP */ - PKE_REG_MASK_SET(me, ITOP, ITOP, - PKE_REG_MASK_GET(me, ITOPS, ITOPS)); - PKE_REG_MASK_SET(me, TOP, TOP, - PKE_REG_MASK_GET(me, TOPS, TOPS)); } @@ -1428,7 +1428,7 @@ pke_code_mpg(struct pke_device* me, unsigned_4 pkecode) /* imm: in 64-bit units for MPG instruction */ /* VU*_MEM0 : instruction memory */ vu_addr_base = (me->pke_number == 0) ? - VU0_MEM0_WINDOW_START : VU0_MEM0_WINDOW_START; + VU0_MEM0_WINDOW_START : VU1_MEM0_WINDOW_START; vu_addr = vu_addr_base + (imm + i) * 8; /* XXX: overflow check! */ diff --git a/sim/mips/sky-vu1.c b/sim/mips/sky-vu1.c index 2d01fec0da6..b1b853c3a85 100644 --- a/sim/mips/sky-vu1.c +++ b/sim/mips/sky-vu1.c @@ -23,6 +23,16 @@ static char vu1_mem_buffer[VU1_MEM1_SIZE] __attribute__ ((aligned(16))); void init_vu1(void); void init_vu(VectorUnitState *state, char* umem_buffer, char* mem_buffer); +static void dump_mem() { + int i; + typedef int T[2048][4]; + T *mem = (T*)&vu1_mem_buffer; + + for (i = 0; i < 200; i++) { + printf("%d: %x %x %x %x\n", i, (*mem)[i][0], (*mem)[i][1], (*mem)[i][2], (*mem)[i][3]); + } +} + void vu1_issue(void) { -- 2.30.2