The build system for simple executive supports building 64-bit and 32-bit applications. By default 64-bit applications are built and the object files are placed in the 'obj' dir in the application build directory. The "make" variable OCTEON_TARGET must be defined to the cvmx_n32 to build 32-bit applications. The object files and executable name will be postfixed with '-cvmx_n32'.
SE的構建系統支持生成64位和32位的應用程序。默認情況下,生成64位的應用程序,生成的目標文件放在應用程序生成目錄下的obj下面。要生成32位應用程序,make變量OCTEON_TARGET必須被定義成cvmx_n32 。生成的目標文件和可執行文件的名字將被加上'-cvmx_n32'后綴。
The build system supports building for either compile time or runtime Octeon model selection. Please see the "Supporting multiple Octeon models" section of the simple executive documentation page and octeon-model.h for more details.
構建系統支持生成編譯時(shí)或運行時(shí)模塊選擇。詳細信息請看SE文檔"Supporting multiple Octeon models" 章節和octeon-model.h。
When the envionment is sourced with OcteonII model, for example OCTEON_CN63XX, the application is compiled with -march=octeon2 ISA. This toolchain option generates Octeon2 specific instructions. The application will not run on Octeon and OcteonPlus models.
當環(huán)境來(lái)源于OcteonII模塊時(shí),比如OCTEON_CN63XX,應用程序編譯時(shí)加上了-march=octeon2 ISA。這個(gè)工具鏈的選項生成octeon2特性的指令。應用程序將不能運行在octeon和octeonplus模塊上。
## application Makefile## $Id: doc-build-system.h 50321 2010-06-19 00:55:39Z cchavva $## subdirectory config/ contains all the configuration header files.# for example config/cvmx-config.h contains the system resource config,# config/executive-config.h contains the simple executive config,# config/global-config.h contains global config across components,# config/comp1-config.h contains component config for comp1.# subdirectory obj/ contains intermediate build and library files.## default targetdefault: application-target# standard common Makefile fragmentinclude $(OCTEON_ROOT)/common.mk# include needed component Makefile fragmentsdir := $(OCTEON_ROOT)/executiveinclude $(dir)/cvmx.mk# dir := $(OCTEON_ROOT)/components/comp1# include $(dir)/comp1.mk## dir := $(OCTEON_ROOT)/components/comp2# include $(dir)/comp2.mk# application specificationTARGET = app_exe$(PREFIX)//->目標OBJS = $(OBJ_DIR)/app1.o $(OBJ_DIR)/app2.o//依賴(lài)文件CFLAGS_LOCAL = -g -O2 -W -Wall -Wno-unused-parameterinclude $(OCTEON_ROOT)/application.mk# clean targetclean: rm -f $(TARGET) rm -f $(CVMX_CONFIG) rm -fr $(OBJ_DIR)
Some items have special meaning:
This build system should be used for applications that require cvmx-config.h (system resource config). All SDK examples that need cvmx-config.h use this build system.
構建系統應該被用于需要cvmx-config.h (系統資源配置)的應用程序。所有的需要cvmx-config.h的SDK示例都是用了構建系統。
The contents of these variables (if defined) will be added to the respective FLAGS variable in the build system. The build system current uses OCTEON_CPPFLAGS_GLOBAL_ADD for the following configuration options:
Example: creating an application that uses simple executive% mkdir application% cd application% mkdir config% cp $OCTEON_ROOT/executive/executive-config.h.template config/executive-config.h(then edit config/executive-config.h to tune the flags/settings as appropriate for the application)The build system will take care of creating a system resource header file, by running the cvmx-config tool on all the configuration header files in the application's config subdirectory. The automatically generated file will be config/cvmx-config.h.
根據應用程序配置子目錄中的所有配置頭文件,運行cvmx-config工具,構建系統將會(huì )創(chuàng )建一個(gè)系統資源頭文件。這個(gè)自動(dòng)生成的文件就是config/cvmx-config.h。
The application can specify its own config/resource requirements via this system as well. For example, config/app-config.h can be created to list application configs and requirements. All header files of the form config/*-config.h will be picked up by the config/build system.
通過(guò)構建系統,應用程序也可以指定它自己的config/resource需求。例如:config/app-config.h可以被創(chuàng )建,且它列舉了應用程序的配置和需求。所有的config/*-config.h這種形式的頭文件都將被配置/構建系統所讀取。
Each component-config.h file contains two sections: first, the component configuration section should detail the various compilation flags and settings that can be defined to control the behavior of that particular component. Flags may be used to enable/disable features, settings may be used to define parameters required for that component. This section is normal C code.
每一個(gè) component-config.h 包含兩個(gè)段:首先,.組件配置段,它應該詳細描述各種編譯選項和設置,可以被定義去控制那個(gè)特定組件的行為。選項可以用來(lái)去使能或禁止特性,設置可以用來(lái)定義組件需要的參數。這個(gè)段通常用C去寫(xiě)。
The second section contains the resource requirements of the component. This section is not C code, and is therefore bracketed by #ifdef CAVIUM_COMPONENT_REQUIREMENT/#endif. The resource requirement section may be split into another file and included in the component-config.h file. This is done for the simple executive with the resources described in the cvmx-resources.config file that is included by executive-config.h.
第二段包含組件需要的資源。這段不是用C寫(xiě)的,且被用#ifdef CAVIUM_COMPONENT_REQUIREMENT/#endif括起來(lái)。需要的資源段可能被分離到另外一個(gè)文件并被包含在component-config.h文件中。這樣做是為了用于在cvmx-resources.config文件中描述的資源的SE,cvmx-resources.config文件被包含在executive-config.h文件中。
The resource requirements are always specified in the format of section name "cvmxconfig", followed by open brace, followed by the resource requirement specifications, then finally ending with a close brace.
需要的資源總是在名為"cvmxconfig"的段中被描述,格式是:cvmxconfig, + 左花括號 + 需要的資源描述 +右花括號。
cvmxconfig{ ... resource requirement specifications go here ...}There are three types of resources requirements: fpa, fau, and scratch.
有3種所需資源類(lèi)型:fpa, fau 和 scratch
Each resource specification start with the resource type, followed by the definition name (the name of macros that will end up in the generated cvmx-config.h), followed by a series of name = value pairs, terminating with semicolon.
每種資源描述開(kāi)頭是資源類(lèi)型,跟著(zhù)是定義的名字(最終在生成的cvmx-config.h文件中的宏名),再跟著(zhù)是一系列 “name = value;”這種格式。
For fpa resource specification, the following name value pairs are recognized:
pool = <integer> ranges from 0 through 7, specifies the required FPA pool number, for pools that must be fixed. size = <integer> specifies the size of buffers in the pool in number of cache lines. (default: 1) priority = <integer> ranges from 1 through 8, specifies the desired priority (1 = highest priority). (default: 8) protected = <boolean> if true, no other fpa resource can map to the hardware pool assigned to this resource. (default: false) description = <string> doubly quoted string, which will appear as comment in the generated cvmx-config.h. <boolean> can be "true", "yes", or "1" for true, and "false", "no", or "0" for false.
Example fpa resource specification: the packet buffer pool fpa CVMX_FPA_PACKET_POOL pool = 0 size = 8 priority = 1 description = "Packet buffers";
For fau resource specification, the following name value pairs are recognized:
size = <integer> specifies the number of bytes per element. (default: 8) count = <integer> specifies the number of elements. (default: 1) description = <string> doubly quoted string, which will appear as comment in the generated cvmx-config.h.
Example fau resource specification: an array of 8 bytes for output queue index fau CVMX_FAU_REG_OQ_INDEX_BASE size = 1 count = 8 description = "FAU registers for the position in PKO command buffers";
For scratch resource specification, the following name value pairs are recognized:
permanent = <boolean> if true, this scratch location cannot be shared with another scratch resource. (default: true) size = <integer> specifies the number of bytes per element. (default: 8) count = <integer> specifies the number of elements. (default: 1) iobdma = <boolean> if true, this scratch location can be used as an IOBDMA destination. (default: true)
Example scratch resource specification: output queue buffer preallocation scratch CVMX_SCR_OQ_BUF_PRE_ALLOC size = 8 iobdma = true permanent = true description = "Pre allocation for PKO queue command buffers";
聯(lián)系客服