Bxillinx_mb_ta

所属分类:驱动编程
开发工具:Visual C++
文件大小:2997KB
下载次数:4
上传日期:2012-07-20 14:52:45
上 传 者qschh
说明:  一种基于MicroBlaze软处理器核的Threaadx代码,包含移植与驱动driver。实时性能出众。
(Based on the MicroBlaze soft processor core Threaadx code, including transplantation and drive driver. Real-time performance is outstanding.)

文件列表:
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Express_Logic_Brochure.pdf (1726947, 2003-09-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Express_Start_Guide.pdf (25053, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\code\demo.c (14920, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\code\Timer.c (2131, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\code\tx.a (180446, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\code\tx_api.h (38001, 2003-01-01)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\code\tx_ill.s (8399, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\code\tx_port.h (8792, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\data\system.ucf (2337, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\etc\bitgen.ut (343, 2003-06-26)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\etc\bitgen_spartan3.ut (250, 2003-12-02)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\etc\download.cmd (115, 2004-11-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\etc\fast_runtime.opt (2687, 2004-11-08)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\etc\xmd_mblaze.opt (95, 2004-11-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\pcores\clk_gen\data\clk_gen_v2_0_0.mpd (443, 2003-07-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\pcores\clk_gen\data\clk_gen_v2_0_0.pao (251, 2003-07-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\pcores\clk_gen\data\clk_gen_v2_1_0.mpd (429, 2003-12-02)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\pcores\clk_gen\data\clk_gen_v2_1_0.pao (244, 2003-12-02)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\pcores\clk_gen\hdl\vhdl\clk_gen.vhd (2071, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\system.make (9053, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\system.mhs (6339, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\system.mss (1841, 2004-05-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\system.xmp (1066, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE3LC\system_incl.make (4638, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\code\demo.c (14920, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\code\Timer.c (2131, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\code\tx.a (180446, 2004-11-16)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\code\tx_api.h (38001, 2003-01-01)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\code\tx_ill.s (8399, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\code\tx_port.h (8792, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\data\system.ucf (2337, 2004-11-10)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\etc\bitgen.ut (343, 2003-06-26)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\etc\bitgen_spartan3.ut (250, 2003-12-02)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\etc\download.cmd (115, 2004-11-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\etc\fast_runtime.opt (2687, 2004-11-08)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\etc\xmd_mblaze.opt (95, 2004-11-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\pcores\clk_gen\data\clk_gen_v2_0_0.mpd (443, 2003-07-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\pcores\clk_gen\data\clk_gen_v2_0_0.pao (251, 2003-07-09)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\pcores\clk_gen\data\clk_gen_v2_1_0.mpd (429, 2003-12-02)
Bxillinx_mb_ta\Xilinx_MicroBlaze_ThreadX_Demo\Memec_Spartan_2SE6LC\pcores\clk_gen\data\clk_gen_v2_1_0.pao (244, 2003-12-02)
... ...

Express Logic's ThreadX for MicroBlaze Using the Xilinx EDK Tools Demonstration Version 1. Installation Unzip the xilinx_mb_threadx.zip file on your machine. This will create a directory tree on your hard-disk of the following form: \Xilinx_MicroBlaze_Threadx_Demo \Memec_Spartan_2SE3LC \Memec_Spartan_2SE6LC \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 There are multiple demonstration systems for the MicroBlaze, several that run on Memec Spartan Development Boards and one that runs on the Memec Virtex-II Pro Development Board. Building and running each 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_MicroBlaze_Threadx_Demo\Memec_Spartan_2SE3LC 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. 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. 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 entry point in ThreadX for the MicroBlaze using Xilinx GNU tools is at label _start. This is defined within the modified version of the Xilinx startup code - CRT0.S. The ThreadX TX_ILL.S file is responsible for setting up various system data structures and basic interrupt vector management. ThreadX defines its own _interrupt_handler, which the Xilinx startup code sets the general interrupt vector to. In addition, _tx_initialize_low_level defines the first available address for use by the application, which is supplied as the sole input parameter to your application definition function, tx_application_define. 5. Assembler / Compiler Switches The following are compiler switches used in building the demonstration system: Compiler/Assembler Meaning Switches -g Specifies debug information -O3 Specifies level 3 optimization -c Specifies object code generation 6. Register Usage and Stack Frames The MicroBlaze GNU compiler assumes that registers r3-r12 are volatile across function function call boundaries. 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 only the non-scratch 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 control block TX_THREAD. Offset Interrupted Stack Frame Non-Interrupt Stack Frame 0x00 1 0 0x04 r3 r19 0x08 r4 r20 0x0C r5 r21 0x10 r6 r22 0x14 r7 r23 0x18 r8 r24 0x1C r9 r25 0x20 r10 r26 0x24 r11 r27 0x28 r12 r28 0x2C r15 r29 0x30 r18 r30 0x34 r19 r31 0x38 r20 r15 (return address) 0x3C r21 msr 0x40 r22 0x44 r23 0x48 r24 0x4C r25 0x50 r26 0x54 r27 0x58 r28 0x5C r29 0x60 r30 0x*** r31 0x68 r14 (point of interrupt) 0x6C msr 7. Improving Performance The distribution version of ThreadX is built without any compiler optimizations. This makes it easy to debug because you can trace or set 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 MicroBlaze targets. Interrupt processing starts at the label _interrupt_handler in tx_ill.s. From this handler, ThreadX calls _tx_thread_context_save to save the initial state of the interrupted thread and switches to the system stack pointer for use during the interrupt processing. Once context save returns, ThreadX calls the Xilinx library interrupt handler XIntc_LowLevelInterruptHandler. This is where all the interrupts setup with the Xilinx tools are dispatched from. If you use the Xilinx tools to setup all the interrupt sources, you will not need to modify tx_ill.s in any way. Once interrupt processing is complete (when XIntc_LowLevelInterruptHandler returns), the _tx_thread_context_restore routine is invoked. This routine either returns to the point of interrupt or to the ThreadX scheduler if a higher-priority thread was made ready by the ISR processing. 9. ThreadX Timer Interrupt ThreadX requires a periodic interrupt source to manage all time-slicing, thread sleeps, timeouts, and application timers. Without such a timer interrupt source, these services are not functional but the remainder of ThreadX will still run. To add the timer interrupt processing, simply provide a module similar to the "Timer.c" function supplied with the demonstration systems. 10. Revision History 11/01/2004 Initial ThreadX demonstration version for MicroBlaze using Xilinx GNU tools. Copyright(c) 1996-2004 Express Logic, Inc. Express Logic, Inc. 11423 West Bernardo Court San Diego, CA 92127 www.expresslogic.com

近期下载者

相关文件


收藏者