def attachIO(self, bus, dma_ports=[]):
    self.uart.pio = bus.master
    self.realview_io.pio = bus.master
    self.pci_host.pio = bus.master
    self.timer0.pio = bus.master
    self.timer1.pio = bus.master
    self.clcd.pio = bus.master
    if (dma_ports.count(self.clcd.dma) == 0):
        self.clcd.dma = bus.slave
    self.hdlcd.pio = bus.master
    self.kmi0.pio = bus.master
    self.kmi1.pio = bus.master
    self.cf_ctrl.pio = bus.master
    if (dma_ports.count(self.cf_ctrl.dma) == 0):
        self.cf_ctrl.dma = bus.slave
    self.rtc.pio = bus.master
    self.vram.port = bus.master
    self.l2x0_fake.pio = bus.master
    self.uart1_fake.pio = bus.master
    self.uart2_fake.pio = bus.master
    self.uart3_fake.pio = bus.master
    self.sp810_fake.pio = bus.master
    self.watchdog_fake.pio = bus.master
    self.aaci_fake.pio = bus.master
    self.lan_fake.pio = bus.master
    self.usb_fake.pio = bus.master
    self.mmc_fake.pio = bus.master
    self.energy_ctrl.pio = bus.master
    try:
        self.ide.pio = bus.master
        if (dma_ports.count(self.ide.dma) == 0):
            self.ide.dma = bus.slave
        self.ethernet.pio = bus.master
        if (dma_ports.count(self.ethernet.dma) == 0):
            self.ethernet.dma = bus.slave
    except:
        pass
def attachIO(self, bus, dma_ports=[]):
    self.uart.pio = bus.master
    self.realview_io.pio = bus.master
    self.pci_host.pio = bus.master
    self.timer0.pio = bus.master
    self.timer1.pio = bus.master
    self.clcd.pio = bus.master
    if (dma_ports.count(self.clcd.dma) == 0):
        self.clcd.dma = bus.slave
    self.hdlcd.pio = bus.master
    self.kmi0.pio = bus.master
    self.kmi1.pio = bus.master
    self.cf_ctrl.pio = bus.master
    if (dma_ports.count(self.cf_ctrl.dma) == 0):
        self.cf_ctrl.dma = bus.slave
    self.rtc.pio = bus.master
    self.vram.port = bus.master
    self.l2x0_fake.pio = bus.master
    self.uart1_fake.pio = bus.master
    self.uart2_fake.pio = bus.master
    self.uart3_fake.pio = bus.master
    self.sp810_fake.pio = bus.master
    self.watchdog_fake.pio = bus.master
    self.aaci_fake.pio = bus.master
    self.lan_fake.pio = bus.master
    self.usb_fake.pio = bus.master
    self.mmc_fake.pio = bus.master
    self.energy_ctrl.pio = bus.master
    try:
        self.ide.pio = bus.master
        if (dma_ports.count(self.ide.dma) == 0):
            self.ide.dma = bus.slave
        self.ethernet.pio = bus.master
        if (dma_ports.count(self.ethernet.dma) == 0):
            self.ethernet.dma = bus.slave
    except:
        pass