pcisim.data.pcimem
index
../../src/pcisim/data/pcimem.py

Implements a PciMemory structure.

 
Classes
       
pcisim.lib.register.RegistersBlock(__builtin__.object)
PciMemory

 
class PciMemory(pcisim.lib.register.RegistersBlock)
    Implements some of the *PCI Device Structure* registers.
 
Structure fields 'Vendor ID' and 'Device ID' are filled with some
real world codes. These are fetched from the following website:
    http://www.pcidatabase.com
 
 
Method resolution order:
PciMemory
pcisim.lib.register.RegistersBlock
__builtin__.object

Methods defined here:
__init__(self)
__str__(self)
get_bars(self)
Get PCI Device Structure BAR registers.
 
@RETURN
    (RegistersBlock) structure BAR registers.
get_header(self)
Get PCI Device Structure header.
 
@RETURN
    (RegistersBlock) structure header.

Methods inherited from pcisim.lib.register.RegistersBlock:
__getitem__(self, item)
Get a register content or a specific field value.
 
@PARAMS
    | (int) item : register position aligned to regsize
    | (str) item : DataField to find
    | (slice) item : create registers slice
 
@RETURN
    | (DataWord) register if (int) was passed.
    | (DataField) field if (str) was passed.
    | (RegistersBlock) register if a (slice) was passed.
 
@RAISES
    UnalignedAddress if offset is not alligned to register size.
    FieldNotFound if no field was found.
__iter__(self)
Get an iterator over (DataWord) registers.
__setitem__(self, field, val)
Set a field by name.
 
@PARAMS
    (str) field : field name to be set
    (int) val : field value to set
 
@RETURN
    (DataField) modified field.
 
@RAISES
    FieldNotFound if no field was found.
    DataFieldOverflow on field value overflow.
 
@NOTES
    If multiple fields share the same name, only first one is
    returned.
add_register(self, reg)
Adds a register to the block.
 
@PARAMS
    (DataWord) reg : register to add.
get_field(self, field)
Find a field in the block by name.
 
@PARAMS
    (str) field : name of the field to search
 
@RETURN
    (DataField) object
 
@RAISES
    FieldNotFound if no field was found.
 
@NOTES
    If multiple fields share the same name, only first one is
    returned.
get_register(self, offset)
Get a register by register offset.
 
@PARAMS
    (int) offset : register offset.
 
@RETURNS
    (DataWord) register.
 
@RAISES
    UnalignedAddress if offset is not alligned to register size.
new_register(self)
Creates and adds new register.
 
@RETURN
    (DataWord) created register.

Data descriptors inherited from pcisim.lib.register.RegistersBlock:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)