You are on page 1of 44

Volume 1

Getting Started
TriMedia Compilation System 5.4
February 2010

The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice. No liability will be accepted by the publisher for any consequence of its use. Publication thereof does not convey nor imply any license under patent or industrial or intellectual property rights. NXP Semiconductors and North American NXP Corporation reserve the right to make changes, without notice, in the products, including circuits, standard cells and/or software, described or contained herein in order to improve design and/or performance. NXP Semiconductors assumes no responsibility or liability for the use of any of these products, conveys no license or title under any patent, copyright, or mask work right to these products makes no representations or warranties that these products are free from patent copyright, or mask work right infringement, unless otherwise specified. Applications that are described herein for any of these products are for illustrative purposes only. NXP Semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. Copyright © 2010 NXP B.V. All rights reserved.

Publication Date: February 2010 Reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. All other company, brand or product names are trademarks or registered trademarks of their respective companies or organizations.

Right to make changes — NXP Semiconductors reserves the right to make changes, without notice, in the products, including circuits, standard cells, and/or software, described or contained herein in order to improve design and/or performance. NXP Semiconductors assumes no responsibility or liability for the use of any of these products, conveys no licence or title under any patent, copyright, or mask work right to these products, and makes no representations or warranties that these products are free from patent, copyright, or mask work right infringement, unless otherwise specified. Life support — These products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. NXP Semiconductors customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify NXP Semiconductors for any damages resulting from such application. Quality assured — Our quality system focuses on the continuing high quality of our components and the best possible service for our customers. We have a three-sided quality strategy: we apply a system of total quality control and assurance; we operate customer-oriented dynamic improvement programs; and we promote a partnering relationship with our customers and suppliers. For more information see the General Quality Specification for Integrated Circuits, SNW-FQ-611_PART D.

Purchase of NXP I2C components conveys a license under the NXP’ I2C patent to use the components in the I2C system provided the system conforms to the specification defined by NXP. This I2C specification can be ordered using the code 9398 393 40011.

Windows “xx” – are either trademarks or registered trademarks of Microsoft Corporation. Nexperia – is a trademark of NXP B.V. All other company, brand or product names are trademarks or registered trademarks of their respective companies or organizations.

Chapter 1

Overview of the TriMedia System
1.1 TriMedia VLIW Architecture
TriMedia’s DSPCPU family delivers exceptional performance and high-level language programmability for multimedia applications through the use of its VLIW (very long instruction word) architecture. TriMedia’s VLIW architecture combines innovations in compiler and software design with advances in logic design. Overview of The TriMedia VLIW Architecture The TriMedia architecture is based on a three-level hierarchy of operators:
■ ■ ■

Instructions Operations RISC operations

One instruction may contain five operations. Each operation may execute multiple arithmetic operations.

Operation 1

Operation 2

Operation 3

Operation 4

Operation 5

Cycle n

An example of one such operation is the command ifir(a,b). This command contains a total of three arithmetic operations: two multiplications and one addition (aHI × bHI + aLO × bLO). Up to five operations including two ifir commands can be issued in each machine cycle. The ability of TriMedia’s VLIW architecture to execute multiple operations in parallel gives it a big advantage over traditional RISC and CISC architectures found in current mass-market microprocessors.

1.1.1 Functional Unit Assignment
Although the VLIW architecture allows for five operations to be executed per instruction, most operations cannot use just any of the slots because each functional unit of the TriMedia CPU is assigned to specific issue slots in a TriMedia VLIW instruction. Table 1-1: gives the functional unit assignments for pnx1500 Chip.
Table 1-1: Functional Unit Assignments Functional Unit Quantity Latency[1]/ Delay[2] 1 1 3 Recovery[3] Slot Assignment 1 1 1 1
3 3

3 3

3 3

3 3 3

3 3 3

Constant Integer ALU Load/Store

5 5 2

Volume 1 – Getting Started

Release 5.4 - February 2010


NXP Semiconductors
Table 1-1: Functional Unit Assignments Functional Unit Quantity Latency[1]/ Delay[2] 2 3 1 3 3 3 1 17 Recovery[3] Slot Assignment 1 1 1 1 1 1 1 1 16
3 3 3 3 3 3 3 3 3


3 3 3 3 3



DSP ALU DSP MUL Shifter Branch Int/Float MUL Float ALU Float Compare Float sqrt/div

2 2 2 3 2 2 1 1

3 3



[1] Clock cycles between the issuance of an operation and availability of its results [2] Clock cycles between the execution of a branch instruction and the branching taking place [3] Minimum number of clock cycles between successive operations

Because of the number of available functional units and their assignment, some operations may have to wait for one or more cycles before they are executed. This means that in some cases not all issue slots are used. Good use of issue slots is one of the purposes of software code optimization.

1.1.2 What Makes TriMedia’s VLIW Architecture Better
The instruction set architecture (the processor programming model) must be distinguished from implementation (the physical chip and its characteristics). VLIW microprocessors and superscalar implementations of traditional instruction sets share some characteristics such as multiple execution units and the ability to execute multiple operations simultaneously. The techniques used to achieve high performance are different between VLIW and superscalar architectures. In superscalar architecture, parallelism has to be discovered by hardware at runtime. Whereas in the case of VLIW, parallelism is explicit in instructions, paving way for a simpler hardware logic and therefore lower cost. Just as RISC architectures permit simpler, cheaper high-performance implementations than do ClSC architectures, VLIW architectures are simpler and cheaper than superscalar RlSC architectures because of hardware simplifications. However, they require more compiler support. The TriMedia VLIW architecture optimizes parallelism at compile time using its sophisticated compilation system. This makes the core less complicated (and feasible) and does not require specialized scheduling hardware at runtime. As a result, the TriMedia processors have much simpler control logic than other parallel designs and can run at higher clock speeds.

1.1.3 Performance
The best performance measurement is actual application measurement. Experience shows that complex DSP algorithms ported to TriMedia take between 0.5 and 1.0 times the number of instruction cycles as on other DSPs. However, while these algorithms are optimized in C for TriMedia, DSPs are traditionally optimized in assembly language. In some algorithms, very high peak performance can be achieved. This is one of the keys to the optimization of the MPEG decoding algorithm. Because as many as 4 “RISC” operations can be performed in one TM operation, and because up to five TM operations can be executed at the cycle rate of 400 MHz and above for newer TriMedia chips, peak execution rates of 2500 million operations per second are possible.

Volume 1 – Getting Started

Release 5.4 - February 2010


