frodus Posted April 13, 2011 Report Share Posted April 13, 2011 Hi All, I'm currently trying to write a frame generator with support for multiple protocols. My current idea is to implement one class for each protocol which I have to support and then one frame class which can instance the different protocols as needed. Currently I've some difficulties to figure out how to do the packing in such an approach can be implemented. In principal I do have a do_pack as described below for simple packet. If I would like to add another level of protocol it would have been put right after the type field and before the data. The question is which approach I've to follow in order to change this position from another protocol class. (Note: I have to support a lot of protocols so hard coding each combination is not an option.) function void do_pack(uvm_packer packer); super.do_pack(packer); packer.pack_field_int(dest,$bits(dest)); packer.pack_field_int(src,$bits(src)); packer.pack_field_int(type,$bits(type)); foreach(data) packer.pack_field_int(data,8); packer.pack_field_int(fcs,$bits(fcs); endfunction Thanks, Frodus Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.