try
and else
are Specman's exception handling constructs. If an error is created in the try
block, then the else
block is immediately executed instead of the rest of the try
block and the error is suppressed with no printout.
In this case, if lob
has more bits than pkt
has "physical fields", then the unpack will generate an error. If that happens, the Specman runtime will jump to the else
block and print out the lob
data structure instead of printing the original unpack
error. Look in the docs with regards to what "physical fields" are and how they are used. They are a strange construct that specifically interacts with the behavior of Specman's %
, pack
, and unpack
constructs. Physical fields of pkt
will be declared with the %
modifier preceding the "physical fields" of pkt
.