Once a port has been added to a block descriptor, it is often necessary to
configure individual attributes on the port. Before configuring
the port, you must obtain a descriptor for the port you would
like to configure. SysgenBlockDescriptor provides methods for
accessing the port objects that are associated with it. For
example, the following method retrieves the port named
din
on the
this_block
descriptor:
Accessing a SysgenPortDescriptor object:
din = this_block.port('din');
In the above code, an object din
is created and assigned to the
descriptor returned by the port
function call.
SysgenBlockDescriptor also provides methods, inport
and
outport
, that return a port object
given a port index. A port index is the index of the port (in
the order shown on the block interface) and is some value
between 1 and the number of input/output ports on the block.
These methods are useful when you need to iterate through the
block's ports (e.g., for error checking).