At times, when using XPS Editor, I find that the commented lines in the MHS are moved outside the module definition.
XPS preserves comments in most of the cases (95%). Only in very few cases do comments get moved around.
When the GUI reads on the MHS file, it associates comments either with an IP instance or an individual port/parameter/bus interface of an IP. Therefore, when it writes out the MHS, the comments get written out along with those entities (IP, port, param, etc.).
Following are some cases where the GUI moves the comment around:
- Comments written on same line as port, param, or bus interface; these need to be written in the line above.
- Comments written after the last port declaration on an IP are associated with the IP itself, and therefore, will get moved to the top of the instance declaration when the MHS is written out. Again, comments for a port should be written just above that port.