QualiTI

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

QualiTI Introduction

QualiTI is a tool from TI to verify the XDAIS compliance of a certain piece of code, e.g. a codec library. The tool was first published with XDAIS 6.00 and improvements are made with each XDAIS release. Currently, the tool supports C64x+ (64P), C674, and ARM platforms. An older, alternative approach for ARM codec developers non-QualiTI-based approaches is still available.

It is designed as an optional but recommended helper for porting existing free form codec libraries (e.g. open source ones) to the more encapsulated XDAIS or XDM design for making that code correctly plug into any XDAIS-based framework (e.g. Codec Engine).

Qualiti ScreenShot043.jpg

At present the QualiTI compliance tool only tests a subset of the XDAIS rule-set - however it does check most of the typical problems that cause integration issues. For example: -

For each rule tested it will emit PASS or FAIL. For each failure, it will indicate precisely what failed, possible reasons for the failure and suggested ways to fix it.

Some details on the tests performed follow: -

Details on tests performed

Rules 8, 9, 10: Namespace compliance

These rules are bundled together simply because we run the same tool to check compliance for all 3.

The rules themselves are: -

What does namespace compliance mean?

Well, if we run the symbol listing tool nm6x on an algorithm as follows: -

      C:\CCStudio_v3.3\C6000\cgtools\bin\nm6x.exe -g fir_ti.l64P

This yields an output something like: -

ARCHIVE:  fir_ti.l64P
00000000 T _FIR_TI_exit
00000000 T _FIR_TI_init
00000064 T _FIR_TI_filter
00000000 T _dummy1
00000000 U _memcpy
00000000 T _FIR_TI_activate
00000000 T _FIR_TI_alloc
00000000 T _FIR_TI_control
...

Anything with FIR_TI_ prefix is good, _memcpy is ok since it comes from the allowed RTS functions list in Appendix list of spru352. _dummy1 is bad - 'T' represents 'text' so there's a global function without a decent namespace. This is not namespace compliant.

How to fix this?

QualiTI tells you this too.


Rule 12: IALG interface implementation

Here we check for the presence of required XDAIS function-table interface entry points. XDAIS requires the following 2 symbols to be exposed: -

Internally again QualiTI uses nm6x to check for the existence of such symbols

Absence of either of these symbols is non-compliance - there should be no characters after the _IALG or _IMOD characters

How to fix this?

QualiTI tells you this too.


Rule 13+: correct linker section names

This rule requirs that each IALG function be in its own section - this enables clients to link/place them anywhere they want - as opposed to lumping them in with .text

We need a different tool than nm6x for this - we need something that shows the list of sections in the archive.

QualiTI therefore leverages the Codegen XML Perl Scripts Utility package. More specifically it runs sectti.exe

This is the same utility that the XDC Codec Package Wizard uses.

It produces something like: -

Reading from stdin ...
Library,Filename,Section,Type,Size
fir_ti.l64P,fir_ti.o64,.text:init,CODE,32
fir_ti.l64P,fir_ti.o64,.text:exit,CODE,32
fir_ti.l64P,fir_ti_filter.o64,.text,CODE,32
fir_ti.l64P,fir_ti_filter.o64,.cinit,DATA,24
fir_ti.l64P,fir_ti_filter.o64,.tables,UDATA,16
fir_ti.l64P,fir_ti_filter.o64,.text:filter,CODE,224
fir_ti.l64P,fir_ti_ialg.o64,.text:algNumAlloc,CODE,32
fir_ti.l64P,fir_ti_ialg.o64,.text:algMoved,CODE,32
fir_ti.l64P,fir_ti_ialg.o64,.text:algInit,CODE,64
fir_ti.l64P,fir_ti_ialg.o64,.text:algAlloc,CODE,128
fir_ti.l64P,fir_ti_ialg.o64,.text:algFree,CODE,64
fir_ti.l64P,fir_ti_ialg.o64,.text:algDeactivate,CODE,32
fir_ti.l64P,fir_ti_ialg.o64,.text:algControl,CODE,64
fir_ti.l64P,fir_ti_ialg.o64,.text:algActivate,CODE,32
fir_ti.l64P,fir_ti_vt.o64,.cinit,DATA,48
fir_ti.l64P,fir_ti_vt.o64,.far,UDATA,40

