xilinx_ppc_threadx

所属分类:处理器开发
开发工具:DOS
文件大小:3123KB
下载次数:49
上传日期:2009-08-27 17:31:17
上 传 者developercn
说明:  关于threadx的有一本中文书《嵌入式实时操作系统的多线程计算:基于ThreadX和ARM》。

文件列表:
Xilinx_PPC_ThreadX_Demo (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Express_Logic_Brochure.pdf (1726947, 2003-09-10)
Xilinx_PPC_ThreadX_Demo\ThreadX.pdf (3108364, 2003-01-13)
Xilinx_PPC_ThreadX_Demo\ThreadX_PPC405_Xilinx_Data_Sheet.pdf (82928, 2004-02-09)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672 (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\system_incl.make (4333, 2004-11-19)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\demo.c (17024, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\function.c (1549, 2004-11-18)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\function.h (597, 2003-02-06)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\lcd.c (2933, 2004-11-18)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\lcd.h (804, 2003-01-13)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\tx.a (182596, 2004-11-19)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\tx_api.h (38001, 2003-01-01)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\tx_ill.s (10809, 2004-02-10)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\tx_port.h (8235, 2004-02-28)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\code\vectors.s (2902, 2004-02-10)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\data (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\data\system.ucf (5096, 2004-11-16)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\etc (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\etc\bitgen.ut (343, 2004-11-16)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\etc\bitgen_spartan3.ut (250, 2004-11-16)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\etc\download.cmd (115, 2004-11-19)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\etc\fast_runtime.opt (2733, 2004-11-16)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\etc\xmd_PPC405_i.opt (75, 2004-11-18)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\data (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\data\opb_lcd_interface_v2_0_0.mpd (1799, 2004-09-24)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\data\opb_lcd_interface_v2_0_0.pao (1573, 2004-09-24)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\data\opb_lcd_interface_v2_1_0.mpd (1799, 2004-09-24)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\data\opb_lcd_interface_v2_1_0.pao (1573, 2004-09-24)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\hdl (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\hdl\vhdl (0, 2004-11-22)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\hdl\vhdl\lcd_interface_core.vhd (5282, 2004-09-24)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\pcores\opb_lcd_interface_v1_00_a\hdl\vhdl\opb_lcd_interface.vhd (15225, 2004-09-24)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\system.bsb (2869, 2004-11-16)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\system.make (8803, 2004-11-19)
Xilinx_PPC_ThreadX_Demo\Memec_Virtex2pro_2vp7_ff672\system.mhs (8491, 2004-11-18)
... ...

Express Logic's ThreadX for PPP405 Using the Xilinx EDK Tools Demonstration Version 1. Installation Unzip the xilinx_ppc_threadx.zip file on your machine. This will create a directory tree on your hard-disk of the following form: \Xilinx_PPC_Threadx_Demo \Memec_Virtex2pro_2vp7_ff672 2. ThreadX Limited Run-Time Library The supplied ThreadX binary library (tx.a) has the following constraints: Object Maximum Allowed Threads 10 Timers 2 Semaphores 2 Queues 2 Mutexes 2 Event Flag Groups 2 Block Memory Pools 1 Byte Memory Pools 1 The return code TX_NOT_AVAILABLE is returned if the application attempts to create more than the specified number of objects allowed in this demonstration version of ThreadX. This library is meant for simple evaluation only. If you need more capabilities please contact sales@expresslogic.com to request a full ThreadX evaluation. 3. Demonstration System The demonstration systems for the Xilinx PPC405 is designed to run on the Memec VIRTEX-II Pro Development Board. Building and running the demonstration is easy as the following steps show: 1. Invoke the Xilinx Platform Studio 2. Select "File -> Open Project" from the IDE. 3. Browse to the desired demonstration sub-directory off of the ThreadX installation directory, e.g.: C:\Xilinx_PPC_Threadx_Demo\Memec_Virtex2pro_2vp7_ff672 4. Once in the desired sub-directory, open the "SYSTEM.XMP" project file. 5. Build the Bitstream for the board and download it. 6. Select the "Compile Program Sources" button and observe the libraries and demonstration being built. Note that the demonstration relies on the ThreadX library being built in the parent directory with the BUILD_TX.BAT file. 7. At this point, the demonstration is ready for downloading and running on the target. 8. Select the "XMD" button to establish communication with the XMD stub on the target board. You should observe a console window showing that the GDB server "stub" was started for on the target. Note: On JP19, a jumper should be placed in the 2-3 position for proper operation. 9. Select "Tools -> Software Debugger" to invoke the debugger. You should now see the "main" entry point of the demonstration program in the debugger's "Source Window". 10. From the debugger "Source Window" select the "Run" button to download and execute the demonstration on the target board. At this point you will be prompted for several items, please enter the following for each selection box: For Target select: "Remote/TCP:XMD" For Baud Rate enter: "localhost" For Port enter: 1234 When the "Target Selection" information is complete, select "OK" to begin the download. You should now observe the download and execution of the demonstration to the default breakpoint in "main". 11. You can now select the "Continue" button to run the entire demonstration, step, or set breakpoints to explore how the demonstration system works. 4. System Initialization The system entry point using the XILINX EDK tools is at the label _start. This is defined within the CRT0.S file supplied by XILINX. In addition, this is where all static and global pre-set C variable initialization processing is called from. After the XILINX startup function returns, ThreadX initialization is is called. The main initialization function is _tx_initialize_low_level and is located in the file TX_ILL.S. This function is responsible for setting up various system data structures, interrupt vectors, and the PowerPC PIT as the periodic timer interrupt source of ThreadX. In addition, _tx_initialize_low_level determines the first available address for use by the application. By default free memory is assumed to start at the linker defined symbol _end. This address is supplied to tx_application_define for the application's use. 5. Assembler / Compiler / Linker Switches The following are XILINX switches used in building the demonstration system: Compiler/Assembler Meaning Switches -mcpu=405 Specifies PPP405 code generation -g Specifies debug information -c Specifies object code generation -o Specifies output file (assembler and linker only) 6. Register Usage and Stack Frames The XILINX compiler for the PPP405 assumes that registers r0 and r3-r12 are scratch registers for each function. All other registers used by a C function must be preserved by the function. ThreadX takes advantage of this in situations where a context switch happens as a result of making a ThreadX service call (which is itself a C function). In such cases, the saved context of a thread is comprised of only the preserved registers. The following defines the saved context stack frames for context switches that occur as a result of interrupt handling or from thread-level API calls. All suspended threads have one of these two types of stack frames. The top of the suspended thread's stack is pointed to by tx_stack_ptr in the associated thread's control block TX_THREAD. Offset Interrupted Stack Frame Non-Interrupt Stack Frame 0x00 1 0 0x04 srr0 (point of interrupt) msr 0x08 srr1 (interrupted msr) lr 0x0C lr r14 0x10 ctr r15 0x14 cr r16 0x18 xer r17 0x1C r0 r18 0x20 r3 r19 0x24 r4 r20 0x28 r5 r21 0x2C r6 r22 0x30 r7 r23 0x34 r8 r24 0x38 r9 r25 0x3C r10 r26 0x40 r11 r27 0x44 r12 r28 0x48 r14 r29 0x4C r15 r30 0x50 r16 r31 0x54 r17 0x58 r18 0x5C r19 0x60 r20 0x*** r21 0x68 r22 0x6C r23 0x70 r24 0x74 r25 0x78 r26 0x7C r27 0x80 r28 0x84 r29 0x88 r30 0x8C r31 7. Increasing Performance The distribution version of ThreadX is built without any compiler optimizations. This makes it easy to debug because you can trace or set breakpoints inside of ThreadX itself. Of course, this costs some performance. To make it run faster, you can replace the -g compiler option with a -O3 in the BUILD_TX.BAT file to enable all compiler optimizations. In addition, you can eliminate the ThreadX basic API error checking by compiling your application code with the symbol TX_DISABLE_ERROR_CHECKING defined. 8. Interrupt Handling ThreadX provides complete and high-performance interrupt handling for PowerPC targets and is integrated with the Xilinx EDK software libraries. All external interrupts are processed by the _tx_external_interrupt handler defined in TX_ILL.S. After context is saved, the Xilinx EDK external interrupt dispatch routine, XIntc_LowLevelInterruptHandler, is called. All application registered interrupt handlers are called from inside XIntc_LowLevelInterruptHandler. When this routine returns, ThreadX calls the context restore function to complete the interrupt processing. The following is an example of the external interrupt processing in ThreadX: .globl _tx_external_interrupt _tx_external_interrupt: addi %r1,%r1,-144 # Allocate interrupt stack frame stw %r0,28(%r1) # Save r1 mflr %r0 # Pickup lr stw %r0,12(%r1) # Save lr stw %r3,32(%r1) # Save r3 mfcr %r0 # Pickup cr register stw %r0,20(%r1) # Store cr bla _tx_thread_context_save # Save system's context # /* Actual dispatch to the Xilinx EDK interrupt dispatcher here! */ bl XIntc_LowLevelInterruptHandler ba _tx_thread_context_restore # Restore system context Note: the only interrupt required by ThreadX is a periodic timer. ThreadX uses the PIT interrupt for this, which is handled by a completely different interrupt. 9. Revision History 11/01/2004 Initial ThreadX demonstration version for PowerPC PPP405 using the Xilinx EDK tools. Copyright(c) 1996-2004 Express Logic, Inc. Express Logic, Inc. 11423 West Bernardo Court San Diego, CA 92127 www.expresslogic.com

近期下载者

相关文件


收藏者