|
- Method resolution order:
- BDF
- pcisim.lib.dataword.DataWord
- __builtin__.object
Methods defined here:
- __init__(self, bus=0, dev=0, func=0, reg=0)
- @PARAMS
(int) bus : bus number in range 0-255
(int) dev : device number in range 0-31
(int) func : function number in range 0-7
(int) reg : register index in PCI Device Structure, range 0-255
Methods inherited from pcisim.lib.dataword.DataWord:
- __getattr__(self, attr)
- Allows point notation to be used to access fields by name.
@PARAMS
(str) attr : field or attribute to get
@RETURNS
(int) field value
@RAISES
AttributeError if field or attribute not found
- __iter__(self)
- Iterate over structure fields.
@RETURN
self.fields iterator.
- __setattr__(self, attr, val)
- Allows point notation to be used to set field value.
@PARAMS
(str) attr : field or attribute to be set
(int) val : value to set
- __str__(self)
- add(self, field)
- Adds a field to the structure starting from bit 0.
@PARAMS
(DataField) field : field to add
@NOTES
Unlocks the structure if locked.
- add_field(self, name, bits, *args, **kargs)
- Creates a DataField and adds it to the structure starting from
bit 0.
@PARAMS
(str) name : symbolic name for the field
(int) bits : number of bits of the field
*args : additional arguments to pass to DataField init
**kargs : additional keyword arguments to pass to DataField init
@RETURN
(DataField) added field.
@NOTES
Unlocks the structure if locked.
- get_bits(self)
- Get structure overall bit size.
@RETURN
(int) bit size.
@RAISES
StructureNotLocked if lock() function was not called.
- get_field(self, fieldname)
- Get a field by field name.
@PARAMS
(str) fieldname : name of the field to search
@RETURN
(DataField) field found.
@RAISES
FieldNotFound when given field name does not match any.
- get_raw(self)
- Get structure value as an integer value;
@RETURN
(int) raw fields value.
- is_locked(self)
- True if structure is locked;
- lock(self)
- Calculates structure bitsize.
This method should be called after structure has been populated.
After this call, bitsize can be retrieved by get_bits() call.
- set_field(self, fieldname, value)
- Sets a specific field value;
@PARAMS
(str) fieldname : name of the field to set
(int) value : value to set
@RETURN
(DataField) modified field.
- set_raw(self, rawdata)
- Set a raw value to the structure, overwriting fields value.
@PARAMS
(int) rawdata : value to set
Data descriptors inherited from pcisim.lib.dataword.DataWord:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|