aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom/cle/gen_pack_header.py
Commit message (Collapse)AuthorAgeFilesLines
* v3d: Add pack header support for f187 values.Eric Anholt2018-07-301-0/+7
| | | | | | V3D only has one of these (the top 16 bits of a float32) left in its CLs, but VC4 had many more. This gets us proper pretty-printing of the values instead of a large uint.
* python: Use range() instead of xrange()Mathieu Bridon2018-07-241-1/+1
| | | | | | | | | | | | | | | | Python 2 has a range() function which returns a list, and an xrange() one which returns an iterator. Python 3 lost the function returning a list, and renamed the function returning an iterator as range(). As a result, using range() makes the scripts compatible with both Python versions 2 and 3. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* v3d: Create XML fields for min_ver and max_ver of a packet/struct/enum.Eric Anholt2018-06-291-2/+39
| | | | | This will be used to merge together the V3D 3.3-4.1 XML with the variants disabled based on the version.
* v3d: Pass the version being generated to the pack generator script.Eric Anholt2018-06-291-4/+4
| | | | | | | It turns out that most V3D versions change very few packets, so keeping separate copies of the XML per version makes changing the XML a pain as you have to replicate your changes to each one. This is the start of changing it so that one XML can generate headers for multiple versions.
* v3d: Add pack/unpack/decode support for fields with a "- 1" modifier.Eric Anholt2018-06-271-17/+34
| | | | | | | | | | 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).
* v3d: Be more explicit about include directory from our generated code.Eric Anholt2018-06-051-1/+1
| | | | | | | You'd need src/broadcom/cle/ in the -I previously, for srcdir != builddir. nir was fine at that, but automake didn't have it. Bugzilla: https://github.com/anholt/mesa/issues/104
* broadcom/cle: Fix error path of missing a "type" in the XML.Eric Anholt2018-01-121-1/+2
| | | | | | We try to emit a #error and continue so that you can debug the missing type at C compile time, but were missing a couple of definitions in that path (sigh, python).
* broadcom/xml: Fix up safe name confusion with prefixing.Eric Anholt2018-01-031-14/+13
| | | | | | | For enums we were doubling the underscore if the value had a numeric first character of its name (which safe_name() adds an underscore to). A little helper function cleans up the other instance of prefixing while also fixing this.
* broadcom/xml: Fix address packing for address with >= 8 alignment bits.Eric Anholt2017-10-301-2/+5
| | | | | | | We were handing the intra-byte padding fine, but with a 24-bit address (bottom 8 bits implied 0) we would end up off by 8 bytes in our shift, impacting vc5's load/store general packets (all other packets we have had <8 bits of padding).
* broadcom/xml: Throw an #error in XML-based codegen for a >1bit boolEric Anholt2017-10-301-0/+3
| | | | | I've debugged two nasty errors now due to copy-and-pasting a bool type when writing a uint field. Make sure I don't do that again.
* broadcom/genxml: Add support for enum-typed fields.Eric Anholt2017-09-191-3/+13
| | | | | This basically comes from the intel genxml script. This will help improve gdb and CLIF output once we convert fields over.
* broadcom/genxml: Emit code for default headers for structs as well.Eric Anholt2017-08-181-14/+13
| | | | | | In the vc5 NIR backend, I want to use the XML code-generation to set up pack/unpack of structs for the texture uniforms, and setting up the unpacked copy needs a default header.
* broadcom/genxml: Use the same "gen" attr for HW version as Intel does.Eric Anholt2017-07-131-2/+2
| | | | This will let us reuse their tools more easily.
* broadcom/genxml: Support unpacking fixed-point fractional values.Eric Anholt2017-07-131-4/+9
| | | | | This was an oversight in the original XML support, because unpacking wasn't used much. The new XML-based CL dumper will want it, though.
* vc4: Introduce XML-based packet header generation like Intel's.Eric Anholt2017-06-301-0/+546
I really liked this idea, as it should help with management of packet parsing tools like the CL dump. The python script is forked off of theirs because our packets are byte-based instead of dwords, and the changes to do so while avoiding performance regressions due to unaligned accesses were quite invasive. v2: Fix Android.mk paths, drop shebang for python script, fix overlap detection. Acked-by: Jason Ekstrand <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Tested-by: Rob Herring <[email protected]>