Commit 0db4269a authored by Benoit Rat's avatar Benoit Rat

c_headers: add the size of a field in the list of extended define

We prefer to use size and shift than to get the size by reading the mask
because the bits in mask might not be contiguous.
parent 469a107e
......@@ -49,6 +49,7 @@ function cgen_c_field_define(field, reg, index)
emit(string.format("%-45s %s", "#define "..prefix.."_ACCESS", "WBGEN2_"..rw_table[field.access_bus]));
emit(string.format("%-45s %d", "#define "..prefix.."_NBFP", field.nbfp));
emit(string.format("%-45s %d", "#define "..prefix.."_SIGN", field.sign));
emit(string.format("%-45s %d", "#define "..prefix.."_SIZE", field.size));
if(field.type == BIT or field.type == MONOSTABLE) then
emit(string.format("%-45s %d", "#define "..prefix.."_SHIFT", field.offset));
emit(string.format("%-45s %s", "#define "..prefix.."_MASK", "WBGEN2_GEN_MASK("..field.offset..", "..field.size..")"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment