Open sjalloq opened 5 years ago
Yes, ordt will pack fields with no assigned offset in first available space in the reg starting from lsb. Spec was somewhat ambiguous here so implementation may differ from other compilers - given volume of code out there, default behavior will not be changed. Might be worth adding a switch at some point, but solution for now is to use bit offsets when instancing fields.
Kamino cloned this issue to sdnellen/open-register-design-tool
The RDL spec shows how fields are packed in a register on p.44 of the v1.0 spec. In the case of LSB ordering, the following should hold:
However, this doesn't appear to be the case with Ordt. My understanding from the above example is that the following register:
should result in a packed register of the form:
Bit 0 : init_done Bit 1: tc_ready Bit 2 : reserved Bit 3 : reserved Bit 4 : temp_low_warn Bit 5 : temp_high_warn Bit 6 : temp_low_alarm Bit 7 : temp_high_alarm
Ordt is outputting the following:
Bit 0 : init done Bit 1: tc_ready Bit 2 : temp_high_warn Bit 3 : temp_low_alarm Bit 4 : temp_low_warn Bit 5 : temp_high_alarm