@classmethod<EOL><INDENT>def fromPy(cls, val, typeObj, vldMask=None):<DEDENT>
if vldMask == <NUM_LIT:0>:<EOL><INDENT>val = None<EOL><DEDENT>return cls(val, typeObj)<EOL>
:param val: None or dict {field name: field value}
:param typeObj: instance of String HdlType
:param vldMask: if is None validity is resolved from val
    if is 0 value is invalidated
    if is 1 value has to be valid