| |
- __builtin__.object
-
- Port
-
- Bus
- exceptions.Exception(exceptions.BaseException)
-
- BusFull
- NoSuchDevice
- PortBadBits
class Bus(Port) |
|
A one-to-many Port like object.
@ATTRIBS
(list) slots : available slots in the bus
link : current active slot link |
|
- Method resolution order:
- Bus
- Port
- __builtin__.object
Methods defined here:
- __init__(self, bits, slots, name='bus')
- @PARAMS
(int) bits : number of data lines in the bus
(int) slots : maximun device number
(str) name : optional bus name
- __str__(self)
- get_slot(self, slot)
- Get a device by slot number.
@PARAMS
(int) slot : slot number
@RETURN
device at that slot
@RAISE
NoSuchDevice if slot number is out of range
@NOTES
Can return (None) if slot is not already assigned.
- set_link(self, slot)
- Set current active slot link.
@PARAMS
slot : slot number of the device to set
@RETURN
device in that slot
@RAISE
NoSuchDevice if slot number is out of range
@NOTES
Can set and return (None) if slot is not already assigned.
- set_slot(self, dev, slot=None)
- Set a slot in the bus, assigning a device.
@PARAMS
dev : device to assign the slot to
| (int) slot : slot number
| (None) slot : will find an available slot
@RETURN
(int) assigned slot number
@RAISE
BusFull if no slots are available
NoSuchDevice if slot number is out of range
@NOTES
If given slot number is already used, the previous device is
replaced with new one.
Methods inherited from Port:
- get_bits(self)
- Get port bits.
- write(self, data)
- Write data onto the port.
@PARAMS
| (int) data : data to write
| (DataWord) data : data to write
Data descriptors inherited from Port:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Port(__builtin__.object) |
|
A logical port between two components. Holds a DataWord.
@ATTRIBS
(DataWord) value : value to keep into the port
(str) name : symbolic name for the port |
|
Methods defined here:
- __init__(self, bits, name)
- @PARAMS
(int) bits : bits of the port
(str) name : symbolic name for the port
- __str__(self)
- get_bits(self)
- Get port bits.
- write(self, data)
- Write data onto the port.
@PARAMS
| (int) data : data to write
| (DataWord) data : data to write
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
|