async def METHOD_NAME(self, address, data, space):
    if space == "memory":
        dr_txn_command = DR_TXN_COMMAND_WRITE_MEMORY
    elif space == "core":
        dr_txn_command = DR_TXN_COMMAND_WRITE_CORE
    elif space == "aux":
        dr_txn_command = DR_TXN_COMMAND_WRITE_AUX
    else:
        assert False
    self._log("write %s address=%08x data=%08x", space, address, data)
    dr_address = DR_ADDRESS(Address=address)
    await self.lower.write_ir(IR_ADDRESS)
    await self.lower.write_dr(dr_address.to_bits())
    await self.lower.write_ir(IR_DATA)
    dr_data = DR_DATA(Data=data)
    await self.lower.write_dr(dr_data.to_bits())
    await self.lower.write_ir(IR_TXN_COMMAND)
    await self.lower.write_dr(dr_txn_command)
    await self.lower.run_test_idle(1)
    await self._wait_txn()