<s> from pymtl import * <EOL> class CoProcMsg ( object ) : <EOL> def __init__ ( s , addr_nbits , data_nbits ) : <EOL> s . req = CoProcReqMsg ( addr_nbits , data_nbits ) <EOL> s . resp = CoProcRespMsg ( data_nbits ) <EOL> class CoProcReqMsg ( BitStructDefinition ) : <EOL> def __init__ ( s , addr_nbits , data_nbits ) : <EOL> s . addr_nbits = addr_nbits <EOL> s . data_nbits = data_nbits <EOL> s . addr = BitField ( s . addr_nbits ) <EOL> s . data = BitField ( s . data_nbits ) <EOL> def mk_msg ( s , type_ , addr , len_ , data ) : <EOL> msg = s ( ) <EOL> return msg <EOL> class CoProcRespMsg ( BitStructDefinition ) : <EOL> def __init__ ( s , data_nbits ) : <EOL> s . data_nbits = data_nbits <EOL> s . data = BitField ( s . data_nbits ) <EOL> def unpck ( s , msg ) : <EOL> resp = s ( ) <EOL> resp . value = msg <EOL> return resp </s>