Observe: -

However: -

fir_ti.l64P,fir_ti_filter.o64,.tables,UDATA,16

This is bad. Absent the sectti script we wouldn't know whether this was code, uninitialized data or const data. Hence the linker may arbitrarily place this in the wrong type of memory (eg L1PSRAM) if not explicitly placed - this is a frequent source of crashes.

QualiTI therefore emits a FAIL if sections found are not subsections of the main compiler sections (.text, .far, .const etc). Since this is an addition to Rule 13 we call this Rule13+.

How to fix this?

Rule 15: library filename & filetype

that follows a uniform naming convention

Pretty straightforward - your archive name format needs to match Rule 15 e.g. fir_ti.l64P is ok but myLib.lib is not

It also has to be an archive - not a partial link or executable.

How to fix this?


Rule 20: must declare worst-case stack requirements

This rule is ever more important to specify accurately now because Frameworks like Codec Engine have methods to specify stack size and the BIOS TSK stacks are allocated on this basis - so if you specify a value too low in your XDAIS algorithm documentation your Codec Engine application will crash.

QualiTI uses the call_graph.exe script to determine worst-case stack usage of the algorithm. It trawls the algorithm's DWARF information to find the cumulative worst-case function and reports it.

NOTE - worst-case stack calculation is dependent on a number of factors due to TI Codegen limitations - if you get a warning from running this script on your alg, please read the documentation of the call_graph.exe (docs\ofd\call_graph.htm) script to determine the cause. A common example is if you build your codec with -ml3. This causes all calls to be far calls - some deficiencies in the generated assembly from Codegen then make it impossible to differentiate far calls .v. indirect calls .v....hence the stack size number reported is wrong. The right way to fix this is not to use -ml3. Far calls were made redundant 3 years ago when linker trampolines became available. Full details on these limitations can be found here.

NOTE - Building your algorithm with -g (debug info) also causes problems in calculating the worst-case stack usage at present. The background to this can be found here. This is typically not a major problem since -g inhibits optimization thus most production libraries do not use -g.

Rules 21, 22: must characterize static data & program memory requirements

For rules 21 & 22 the static data & program memory requirements, sectti.exe is again used, this time to get the footprint. The output is folded into the final HTML report.


Rule 25: All C6x algorithms must be supplied in little-endian format

Again this can be determined statically. The information is in each of the object files.

If any file in the archive is not little-endian, this rule will fail.

Rule 26: All static/global data must be far on c6x

There should be no .bss in your algorithm if its for c6x - it is a nightmare for ROMing and also has some total-application-size limits since .bss must be < 32Kb (on c6x).

How to fix this?

--mem_model:data=far


How to run the tool?

The README.txt in packages\ti\xdais\qualiti\ shows how to run the tool. In a nutshell its a RTSC package, so if you know how to run one XDCScript product, you know how to run them all. QualiTI supplies: -

Edit startqti and modify the path to match your XDC installation directory.

Once you have setup the environment and specified the MODULE, VENDOR, INTERFACE, and tool-settings, the script will run the tests and generate an HTML report, presenting a brief summary on standard output.

Requirements

The requirements to run this tool are:

XDAIS XDC Tools TI cgtools TI CG XML tools
6.10 to 6.22.01 3.00.05 or higher Yes* 1.20 or higher
6.23 or higher 3.05 or higher No 2.10 or higher

* TI codegen tools (on Windows they are typically found in C:\CCStudio_<version>\C6000\cgtools)

Note that more info on the CG XML product is available here

Feature Additions

Download

QualiTI is distributed with the XDAIS product here. Newer versions have more features, so it's recommended to download the most recent release.

See Also

Leave a Comment

Comments

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox