summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/vme/vme.h
diff options
context:
space:
mode:
author Joakim Larsson Edstrom <joakimlarsson42@gmail.com>2017-02-08 15:25:56 +0100
committer Joakim Larsson Edstrom <joakimlarsson42@gmail.com>2017-02-08 15:25:56 +0100
commit42b50225edcb35de1ba2eb1fb7c40c8ddb62d0e7 (patch)
tree2b0b6ea22ee907b43313b9186b234368efd6aafb /src/devices/bus/vme/vme.h
parent41d1224bd72e0bee965c709d6638dd352b577ea4 (diff)
VME bus: added default bus address space and prepared for bus specific features
Diffstat (limited to 'src/devices/bus/vme/vme.h')
-rw-r--r--src/devices/bus/vme/vme.h129
1 files changed, 88 insertions, 41 deletions
diff --git a/src/devices/bus/vme/vme.h b/src/devices/bus/vme/vme.h
index c2aa6e2b666..24b7a94976b 100644
--- a/src/devices/bus/vme/vme.h
+++ b/src/devices/bus/vme/vme.h
@@ -101,6 +101,8 @@ public:
virtual void device_config_complete() override;
static void static_set_vme_slot(device_t &device, const char *tag, const char *slottag);
+ static void static_update_vme_chains(device_t &device, uint32_t slot_nbr);
+
// configuration
const char *m_vme_tag, *m_vme_slottag;
@@ -115,27 +117,102 @@ private:
extern const device_type VME;
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
#define MCFG_VME_DEVICE_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, VME, 0)
+#define MCFG_VME_CPU(_cputag) \
+ vme_device::static_set_cputag(*device, _cputag);
+
+#define MCFG_VME_BUS_OWNER_SPACES() \
+ vme_device::static_use_owner_spaces(*device);
+
class vme_card_interface;
-class vme_device : public device_t
+class vme_device : public device_t,
+ public device_memory_interface
{
public:
vme_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
vme_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
~vme_device();
+ // inline configuration
+ static void static_set_cputag(device_t &device, const char *tag);
+ static void static_use_owner_spaces(device_t &device);
+
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum) const override
+ {
+ switch (spacenum)
+ {
+ case AS_PROGRAM: return &m_a32_config;
+ default: return nullptr;
+ }
+ }
+ const address_space_config m_a32_config;
+
void add_vme_card(device_vme_card_interface *card);
- void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask);
- void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask);
- void install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask);
+
+ //
+ // Address Modifiers
+ //
+ /* There are 6 address modifier lines. They allow the MASTER to pass additional binary
+ information to the SLAVE during data transfers. Table 2-3 lists all of the 64 possible
+ address modifier (AM) codes and classifies each into one of three categories:
+ - Defined
+ - Reserved
+ - User defined
+ The defined address modifier codes can be further classified into three categories:
+ Short addressing AM codes indicate that address lines A02-A15 are being used to select a BYTE(0-3) group.
+ Standard addressing AM codes ,indicate that address lines A02-A23 are being used to select a BYTE(0-3) group.
+ Extended addressing AM codes indicate that address lines A02-A31 are being used to select a BYTE(0-3) group.*/
+
+ enum vme_amod_t
+ { // Defined and User Defined Address Modifier Values (long bnames from VME standard text. please use short)
+ AMOD_EXTENDED_NON_PRIV_DATA = 0x09, //A32 SC (Single Cycle)
+ A32_SC = 0x09, //A32 SC (Single Cycle)
+ AMOD_EXTENDED_NON_PRIV_PRG = 0x0A,
+ AMOD_EXTENDED_NON_PRIV_BLK = 0x0B,
+ AMOD_EXTENDED_SUPERVIS_DATA = 0x0D,
+ AMOD_EXTENDED_SUPERVIS_PRG = 0x0E,
+ AMOD_EXTENDED_SUPERVIS_BLK = 0x0F,
+ AMOD_USER_DEFINED_FIRST = 0x10,
+ AMOD_USER_DEFINED_LAST = 0x1F,
+ AMOD_SHORT_NON_PRIV_ACCESS = 0x29, //A16 SC
+ A16_SC = 0x29, //A16 SC
+ AMOD_SHORT_SUPERVIS_ACCESS = 0x2D,
+ AMOD_STANDARD_NON_PRIV_DATA = 0x39, //A24 SC
+ A24_SC = 0x39, //A24 SC
+ AMOD_STANDARD_NON_PRIV_PRG = 0x3A,
+ AMOD_STANDARD_NON_PRIV_BLK = 0x3B, //A24 BLT
+ AMOD_STANDARD_SUPERVIS_DATA = 0x3D,
+ AMOD_STANDARD_SUPERVIS_PRG = 0x3E,
+ AMOD_STANDARD_SUPERVIS_BLK = 0x3F
+ };
+ void install_device(vme_amod_t amod, offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask);
+ // void install_device(vme_amod_t amod, offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
+ void install_device(vme_amod_t amod, offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask);
+ void install_device(vme_amod_t amod, offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask);
+
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
simple_list<device_vme_card_interface> m_device_list;
+
+ // internal state
+ cpu_device *m_maincpu;
+
+ // address spaces
+ address_space *m_prgspace;
+ int m_prgwidth;
+ bool m_allocspaces;
+
+ const char *m_cputag;
+
};
@@ -161,45 +238,15 @@ public:
const char *m_vme_tag, *m_vme_slottag;
int m_slot;
device_vme_card_interface *m_next;
-
- //
- // Address Modifiers
- //
- /* There are 6 address modifier lines. They allow the MASTER to pass additional binary
- information to the SLAVE during data transfers. Table 2-3 lists all of the 64 possible
- address modifier (AM) codes and classifies each into one of three categories:
- - Defined
- - Reserved
- - User defined
- The defined address modifier codes can be further classified into three categories:
- Short addressing AM codes indicate that address lines A02-A15 are being used to select a BYTE(0-3) group.
- Standard addressing AM codes ,indicate that address lines A02-A23 are being used to select a BYTE(0-3) group.
- Extended addressing AM codes indicate that address lines A02-A31 are being used to select a BYTE(0-3) group.*/
- enum
- { // Defined and User Defined Address Modifier Values, The rest us Reserved between 0x00 and 0x3F
- AMOD_EXTENDED_NON_PRIV_DATA = 0x09,
- AMOD_EXTENDED_NON_PRIV_PRG = 0x0A,
- AMOD_EXTENDED_NON_PRIV_BLK = 0x0B,
- AMOD_EXTENDED_SUPERVIS_DATA = 0x0D,
- AMOD_EXTENDED_SUPERVIS_PRG = 0x0E,
- AMOD_EXTENDED_SUPERVIS_BLK = 0x0F,
- AMOD_USER_DEFINED_FIRST = 0x10,
- AMOD_USER_DEFINED_LAST = 0x1F,
- AMOD_SHORT_NON_PRIV_ACCESS = 0x29,
- AMOD_SHORT_SUPERVIS_ACCESS = 0x2D,
- AMOD_STANDARD_NON_PRIV_DATA = 0x39,
- AMOD_STANDARD_NON_PRIV_PRG = 0x3A,
- AMOD_STANDARD_NON_PRIV_BLK = 0x3B,
- AMOD_STANDARD_SUPERVIS_DATA = 0x3D,
- AMOD_STANDARD_SUPERVIS_PRG = 0x3E,
- AMOD_STANDARD_SUPERVIS_BLK = 0x3F
- };
};
-#define MCFG_VME_SLOT_ADD(_tag, _slot_tag, _slot_intf,_def_slot) \
- MCFG_DEVICE_ADD(_slot_tag, VME_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- vme_slot_device::static_set_vme_slot(*device, _tag, _slot_tag);
+#define MCFG_VME_SLOT_ADD(_tag, _slotnbr, _slot_intf,_def_slot) \
+ { std::string stag = "slot" + std::to_string(_slotnbr); \
+ MCFG_DEVICE_ADD(stag.c_str(), VME_SLOT, 0); \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false); \
+ vme_slot_device::static_set_vme_slot(*device, _tag, stag.c_str()); \
+ vme_slot_device::static_update_vme_chains(*device, _slotnbr); \
+ }
#define MCFG_VME_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)