Reference: http://xilinx.eetrend.com/d6-xilinx/blog/2010-05/682.html
With the development of integrated circuit design and manufacturing technology, the FPGA chip capacity is getting bigger and higher, and the performance is getting higher and higher. It has become a reality to Use FPGA to build on-chip systems, FPGA-based embedded systems and system on a programmable chip design technology will gradually become the mainstream technology of system design and are gaining more and more extensive research. Microblaze is a software processor core optimized for FPGA Devices by Xilinx. It has good performance and low price, and supports the full range of FPGA Devices of Xilinx, there should be broad development prospects. μ c/OS-II is an excellent open source real-time operating system launched by Mr. Jean labrosse in 1998. It has the advantages of convenient transplantation, high execution efficiency, small space occupation, strong real-time performance and high reliability. The application platform using μC/OS-II + microblze is very suitable for small and medium embedded system applications. Based on the transplantation of μC/OS-II on microblze and the application research of this system, this paper records the experiences and experiences of transplantation and use process, and the content may be scattered, I hope to help some friends who have similar applications, and you are welcome to exchange and discuss them.
I. Main references
① μ c/OS-II learning mainly refer to professor Shao Beibei's "embedded real-time operating system μC/OS-II (2nd edition)"
The following is the introduction of China-Pub http://www.china-pub.com/12618
You can also find the first version of the book on the Internet.
2 micrium Micrium-uCOS-II-V286.ZIP, including code and documentation, can be from
Www.micrium.com.
③ Micrium company's μC/OS-II and the Xilinx microblaze processor application note
It can be obtained from www.micrium.com.
Xilinx EDK related documents: http://www.xilinx.com/ise/embedded/edk_docs.htm
⑤ ISE and EDK help documents, including the microblaze processor Reference Guide (mb_ref_guide.pdf ).
6. For basic use of EDK, refer to: xilinx's 6 edklabs (Chinese Version)
Baidu Library has http://wenku.baidu.com/view/e92e71d184254b35eefd3425.html
Ii. Operating System Configuration Options
During software platform configuration, generally after EDK software is installed, there are only two standard options available for operating system and database settings: Standalone and kernel. Standalone is suitable for applications without operating systems. It only provides basic interrupt settings, cache configuration, and other functions. The kernel is an embedded kernel provided by Xilinx. In order to be able to select μ c/OS-II when setting the operating system, according to the cylinth document, the EDK software operating system configuration options are actually obtained by scanning the BSP directory, the scan order is:
1. The current working directory, that is, the project directory.
2. Use the-LP option to specify the directory when calling libgen.
3. the EDK \ Sw \ Lib \ BSP directory under the EDK installation directory.
Therefore, if we want to create a new project with μC/OS-, copy the contents in the BSP directory of the migration package an-1013.zip of micriumcompany to the EDK installation directory's EDK \ Sw \ Lib \ BSP directory. If only the current project is used, copy it to the project directory.
The BSP directory has a specific structure, as shown in:
In the BSP directory, my_ OS specifies the operating system we use. Here is the uCOS-II_v2_86_a.
The src directory under the my_ OS directory contains all the source files and header files. The data directory contains two files: The MLD file and the Tcl file. The MLD file is used to customize the software library and board-level support package of the Operating System (BSP: Board
Support packages). The TCL file is the script file that generates the software library and BSP package.
Iii. Bus Interface of microblze
The microblaze processor provides the following bus interfaces for external communication.
① PLB Bus: The 32-bit PLB v4.6 bus supports connection between multiple master devices and slave devices to provide efficient transmission performance. It is suitable for data transmission intensive applications.
② OPB Bus: Peripheral Bus, suitable for low-speed device connection.
③ LMB Bus: Local Storage bus, used to connect block ram synchronization bus in the chip at high speed, using a minimum number of control signals and a simple protocol for getting block ram in a clock cycle. The read/write timing of the LMB bus is the same as that of block ram, and all LMB signals are valid at a high level.
④ FSL Bus: quick ticket Link interface, which provides one-way point-to-point data stream transmission with high efficiency and low resource usage. The latest microblaze 7.2 processor supports up to 16 FSL interfaces. Each FSL interface consists of an input and an output interface. The read/write operations of the FSL bus are completed through the put and get commands of microblze. There are two modes: Blocking Mode and non-blocking mode. Blocking Mode means that when a write operation is completed, the processor will wait if the FIFO is full or the read operation is null, but the write operation is successful if the FIFO is not full or the FIFO is not empty, and the read operation is successful. If the read/write operation in non-blocking mode is unsuccessful, the processor does not wait, but sets the carry signal in MSR.
⑤ Xcl Bus: Xilinx cache Link interface, which provides an efficient and minimum latency solution when external storage is required. The xcl interface is designed to directly connect to the memory controller through an embedded FSL interface.
⑥ Debug and trace: JTAG-based software debugging Module (
Xilinx microprocessor debug module ).
For applications with a small amount of code, the code and data can be stored in block ram and the LMB bus is more convenient, it is necessary to use the xcl bus to provide access efficiency to external memory. Peripheral connections generally use PLB, OPB, or FSL bus. The LMB and FSL bus protocols are relatively simple, but they are also widely used. For more information about the read/write sequence, see Chapter 2nd signal interface description in the microblaze processor reference guide, for more information about PLB bus, see IBM 128-bit processor local bus architectural specification (v4.6 ). The edkip core under the EDK \ HW installation directory has the corresponding IP address instructions reference.
-To be continued-
This article is the entries of the "aflow Cup" Xilinx FPGA design skills and application innovation blog contest
The transplantation and use of μC/OS-II on microblze -- entries of the "anfuli Cup" Xilinx FPGA design skills and application innovation blog Competition