]> git.sesse.net Git - pistorm/commitdiff
IDE IRQ, FPGA with maximum current strength on FET busctrl signals
authorClaude <claude.schwarz@gmail.com>
Mon, 23 Nov 2020 15:55:04 +0000 (15:55 +0000)
committerClaude <claude.schwarz@gmail.com>
Mon, 23 Nov 2020 15:55:04 +0000 (15:55 +0000)
Gayle.c
bitstream.svf
emulator.c

diff --git a/Gayle.c b/Gayle.c
index e051095bf5deae2480e7aef7bed51a151ee60cb3..36c7de2ac3c0929cea0bacaf09892286053cf3bc 100644 (file)
--- a/Gayle.c
+++ b/Gayle.c
@@ -158,8 +158,7 @@ void writeGayleB(unsigned int address, unsigned int value) {
 
   if (address == GIRQ) {
     //  printf("Write Byte to Gayle GIRQ 0x%06x (0x%06x)\n",address,value);
-    gayle_irq =
-        (gayle_irq & value) | (value & (GAYLE_IRQ_RESET | GAYLE_IRQ_BERR));
+    gayle_irq = (gayle_irq & value) | (value & (GAYLE_IRQ_RESET | GAYLE_IRQ_BERR));
 
     return;
   }
@@ -247,6 +246,8 @@ uint8_t readGayleB(unsigned int address) {
   if (address == GIRQ) {
     // printf("Read Byte From GIRQ Space 0x%06x\n",gayle_irq);
 
+    return 0x80;//gayle_irq;
+/*
     uint8_t irq;
     irq = ide0->drive->intrq;
 
@@ -256,7 +257,8 @@ uint8_t readGayleB(unsigned int address) {
     }
 
     return 0;
-  }
+*/ 
+ }
 
   if (address == GCS) {
     printf("Read Byte From GCS Space 0x%06x\n", 0x1234);
index 8103b7bdc49bbbf3037ebd46bf3c4c23276c9f41..a37c83cf084a3e438325cd1bb69b9df9eda8351a 100644 (file)
@@ -14,7 +14,7 @@
 !\r
 !Quartus II SVF converter 13.0\r
 !\r
-!Device #1: EPM570 - output_files/max2.pof Sun Nov 22 11:45:08 2020\r
+!Device #1: EPM570 - output_files/max2.pof Mon Nov 23 16:52:29 2020\r
 !\r
 !NOTE "USERCODE" "0032528E";\r
 !\r
index 35b6b9e7847ac6044ee8ad17daa87c3086d06326..730927ff1a827b7399782673c1da97ea74495d77 100644 (file)
@@ -259,7 +259,7 @@ int main() {
   usleep(1500);
 
   m68k_init();
-  m68k_set_cpu_type(M68K_CPU_TYPE_68030);
+  m68k_set_cpu_type(M68K_CPU_TYPE_68040);
   m68k_pulse_reset();
 
   if (maprom == 1) {
@@ -280,13 +280,18 @@ int main() {
 
   m68k_pulse_reset();
   while (42) {
-    m68k_execute(3000);
-    if (GET_GPIO(1) == 0) {
+    m68k_execute(300);
+
+    if (GET_GPIO(1) == 0){
       srdata = read_reg();
       m68k_set_irq((srdata >> 13) & 0xff);
     } else {
-      m68k_set_irq(0);
+//      if (CheckIrq() == 1)
+//      m68k_set_irq(2);
+//      else
+         m68k_set_irq(0);
     };
+
   }
 
   return 0;
@@ -324,7 +329,7 @@ unsigned int m68k_read_memory_8(unsigned int address) {
     return read8((uint32_t)address);
   }
 
-  return 0;
+  return 1;
 }
 
 unsigned int m68k_read_memory_16(unsigned int address) {
@@ -346,7 +351,7 @@ unsigned int m68k_read_memory_16(unsigned int address) {
     return (unsigned int)read16((uint32_t)address);
   }
 
-  return 0;
+  return 1;
 }
 
 unsigned int m68k_read_memory_32(unsigned int address) {
@@ -370,7 +375,7 @@ unsigned int m68k_read_memory_32(unsigned int address) {
     return (a << 16) | b;
   }
 
-  return 0;
+  return 1;
 }
 
 void m68k_write_memory_8(unsigned int address, unsigned int value) {
@@ -443,7 +448,8 @@ void write16(uint32_t address, uint32_t data) {
   uint32_t data_r = (~data & 0x0000ffff) << 8;
 
   //      asm volatile ("dmb" ::: "memory");
-  W16 *(gpio) = gpfsel0_o;
+  W16
+  *(gpio) = gpfsel0_o;
   *(gpio + 1) = gpfsel1_o;
   *(gpio + 2) = gpfsel2_o;
 
@@ -484,7 +490,8 @@ void write8(uint32_t address, uint32_t data) {
   uint32_t data_r = (~data & 0x0000ffff) << 8;
 
   //   asm volatile ("dmb" ::: "memory");
-  W8 *(gpio) = gpfsel0_o;
+  W8
+  *(gpio) = gpfsel0_o;
   *(gpio + 1) = gpfsel1_o;
   *(gpio + 2) = gpfsel2_o;
 
@@ -521,8 +528,7 @@ uint32_t read16(uint32_t address) {
 
   //   asm volatile ("dmb" ::: "memory");
   R16
-
-      *(gpio) = gpfsel0_o;
+  *(gpio) = gpfsel0_o;
   *(gpio + 1) = gpfsel1_o;
   *(gpio + 2) = gpfsel2_o;
 
@@ -558,7 +564,8 @@ uint32_t read8(uint32_t address) {
   uint32_t addr_l_r = (~address >> 16) << 8;
 
   //    asm volatile ("dmb" ::: "memory");
-  R8 *(gpio) = gpfsel0_o;
+  R8
+  *(gpio) = gpfsel0_o;
   *(gpio + 1) = gpfsel1_o;
   *(gpio + 2) = gpfsel2_o;
 
@@ -587,10 +594,9 @@ uint32_t read8(uint32_t address) {
 
   val = (val >> 8) & 0xffff;
   if ((address & 1) == 0)
-    val = (val >> 8) & 0xff;  // EVEN, A0=0,UDS
+    return (val >> 8) & 0xff;  // EVEN, A0=0,UDS
   else
-    val = val & 0xff;  // ODD , A0=1,LDS
-  return val;
+    return val & 0xff;  // ODD , A0=1,LDS
 }
 
 /******************************************************/