analyze and optimize performance. open development platform for building software. vendor-neutral. 1. Inc. Multiple Data) Simulator Figure 1-1: TriMedia Compilation Simulation and System Components TriMedia TCS releases feature the following: ■ An Integrated development Environment (IDE) based on Eclipse Platform an independent.NXP Semiconductors The mixture of programmability in C and efficient signal processing loops makes TriMedia particularly suited for the complex signal processing required by today’s multimedia applications.February 2010 5 . ANSI-compliant C/C++ compilation system Source level debugging Performance analysis and enhancement tools Cycle-close machine-level simulator TriMedia core device libraries Example programs Comprehensive online documentation Includes pSOS operating systems from Wind River Systems (formerly Integrated Systems. (ISI)) ■ ■ ■ ■ ■ ■ ■ ■ Volume 1 – Getting Started Release 5.4 .and Machine-level Debugging Performance Analysis and Enhancement Execution Code Profiling TriMedia Multimedia Libraries Independent Software Vendors (ISVs) Customer-developed Optimization Tools Reporting C-Callable Multimedia Ops Highly Optimized SIMD (Single Input.2 TriMedia Compilation and Simulation System (TCS) TriMedia processors are supported by a robust. C/C++ Development VLIW Compilation System System Tools Source. TriMedia Compilation and Simulation System (TCS) that speeds up creation of highly optimized multimedia applications entirely in the C and C++ programming languages. The TCS Tools releases provide a suite of system software tools to compile and debug multimedia applications. and simulate execution on a TriMedia processor.

Volume 1 – Getting Started Release 5. Table 1-2: Execution Tools Tool tmgmon tmrun Description GUI utility for running TriMedia applications.2.4 .1 TriMedia Tools Figure 1-2: shows TriMedia TCS tools.2. tmgmon—GUI utility for running TriMedia applications Execution Tools tmrun—Tool for downloading and running TriMedia applications tmcc—C/C++ Compiler Driver tmcfe—Compiler Front End System Tools VLIW ANSI C/C++ Compilation System tmccom—Compiler tmipa—Inter-Procedural Analysis Tool tmsched—Instruction Scheduler tmas—Assembler TriMedia TCS Tools Source-level Debugging tmld—Linker and Loader tmstrip—Strips symbol information from object files tmdbg—Source-level Debugger Profiling Tools tmprof—Profile Analysis Tool tmact — Execution Trace Analysis Tool tmmgprof—Statistics Merger Performance Analysis & Enhancement Tools tmar—Archive Librarian Tool tmdump—Dumps TriMedia object modules Reporting Tools tmnm—Prints name list of TriMedia object file or library tmsize—Prints TriMedia object file size Machine-level Simulator ttisim—functional (ISA) Simulator tmverisim . Tool for downloading and running TriMedia applications.February 2010 6 .1.NXP Semiconductors 1.1 Execution Tools Table 1-2: describes the TriMedia Execution tools.Cycle accurate Simulator Figure 1-2: TriMedia TCS Tools 1.

extract modules from a library. Table 1-6: Reporting Tools Tool tmar tmdump tmnm tmsize Description Allows the user to build a library. delete or replace the modules in a library.1.4 .2. The tool etmact is used to decompress and recreate execution trace using the ETM trace as input.2. Table 1-5: Profiling Tools Tool tmprof tmmgprof tmact etmact Description Generate estimated execution profile. The TriMedia assembler. if included in a SoC.t) for the target machine specified by the machine description file (. loading necessary modules from specified libraries Strips symbol information from object files.3 Performance Analysis and Enhancement Tools Table 1-5: describes the TriMedia Profiling Tools. The TriMedia instruction scheduler.2 System Tools Table 1-3: describes the TriMedia VLIW ANSI C/C++ Compilation System Tools. Table 1-4: Source-level Debugging Tool tmdbg Description A utility for source-level debugging and execution of programs written in ANSI C for a TriMedia VLIW processor.February 2010 7 .md) and produces the TriMedia assembly code file (. Prints the name list (symbol table) of a TriMedia format object file or library table of contents (__. Analyzes execution trace created by tmverisim. Volume 1 – Getting Started Release 5.NXP Semiconductors 1. or print modules from a library Dumps a TriMedia format object file or library in readable form.s). Prints the sizes of sections (segments) and functions in a TriMedia object file or library. Table 1-3: VLIW ANSI C/C++ Compilation System Tool tmcc tmcfe tmipa tmccom tmsched Description C/C++ Compiler Driver.SYMDEF module). tmas tmld tmstrip Table 1-4: describes the TriMedia Source-level Debugging Tool. and produces dynamic call graph and execution profile Some TriMedia cores such as TM3271. It schedules the TriMedia intermediate code input file (.1. print the contents of a library. Inter-Procedural Analysis (used by TriMedia compiler tmccom). Processes a C/C++ source file and produces input for tmccom. Table 1-6: describes the TriMedia Reporting Tools. can produce execution trace that is compressed. Merges the profiling statistics from specified files. 1. The C/C++ core compiler module of the TriMedia Compilation System. TM3282 etc have assocaited embedded trace modules (ETMs) and these ETMs. cycle accurate simulator. Links files together to produce a linked object module or executable. TriMedia linker and loader.

1. navigating between those files with a simple text editor may be fastidious and error prone.1. simulating and debugging applications. They provide graphical tools that help users to better understand their applications by displaying textual data (critical paths. The TriMedia specific features. are aimed to help users in developing high-performance applications. navigating in user written code and compiler generated intermediate files. which exploit and extend the rich Eclipse platform.4 . Moreover.February 2010 8 .3.NXP Semiconductors 1.3 Eclipse IDE for TriMedia Tools The Eclipse IDE delivered with TCS provides many features that cover the whole software development cycle: building a software component.1 Navigation and Visualization When trying to optimize a TriMedia application you may need to analyze intermediate textual files generated by the compiler. Volume 1 – Getting Started Release 5.2.4 Machine-Level Simulator Table 1-7: lists a few of the TriMedia Core Simulators Table 1-7: Simulation Tools Tool ttisim tm5250sim tm3260sim tm2270sim tm3271sim tm3282sim tm32Config1sim tm3285sim Description Functional simualtor for TriMedia cores (invokes one of the following simulators automatically) Functional Simulator for tm5250 core Functional Simulator for tm3260 core Functional Simulator for tm2270 core Functional Simulator for tm3271 core Functional Simulator for tm3282 core Functional Simulator for tm32Config1 core Functional Simulator for tm3285 core tmverisim tm5250verisim tm3260verisim tm2270verisim tm3271verisim tm3282verisim tm32Confgi1verisim tm3285verisim Cycle accurate simulator for TriMedia cores (invokes one of the following cycle accurate simulators automatically) Cycle-accurate core simulator for tm5250 core Cycle-accurate core simulator for tm3260 core Cycle-accurate core simulator for tm2270 core Cycle-accurate core simulator for tm3271 core Cycle-accurate core simulator for tm3282 core Cycle-accurate core simulator for tm32Config1 core Cycle-accurate core simulator for tm3285 core 1. These files contain very useful information which are sometimes tedious to find. cache trace files) in a structured graphical way and also ease execution of repetitive manual tasks (report generation. analyzing and tracking performance and code size. design space exploration).

3.. 1. if-conversion. However.s).4 . especially when more than two configurations are involved. In a few clicks you can launch the automatic generation. those editors and views are also linked to the report engine in order to generate a report corresponding to the visualized data in a few clicks. Finally. These plug-ins support the following features: ■ Downloading an application to TriMedia Hardware. To further enhance the user experience some editors also provide views that offer alternative representations of the data being edited.3.3 Design space exploration Performance of an application may be greatly influenced by compiler flags used to compile its source files. By right-clicking on the components of these views you can smoothly jump to the corresponding component in other files (e. And finding such an optimal configuration is greatly simplified by the possibility to generate performance comparison reports on the generated configurations.NXP Semiconductors The TCS Eclipse environment provides text editors with syntax coloring for tree (. such reports also provide a more insightful way to exchange information on the performance and code size status of the application.5 Eclipse TriMedia target control plugins TCS Releases from 5.g. Such an exploration may reveal some flag combinations that could reduce the cycle budget of even the most handoptimized applications. for all use cases. For instance.t).February 2010 9 .2 Report Generation Analyzing cycle counts or code size in textual file can be a tedious task. The TCS Eclipse IDE provides a report engine that can generate some graphical reports (html or pdf format) to ease that task. During downloading there is support for Volume 1 – Getting Started Release 5. in case of a development distributed over multiple physical locations.3. Please contact your regular TCS support to find out which situation applies to your location. All those editors also have an outline view containing a hierarchical view of the textual file being edited. regular reports can also be used to document the progress of the project by comparing the effect of the last optimization attempts with the results of previous attempts. compilation and simulation of some new configurations based on well-known sensitive optimization flags (grafting. Those outline views also offer sorting and filtering features in order to allow available data to be displayed using the most appropriate way.schedlog) files.3.: from a dtree in a tree file to the corresponding C/C++ source line. 1. Finally. 1. Depending on your location these updates may be directly available through a web server or zipped archives. cache trace analysis (.. the TCS Eclipse features also become available on a weekly basis. by simply selecting multiple cache trace analysis files in the report wizard. 1. due to the numerous optimization flags available.2 onwards include TriMedia target control Eclipse plug-ins. these reports reduce development time by providing visually attractive graphical data.cta) and scheduler log (. it can be a very tedious task to exercise all flags and all possible combinations of those flags. The TCS Eclipse IDE contains a Design Space Exploration wizard that greatly simplifies this task. Updates can be installed through the automatic update feature of Eclipse. Those reports can be generated at multiple times during the development cycle of an application: just after the first successful compilation of an application such a report can provide a quick overview of where the time is spent in the application and can thus drive the optimization process.4 Automatic Updates Beside the regular updates through Engineering Releases. from a function in a cache trace analysis file to the corresponding schedule of this function). schedule (.). cycle counts can be compared at function level thanks to an expressive bar graph chart. .

Stop. EJTAG support has been tested with PNX8550 and PNX5100. 1. Displaying stack traces and pSOS task list. suspend. ■ ■ ■ ■ ■ ■ ■ Volume 1 – Getting Started Release 5.February 2010 10 .dll as distributed with TCS 5. Therefore please make sure that $TCS/tmComm/bin is in your path before any other directory containing a probe. Clear BIS) Getting information from a TriMedia Target (DP Dump. profiles and date. The Eclipse debugger supports the following features: ■ ■ ■ ■ Loading or attaching a program. step. Viewing registers including MMIO registers. next. Displaying the local variables for the selected stack frame. Displaying the source file location of the selected stack frame.2 onwards. Specifying EJTAG targets as well as enabling and disabling of channels can be done by clicking the Configure button on that Target control view or by navigating to Window->Preferences and then selecting TriMedia Compilation System -> Target Control tab. objects. Run. semaphores. Manipulating breakpoints (software. and TM32_CLIMIT. Viewing memory. this is not advised.4 . regions. Dumping the Debug Print (DP) buffer.dll as well. Although it should be possible to use a different probe.NXP Semiconductors ■ ■ ■ ■ BIS creation. Please ensure that you are using the correct firmware. For example. finish. including the possibility to display single values as quadruples. It is currently not possible for the user to supply other values.dll. Also note that when controlling the TriMedia and downloading over EJTAG there are currently no sanity checks done. When using EJTAG the Target Control Plug-ins will automatically determine values for TM32_DRAM_LO. Redirecting application standard I/O. Displaying pSOS information such as queues.1 is the first release featuring the TriMedia debugger as an Eclipse plug-in. when downloading an application there is no check on whether the image will actually fit in memory or whether the application has been compiled for the correct TriMedia architecture. continue. Download for debugging (enabling attaching through debugger). hardware. Due to limitations of the WindRiver PowerICE drivers it is not possibly to have more than one active EJTAG target at a time.6 Eclipse Debugger TCS 5.3. Both can be collapsed for limiting target communication bandwidth. The TriMedia target control plug-ins also contain preliminary support for EJTAG. EJTAG support has been tested with the probe. BIS dump) All the above features are supported over PCI channel. and pSOS breakpoints). Reset. Note that the WindRiver PowerICE probe needs different firmware for PNX5100 than for PNX8550. TM32_DRAM_HI. Controlling a TriMedia target (Run.

the table below shows the TriMedia cores together with the targets and hosts to be used with tmcc command: Table 1-9: Compilation for the pnx85500 Emulator Core Instantiation avdsp nm_dsp1 nm_dsp2 Target option to tmcc command -target pnx85500_av_dsp_Emulator -target pnx85500_nm_dsp1_Emulator -target pnx85500_nm_dsp2_Emulator -target pnx85500_tm3285_memc1_Emulator (default) -host option of tmcc command -host WinNT -host WinNT -host WinNT -host WinNT (since PCI block is available in emulation) tmconfig tm3282 tm3282 tm3285 Volume 1 – Getting Started Release 5. starting with 3.81. CDT.) * The make utility * The echo command On Windows the make and echo executables are provided by Cygwin (www.February 2010 11 . Note that the version of make should NOT be higher than 3. The Cygwin version used is 1. the table below shows the TriMedia cores together with the targets and hosts to be used with tmcc command: Table 1-8: Compilation for the actual SoC Core Instantiation avdsp nm_dsp1 nm_dsp2 Target option to tmcc command -target pnx85500_av_dsp -target pnx85500_nm_dsp1 -target pnx85500_nm_dsp2 -target pnx85500_tm3285_memc1 (default) -host option of tmcc command -host WinNT -host WinNT -host WinNT -host nohost tmconfig tm3282 tm3282 tm3285 When compiling for the pnx85500 Emulator. tmcc.3. 1. To properly build C/C++ projects CDT requires the following executables to be in your search path: * The target compiler (gcc. When compiling for the pnx85500 SOC.18 1..NXP Semiconductors 1.4 PNX85500 Support TCS 5.cygwin. the tables below show the various options to be used with the compiler/ linker driver tmcc.4 .80 (more recent Release provides support for the PNX85500 SoC and associated VPE. relies on external tools in order to provide some functionality.7 Eclipse setup The C/C++ development environment..1 Compilation When compiling for the actual SoC. have dropped support for the (non-POSIX) Windows path notation)..5.4.

c ■ To compile an application for the second NM-DSP processor (the tm3282 without coprocessor).NXP Semiconductors When compiling for ttisim / pnx85500 VPE.c' ■ To compile an application for the AV-DSP processor (the tmConfig).February 2010 12 . use the target "pnx85500_av_dsp": > tmcc -target pnx85500_av_dsp file. Below an overview of these options and their effect: Table 1-11: Functional simulation of tmconfig and tm3282 Core Simulator tm32Config1sim tm32Config1sim tm3282sim tm3282sim tm3282sim tm3285sim Options <none> -avdsp <none> -target pnx85500_nm_dsp1 -target pnx85500_nm_dsp2 -target pnx85500_tm3285_memc1 What is simulated tmconfig (8 interrupts) in msvd2 tmconfig (16 interrupts) in msvd2 in pnx85500 tm3282 in pnx1005 nm_dsp1 in pnx85500 nm_dsp2 in pnx85500 tm3285 core + memc1 coprocessor in PNX85500M1 SoC tmconfig tmconfig tm3282 tm3282 tm3282 tm3285 Volume 1 – Getting Started Release 5. and tm3285 cores is done usin appropriate simulators. Users must specify '-host ttisim' for simulation with ttisim / VPE. just as you would use 'tmcc -target pnx8550_av_dsp -host ttisim hello. the minimal target 'tm32Config1Minimal' can not be used since the tmconfig core in the minimal target has 8 interrupts. use the target "pnx85500_nm_dsp1": > tmcc -target pnx85500_nm_dsp1 file.4 . If coprocessor latency / recovery is of importance in compiling for nm_dsp1. the table below shows the Trimedia cores together with the targets and hosts to be used with tmcc command: Table 1-10: Compilation for ttisim / pnx85500 VPE Core Instantiation avdsp nm_dsp1 nm_dsp2 Target option to tmcc command -target pnx85500_av_dsp -target tm3282Minimal -target tm3282Minimal -target tm3285Minimal -host option of tmcc command -host ttisim (default) -host ttisim (default) -host ttisim (default) -host ttisim tmconfig[1] tm3282[2] tm3282 tm3285 [1]For the tmconfig core present in pnx85500.c '. The user can select the specific variant of TriMedia core via simulator options.c 1. tm3282.4.c ■ To compile an application for the first NM-DSP processor (the tm3282 with NM coprocessor). Note however that coprocessor latency / recovery times for the minimal target differ 1 cycle from the coprocessor latency / recovery times of the nm_dsp1.2 Simulation Functional simulation of tmconfig. the tm3282Minimal target suffices. [2]Since coprocessors are not yet included in the pnx85500 VPE. where the pnx85500 instance of the tmconfig core has 16 interrupts. Compilation of coprocessor load / stores are supported in the minimal target. use the target "pnx85500_nm_dsp2": > tmcc -target pnx85500_nm_dsp2 file. you can use 'tmcc -target pnx85500_nm_dsp1 -host ttisim hello.

WindRiver WinICE EJTAG drivers and MDS PCI or USB jtag drivers are not provided by respective vendors on Linux. 1. app mem size.2. If you want to use the TriMedia debugger or Eclipse as distributed with TCS with a Java/JRE install other than the one distributed with TCS. If you do need support for other Linux versions or for other SoCs. 1.February 2010 13 . If your Linux distribution is based on Linux kernel version 2. limit. The TCS 5. Applications compiled with .2.1. The available features on Linux are TCS compilation and simulation tools and the debugger. cacheable limit. You will need to take care that the MS C runtime dlls and Manifest file are in the java/bin directory of the java version used by your Eclipse installation. If an application loads such dlls then the MS C runtime dlls and their Manifest file are required to be present in the application's directory. or you may experience other unexpected behavior.dll from a TCS release with Dvpmon and copy it to the Dvpmon application directory you will also need to copy the MS C runtime dlls and Manifest file to Dvpmon application directory. it is required to fill in correct values for sdram base.TCS releases are compiled with .NXP Semiconductors 1. The same holds for dlls that use the MS C runtime dlls. 1.9-67. When selecting the EJTAG channel in tmdbg's download box.1 .1 Linux The supported Linux platform is 32-bit RedHat Enterprise Linux 4.3 is available on both Linux and Windows. For example if you want to use probe.0 and 5.5. JTAG channels are not supported on Linux platform.0.5. since tmcal EJTAG driver and tmdbg cannot automatically determine these values Users compiling their application for the Windows platform and linking against TriMedia custom ops emulation libraries need to use MSVC 8.5.Net 2005) with Service Pack 1 (SP1) installed. EJTAG. If you use any other version of MSVC you may get error messages at link time about unresolved symbols. Hence. Volume 1 – Getting Started Release 5. There is no support for other versions of Linux or for other TriMedia SoCs.4 .0 (.Net 2005 on Windows.5 Platform support TCS 5. kernel version 2. if you want to use TCS applications and/or dlls outside the regular TCS install.0 on x86 architecture.Net2005 using Microsoft(R) C runtime dlls require these dlls and their Manifest file to be present in the application's directory.6 you may try to build the Linux drivers yourself using the makefiles provided under $TCS/tmComm/src/drivers/tmman32/x86_linux/PNX*. and mmio base.2 Windows The supported Windows platforms are Windows 2000 and Windows XP. As a result. In the Makefile for your particular SoC you will need to set the TCS variable to point to your TCS install and then issue a "make clean all" command. The drivers have been built and tested on RHEL4. please contact your account manager or business line representative.Net 2005 As of TCS 5. you need to ensure that the MS C runtime dlls and Manifest file are copied to your java/bin directory. All the other values should not be left at 0 and users must supply the correct values.ELsmp.2 release also includes Linux drivers for PNX1500 and PNX1700 SoCs for RHEL 4 platform. The same holds if you want to use an Eclipse install other than the one provided with TCS in combination with the TCS plug-ins.6. you will also need to copy the MS C runtime dlls and Manifest file. If the sdram base is left at 0 tmdbg will assume an sdram base equal to the sdram base of the SoC you are downloading to.

dll was not found.February 2010 14 . You may get one of the following error messages depending on the version of Windows on which you try to run the application: • • The application failed to initialize properly (0xc0000135). b.4 .CRT. • • • • The MS C runtime dlls and Manifest files that need to be copied are the following: a. Reinstalling application may fix this problem. This application has failed to start because MSVCR80. This application has failed to start because the application configuration is incorrect. The system cannot execute the specified program.dll They can be found in the $TCS/bin and $TCS/tmComm/bin directories. Microsoft.manifest msvcp80.dll was not found.NXP Semiconductors If the MS C runtime dlls and Manifest file are not copied correctly the application may fail to initialize properly and abort or crash. Re-installing the application may fix this problem.dll msvcr80. Note that when you do not use/copy any of the TCS applications or dlls outside your TCS install and do not use Java/JRE or Eclipse versions other than the ones provided in the TCS install you should not have to take any action. R6034 An application has made an attempt to load the C runtime library incorrectly.VC80. Volume 1 – Getting Started Release 5. Re-installing the application may fix this problem. This application has failed to start because MSVCP80. c.

The early chapters of the TriMedia cookbook provide more information on building and running your programs. allowing you to execute TriMedia code on the actual hardware. For example. device libraries for the tm32 and tm3260 cores.exe and can be found in the WINDOWS directory under the root of the Windows dics. where you build on one machine but run on the other.1. The Windows disc contains a version of the TriMedia TCS tools for Windows (Windows XP).2 Installing TriMedia TCS tools The PC can function both as a build host and as an execution host. The TriMedia compiler runs on build hosts such as Windows XP.2 Supported PC Execution Hosts This release supports the following execution host: ■ ■ Windows XP Linux (RHEL 5) for PNX1500 and PNX1700 only 2.1. You can also install TriMedia hardware on a PC with or without the complete TCS. The installation program for Windows is called setup. Installing TriMedia TCS Software on a PC The TriMedia TCS tools can be installed on a PC to create a complete development and test environment. RHEL5) 2.Chapter 2 Installing TriMedia TCS Tools 2. Portions of the TCS are required to use the reference board. target-host communication libraries and TriMedia SoC simulation architecture (Ttisim). Although an execution host can also be used as a build host. 2. it is possible to install TCS on a machine that does not include TriMedia hardware. The TriMedia reference board (NREF) plugs into an execution host.4 . In the same way.1 Introduction This chapter provides detailed information for installing TriMedia TCS tools which includes the TriMedia Compilation System. it is a common practice to use different hosts for building and running. you might use two machines connected by a network.February 2010 15 . Volume 1 – Getting Started Release 5. This keeps the build environment active if your program crashes the execution host.1 Supported PC Build Hosts The following is the supported operating system for PC build host: ■ ■ Windows XP Linux (RedHat enterprise Linux version 5.

To install the complete TCS. This program automates much of the installation process. but not recommended. Once you agree to the license agreements. 2.exe in the WINDOWS directory under the root directory of the Windows disc.1.February 2010 16 .4 .2. You must agree to the License Agreement before installation will proceed. The compact Windows installation requires about 250 MB of disk space.1 Windows Installation Warning: For an execution host.NXP Semiconductors 2.1 Using the Setup Program TriMedia TCS CD includes setup.1. 2.2. A full installation including examples requires 300 MB of disk space. It is possible. perform the procedures described in the following sections. which allows host compilation and execution. The typical Windows installation installs the entire Windows TCS tools. it is important that no previous version of the TriMedia TCS is installed on your PC.1.1 Entering Personal Information First few screens will show you the licensing information and terms and conditions of installing the TCS tools software. run that program and follow its directions as outlined below. Users can also choose custom install to select only those components that they would like to install. Fill in your name and your company’s name: Volume 1 – Getting Started Release 5. not including documentation.2. to keep two versions of the build environment on one PC: To install the TriMedia TCS on your Windows computer. the next screen will ask for some information about you and your company.

1.February 2010 17 .2 Choosing the Location of the Installation Folder Choose the location of the installation.4 . If the directory does not already exist. By default. the installation wizard will prompt you if you would want a new folder to be created to use as the installation folder. Volume 1 – Getting Started Release 5. The Choose Folder window will appear.2. 3.NXP Semiconductors 2. the installation wizard installs the TriMedia TCS at C:\TriMedia directory. 2. Click the Browse button if you want to specify an installation directory different from the default chosen by the installation wizard. 1. Choose the directory in which you would like to install the TriMedia TCS from the Directories panel.

February 2010 18 . 6.NXP Semiconductors 4. Click Next. Type the name of the installation folder in the Path field. Volume 1 – Getting Started Release 5.4 . Click OK. The Setup window appears. 5.

February 2010 19 . Click Next. Volume 1 – Getting Started Release 5. Click Next. which will enable the use of powerful Eclipse based Integrated Development Environment for TriMedia Tools. tmdbg.exe. The default name for program folder is TriMedia TCS. The wizard asks you to choose either TCS tools only installation or TCS tools plus Eclipse installation. It is recommended that you choose to install TCS tools + Eclipse.NXP Semiconductors 7.exe and a readme file will be stored. 8. The wizard asks you for the name of the program folder where tmgmon.4 .

Consequently.3 A Note on Installation Requirements For the TriMedia Debugger The TriMedia debugger tmdbg uses sockets for interprocess communication when used with a simulator target. Click Next. The wizard copies the necessary files into the installation and program folders. Note: Use the WordPad program (Start\Programs\Accessories) to view the Windows XP readme files. you elect to install the TMMan driver.2. If during installation. the wizard creates the TriMedia.2. sets up environment variables and asks you to review the readme file. When prompted for the path of the driver. On a Windows XP system. the system should detect new TriMedia based hardware.1.1 Finishing the Installation Click Finish to exit the installation wizard. In addition. the installation will remove any existing TMMan driver and reboot the system after the installation process completes. Volume 1 – Getting Started Release 5. After rebooting. 2. the host operating system must support sockets.4 . please select the folder corresponding to the appropriate Windows version on the installation CD at tmcomm\lib\kernelmode\win2k\pnxXXXX. you must install an Ethernet card and TCP/IP networking (even if the host machine is not attached to a network) and make sure the machine has an assigned IP address.February 2010 20 . 2.1.2.NXP Semiconductors 9.bat file.

2. 2.4 Installation of Updates If you have been using TriMedia with earlier releases. the drivers from a new release are sometimes not compatible with earlier releases. the drivers that are currently installed must be removed and the new drivers must be installed. Eclipse is accessible through a shortcut in the Start menu: Programs > TriMedia TCS X. Volume 1 – Getting Started Release 5.Y > TriMedia Eclipse IDE. your installation will require an extra step to remove the old drivers. 2.3. tmdbg will report a gethostbyname failure if it cannot find an IP address for the host machine. Windows XP became the preferred operating system. 2.1. If TCP/IP is not installed. This information will be clearly stated in the release Because new features are added. a welcome screen is displayed: By clicking on the What's New icon you can access the list of new features grouped by components. you must reboot to install new drivers. Once it is installed. On Linux. You can then click on the "C/C++ Development" icon to get news about the C/C++ support in Eclipse or on the "TriMedia Compilation System" icon to get an overview of the newly introduced features. For existing Windows XP installations. select: Control Panels>>Network>>TCP/IP>> Properties>>IP Address and make sure the machine has an assigned IP address (not “Obtain an IP address automatically”). click Add and follow directions to install TCP/IP.4 .February 2010 21 .1 Welcome Screen When launching Eclipse for the first time. you can launch <TCS_ROOT>/eclipse/ tcs_eclipse_launcher.3 Eclipse On Windows. Since the drivers for a Windows system are closely tied to the kernel of the OS.NXP Semiconductors Select: Control Panels>>Network.

to get familiar with the Eclipse IDE C/C++ Development Environment User Guide.2 On-line Help The Eclipse help system is available through the global menu Help > Help Contents: The help system contains documentation for all installed plug-ins.NXP Semiconductors 2.4 .February 2010 22 . ■ Volume 1 – Getting Started Release 5. TCS Development User Guide contains tutorials covering available features. to get started with the C/C++ environment in which the TCS tool-chain is integrated. The most relevant entries are: ■ ■ Workbench User Guide.3.

Refer to Chapter 5.February 2010 23 . Select files. do the following: 1. 2. for more information. The supplied readme file provides the necessary information for running these programs. To run the files program. Click the Filename button.1 Introduction The installed version of the TriMedia TCS includes a set of demonstration programs that you can run on the 32-bit variants of the TriMedia chip.out from the folder where it was compiled.2 Running the Files Program The files program is also useful for verifying TriMedia board installation. In addition. Errors will be consistently generated (error messages are displayed in the tmrun window) if there is a hardware compatibility problem. The files program should run for many hours without errors. Double-click on the tmgmon. 4. you can learn how to write TriMedia programs.exe is included in the path. You can build the executable by issuing the following command: make TARGET=pnx1500 TCS=<path> You are encouraged to try the other demonstration programs on the CD. It uses the fread and fwrite calls to transfer data back and forth across the PCI bus. This chapter describes how to run the following demonstration program: ■ files The sources of example program files are at installation_folder_for tcs/examples/misc/files. The TriMedia Monitor window appears. The tmrun window appears. Warning: Make sure that the directory which contains tmgmon and tmrun.Chapter 3 Running Demonstration Programs 3. Volume 1 – Getting Started Release 5. The demonstration programs are designed to give you a flavor of the capabilities of the TriMedia processor. 3. by studying how these programs work. 3. Click Go. Troubleshooting. Press Control-C to quit and go back to tmgmon.4 . 5.exe icon.

4 .February 2010 24 .NXP Semiconductors Volume 1 – Getting Started Release 5.

printf("\nIt's getting started !!!!!!!\n"). finalResult = factorial(INPUT). process.h> <stdio.h> <tmlib/tmtypes.h> <math. result *= help. printf(".4 .2 Sample Program: getIt. a TriMedia sample program. result=1.c. i>0. and debug getIt. } return result. tmgmon/tmrun. } void main( void ){ Float finalResult. using tmcc.. and tmdbg respectively.February 2010 25 . help.c program calculates and prints the factorial of the value of INPUT. for( i=input. INPUT).Chapter 4 Using TriMedia TCS Tools 4. finalResult). i–– ){ help = (Float)i.. printf("\nThe result is %le.c program: #include #include #include #include <stdlib.\n\n". ttisim. simulate. step by step. how to compile.h> #define INPUT 30 static Float factorial( Int input ){ Int i. Volume 1 – Getting Started Release 5.1 Introduction This chapter shows. exit(0).c The step-by-step examples covered in the remaining sections of this chapter are based on the getIt. Float result. } The getIt. 4.calculating the factorial of %d\n".

generates accurate cycle data that can be used to optimize each behavior. the Core Compiler (tmccom).c program to run on TriMedia Processor pnx1500 hosted on a Windows XP platform. To compile for a particular target. the target will be compiled to run on ttisim. listed in Sample Program: getIt. enter the following command line at the DOS prompt: tmcc -target pnx1500 -host WinNT -o getIt.4 . to build target programs for pnx8550 based on tm3260 core. specify the option "-target target" where target is one of the supported types specified in tmconfig file. the target option is: tmcc -target pnx1500 Use either of the following two examples to compile the getIt. make sure that you have placed $TCS/bin and $TMCOMM/bin in your path. the Scheduler (tmsched).out. refer to Book 4. The actual location of $TMCOMM can be confirmed by examining the variable TCOMMROOT defined in $TCS/tmconfig file. If you don’t use this option. ■ To compile the getIt. tmcpp. The default target is PNX1500 which uses tm3260 core.The core type for the target is picked from the tmconfig file (tmcc supports a -core option. Each of tmcc. unlike the first. run your programs on a TriMedia processor.3 Compiling TriMedia Applications Use tmcc. profile-driven compilation. the compiler driver.c on page 25: ■ To compile the getIt. the target option is: tmcc -target pnx8550 To build target programs for pnx1500 based on tm3260 core. refer to: Book 3. enter the following command line at the DOS prompt: tmcc -o getIt. and the Linker (tmld). The default output is a. where $TMCOMM is typically $TCS/tmComm.out getIt. 4.4 Simulating TriMedia Applications Simulating TriMedia applications is ideal for working with inner loops. for more detailed information about the different techniques for generating optimized code (such as using restricted pointers. loop optimization. ttisim. and decision-tree grafting).February 2010 26 . but its use is unnecessary when the target option is specified). Cookbook. you must use the -host option to specify the system that hosts the TriMedia processor. The simulator.c The -o option allows you to specify the output file getIt. and tmCC invoke the C/C++ Front End (tmcfe).out. loop unrolling. when speed is a concern or when you are using peripheral I/O.c In the second example. Using the C Compiler. Compilation Tools. custom operators. Volume 1 – Getting Started Release 5. ttisim. especially Chapter 2. to compile TriMedia C-language applications. Note: Before proceeding with this section. For more detailed information about compiling TriMedia applications. Also.NXP Semiconductors 4. the Assembler (tmas).c program to run on the simulator. However. For example.out getIt.c program.

Enter the following command line at the DOS prompt: tmgmon The tmgmon window appears.out program that you generated (in Compiling TriMedia Applications on page 26) on the TriMedia processor..5 Running TriMedia Applications on the TriMedia Processor To run the getIt. Start the TriMedia Debugger: tmdbg 4. 3. 3. You can also use tmgmon to run programs on the TriMedia processor. Make sure that the directory $TMCOMM/bin is in path on Windows platform or in LD_LIBRARY_PATH on Linux platforms. To use tmgmon.out tmrun downloads the program and runs it on the TriMedia processor. especially Chapter 3. do the following (under command shell in Windows): 1.calculating the factorial of 30.6 Debugging TriMedia Applications To debug getIt.NXP Semiconductors To simulate the getIt. If you want ttisim to generate performance reports.. Using a Standalone Simulator.out program. you can use certain options when compiling the getIt. Compile getIt. For more information about the simulators see Book 6.c.. enter the following command line at the DOS prompt: tmrun getIt. Click Go.652529e+32. enter the following command line at the DOS prompt: ttisim getIt.c The -g option generates the symbolic debugging information and links the program with the debug monitor library and the -O0 option disables global optimization. Use the Browse button to locate the getIt. The result is 2.February 2010 27 . 4.c program. See the debugger documentation for details on how to debug. tmcc -g -O0 -o getIt. 2.c using the -g and -O0 options.out getIt. 4. TTIsim User Manual.out file.out ttisim generates the following output: It's getting started !!!!!!! .4 . 2. Volume 1 – Getting Started Release 5.. do the following: 1.

4 . refer to the debugger documentation.February 2010 28 . For more information. Volume 1 – Getting Started Release 5.NXP Semiconductors The debugger can also be loaded in command-line mode by entering tmdbg -cli.

If you are using profiling (-p) and grafting (-G) in your compilation process. There are two main considerations. 5. Second. These options are generally advantageous. if the variable in question is a pointer to volatile storage. In order to make this work you should ensure proper alignment of the char* array by dynamically allocating it (word aligned by default) or if it is a static or external array using the -Xalign option or the TCS_align pragma to force word alignment. you can use the nocompact option. not the storage to which it points.2 tmcc/tmccom—The C/C++ Compiler The most common problem anticipated is improper use of the volatile keyword. using the new tools or demos. First. Volume 1 – Getting Started Release 5. please note that the options and the source given on the profiling compilation must match the options and the source given on the grafting run (with the exception of the -p or -G options). in some cases. If you use -nocompact. programs. the data should be 4-byte aligned.Chapter 5 Troubleshooting This chapter helps you in troubleshooting the problems that you may encounter while using the TriMedia TCS. we recommend that you manually turn bremoveunusedcode back on by passing tmcc (or tmCC) the option string -tmld bremoveunusedcode --. Because this is a new compiler. you must re-evaluate your code. The Trimedia hardware accesses types only on their natural alignment. It also contains answers to commonly asked questions. If the options are different or the source is different. or threads).2 compiler. tmcc now turns on the -bremoveunusedcode and -bcompact linker options by default.4 .1 Important Points to Remember This section presents some points you must consider before: ■ ■ setting up your hardware environment. A common mistake is to mark the pointer as volatile. To support another version of TriMedia board. That means if an integer load is used.1 Device Libraries and Board Support Packages The tmconfig file allows one to specify a Board Support Package for a given target SoC such as PNX1500 etc. however. the compiler will not correctly graft the code and a compiler error could be issued. If you were relying on specific timings or dtrees. please modify the BOARD_LIST line of the tmconfig file and add the relevant board support package. 5. The information presented here is arranged by component. it does not generate exactly the same dtrees as the 2.1. -bcompact can cause a performance degradation because of a cache hit. To turn off both of these options with tmcc.February 2010 29 . the volatile keyword should be used in any case where the value will be updated by other sources (processes.1. This can cause trouble in cases where a char* array is cast to an int* pointer and then dereferenced. ensure that you have defined it as such. 5.

February 2010 30 . If you choose to use this function. 5. The debugger cannot debug header files. Volume 1 – Getting Started Release 5. by default. If you wish to generate a . If any executable code is contained in a header file the debugger cannot break on those lines. This can lead to problems in several areas of which you should be aware. where main was part of pSOS which was compiled as a C module. the compiler has added support for 64-bit emulated long double floating point. there were major changes between the tmprof in the v2. However. Such code includes targets compiled with any of the following linker options: -bcompact.o). you should compile with the options: -t -tmccom -generate_data_units --. It is important that tmprof users carefully read the chapter Performance Analysis Overview in Book 4.NXP Semiconductors A linker optimization called -bfoldcode can create a significant reduction in module size by removing redundant trees. in case of pSOS applications. If a source file is modified after the target has been built. the debugger does not warn you that the source file is out of date.5 tmdbg —The Debugger The debugger cannot debug linker-optimized code.0 release and previous releases.6 tmprof—The Profiler The tmprof in TCS is completely upward compatible from the tmprof in TCS 2. In TCS 4. or -bremoveunusedcode. 5. 5.3 PSOS+ and C++ In TCS 2. Therefore. Cook Book. applications had to explicitly call _main after root. You should not use this option if you have code that depends on functions with different names having different addresses. C++ static constructors were called by _main function which was called by main in the generated code if the file containing main was compiled as a C++ program.1.1 release.2.1.4 . The debugger cannot be used with the -ptm profiling option. Profile-guided compilation (the -p option) is possible with debugging.1. With the v2. you can turn it on by passing the following string to tmcc (or tmCC) when you link: -tmld -bfoldcode -. Also. The -ptm option cannot be used with programs compiled with -g. _main is just a stub as C++ initialization had already happened in boot code. The tmcc driver passes the -generate_data_units flag to the compiler except when the -t compiler option is used. Although tmcc does specify -bcompact and -bremoveunusedcode.1. If you plan to develop new code using this functionality or if you are porting code from an architecture that currently uses 64-bit doubles.t file with -generate_data_units.x. please read the compiler section of Chapter 5. Link errors would result. The debugger does not use source file/target time stamps.2. 5. -bfoldcode. This function uses synchronous DMA calls that depend on the scheduler being active and cannot be called from interrupt handlers. they are not specified if the -g option is specified.4 Interrupt Service Routines The PCI device library provides a function (pciMemoryCopy) which can be used to copy memory between SDRAM and HOST(PC) even with the PCI Memory window disabled. the option cannot be used with the pSOS debug monitor (psosmon.

dll can be running for a given TriMedia processor at any time. In a few special cases. it might be necessary to remove the TriMedia device and the existing device drivers.dll. or TMMon.1. Further. The error message “TMRun: ERROR: Cannot Initialize C Run Time Server: CRT I/O calls will not work” appears in the TMRun Window. Differences in the implementation of system calls in the underlying operating systems and differences in the underlying hardware (e..NXP Semiconductors 5. Volume 1 – Getting Started Release 5. block size) can cause small differences in the reported simulated cycles on different execution host platforms. If the previous version of the driver is installed. the behavior of floating point operations involving NaNs and denormals under ttisim may differ from the behavior on TriMedia hardware or under ttisim on a different host platform. Only one instance of TMCRT. Cause No device driver has been installed for the TriMedia device or an old and incompatible version of the driver is currently installed.2 Troubleshooting Common Problems Under Windows This section can help you troubleshoot common problems that you might encounter when using the TriMedia TCS under Windows.4 . If another instance is already running.g. TMRun generates the error message on the left. TMRun uses the C Run Time server TMCRT. 5.February 2010 31 .inf file. ttisim uses the underlying operating system to implement system calls.exe that might be running for the given TriMedia processor.7 ttisim—The functional Simulator ttisim cycle counts do not account for cache related cycles since ttisim does not simulate the cache sub-system. Table 5-1: Causes and Solutions for Common TriMedia TCS Problems Problem The error message “Cannot connect to Kernel Mode Driver” occurs when running TMGMon. Solution Install the latest device driver through the appropriate . TMRun. ttisim uses the floating point of the host machine to simulate TriMedia floating point operations. Close all other instances of TMRun.

(7)Click OK. Click on (Folder Options / Options).INF file for the TriMedia device. point to Programs. Click on Tool. When the user reboots the system. Click on View Tab.exe runs under Windows XP.INF files from the system. Click OK button. Windows XP? (1) Click Start. point to Programs. Click on Files or Folders.exe. How can I manually remove existing Removing the driver pnxXXXX. TriMedia device and device driver under (1)Right click My Computer.3 Frequently Asked Questions Table 5-2: lists frequently asked questions and their answers. and then click Windows Explorer. Find dialog box pops up. (3)Click the Device Manager tab. How can I manually remove existing Removing the hardware device instance from the system. (3) Look for pnxXXXX. Click on this file to highlight it. In Explorer. Video and Game Controllers). Click on Find. go to c:\WINNT\INF directory In Explorer.sys where XXXX is 1700 or 1500 or 1005. tmmanins.February 2010 32 . (4)Double-click a device type (Other Devices/Sound. Tmmanins. Files containing the string will be displayed. and then click Windows Explorer. Right Click and then Click Delete. Click on View.sys from the system Windows TriMedia device and device driver under XP). Click on Hidden Files. (6)Click Remove. Click on each file to highlight it. Right Click and then Click Delete. Click Start. Removing all the INF files containing the string "tmman" from the system Windows XP. after running tmmanins. Click on Find Now.exe is a dialog-based Windows application that removes the TriMedia device.exe utility can be used to achieve this.NXP Semiconductors 5. go to C:\Windows\ System32\Drivers directory. TriMedia device drivers and the relevant . Note: after these steps when the system is rebooted Windows Plug and Play will re-detect the device and ask for the INF file and the device driver again. Click on Show All Files. Windows prompts the user for . In the Containing Text edit box type "tmman" (without the quotes). Table 5-2: Frequently Asked Questions Question How can I automatically remove the existing TriMedia device and device drivers under Windows XP? Answer The tmmanins. Windows XP? Continued (2)Click Properties. Volume 1 – Getting Started Release 5. (5)Click the TriMedia Device (PCI Multimedia Device/TriMedia NREF Board). A Confirm Device Removal dialog box appears.4 . (2) In Explorer. In Explorer.

tmman32.NXP Semiconductors Table 5-2: Frequently Asked Questions (Continued) Question How can I determine if the device drivers are installed for the TriMedia device under Windows XP? Answer Follow the steps below to determine if proper device drivers are installed in the system that has the TriMedia device installed.inf *. Goto step 6. (1)Right Click My Computer. (3)Click on Properties. click Device Manager tab. (2)In Explorer RIGHT click on any TriMedia Device Driver file i. (2)Double-click a Other Devices. tmrun.exe TMGMon.exe TMMan32.exe TMRun.exe. How to find the version information for TriMedia Device Driver Files? (1)Click Start. point to Programs. (4)Click on the Version tab (5)File Version field indicates the version of the executable. (6)Click on OK.sys.dll.dll TMCRT.dll AuthHost. and then click Windows Explorer. If this category is not present then go to step 4. tmmon.4 . then device drivers are installed in the system. (4)Double-click on Sound / Video and Game Controllers.dll *.exe. What files are required to setup the hosted execution environment under Windows XP? The following common files are required to setup an environment to run TriMedia executables on a TriMedia board. to see the devices in that category.February 2010 33 . click Properties.sys Volume 1 – Getting Started Release 5. (5)If the TriMedia Board entry is present.dll etc.e tmman. to see the devices in that category.exe TMMPRun. TMMon. Properties dialog box pops up. tmcrt. (3)If the PCI Multimedia Device entry is present then there are NO drivers installed for that device.

February 2010 34 .NXP Semiconductors Volume 1 – Getting Started Release 5.4 .

the default will be 32bit precision for all floating point calculations (-fp32).e. to build target programs for tm3282 core based systems to run on a tm3282 minimal system. the target option is: tmcc -target tm3282Minimal 6.February 2010 35 . no initial special porting is necessary.1. the floating point code must be written with care.1 tmcc/tmccom — C/C++ Compiler 6. TCS still represents C type float using IEEE single precision format (32 bits). double and long double operations are more accurate. The elegance of the -fp64 option is the transparency for the user. This chapter can also be used as a short overview of the differences between the version 2 and version 4 products. such as: extern float _f_cos(float d). users should note Volume 1 – Getting Started Release 5. Since the tm32 architecture does not provide 64 bit floating point instructions.2 and later include a new tmcc option -fp64. The standard C library normally defines only double versions of the standard <math. In contrast to the scheme used in v2..4 . double precision floating point operations are supported via a software emulation library. For users who do not require the additional precision. double and long double using IEEE single precision format (32 bits). With -fp64. For example. 6. the TCS distribution includes two separate versions of the standard C library and tmcc links with the appropriate version based on the presence of the -fp64 option. Mixing object files compiled with and without the -fp64 option yields undefined results. and the C/ C++ compiler generated TriMedia hardware floating point operations for all floating point arithmetic. The default target is tm1 which uses tm32 core. C type float) arithmetic on hardware to aid in performance. If an application developer compiling with -fp64 wishes to do some single precision (i. but its use is unnecessary when the target option is specified). In addition to using the floating point specific functions mentioned above. If the -fp64 option is not specified. such as: extern double cos(double d).1. but considerably slower than the corresponding float operations.Chapter 6 Migration This chapter is primarily intended to aid users migrating from TCS 2.2 64 bit Floating Point Emulation TCS releases v2.2 to TCS 4. TCS represented C types float. Thus. specify the option "-target target" where target is one of the supported types specified in tmconfig file. the -fp64 version of the standard C library also defines corresponding single precision routines.1 of the TCS.x.h> mathematics library functions. Previously. code written using double can be compiled out-of-the-box with either 32 bit precision or 64 bit precision based on the need for speed or precision. but it represents C types double and long double using IEEE double precision format (64 bits). NOTE: Because the sizes of double and long double types are different with the -fp64 option.The core type for the target is picked from the tmconfig file (tmcc supports a -core option.1 Compiling for different targets To compile for a particular target.

If n is omitted.3 64 bit Integers Releases v4. With the v4.4 . not float. modulus and shifts are emulated by function calls. For tm32. 1. For instance: extern int __unaligned *packed_struct_field. 6. If possible. generating appropriate loads and stores when dereferencing the pointer. which basically focus on pointers only pointing at objects of the same type as the object they are declared to point to. This marks the contents of the pointer as unaligned integer data.5 Stricter Aliasing When a program uses pointers. operations are mapped into native instructions.0F compiler. The fields in the struct that have a smaller alignment than their natural alignment are marked as unaligned and special unaligned load and stores are generated (unaligned loads and stores are not supported by the tm32 architecture and thus must be expanded by the compiler into loads and stores of portions of the elements). A program that does not conform to the ANSI defined rules that produced certain results with previous versions of the compiler may thus produce different results with the v4. For instance. The syntax is: #pragma pack(n) #pragma pack() where n is the maximum alignment that may be assigned to any nonstatic data member (even if it is less than the normal alignment for the member’s type). the pack alignment effectively reverts to the default value. a load of an int field in a struct subject to a #pragma pack(1) is expanded into 4 byte loads. division.1. If you neglect to put the ’F’ suffix on constants that you intend to be single precision you could unintentionally use the 64bit floating point emulation library. Must be used with -ignore_alias_types.NXP Semiconductors that unsuffixed floating point constants are of type double. the compiler by default conforms to the ANSI defined rules. 6. These new alias restrictions can be disabled in the v4.February 2010 36 . floating point constants suffixed with ’F’ (e. If not possible. Do not apply ANSI aliasing rules. pack. an emulation function is called. This assumption enables the compiler to do more optimization.1.0 and later allow user-defined struct packing and unaligned loads and stores.x. No option needs to be passed to tmcc to recognize long long. It is also possible to use the __unaligned qualifier to signify that a variable should be treated as unaligned. the compiler uses certain rules to determine where those pointers could be pointing. most operations are mapped into a sequence of native operations.4 Struct Packing and Specifying Unaligned Data TCS release v3.g.1. which are combined to construct the 32-byte integer.0F compiler (to produce the behavior of previous compiler versions) using one or both of the following options: -tmccom -ignore_alias_types --tmccom -ignore_alias_sizes -- Do not apply ANSI aliasing rules for types that have the same size. Volume 1 – Getting Started Release 5. Structure packing is supported by a special pragma.0 and later of the TCS allow the use of C type long long (C9X extension). 6.234F) are of type float.

6. which also inhibits the compiler from speculating loads. -bcompact_lookahead <n> and -bcompact_lookbehind <n>: These new options are used in conjunction with the -bcompact option to provide greater control over its operation.research. -allow_atomic_calls: This option allows functions that have the TCS_atomic pragma ■ to call other functions. These new options parameterize the compaction algorithm to allow a user to lessen the chance that unrelated functionality will be placed together by paying particular attention to the dtrees adjacent to the last dtree assigned an ■ Volume 1 – Getting Started Release 5.9 List of New Options in tmcc ■ -noloadspec: Do not speculate loads. In v2. if (__TCS_VERSION__ >=220) would be true for 2.2 tmld . tmld now reads it’s endian information directly from the object file.x.8 New Versioning Macros The predefined macro __TCS_V2__ has been replaced with a more general mechanism. this option is a more general implementation of the tmsched option -noloadspec. The results of this option can be displayed using the dot tool found at http://www.6 Other Compiler Enhancements With v4.Linker ■ The -el and -eb options are no longer supported for tmld (but are still used for tmcc).x comes a number of other compiler enhancements.2 this macro was also defined as D__TCS_VERSION=220.4 the compiler automatically generates guarded code for sufficiently simple if file that contains the dependency graph for the given function. tmcc supplies D__TCS_VERSION__450 to the compiler front end. ■ -dirty_float: Specify the amount of optimization that should occur for floating point numbers. the value of __TCS_VERSION__ is 450. These macros allow the user to write comparisons in code that are good for several releases. For v4. e. but in doing so may adversely impact performance by placing together unrelated program functionality. as follows: ■ The scope of the TCS_unroll pragma has been changed so that it now only applies to the loop following its use.1. ■ -fp64: Use double precision floating point emulation (see the detailed description above).7 Better C++ Support ■ Iterator classes now support the operator->() functions as described by the C++ ISO standard. and tmsched not to speculate loads. Code using the TCS_unroll pragma no longer has to reset the TCS_unroll value after the loop. ■ 6. It is the responsibility of the programmer to ensure that any function called from an atomic function is also an atomic function.5. 6.1. by avoiding padding.2 and all following releases. tmccom. The -bcompact option attempts to reduce the size of the executable. 6.February 2010 37 .att. With v4. ■ -graph=<dtree>: This option generates a graph. __TCS_VERSION__. Using this option will signal tmcfe.g.NXP Semiconductors 6.1.

a is now at $(LIBDEV)/lib/$(CORE)/$(TARGET)/$(ENDIAN)/$(FP)/libdev.h> With the separation of host communication from TCS.”. 6. 6. A user may try different values for lookahead and lookbehind to strike the desired balance between performance and code size.0F release will not work with machine description files from previous releases and vice versa. 6.g.a The source files also should be modified as they might have tm1 in the include path. e.6. Since multiple targets are supported... pnx1500.a is now at $(TCS)/lib/$(CORE)/$(ENDIAN)/$(FP)/libz. This means that tools from the v4.: #include <tm1/*.4 tmman — Execution Hosts This release supports tmman on Windows XP for pnx1005.. 6. some header files have moved from $TCS/ tmlib to $TCOMMROOT/include. You may have to modify pathnames in your Makefiles to match these new locations. Volume 1 – Getting Started Release 5. e. The default values for lookahead and lookbehind are 8 and 1.” needs to be changed to “. respectively.. tmcc will automatically include the correct path depending on the target specified. Note that using a lookahead value of 1 and a lookbehind value of 0 will produce the behavior of the -bcompact option in previous releases.h" to "*.3 Machine Description File Incompatibility Note The low-level machine description file format has been enhanced.: $(TCS)/lib/$(ENDIAN)/libz. This should have no impact on the ordinary user.NXP Semiconductors address during compacting.5 Device Libraries The release includes all tm1 device libraries and core device libraries for the other supported targets. The directory $TCOMMROOT/include will be added to the include path automatically. So it would be necessary to replace "tmlib/*. any include path like “tm1/.g. 6.h and fops..6 Changes in Include and Library Paths Library locations have been re-organized to support different architectures.1 Custom Ops Header Files Location The location of ops. when the -bcompact option is specified.h has been changed from $TCS/include/ops to $TCS/ include/cores/$CORE/ops. pnx1700 and pnx8550 processors.h> All the tm1’s in the include path should be replaced to #include <*.a Similarly $(TCS)/lib/$(ENDIAN)/libdev.February 2010 38 ..h" for such files.4 . This has led to backward compatibility being broken.

Customers using the TM1xxx cores from NXP should continue to use tmsim. It is not necessary to turn on -verbose(v) for these to take effect. Volume 1 – Getting Started Release 5. _cache_copyback and _cache_invalidate were declared in $TCS/tmlib/tmlibc. TCS releases do not contain tmsim anymore. Options and commands relating to them have no equivalents in TTIsim. you will need to make some changes. so you will not need to migrate again when you move to future TTI cores. Use the new functions tmCacheDataCopyBack and tmCacheInvalidateData instead of _cache_copyback and _cache_invalidate respectively. The -eb and -el options that control endianness do not exist in TTIsim. However. In TTIsim the argument is in bytes. for backward compatibility. The -memorysize(ms) option of tmsim expects its argument in Kbytes. This is the default with TTIsim. The -memorymodel(mm) option of tmsim does not exist.h" #endif #endif 6.2 and TCS 4. Therefore. TTIsim is a new simulation system. your scripts and batch files will work for all TTIsim simulators. and its simulators are not backward compatible with tmsim.h.February 2010 39 .7 Cache Device Library A new cache device library has been added and the function prototypes are defined in the header file $LIBDEV/include/$TMTARGET/tmCache. The undocumented tmsim option -mmiobase(ib) is replaced by -mmiobase(mmb) (only the short form is different). The decision not to be backward compatible with tmsim allows a clearer and more flexible interface suitable for supporting many different cores and system configurations.8 Migrating from tmsim to TTIsim Simulators Starting with TCS 5. as it is with tmsim. regardless of core or system configuration. the old functions have been retained. the file can be included as follows: #if defined(__TCS_VERSION__) #if (__TCS_VERSION__ >= 410) include "tmCache. but now they are declared in $LIBDEV/include/$TMTARGET/tmCache. Please refer to the TTIsim user manual for details of the invocation switches (options) and CLI commands.3. The -cycles1(c1) and -cycles2(c2) options should be replaced by -cycleinterval(ci) and cyclelimit(cl) respectively. If you have scripts that invoke tmsim or batch (control) files for tmsim. Some areas to watch in particular (not an exhaustive list): TTIsim simulators do not simulate any of the TM1xxx peripherals. TTIsim simulators all use a uniform invocation syntax and command line interface (CLI).h. application code must include tmCache. if prototype checking is needed. Once migration is complete. TTIsim will warn if -memorysize(ms) has an argument <= 65536. The -nomemorymodel(nomm) option requires no change.h. In order to compile the code for both TCS 2. Previously. The endianness is obtained from the target program executable (set by the tmld) and should be set in the PCSW by the target program (else the architectural default of the particular core applies).h. It is easier to relate memory size to memory base and top. Scripts should remove this option.NXP Semiconductors 6.4 .1.

out is not supported. use -quiet(q).x. the executable appshell. when a -btype app executable was specified as the executable name in the run tools tmrun. and specify the btype app executable as the argument to appshell. tmsim batch (control) files are not compatible with TTIsim because the command line interface (CLI) is different.out myapp. 6.x. Therefore. TCS path needed to be specified in the registry.out -trace myapp.out. so it is no longer possible to have a single version of appshell.4 . This is useful for controlling aperture settings in one or more cores.9 Loading of Dynamic Applications via appshell.out was loaded implicitly either from the current directory or from $TCS/lib/$ENDIAN/$HOST and the -btype app executable was provided as an argument to it. written to the core(s) by the boot block during the reset protocol. Volume 1 – Getting Started Release 5. Please see the user manual for details. For example. one per line. They are simply lists of CLI commands. It is recommended that batch files be fully converted. Please see the user manual for details. This will alert you that you need to migrate your batch files.out In TCS 2. and ttisim.out. and should be used instead of several undocumented options in For displaying trace messages while loading. If you want to load -btype app executables from these tools. TTIsim provides a -bootfile(boot) switch that causes the simulated boot block to read its boot parameters from a file. Batch files need to be converted. then an error message will be displayed saying that a dynamic application must be loaded via appshell. There is no need to specify -t to obtain the cycle count (this option does not exist in TTIsim).out for a given endianness and host which will support all targets. specify appshell. tmrun path\appshell. specify the -trace option to appshell. TTIsim will complain if it is encountered.February 2010 40 .x. tmrun path\appshell. TTIsim batch files do not need to begin with a line containing only the word “control”. 6. In the case of If a -btype app executable is provided directly to the run tools. TTIsim provides most of the same functionality with a more flexible and uniform syntax and more options for controlling output. tmmon and tmgmon.NXP Semiconductors TTIsim by default reports the cycle count at the end of the program. tmgmon. For interactive convenience.out for the intended target.x uses different locations of registry for the kernel level tmman driver and the user mode driver and tools. in TCS 4.out. The Windows XP tmman kernel level drivers now read entries from HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services while user mode tmman drivers and tools read entries from HKEY_LOCAL_MACHINE\SOFTWARE\NXPSemiconductors\TMMan. and many commands are backward compatible. Multiple targets are supported in TCS 4. Since “control” is not a recognized CLI command.10 Windows Registry Settings for tmman TCS 4. The boot parameters are pairs of MMIO addresses and values. To suppress informational messages (and warnings) so that non-error output from the simulator is purely target program output. and gives some other pieces of information at the beginning. a few common tmsim commands are silently recognized by TTIsim. implicit loading of appshell. For example.

x compiler to use the new debugger. The debugger has a new interface and look and feel.11 tmdbg . it must be specified by the user. if the program is built for host=WinNT. tm2270sim as the commMethod.February 2010 41 . select sim as the commType and appropriate simulator such as tm3260sim.Debugger You must compile your application using TCS 4. Since the debugger itself does not have any builtin knowledge about the communication channel. 6. For example.NXP Semiconductors This change was necessary as Windows XP kernel driver cannot read entries from HKEY_LOCAL_MACHINE\SOFTWARE\NXPSemiconductors\TMMan. For simulator hosts. there is a new option to specify the communication channel (commType) and communication method (commMethod) used. In the “Load Target” dialog. Volume 1 – Getting Started Release 5. select PCI for commType and commMethod.4 .

February 2010 42 .NXP Semiconductors Volume 1 – Getting Started Release 5.4 .

4 2.1.5 4.3.1 1.2 1.7 Navigation and Visualization 8 Report Generation 9 Design space exploration 9 Automatic Updates 9 Eclipse TriMedia target control plugins 9 Eclipse Debugger 10 Eclipse setup 11 1.2 2.1.2 Eclipse 21 Welcome Screen 21 On-line Help 22 Chapter 3 – Running Demonstration Programs 3.1 1.2.7 ttisim—The functional Simulator 31 5.5 1.4 Important Points to Remember 29 Device Libraries and Board Support Packages 29 tmcc/tmccom—The C/C++ Compiler 29 PSOS+ and C++ 30 Interrupt Service Routines 30 tmdbg —The Debugger 30 tmprof—The Profiler 30 5.4 .5 1.5.6 1.2.3 TriMedia VLIW Architecture 3 Functional Unit Assignment 3 What Makes TriMedia’s VLIW Architecture Better 4 Performance 4 1.1 2.2 5.1 1.2.6 Simulating TriMedia Applications 26 Running TriMedia Applications on the TriMedia Processor 27 Debugging TriMedia Applications 27 Chapter 5 – Troubleshooting 5.3 Introduction 25 Sample Program: getIt.2 PNX85500 Support 11 Compilation 11 Simulation 12 1.4 1.2 1.2.3 Troubleshooting Common Problems Under Windows 31 Frequently Asked Questions 32 Volume 1 – Getting Started Release 2.5 5.3 5.1 1.1 5.1 Installing TriMedia TCS tools 15 Windows Installation 16 Using the Setup Program 16 Choosing the Location of the Installation Folder 17 A Note on Installation Requirements For the TriMedia Debugger 20 Installation of Updates 21 2.4.3 1.1.1 5.c 25 Compiling TriMedia Applications 26 4.3 1.3.Contents Chapter 1 – Overview of the TriMedia System 1.2 1.1 4.3 2.1.2 Introduction 15 Supported PC Build Hosts 15 Supported PC Execution Hosts 15 5.3 Eclipse IDE for TriMedia Tools 8 Chapter 2 – Installing TriMedia TCS Tools 2.February 2010 43 .1 2.1 2.4.4 TriMedia Compilation and Simulation System (TCS) 5 TriMedia Tools 6 Execution Tools 6 System Tools 7 Performance Analysis and Enhancement Tools 7 Machine-Level Simulator 8 1.2 Running the Files Program 23 Chapter 4 – Using TriMedia TCS Tools 4.2.1 Introduction 23 3.2 1.1.2 1.2 4.1.1 1.2.Net 2005 13 1.5.1 Platform support 13 Linux 13 Windows 13 .1.4 5.1.

3 6.8 6.1.6 6.6 6.11 6.Debugger 41 Volume 1 – Getting Started Release 5.1 6.NXP Semiconductors Chapter 6 – Migration 6.7 6.9 6.4 6.4 6.2 6.1.10 6.1.5 6.3 tmld .1 tmman — Execution Hosts 38 Device Libraries 38 Changes in Include and Library Paths 38 Custom Ops Header Files Location 38 6.1.Linker 37 Machine Description File Incompatibility Note 38 Cache Device Library 39 Migrating from tmsim to TTIsim Simulators 39 Loading of Dynamic Applications via appshell.4 .7 6.out 40 Windows Registry Settings for tmman 40 tmdbg .February 2010 44 .5 6.2 6.8 Contents tmcc/tmccom — C/C++ Compiler 35 Compiling for different targets 35 64 bit Floating Point Emulation 35 64 bit Integers 36 Struct Packing and Specifying Unaligned Data 36 Stricter Aliasing 36 Other Compiler Enhancements 37 Better C++ Support 37 New Versioning Macros 37 List of New Options in tmcc 37 6.