0 Replies Latest reply on Feb 26, 2011 8:52 AM by sgratton

    cal image binary information/header request

      In particular about the programinfo note...


      Hi there,


      Thanks to the information in the AMD CAL programming guide v2.0 and the various ISA manuals I've been able to almost completely understand the form of cal image binaries for the various cards and shader types.  The plan was to use the provided information in a fruitful way and write my own simple assembler for CAL.


      However, unfortunately the documentation does not list the actual numerical values associated with the cal note header type identifiers (see e.g. table B3).  Rather than deducing them would it be possible for AMD to provide these?


      One nice way to do this might be to provide header files with the appropriate enums/defines in them.


      An additional, more complicated issue, comes in the form of the programinfo note.  More information is really needed to be able to straightforwardly use this.  The note is described as containing a list of address, value pairs and only changes a little bit between shaders/cards.   For a simple 770 pixel shader it looks like:

          A210           0
          A211           0
          A212           0
          A213           0
          A214    72000003
          A215           2
          A233           0
          A1B3         101
          A1B4           3
          A1B6           0
      80000000           1
      80000001           0
          A191           0
          A192           0
          A193           0
          A194           0
          A195           0
          A196           0
          A197           0
          A198           0
          A199           0
          A19A           0
          A19B           0
          A19C           0
          A19D           0
          A19E           0
          A19F           0
          A1A0           0
          A1A1           0
          A1A2           0
          A1A3           0
          A1A4           0
          A1A5           0
          A1A6           0
          A1A7           0
          A1A8           0
          A1A9           0
          A1AA           0
          A1AB           0
          A1AC           0
          A1AD           0
          A1AE           0
          A1AF           0
          A1B0       30003
          A08F           F
          A203         210
          A1E8           1
          2301    400000F0
          2302           0
          2300           8

      The "low" addresses, when multiplied by four, and contents are by and large consistent with the disassembly output (e.g. cf. SQ_PGM_RESOURCES_PS and a214) and what is in the R6xx_3D_Registers.pdf file.   Each of these lines could be interpreted as a pm4 type-0 command packet as described in R6xx_R7xx_3D.pdf .  One or two numbers don't quite match up though.


      The "high" addresses look like pm4 type-2 filler packets, but they have some information in the reserved field and an associated value, so it would be strange if they actually were fillers.  What are these? 


      In most cases most fields are zero so the non-trivial information required should not be too great.  (Compute shaders for cypress/cayman are a little more complicated but not overly so.)


      My feeling is that the entire programinfo note is a function of only a few variables of the kernel, such as its inputs, outputs, resources and numbers of gprs used, so it should be possible to write/use a function that outputs a suitable programinfo note given those variables.


      Any help much appreciated,