From: Ron Unrau Date: Sun, 15 Feb 1998 21:33:13 +0000 (+0000) Subject: configure.in: add -DTARGET_SKY for mips64r5900-sky-elf configure. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97908603a4b9f1d8b0a58d72b881245b889fac1f;p=binutils-gdb.git configure.in: add -DTARGET_SKY for mips64r5900-sky-elf configure. sim-main.h: Define regs for sky if -DTARGET_SKY interp.c: Initial register upload/download support for sky. --- diff --git a/sim/mips/configure.in b/sim/mips/configure.in index a3b294abfda..9c56e7ab042 100644 --- a/sim/mips/configure.in +++ b/sim/mips/configure.in @@ -202,7 +202,7 @@ AC_SUBST(sim_gen) case "${target}" in # start-sanitize-sky mips64r59*-sky-*) mips_extra_objs='$(SIM_SKY_OBJS)' ; - SIM_SUBTARGET="-DWITH_DEVICES=1 -DDEVICE_INIT=1";; + SIM_SUBTARGET="-DTARGET_SKY -DWITH_DEVICES=1 -DDEVICE_INIT=1";; # end-sanitize-sky *) mips_extra_objs="" ;; diff --git a/sim/mips/interp.c b/sim/mips/interp.c index da161828a08..bca479cadc9 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -255,13 +255,20 @@ interrupt_event (SIM_DESC sd, void *data) /*---------------------------------------------------------------------------*/ /*-- Device registration hook -----------------------------------------------*/ /*---------------------------------------------------------------------------*/ -static device_init(SIM_DESC sd) { +static void device_init(SIM_DESC sd) { #ifdef DEVICE_INIT extern void register_devices(SIM_DESC); register_devices(sd); #endif } +/* start-sanitize-sky */ +static struct { + short i[16]; + int f[NUM_VU_REGS - 16]; +} vu_regs[2]; +/* end-sanitize-sky */ + /*---------------------------------------------------------------------------*/ /*-- GDB simulator interface ------------------------------------------------*/ /*---------------------------------------------------------------------------*/ @@ -369,6 +376,41 @@ sim_open (kind, cb, abfd, argv) for( rn = LAST_EMBED_REGNUM+1; rn < NUM_REGS; rn++) cpu->register_widths[rn] = 64; /* end-sanitize-r5900 */ + + /* start-sanitize-sky */ +#ifdef TARGET_SKY + /* Now the VU registers */ + for( rn = 0; rn < 16; rn++ ) { /* first the integer registers */ + cpu->register_widths[rn + NUM_R5900_REGS] = 16; + cpu->register_widths[rn + NUM_R5900_REGS + NUM_VU_REGS] = 16; + + /* Hack for now - to test gdb interface */ + vu_regs[0].i[rn] = rn + 0x100; + vu_regs[1].i[rn] = rn + 0x200; + } + + for( rn = 16; rn < NUM_VU_REGS; rn++ ) { /* then the FP registers */ + float f; + + cpu->register_widths[rn + NUM_R5900_REGS] = 32; + cpu->register_widths[rn + NUM_R5900_REGS + NUM_VU_REGS] = 32; + + /* Hack for now - to test gdb interface */ + if( rn < 24 ) { + f = rn - 16 + 100.0; + vu_regs[0].f[rn-16] = *((unsigned *) &f); + f = rn - 16 + 200.0; + vu_regs[1].f[rn-16] = *((unsigned *) &f); + } + else { + f = (rn - 24)/4 + (rn - 24)%4 + 1000.0; + vu_regs[0].f[rn-16] = *((unsigned *) &f); + f = (rn - 24)/4 + (rn - 24)%4 + 2000.0; + vu_regs[1].f[rn-16] = *((unsigned *) &f); + } + } +#endif + /* end-sanitize-sky */ } #if defined(TRACE) @@ -561,6 +603,28 @@ sim_store_register (sd,rn,memory) if (cpu->register_widths[rn] == 0) sim_io_eprintf(sd,"Invalid register width for %d (register store ignored)\n",rn); + /* start-sanitize-sky */ +#ifdef TARGET_SKY + else if( rn > NUM_R5900_REGS ) { + rn = rn - NUM_R5900_REGS; + + if( rn < 16 ) + vu_regs[0].i[rn] = T2H_2( *(unsigned short *) memory ); + else if( rn < NUM_VU_REGS ) + vu_regs[0].f[rn - 16] = T2H_4( *(unsigned int *) memory ); + else { + rn = rn - NUM_VU_REGS; + + if( rn < 16 ) + vu_regs[1].i[rn] = T2H_2( *(unsigned short *) memory ); + else if( rn < NUM_VU_REGS ) + vu_regs[1].f[rn - 16] = T2H_4( *(unsigned int *) memory ); + else + sim_io_eprintf( sd, "Invalid VU register (register store ignored)\n" ); + } + } +#endif + /* end-sanitize-sky */ /* start-sanitize-r5900 */ else if (rn == REGISTER_SA) SA = T2H_8(*(unsigned64*)memory); @@ -597,6 +661,28 @@ sim_fetch_register (sd,rn,memory) if (cpu->register_widths[rn] == 0) sim_io_eprintf(sd,"Invalid register width for %d (register fetch ignored)\n",rn); + /* start-sanitize-sky */ +#ifdef TARGET_SKY + else if( rn > NUM_R5900_REGS ) { + rn = rn - NUM_R5900_REGS; + + if( rn < 16 ) + *((unsigned short *) memory) = H2T_2( vu_regs[0].i[rn] ); + else if( rn < NUM_VU_REGS ) + *((unsigned int *) memory) = H2T_4( vu_regs[0].f[rn - 16] ); + else { + rn = rn - NUM_VU_REGS; + + if( rn < 16 ) + (*(unsigned short *) memory) = H2T_2( vu_regs[1].i[rn] ); + else if( rn < NUM_VU_REGS ) + (*(unsigned int *) memory) = H2T_4( vu_regs[1].f[rn - 16] ); + else + sim_io_eprintf( sd, "Invalid VU register (register fetch ignored)\n" ); + } + } +#endif + /* end-sanitize-sky */ /* start-sanitize-r5900 */ else if (rn == REGISTER_SA) *((unsigned64*)memory) = H2T_8(SA);