summaryrefslogtreecommitdiffstats
path: root/src/devices/cpu/tms32082/tms32082.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms32082/tms32082.cpp')
-rw-r--r--src/devices/cpu/tms32082/tms32082.cpp147
1 files changed, 92 insertions, 55 deletions
diff --git a/src/devices/cpu/tms32082/tms32082.cpp b/src/devices/cpu/tms32082/tms32082.cpp
index 25dc0af52ac..330627829da 100644
--- a/src/devices/cpu/tms32082/tms32082.cpp
+++ b/src/devices/cpu/tms32082/tms32082.cpp
@@ -72,40 +72,37 @@ std::unique_ptr<util::disasm_interface> tms32082_mp_device::create_disassembler(
}
-uint32_t tms32082_mp_device::mp_param_r(offs_t offset, uint32_t mem_mask)
+void tms32082_mp_device::tc_command_execute(int channel, uint32_t entrypoint)
{
- //printf("mp_param_w: %08X, %08X\n", offset, mem_mask);
- return m_param_ram[offset];
-}
+ [[maybe_unused]] static const char* CHANNEL_NAME[16] = {
+ "XPT15", "XPT14", "XPT13", "XPT12", "XPT11", "XPT10", "XPT9", "XPT8",
+ "XPT7", "XPT6", "XPT5", "XPT4", "XPT3", "XPT2", "XPT1", "MP"
+ };
-void tms32082_mp_device::mp_param_w(offs_t offset, uint32_t data, uint32_t mem_mask)
-{
- //printf("mp_param_w: %08X, %08X, %08X\n", offset, data, mem_mask);
+ uint32_t address = entrypoint;
- COMBINE_DATA(&m_param_ram[offset]);
+ uint32_t next_entry = m_program.read_dword(address + 0);
+ uint32_t pt_options = m_program.read_dword(address + 4);
- if (offset == 0x3f)
+ if ((pt_options & 0x00100000) == 0)
{
- // initiate Transfer Controller operation
- // TODO: move TC functionality to separate device
- uint32_t address = data;
+ // long-form transfer
- uint32_t next_entry = m_program.read_dword(address + 0);
- uint32_t pt_options = m_program.read_dword(address + 4);
uint32_t src_addr = m_program.read_dword(address + 8);
uint32_t dst_addr = m_program.read_dword(address + 12);
uint32_t src_b_count = m_program.read_word(address + 16);
uint32_t src_a_count = m_program.read_word(address + 18);
- uint32_t dst_b_count = m_program.read_word(address + 20);
- uint32_t dst_a_count = m_program.read_word(address + 22);
+ // uint32_t dst_b_count = m_program.read_word(address + 20);
+ // uint32_t dst_a_count = m_program.read_word(address + 22);
uint32_t src_c_count = m_program.read_dword(address + 24);
- uint32_t dst_c_count = m_program.read_dword(address + 28);
+ // uint32_t dst_c_count = m_program.read_dword(address + 28);
uint32_t src_b_pitch = m_program.read_dword(address + 32);
uint32_t dst_b_pitch = m_program.read_dword(address + 36);
uint32_t src_c_pitch = m_program.read_dword(address + 40);
uint32_t dst_c_pitch = m_program.read_dword(address + 44);
- printf("TC operation:\n");
+ /*
+ printf("TC operation (long form) %s:\n", CHANNEL_NAME[channel]);
printf(" Next entry: %08X\n", next_entry);
printf(" PT options: %08X\n", pt_options);
printf(" SRC addr: %08X\n", src_addr);
@@ -118,6 +115,7 @@ void tms32082_mp_device::mp_param_w(offs_t offset, uint32_t data, uint32_t mem_m
printf(" DST B pitch: %08X\n", dst_b_pitch);
printf(" SRC C pitch: %08X\n", src_c_pitch);
printf(" DST C pitch: %08X\n", dst_c_pitch);
+ */
if (pt_options != 0x80000000)
fatalerror("TC transfer, options = %08X\n", pt_options);
@@ -145,6 +143,57 @@ void tms32082_mp_device::mp_param_w(offs_t offset, uint32_t data, uint32_t mem_m
}
}
}
+ else
+ {
+ // short-form transfer
+
+ bool stop = false;
+
+ do
+ {
+
+ // uint32_t src_addr = m_program.read_dword(address + 8);
+ // uint32_t dst_addr = m_program.read_dword(address + 12);
+
+ // int count = pt_options & 0xffff;
+ stop = (pt_options & 0x80000000) ? true : false;
+
+ /*
+ printf("TC operation (short form) %s [%08X]:\n", CHANNEL_NAME[channel], address);
+ printf(" Next entry: %08X\n", next_entry);
+ printf(" PT options: %08X\n", pt_options);
+ printf(" Byte count: %08X\n", count);
+ printf(" SRC addr: %08X\n", src_addr);
+ printf(" DST addr: %08X\n", dst_addr);
+ */
+
+ address = next_entry;
+ if (!stop)
+ {
+ next_entry = m_program.read_dword(address);
+ pt_options = m_program.read_dword(address + 4);
+ }
+ } while (!stop);
+ }
+}
+
+
+uint32_t tms32082_mp_device::mp_param_r(offs_t offset, uint32_t mem_mask)
+{
+ //printf("mp_param_w: %08X, %08X\n", offset, mem_mask);
+ return m_param_ram[offset];
+}
+
+void tms32082_mp_device::mp_param_w(offs_t offset, uint32_t data, uint32_t mem_mask)
+{
+ //printf("mp_param_w: %08X, %08X, %08X\n", offset, data, mem_mask);
+
+ COMBINE_DATA(&m_param_ram[offset]);
+
+ if (offset >= 0x30 && offset <= 0x3f)
+ {
+ tc_command_execute(offset - 0x30, data);
+ }
}
@@ -255,48 +304,32 @@ void tms32082_mp_device::device_reset()
m_intpen = 0;
m_ie = 0;
+
+ m_pp_status = 0xf0000; // start with all PPs halted
}
void tms32082_mp_device::processor_command(uint32_t command)
{
- printf("MP CMND %08X: ", command);
+ // unhalt PPs
+ if (command & 0x20000000)
+ {
+ if (command & 0x00000001)
+ m_pp_status &= ~0x10000;
+ if (command & 0x00000002)
+ m_pp_status &= ~0x20000;
+ }
- if (command & 0x80000000)
- printf("Reset ");
+ // halt PPs
if (command & 0x40000000)
- printf("Halt ");
- if (command & 0x20000000)
- printf("Unhalt ");
- if (command & 0x10000000)
- printf("ICR ");
- if (command & 0x08000000)
- printf("DCR ");
- if (command & 0x00004000)
- printf("Task ");
- if (command & 0x00002000)
- printf("Msg ");
-
- printf("to: ");
-
- if (command & 0x00000400)
- printf("VC ");
- if (command & 0x00000200)
- printf("TC ");
- if (command & 0x00000100)
- printf("MP ");
- if (command & 0x00000008)
- printf("PP3 ");
- if (command & 0x00000004)
- printf("PP2 ");
- if (command & 0x00000002)
- printf("PP1 ");
- if (command & 0x00000001)
- printf("PP0 ");
+ {
+ if (command & 0x00000001)
+ m_pp_status |= 0x10000;
+ if (command & 0x00000002)
+ m_pp_status |= 0x20000;
+ }
if (!m_cmd_callback.isnull())
m_cmd_callback(space(AS_PROGRAM), command);
-
- printf("\n");
}
uint32_t tms32082_mp_device::read_creg(int reg)
@@ -309,6 +342,11 @@ uint32_t tms32082_mp_device::read_creg(int reg)
case 0x1: // EIP
return m_eip;
+ case 0x2: // CONFIG
+ // Type = 0010: 2 Parallel Processors
+ // Release = 0011: Production release silicon
+ return (0x2 << 12) | (0x3 << 4);
+
case 0x4: // INTPEN
return m_intpen;
@@ -316,7 +354,7 @@ uint32_t tms32082_mp_device::read_creg(int reg)
return m_ie;
case 0xa: // PPERROR
- return 0xe0000;
+ return m_pp_status;
case 0xe: // TCOUNT
return m_tcount;
@@ -331,7 +369,7 @@ uint32_t tms32082_mp_device::read_creg(int reg)
return m_outp;
default:
- printf("read_creg(): %08X\n", reg);
+ //printf("read_creg(): %08X\n", reg);
break;
}
return 0;
@@ -361,7 +399,6 @@ void tms32082_mp_device::write_creg(int reg, uint32_t data)
case 0x6: // IE
m_ie = data;
- printf("IE = %08X\n", data);
break;
case 0xe: // TCOUNT
@@ -381,7 +418,7 @@ void tms32082_mp_device::write_creg(int reg, uint32_t data)
break;
default:
- printf("write_creg(): %08X, %08X\n", reg, data);
+ //printf("write_creg(): %08X, %08X\n", reg, data);
break;
}
}