.. _read_word:

		Read one word from a device.
		The offset is ``device_addr + device_offset``, e.g.::

			offset = 3 # third word of the device
			offset += addr2
			b.read_word(offset)
			# reads third word of d2.

		Truncates the value according to ``width``.

		May raise BUSError_, if the offset exceeds the address space.

def read_word(self, offset):
		"""
		.. _read_word:

		Read one word from a device.
		The offset is ``device_addr + device_offset``, e.g.::

			offset = 3 # third word of the device
			offset += addr2
			b.read_word(offset)
			# reads third word of d2.

		Truncates the value according to ``width``.

		May raise BUSError_, if the offset exceeds the address space.

		"""	
		self._lock = True
		if(offset > self.current_max_offset):
			raise BUSError("Offset({}) exceeds address space of BUS({})".format(offset, self.current_max_offset)) 
		self.reads += 1
		for addresspace, device in self.index.items():
			if(offset in addresspace):
				if(self.debug > 5):
					print("BUS::read({}) | startaddress({})> {}".format(offset, self.start_addresses[device],
								device.read(offset - self.start_addresses[device])))
				self.truncate.setvalue( device.read(offset - self.start_addresses[device]))
				return self.truncate.getvalue()