* Partially implement new VPE_STAT register.
authorIan Carmichael <iancarm@cygnus>
Mon, 16 Feb 1998 21:44:45 +0000 (21:44 +0000)
committerIan Carmichael <iancarm@cygnus>
Mon, 16 Feb 1998 21:44:45 +0000 (21:44 +0000)
sim/mips/.Sanitize
sim/mips/sky-vu1.c
sim/mips/sky-vu1.h

index 29ff045ce5670f18aa601cd45990beefd2745598..30edef2fb729270ac2ac32204813f894cbf6ba6b 100644 (file)
@@ -24,7 +24,7 @@ else
         lose_these_too="${r5900_files} ${lose_these_too}"
 fi
 
-sky_files="ChangeLog.sky sky-device.c sky-device.h sky-dma.c sky-dma.h"
+sky_files="ChangeLog.sky sky-device.c sky-device.h sky-dma.c sky-dma.h sky-bits.h"
 sky_files="$sky_files sky-engine.c sky-gpuif.c sky-gpuif.h"
 sky_files="$sky_files sky-hardware.c sky-hardware.h"
 sky_files="$sky_files sky-libvpe.c sky-libvpe.h sky-pke.c sky-pke.h"
index 6fbb81e7d03ab09ce2bc97331cef835c2909b52b..48152869cae59e456b96f940da0f95de570c738b 100644 (file)
@@ -9,6 +9,9 @@
 #include "sky-vu1.h"
 #include "sky-libvpe.h"
 #include "sky-vu.h"
+#include "sky-bits.h"
+
+#include <assert.h>
 
 VectorUnitState vu1_state;
 
@@ -36,24 +39,35 @@ vu1_io_read_register_window(device *me,
 {
        /* Slow and crappy hack ... */
 
+       
        int i;
 
        char source_buffer[VU1_REGISTER_WINDOW_SIZE];
        char* src;
 
+       assert(nr_bytes == 1 || nr_bytes == 2 || nr_bytes == 4 || nr_bytes == 8 || nr_bytes == 16);
+
        memcpy(source_buffer, &vu1_state.regs.VF[0][0], 0x200); /* copy VF registers */ 
        for (i = 0; i<16; i++ ) {
            *(short*)&source_buffer[0x200 + i*16] = vu1_state.regs.VI[i];
        }
-       *(u_long*)&source_buffer[VU1_MST - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MST;
-       *(u_long*)&source_buffer[VU1_MMC - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MMC;
-       *(u_long*)&source_buffer[VU1_MCP - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MCP;
-       *(u_long*)&source_buffer[VU1_MR  - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MR;
-       *(u_long*)&source_buffer[VU1_MI  - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MI;
-       *(u_long*)&source_buffer[VU1_MQ  - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MQ;
-       *(u_long*)&source_buffer[VU1_MP  - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MP;
-       *(u_long*)&source_buffer[VU1_MTPC - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MTPC;
-       *(VpeStat*)&source_buffer[VPE1_STAT - VU1_REGISTER_WINDOW_START] = vu1_state.regs.VPE_STAT;
+       *(u_long*)&source_buffer[VU1_MST   - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MST;
+       *(u_long*)&source_buffer[VU1_MMC   - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MMC;
+       *(u_long*)&source_buffer[VU1_MCP   - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MCP;
+       *(u_long*)&source_buffer[VU1_MR    - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MR;
+       *(u_long*)&source_buffer[VU1_MI    - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MI;
+       *(u_long*)&source_buffer[VU1_MQ    - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MQ;
+       *(u_long*)&source_buffer[VU1_MP    - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MP;
+       *(u_long*)&source_buffer[VU1_MTPC  - VU1_REGISTER_WINDOW_START] = vu1_state.regs.MTPC;
+
+       {
+           u_long stat;
+           stat = 0;
+           if (vu1_state.runState == VU_RUN || vu1_state.runState == VU_BREAK)
+               SET_BIT(stat, VPU_STAT_VBS1_BIT);
+           
+           *(u_long*)&source_buffer[VPE1_STAT - VU1_REGISTER_WINDOW_START] = stat;
+       }
 
 #if 0
        printf("%s: Read: %x, %d, dest: %x, space: %d, %x!\n", me->name, (int)addr, nr_bytes, (int)dest, space, *(int*)&(vu1_state.regs.VPE_STAT));
@@ -84,7 +98,6 @@ vu1_io_write_register_window(device *me,
        if (addr == VPE1_STAT && nr_bytes == 4) {
            /* Magic to switch VU to run state, until other methods are available. */
            vu1_state.runState = VU_RUN;
-           vu1_state.regs.VPE_STAT.vbs = 1;
            vu1_state.junk.eflag = 0;
            vu1_state.junk.peflag = 0;
 /*printf("Magic start run...\n");*/
index 88fe3e925c26f6308d523655ec39e9d291fa1f14..225b8cb78b5340151a296c5ed23634c9b8203c73 100644 (file)
@@ -7,9 +7,9 @@
 
 #include "sim-main.h"
 
-void vu1_attach(SIM_DESC sd);
 void vu1_issue(void);
 void vu1_init(SIM_DESC sd);
+int vu1_status(void);
 
 #define VU1_MEM0_WINDOW_START  0x11008000
 #define VU1_MEM0_SIZE          0x4000    /* 16K = 16384 */