v3d: Add pack/unpack/decode support for fields with a "- 1" modifier.

Right now, we name these fields as "field name minus one" so that your C
code obviously states what the value should be.  However, it's easy enough
to handle at the codegen level with another little XML attribute, meaning
less C code and easier-to-read values in CLIF dumping and gdb as well.

(The actual CLIF format for simulator and FPGA replay takes in
pre-minus-one values, so we need it there too).
This commit is contained in:
Eric Anholt
2018-06-26 15:53:26 -07:00
parent e9a77c3e96
commit 18b1bb0b63
3 changed files with 46 additions and 17 deletions
+1
View File
@@ -125,6 +125,7 @@ struct v3d_field {
char *name;
int start, end;
struct v3d_type type;
bool minus_one;
bool has_default;
uint32_t default_value;