User’s Manual RX4000 Real-Time Operating System Installation Target Device VR4100 Series™ VR4300 Series™ Document No. U13687EJ1V2UM00 (1st edition) Date Published October 2001 J CP(K) © Printed in Japan 1998 [MEMO] 2 User's Manual U13687EJ1V2UM SUMMARY OF CONTENTS CHAPTER 1 OVERVIEW ........................................................................................................................................... 15 CHAPTER 2 INSTALLATION .................................................................................................................................... 19 CHAPTER 3 SYSTEM CONSTRUCTION.................................................................................................................. 31 CHAPTER 4 USER OWN CODING PART................................................................................................................. 39 CHAPTER 5 INTERFACE LIBRARIES...................................................................................................................... 45 CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES........................................................................................ 47 CHAPTER 7 CONFIGURATOR CF4000 ................................................................................................................... 53 CHAPTER 8 DESCRIBING A CF DEFINITION FILE................................................................................................. 59 CHAPTER 9 INFORMATION FILE GENERATION.................................................................................................... 99 APPENDIX INDEX ................................................................................................................................................... 107 User's Manual U13687EJ1V2UM 3 VR4100, VR4102, VR4111, VR4300, VR4305, VR4310, VR4100 Series, VR4300 Series, and VR Series are trademarks of NEC Corporation. MS-DOS and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. CodeWarrior is a trademark of Metrowerks Co., Ltd. Green Hills Software and MULTI are trademarks of Green Hills Software, Inc. PC/AT is a trademark of International Business Machines Corporation. SPARCstation is a trademark of SPARC International, Inc. Ethernet is a trademark of Xerox Corp. UNIX is a registered trademark licensed by X/Open Company Limited in the US and other countries. SunOS and Solaris are trademarks of Sun Microsystems, Inc. TRON is an abbreviation for The Real-time Operating system Nucleus. ITRON is an abbreviation for Industrial TRON. 4 User's Manual U13687EJ1V2UM The export of this product from Japan is prohibited without governmental license. To export or re-export this product from a country other than Japan may also be prohibited without a license from that country. Please call an NEC sales representative. • The information in this document is current as of September, 1998. The information is subject to change without notice. For actual design-in, refer to the latest publications of NEC's data sheets or data books, etc., for the most up-to-date specifications of NEC semiconductor products. Not all products and/or types are available in every country. Please check with an NEC sales representative for availability and additional information. • No part of this document may be copied or reproduced in any form or by any means without prior written consent of NEC. NEC assumes no responsibility for any errors that may appear in this document. • NEC does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of NEC semiconductor products listed in this document or any other liability arising from the use of such products. No license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC or others. • Descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. The incorporation of these circuits, software and information in the design of customer's equipment shall be done under the full responsibility of customer. NEC assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. • While NEC endeavours to enhance the quality, reliability and safety of NEC semiconductor products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To minimize risks of damage to property or injury (including death) to persons arising from defects in NEC semiconductor products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment, and anti-failure features. • NEC semiconductor products are classified into the following three quality grades: "Standard", "Special" and "Specific". The "Specific" quality grade applies only to semiconductor products developed based on a customer-designated "quality assurance program" for a specific application. The recommended applications of a semiconductor product depend on its quality grade, as indicated below. Customers must check the quality grade of each semiconductor product before using it in a particular application. "Standard": Computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots "Special": Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support) "Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. The quality grade of NEC semiconductor products is "Standard" unless otherwise expressly specified in NEC's data sheets or data books, etc. If customers wish to use NEC semiconductor products in applications not intended by NEC, they must contact an NEC sales representative in advance to determine NEC's willingness to support a given application. (Note) (1) "NEC" as used in this statement means NEC Corporation and also includes its majority-owned subsidiaries. (2) "NEC semiconductor products" means any semiconductor product developed or manufactured by or for NEC (as defined above). M8E 00. 4 User's Manual U13687EJ1V2UM 5 Regional Information Some information contained in this document may vary from country to country. Before using any NEC product in your application, pIease contact the NEC office in your country to obtain a list of authorized representatives and distributors. They will verify: • Device availability • Ordering information • Product release schedule • Availability of related technical literature • Development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, AC supply voltages, and so forth) • Network requirements In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. NEC Electronics Inc. (U.S.) NEC Electronics (Germany) GmbH NEC Electronics Hong Kong Ltd. Santa Clara, California Tel: 408-588-6000 800-366-9782 Fax: 408-588-6130 800-729-9288 Benelux Office Eindhoven, The Netherlands Tel: 040-2445845 Fax: 040-2444580 Hong Kong Tel: 2886-9318 Fax: 2886-9022/9044 NEC Electronics (France) S.A. Velizy-Villacoublay, France Tel: 01-3067-5800 Fax: 01-3067-5899 Seoul Branch Seoul, Korea Tel: 02-528-0303 Fax: 02-528-4411 NEC Electronics (France) S.A. NEC Electronics Singapore Pte. Ltd. Madrid Office Madrid, Spain Tel: 091-504-2787 Fax: 091-504-2860 Novena Square, Singapore Tel: 253-8311 Fax: 250-3583 NEC Electronics (Germany) GmbH Duesseldorf, Germany Tel: 0211-65 03 02 Fax: 0211-65 03 490 NEC Electronics (UK) Ltd. Milton Keynes, UK Tel: 01908-691-133 Fax: 01908-670-290 NEC Electronics Hong Kong Ltd. NEC Electronics Taiwan Ltd. NEC Electronics Italiana s.r.l. NEC Electronics (Germany) GmbH Milano, Italy Tel: 02-66 75 41 Fax: 02-66 75 42 99 Scandinavia Office Taeby, Sweden Tel: 08-63 80 820 Fax: 08-63 80 388 Taipei, Taiwan Tel: 02-2719-2377 Fax: 02-2719-5951 NEC do Brasil S.A. Electron Devices Division Guarulhos-SP, Brasil Tel: 11-6462-6810 Fax: 11-6462-6829 J01.2 6 User's Manual U13687EJ1V2UM PREFACE Users This manual is intended for those users who design and develop application systems of the VR4100 Series and VR4300 Series. Purpose This manual explains the functions of RX4000. Organization This manual includes the following: • Overview • Installation • System construction • User own coding part • Interface libraries • Required memory space estimates • Configurator CF4000 • Describing a CF definition file • Information file generation How to read this manual It is assumed that the readers of this manual have general knowledge on electric engineering, logic circuits, microcontrollers, the C language, and the assembly language. To learn the hardware function and instruction function of the VR4100 Series and VR4300 Series → Refer to User's Manual for each product. Notation Note : Explanation of item indicated in the text Caution : Information to which the user should afford special Remark : Numeric value : attention Supplementary information Binary : xxxx or xxxxB Decimal : xxxx Hexadecimal : xxxxH Units for representing powers of 2 (address space or memory space): : 2 10 = 1,024 M (mega) : 2 20 = 1,024 2 G (giga) 30 = 1,024 3 K (kilo) User's Manual U13687EJ1V2UM : 2 7 Related documents Some related documents may be preliminary versions. Note, however, that whether a related document is preliminary is not indicated in this manual. • Documents related to the VR4100 Series Document name TM VR4100 User's Manual Document No. U10050E µPD30100 Data Sheet U10428E VR4102TM User's Manual U12739E µPD30102 Data Sheet U12543E VR4111TM User's Manual U13137E µPD30111 Data Sheet U13211E • Documents related to the VR4300 Series Document name TM TM TM VR4300 , VR4305 , VR4310 User's Manual µPD30200, 30210 Data Sheet Document No. U10504E U10116E • Documents related to development tools (User's manual) Document name RX4000 (Real-Time OS) 8 Document No. Basic U13422E Technical To be prepared Installation This manual RD4000 (Task Debugger) To be prepared AZ4000 (System Performance Analizer) To be prepared User's Manual U13687EJ1V2UM TABLE OF CONTENTS CHAPTER 1 OVERVIEW ........................................................................................................................................... 15 1.1 OUTLINE.................................................................................................................................................... 15 1.2 FEATURES ................................................................................................................................................ 16 1.3 EXECUTION ENVIRONMENT ................................................................................................................... 17 1.4 DEVELOPMENT ENVIRONMENT ............................................................................................................. 18 CHAPTER 2 INSTALLATION .................................................................................................................................... 19 2.1 OUTLINE.................................................................................................................................................... 19 2.2 INSTALLATION PROCEDURE.................................................................................................................. 20 2.3 DIRECTORY STRUCTURE ....................................................................................................................... 21 2.3.1 Object File Distribution Format....................................................................................................... 21 2.3.2 Source File Distribution Format...................................................................................................... 26 CHAPTER 3 SYSTEM CONSTRUCTION.................................................................................................................. 31 3.1 OUTLINE.................................................................................................................................................... 31 3.2 CREATING A CF DEFINITION FILE.......................................................................................................... 34 3.3 GENERATING THE USER OWN CODING PART ..................................................................................... 35 3.4 CREATING PROCESSING PROGRAMS .................................................................................................. 36 3.5 CREATING A LINK DIRECTIVE FILE (ONLY WHEN SUPPORTING THE CCMIPE COMPILER)........... 37 3.6 CREATING A LOAD MODULE.................................................................................................................. 37 CHAPTER 4 USER OWN CODING PART................................................................................................................. 39 4.1 OUTLINE.................................................................................................................................................... 39 4.2 BOOT PROCESSING ................................................................................................................................ 40 4.3 HARDWARE INITIALIZATION SECTION.................................................................................................. 42 4.4 INITIALIZATION HANDLER ...................................................................................................................... 43 4.5 INTERRUPT/EXCEPTION ENTRY ............................................................................................................ 44 CHAPTER 5 INTERFACE LIBRARIES...................................................................................................................... 45 5.1 OUTLINE.................................................................................................................................................... 45 5.2 SYSTEM CALL INTERFACE LIBRARY .................................................................................................... 46 5.3 EXTENDED SVC HANDLER INTERFACE LIBRARY ............................................................................... 46 CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES........................................................................................ 47 6.1 OUTLINE.................................................................................................................................................... 47 6.2 REQUIRED MEMORY SPACE CALCULATION FORMULAS .................................................................. 47 6.2.1 Management Objects ..................................................................................................................... 47 6.2.2 Stack Area for Tasks...................................................................................................................... 49 6.2.3 Stack Area for Interrupt Handlers................................................................................................... 49 User's Manual U13687EJ1V2UM 9 6.2.4 6.3 Memory Pools................................................................................................................................. 49 EXAMPLE ESTIMATE OF REQUIRED MEMORY SPACE........................................................................ 50 CHAPTER 7 CONFIGURATOR CF4000.................................................................................................................... 53 7.1 OUTLINE .................................................................................................................................................... 53 7.2 CONFIGURATION...................................................................................................................................... 54 7.3 OPERATING ENVIRONMENT ................................................................................................................... 54 7.4 LOAD MODULE CREATION PROCEDURE .............................................................................................. 55 7.5 COMMAND INPUT FORMAT ..................................................................................................................... 56 7.5.1 Command Input Format for the CF Definition File Conversion Tool (CF4000)............................... 56 CHAPTER 8 DESCRIBING A CF DEFINITION FILE ................................................................................................. 59 8.1 DECLARATION .......................................................................................................................................... 59 8.2 DESCRIPTION SEQUENCE....................................................................................................................... 61 8.3 CONFIGURATION INFORMATION............................................................................................................ 62 8.4 8.3.1 SIT Information ............................................................................................................................... 62 8.3.2 SCT Information ............................................................................................................................. 65 SPECIFICATION FORMAT FOR SIT INFORMATION ............................................................................... 68 8.4.1 System Information......................................................................................................................... 68 8.4.2 System Maximum Value Information .............................................................................................. 69 8.4.3 System Memory Information........................................................................................................... 70 8.4.4 Task Information............................................................................................................................. 71 8.4.5 Semaphore Information .................................................................................................................. 73 8.4.6 Event Flag Information ................................................................................................................... 74 8.4.7 Mailbox Information ........................................................................................................................ 75 8.4.8 Memory Pool Information................................................................................................................ 76 8.4.9 Interrupt Handler Information.......................................................................................................... 77 8.4.10 Cyclic Handler Information ............................................................................................................. 79 8.4.11 Extended SVC Handler Information................................................................................................ 81 8.4.12 Initialization Handler Information .................................................................................................... 82 8.4.13 Idle Handler Information ................................................................................................................. 83 8.4.14 Exception Handler Information ....................................................................................................... 84 8.4.15 Signal Handler Information ............................................................................................................. 85 8.5 SPECIFICATION FORMAT FOR SCT INFORMATION ............................................................................. 87 8.5.1 Task Management System Call Information................................................................................... 87 8.5.2 Task-Associated Synchronization Management System Call Information ..................................... 87 8.5.3 Synchronous Communication (Semaphore) Management System Call Information...................... 88 8.5.4 Synchronous Communication (Event Flag) Management System Call Information ....................... 88 8.5.5 Synchronous Communication (Mailbox) Management System Call Information ............................ 89 8.5.6 Memory Pool Management System Call Information ..................................................................... 89 8.5.7 Interrupt Processing Management System Call Information .......................................................... 90 8.5.8 Time Management System Call Information................................................................................... 90 8.5.9 System Management System Call Information............................................................................... 91 8.5.10 Signal Handler Management System Call Information ................................................................... 91 8.6 10 DESCRIPTION EXAMPLE ......................................................................................................................... 93 User's Manual U13687EJ1V2UM CHAPTER 9 INFORMATION FILE GENERATION.................................................................................................... 99 9.1 OUTLINE.................................................................................................................................................... 99 9.2 COMMAND INPUT EXAMPLES .............................................................................................................. 101 9.3 MESSAGES ............................................................................................................................................. 102 9.3.1 Fatal Errors .................................................................................................................................. 102 9.3.2 Non-Fatal Errors........................................................................................................................... 103 9.3.3 Warnings...................................................................................................................................... 106 APPENDIX INDEX ................................................................................................................................................... 107 User's Manual U13687EJ1V2UM 11 LIST OF FIGURES (1/2) Figure No. Title Page 2-1 Object File Directory Structure (RX4000 Version for CodeWarrior) .............................................................. 21 2-2 Object File Directory Structure (RX4000 Version for CCMIPE Compiler)...................................................... 24 2-3 Source File Directory Structure (RX4000 Version for CodeWarrior) ............................................................. 26 2-4 Source File Directory Structure (RX4000 Version for CCMIPE Compiler)..................................................... 28 3-1 Example of the System Construction Procedure (When Using CodeWarrior) .............................................. 32 3-2 Example of System Construction Procedure (When Using CCMIPE Compiler)............................................ 33 4-1 Position of Boot Processing........................................................................................................................... 41 4-2 Position of Hardware Initialization Section..................................................................................................... 42 4-3 Position of Initialization Handler..................................................................................................................... 43 5-1 Position of Interface Library ........................................................................................................................... 45 7-1 System Construction Procedure .................................................................................................................... 54 7-2 Example of Activating CF Definition File Conversion Tool............................................................................. 55 7-3 Command Input Format for the CF Definition File Conversion Tool (cf)........................................................ 56 8-1 CF Definition File Description Sequence ....................................................................................................... 61 8-2 System Information Specification Format ...................................................................................................... 68 8-3 System Maximum Value Information Specification Format ........................................................................... 69 8-4 System Memory Information Specification Format ........................................................................................ 70 8-5 Task Information Specification Format .......................................................................................................... 71 8-6 Semaphore Information Specification Format ............................................................................................... 73 8-7 Event Flag Information Specification Format................................................................................................. 74 8-8 Mailbox Information Specification Format...................................................................................................... 75 8-9 Memory Pool Information Specification Format ............................................................................................. 77 8-10 Interrupt Handler Information Specification Format ....................................................................................... 78 8-11 Cyclic Handler Information Specification Format........................................................................................... 79 8-12 Extended SVC Handler Information Specification Format ............................................................................. 81 8-13 Initialization Handler Information Specification Format.................................................................................. 82 8-14 Idle Handler Information Specification Format............................................................................................... 83 8-15 Exception Handler Information Specification Format..................................................................................... 84 8-16 Signal Handler Information Specification Format .......................................................................................... 85 8-17 Task Management System Call Information Specification Format ................................................................ 87 8-18 Task-Associated Synchronization Management System Call Information Specification Format................... 88 8-19 Semaphore Management System Call Information Specification Format ..................................................... 88 8-20 Event Flag Management System Call Information Specification Format....................................................... 89 8-21 Mailbox Management System Call Information Specification Format............................................................ 89 8-22 Memory Pool Management System Call Information Specification Format................................................... 90 8-23 Interrupt Processing Management System Call Information Specification Format........................................ 90 12 User's Manual U13687EJ1V2UM LIST OF FIGURES (2/2) Figure No. Title Page 8-24 Time Management System Call Information Specification Format................................................................ 91 8-25 System Management System Call Information Specification Format............................................................ 91 8-26 Signal Handler Management System Call Information Specification Format ................................................ 92 8-27 Physical Memory Areas Assumed in Description Example ........................................................................... 93 8-28 CF Definition File Description Example......................................................................................................... 94 9-1 Activating the Configurator ............................................................................................................................ 99 9-2 Message Output Format.............................................................................................................................. 102 User's Manual U13687EJ1V2UM 13 LIST OF TABLES Table No. Title Page 2-1 Correspondence between User Development Environment and RX4000 Distribution Media ....................... 19 4-1 Structure of the User Own Coding Part ......................................................................................................... 39 7-1 Configurator Operating Environment ............................................................................................................. 54 8-1 Types of Values ............................................................................................................................................. 60 8-2 Predefined Default System Memory Areas.................................................................................................... 71 14 User's Manual U13687EJ1V2UM CHAPTER 1 OVERVIEW Rapid advances in semiconductor technologies have led to the explosive spread of microprocessors such that they are now to be found in more fields than many would have imagined only a few years ago. In line with this spread, the number of processing programs that must be created for microprocessors is also increasing. This rule of growth makes it difficult to create processing programs specific to given hardware. For this reason, there is a need for operating systems (OSs) that can fully exploit the capabilities of the latest generation of ever-newer high-performance, multi-function microprocessors. Operating systems are broadly classified into two types: program-development OSs and control OSs. ProgramTM TM development OSs are to be found in those environments in which standard OSs (e.g., MOS-DOS , Windows , and TM UNIX OS) predominate because the hardware configuration to be used for development can be limited to some extent (e.g., personal computers). Conversely, control OSs are incorporated into control units. That is, these OSs are found in those environments where standard OSs cannot easily be applied because the hardware configuration varies from system to system and because efficient operation matching the application is required. To satisfy these market demands, NEC has developed and released not only more powerful microprocessors VR4100 Series and VR4300 Series - but also the RX4000 operating system, which allows users to exploit the functions of these high-performance microprocessors and supports the systematic creation of software. RX4000 is a control OS for real-time, multitasking processing; it has been developed to increase the application range of high-performance, multi-function microprocessors and further improve their generality. 1.1 OUTLINE RX4000 is a built-in real-time, multitasking control OS that provides a highly efficient real-time, multitasking environment to increases the application range of processor control units. RX4000 is a high-speed, compact OS capable of being stored in and run from the ROM of a target system. User's Manual U13687EJ1V2UM 15 CHAPTER 1 OVERVIEW 1.2 FEATURES RX4000 has the following features: (1) Conformity with µITRON 3.0 specification RX4000 is designed to conform with the µITRON 3.0 specification that defines a typical built-in control OS architecture. It implements all µITRON 3.0 functions of up to level S, as well as the level E functions, excluding the extended synchronous communication function. The µITRON 3.0 specification applies to a built-in, real-time control OS. (2) High generality In addition to the system calls specified by the µITRON 3.0 specification, RX4000 provides original system calls specific to RX4000, so that it can run on more generalized application systems. RX4000 can be used to create a real-time, multitasking OS that is compact and optimum for the user's needs because the functions (system calls) to be used by the application system can be selected during creating the system. (3) Realization of real-time processing and multitasking RX4000 supports the following functions to realize complete real-time processing and multitasking: • Task management function • Signal handler function • Task-associated synchronization function • Synchronous communication management function • Interrupt handling management function • Memory pool management function • Time management function • System management function • Scheduling function (4) Compact design RX4000 is a real-time, multitasking OS that has been designed on the assumption that it will be incorporated into the target system; it has been made as compact as possible to enable it to be loaded into a system's ROM. (5) Application utility support RX4000 supports the following utility tool to aid in application system construction: • System configurator CF4000 (6) C compiler packages RX4000 corresponds to the following VR Series TM • CodeWarrior C compiler packages: (Metrowerks Co., Ltd.) • CCMIPE Compiler (Green Hills Software (7) TM TM Inc.) Compatibility with RX830 (µITRON Ver. 3.0) and RX850 Pro RX4000 is compatible with RX830 (µITRON Ver. 3.0) and RX850 Pro. 16 User's Manual U13687EJ1V2UM CHAPTER 1 OVERVIEW 1.3 EXECUTION ENVIRONMENT This section explains the processing environment required by RX4000. • Processor VR4100 Series µPD30100 (also referred to as VR4100) µPD30101 (also referred to as VR4101) µPD30102 (also referred to as VR4102) µPD30111 (also referred to as VR4111) VR4300 Series µPD30200 (also referred to as VR4300 or VR4305) µPD30210 (also referred to as VR4310) • Peripheral hardware RX4000 provides sample source files for that portion that is dependent on the hardware configuration of the execution environment (system initialization: boot processing and hardware initialization section). Therefore, simply rewriting the system initialization for each target system eliminates the need to use specific peripheral hardware. • Required memory space The memory space required for RX4000 installation and operation is as follows: Space for nucleus text part : approx. 13K to 23K bytes Space for nucleus data : approx. 1K to 2K bytes The memory space is increased or decreased according to the information set in the CF definition file. The maximum memory space above is required if "maximum priority assignment range" and "use of all functions (system calls) provided by RX4000" are specified as the configuration settings. By restricting the priority assignment range and the RX4000 functions, the required amount of memory space can be reduced. User's Manual U13687EJ1V2UM 17 CHAPTER 1 OVERVIEW 1.4 DEVELOPMENT ENVIRONMENT This section explains the hardware and software environments required to develop application systems using RX4000. (1) Hardware environment (a) Host machine TM • IBM-PC/AT -compatible machine (Windows 95-based) • PC-9800 Series (Windows 95-based) • SPARCstation (2) TM TM TM (SunOS -based, Solaris -based) (to be supported) Software environment (a) C compiler packages • CodeWarrior (Metroworks Co., Ltd.) • CCMIPE Compiler (Green Hills Software Inc.) (b) Debuggers • PARTNER (Kyoto Micro Computer Co., Ltd.) • MULTI (c) TM (Green Hills Software Inc.) Task debugger • RD4000 (NEC Corporation) (d) System performance analyzer • AZ4000 (NEC Corporation) 18 User's Manual U13687EJ1V2UM CHAPTER 2 INSTALLATION This chapter explains how to install the files, stored on the media supplied with RX4000 into the user development environment. 2.1 OUTLINE Two types of RX4000 distribution medium are provided according to the user development environment (host machine); one for the Windows-based environment and the other for the UNIX-base environment. Table 2-1. Correspondence between User Development Environment and RX4000 Distribution Media User development environment (host machine) RX4000 distribution media Windows-base • PC-9800 series • IBM-PC/AT-compatible machine Floppy disk 3.5-inch 2HD FD (1.2 MB format) 3.5-inch 2HC FD (1.44 MB format) UNIX-base CGMT (to be supported) User's Manual U13687EJ1V2UM 19 CHAPTER 2 INSTALLATION 2.2 INSTALLATION PROCEDURE This section describes the procedure for installing the files stored in the RX4000 distribution medium on the user development environment. (1) Starting Windows 95 Turn on the personal computer and peripheral devices to start Windows 95. (2) Opening the Run dialog box The installation of RX4000 is performed using the installer provided with the OS package. From the Start menu, click "Run..." to open the Run dialog box. (3) Loading the distribution media Load the floppy disk into the floppy disk drive. Here, assume that the floppy disk is loaded into drive C. (4) Running the installer In the Run dialog box, click the Browse button and move to drive C. From drive C, choose "setup95.exe" and then click the Open button. This activates the installer, which in turn installs the necessary execution files. Caution Installing RX4000 requires the following amount of free disk space: Object file distribution format : Approximately 2M bytes Source file distribution format : Approximately 1.4M bytes 20 User's Manual U13687EJ1V2UM CHAPTER 2 INSTALLATION 2.3 DIRECTORY STRUCTURE The RX4000 distribution formats are classified into an object file distribution format and a source file distribution format. The directory structures of these formats differ. The following sections describe the directory structures of these formats. 2.3.1 Object File Distribution Format (1) Object file distribution format for the RX4000 version for CodeWarrior Figure 2-1 shows the object file directory structure (RX4000 version for CodeWarrior). Figure 2-1. Object File Directory Structure (RX4000 Version for CodeWarrior) nectools32 bin inc4100 rx4000 inc4300 rx4000 lib4100_mwerks little big lib4300_mwerks little big smp4100_mwerks rx4000 conf4100_little conf4100_big src smp4300_mwerks rx4000 conf4300_little conf4300_big src src rx4000 conf4100_mwerks_little conf4100_mwerks_big conf4300_mwerks_little conf4300_mwerks_big ifl User's Manual U13687EJ1V2UM 21 CHAPTER 2 INSTALLATION (a) nectools32 Directory containing RX4000 (b) nectools32\bin Directory containing the utility (configurator CF4000) supported by RX4000 (c) nectools32\inc4100 : For VR4100 Series nectools32\inc4300 : For VR4300 Series Directory containing header files stdrx.h: Standard header file (for C source file) This header file includes all the header files required by RX4000. (d) nectools32\inc4100\rx4000: For VR4100 Series nectools32\inc4300\rx4000: For VR4300 Series Directory containing RX4000 header files (e) nectools32\lib4100_mwerks: For VR4100 Series nectools32\lib4300_mwerks: For VR4300 Series Directory containing object and library files (f) nectools32\lib4100_mwerks\little: For VR4100 Series nectools32\lib4100_mwerks\big : For VR4100 Series nectools32\lib4300_mwerks\little: For VR4300 Series nectools32\lib4300_mwerks\big : For VR4300 Series Directory containing the object files (32-register mode) and the library files (32-register mode) for RX4000 as below: rxcore.o : Common nucleus part librx.lib : Nucleus library libch.lib : System call interface library (with parameter check function) libnc.lib : System call interface library (without parameter check function) (g) nectools32\smp4100_mwerks: For VR4100 Series nectools32\smp4300_mwerks: For VR4300 Series Directory containing sample applications (h) nectools32\smp4100_mwerks\rx4000: For VR4100 Series nectools32\smp4300_mwerks\rx4000: For VR4300 Series Directory containing RX4000 sample applications 22 User's Manual U13687EJ1V2UM CHAPTER 2 INSTALLATION (i) nectools32\smp4100_mwerks\rx4000\conf4100_little : For VR4100 Series nectools32\smp4100_mwerks\rx4000\conf4100_big : For VR4100 Series nectools32\smp4300_mwerks\rx4000\conf4300_little : For VR4300 Series nectools32\smp4300_mwerks\rx4000\conf4300_big : For VR4300 Series Directory containing the command file for generating load modules from sample applications. Executing the command file contained in this directory creates the following load modules in the current directory: sys.out : Kernel load module ap.out : User program load module sys.out.s : Kernel load module (HEX format) ap.out.s : User program load module (HEX format) (j) nectools32\smp4100_mwerks\rx4000\src: For VR4100 Series nectools32\smp4300_mwerks\rx4000\src: For VR4300 Series Directory containing the source file for sample applications (k) nectools32\src Directory containing source files (l) nectools32\src\rx4000 Directory containing RX4000 source files (m) nectools32\src\rx4000\conf4100_mwerks_little : For VR4100 Series nectools32\src\rx4000\conf4100_mwerks_big : For VR4100 Series nectools32\src\rx4000\conf4300_mwerks_little : For VR4300 Series nectools32\src\rx4000\conf4300_mwerks_big : For VR4300 Series Directory containing the command file used to generate object files and library files for RX4000. Executing the command file in this directory creates the following files in the library: rxcore.o: Common nucleus part librx.lib : Nucleus library libch.lib : System call interface library (with parameter check function) libnc.lib (n) : System call interface library (without parameter check function) nectools32\src\ifl Directory containing the source files for the system call interface libraries (one with the check function and the other without it). (2) Object file distribution format for the RX4000 version for CCMIPE Compiler Figure 2-2 shows the object file directory structure (RX4000 version for CCMIPE Compiler). User's Manual U13687EJ1V2UM 23 CHAPTER 2 INSTALLATION Figure 2-2. Object File Directory Structure (RX4000 Version for CCMIPE Compiler) nectools32 bin inc4100 rx4000 inc4300 rx4000 lib4100_ghs little big lib4300_ghs little big smp4100_ghs rx4000 conf4100_little conf4100_big src smp4300_ghs rx4000 conf4300_little conf4300_big src src rx4000 conf4100_ghs_little conf4100_ghs_big conf4300_ghs_little conf4300_ghs_big ifl (a) nectools32 Directory containing RX4000 (b) nectools32\bin Directory containing the utility (configurator CF4000) supported by RX4000 (c) nectools32\inc4100: For VR4100 Series nectools32\inc4300: For VR4300 Series Directory containing header files stdrx.h: Standard header file (for C source file) This header file includes all the header files required by RX4000. 24 User's Manual U13687EJ1V2UM CHAPTER 2 INSTALLATION (d) nectools32\inc4100\rx4000: For VR4100 Series nectools32\inc4300\rx4000: For VR4300 Series Directory containing RX4000 header files (e) nectools32\lib4100_ghs: For VR4100 Series nectools32\lib4300_ghs: For VR4300 Series Directory containing object and library files (f) nectools32\lib4100_ghs\little : For VR4100 Series nectools32\lib4100_ghs\big : For VR4100 Series nectools32\lib4300_ghs\little: For VR4300 Series nectools32\lib4300_ghs\big : For VR4300 Series Directory containing the object files (32-register mode) and the library files (32-register mode) for RX4000 as below: rxcore.o : Common nucleus part (g) librx.a : Nucleus library libch.a : System call interface library (with parameter check function) libnc.a : System call interface library (without parameter check function) nectools32\smp4100_ghs: For VR4100 Series nectools32\smp4300_ghs: For VR4300 Series Directory containing sample applications (h) nectools32\smp4100_ghs\rx4000: For VR4100 Series nectools32\smp4300_ghs\rx4000: For VR4300 Series Directory containing RX4000 sample applications (i) nectools32\smp4100_ghs\rx4000\conf4100_little : For VR4100 Series nectools32\smp4100_ghs\rx4000\conf4100_big : For VR4100 Series nectools32\smp4300_ghs\rx4000\conf4300_little : For VR4300 Series nectools32\smp4300_ghs\rx4000\conf4300_big : For VR4300 Series Directory containing the command file for generating load modules from sample applications. Executing the command file contained in this directory creates the following load modules in the current directory: sys.out : Kernel load module ap.out : User program load module sys.out.s : Kernel load module (HEX format) ap.out.s : User program load module (HEX format) (j) nectools32\smp4100_ghs\rx4000\src: For VR4100 Series nectools32\smp4300_ghs\rx4000\src: For VR4300 Series Directory containing the source file for sample applications (k) nectools32\src Directory containing source files User's Manual U13687EJ1V2UM 25 CHAPTER 2 INSTALLATION (l) nectools32\src\rx4000 Directory containing RX4000 source files (m) nectools32\src\rx4000\conf4100_ghs_little : For VR4100 Series nectools32\src\rx4000\conf4100_ghs_big : For VR4100 Series nectools32\src\rx4000\conf4300_ghs_little : For VR4300 Series nectools32\src\rx4000\conf4300_ghs_big : For VR4300 Series Directory containing the command file used to generate object files and library files for RX4000. Executing the command file in this directory creates the following files in the library: rxcore.o: Common nucleus part librx.a : Nucleus library libch.a : System call interface library (with parameter check function) libnc.a : System call interface library (without parameter check function) (n) nectools32\src\ifl Directory containing the source files for the system call interface libraries (one with the check function and the other without it). 2.3.2 Source File Distribution Format (1) Source file distribution format for the RX4000 version for CodeWarrior Figure 2-3 shows the source file directory structure (RX4000 version for CodeWarrior). The source file distribution format does not include the source files of the sample programs or those of the system call interface libraries. Use the source file distribution format together with the object file distribution format. Figure 2-3. Source File Directory Structure (RX4000 Version for CodeWarrior) nectools32 inc4100 rx4000 inc4300 rx4000 lib4100_mwerks little big lib4300_mwerks little big src rx4000 conf4100_mwerks_little conf4100_mwerks_big conf4300_mwerks_little conf4300_mwerks_big src trace 26 User's Manual U13687EJ1V2UM CHAPTER 2 INSTALLATION (a) nectools32 Directory containing RX4000 (b) nectools32\inc4100: For VR4100 Series nectools32\inc4300: For VR4300 Series Directory containing header files stdrx.h: Standard header file (for C source file) This header file includes all the header files required by RX4000. (c) nectools32\inc4100\rx4000: For VR4100 Series nectools32\inc4300\rx4000: For VR4300 Series Directory containing RX4000 header files (d) nectools32\lib4100_mwerks: For VR4100 Series nectools32\lib4300_mwerks: For VR4300 Series Directory containing object and library files (e) nectools32\lib4100_mwerks\little : For VR4100 Series nectools32\lib4100_mwerks\big : For VR4100 Series nectools32\lib4300_mwerks\little : For VR4300 Series nectools32\lib4300_mwerks\big : For VR4300 Series Directory containing the object files (32-register mode) and the library files (32-register mode) for RX4000 as below: (f) rxcore.o: Common nucleus part librx.lib : Nucleus library libch.lib : System call interface library (with parameter check function) libnc.lib : System call interface library (without parameter check function) nectools32\src Directory containing source files (g) nectools32\src\rx4000 Directory containing RX4000 source files (h) nectools32\src\rx4000\conf4100_mwerks_little : For VR4100 Series nectools32\src\rx4000\conf4100_mwerks_big : For VR4100 Series nectools32\src\rx4000\conf4300_mwerks_little : For VR4300 Series nectools32\src\rx4000\conf4300_mwerks_big : For VR4300 Series Directory containing the command file used to generate object files and library files for RX4000. Executing the command file in this directory creates the following files in the library: rxcore.o : Common nucleus part librx.lib : Nucleus library libch.lib : System call interface library (with parameter check function) libnc.lib : System call interface library (without parameter check function) User's Manual U13687EJ1V2UM 27 CHAPTER 2 INSTALLATION (i) nectools32\src\src Directory containing the source files for the system call interface libraries (one with the check function and the other without it). (j) nectools32\src\trace Directory containing the source file for the trace handler. (2) Source file distribution format for the RX4000 version for CCMIPE Compiler Figure 2-4 shows the source file directory structure (RX4000 version for CCMIPE Compiler). Figure 2-4. Source File Directory Structure (RX4000 Version for CCMIPE Compiler) nectools32 inc4100 rx4000 inc4300 rx4000 lib4100_ghs little big lib4300_ghs little big src rx4000 conf4100_ghs_little conf4100_ghs_big conf4300_ghs_little conf4300_ghs_big src trace (a) nectools32 Directory containing RX4000 (b) nectools32\inc4100: For VR4100 Series nectools32\inc4300: For VR4300 Series Directory containing header files stdrx.h: Standard header file (for C source file) This header file includes all the header files required by RX4000. (c) nectools32\inc4000\rx4000: For VR4100 Series nectools32\inc4300\rx4000: For VR4300 Series Directory containing RX4000 header files 28 User's Manual U13687EJ1V2UM CHAPTER 2 INSTALLATION (d) nectools32\lib4100_ghs: For VR4100 Series nectools32\lib4300_ghs: For VR4300 Series Directory containing object and library files (e) nectools32\lib4100_ghs\little : For VR4100 Series nectools32\lib4100_ghs\big : For VR4100 Series nectools32\lib4300_ghs\little : For VR4300 Series nectools32\lib4300_ghs\big : For VR4300 Series Directory containing the object files (32-register mode) and the library files (32-register mode) for RX4000 as below: rxcore.o : Common nucleus part librx.lib : Nucleus library libch.lib : System call interface library (with parameter check function) libnc.lib : System call interface library (without parameter check function) (f) nectools32\src Directory containing source files (g) nectools32\src\rx4000 Directory containing RX4000 source files (h) nectools32\src\rx4000\conf4100_ghs_little : For VR4100 Series nectools32\src\rx4000\conf4100_ghs_big : For VR4100 Series nectools32\src\rx4000\conf4300_ghs_little : For VR4300 Series nectools32\src\rx4000\conf4300_ghs_big : For VR4300 Series Directory containing the command file used to generate object files and library files for RX4000. Executing the command file in this directory creates the following files in the library: rxcore.o : Common nucleus part librx.lib : Nucleus library libch.lib : System call interface library (with parameter check function) libnc.lib : System call interface library (without parameter check function) (i) nectools32\src\src Directory containing the source files for the system call interface libraries (one with the check function and the other without it). (j) nectools32\src\trace Directory containing the source files for the trace handler. User's Manual U13687EJ1V2UM 29 [MEMO] 30 User's Manual U13687EJ1V2UM CHAPTER 3 SYSTEM CONSTRUCTION This chapter explains how to construct an application system using RX4000. 3.1 OUTLINE System construction involves incorporating created load modules into a target system, using the file group copied from the RX4000 distribution media to the user development environment (host machine). The system construction procedure is outlined below. (1) Creating a CF definition file (2) Generating the user own coding part • Hardware initialization section • Software initialization section • Interrupt/exception entry (3) Creating processing programs • Task • Task-associated handler • Interrupt handler • Cyclic handler • Exception handler • Extended SVC handler • Extended SVC handler interface library (4) Creating a link directive file (RX4000 version for CCMIPE only) (5) Creating a load module • Including ROM information • HEX format (6) Incorporating the load module into the target system Figure 3-1 illustrates an example of the system construction procedure to be performed when using CodeWarrior. Figure 3-2 illustrates an example of the system construction procedure to be performed when using the CCMIPE compiler. User's Manual U13687EJ1V2UM 31 CHAPTER 3 SYSTEM CONSTRUCTION Figure 3-1. Example of the System Construction Procedure (When Using CodeWarrior) CF definition file sys.cf Configurator User task task.c User handler inthdr.c cychdr.c sighdr.c exchdr.c svchdr.c svcif.s idlhdr.s Boot routine boot.s init.c SIT file sit.c SCT file sct.c Entry routine entry.s except.s SCT file sct.o Entry routine entry.o except.o Header file sys.h Compiler/assembler User task task.o User handler inthdr.o cychdr.o sighdr.o exchdr.o svchdr.o svcif.o idlhdr.o Boot routine boot.o init.o SIT file sit.o Link editor Link editor Load module for the user program (including ROM information) ap.out 32 Nucleus library libch.a Runtime Library rxcore.o librx.a User's Manual U13687EJ1V2UM Load module for the kernel (including ROM information) sys.out CHAPTER 3 SYSTEM CONSTRUCTION Figure 3-2. Example of System Construction Procedure (When Using CCMIPE Compiler) CF definition file sys.cf Configurator User task task.c User handler inthdr.c cychdr.c sighdr.c exchdr.c svchdr.c svcif.mip idlhdr.mip Boot routine boot.mip init.c SIT file sit.c SCT file sct.c Entry routine entry.mip except.mip Header file sys.h Entry routine entry.o except.o Link directive file ap.lnk sys.lnk Compiler/assembler User task task.o User handler inthdr.o cychdr.o sighdr.o exchdr.o svchdr.o svcif.o idlhdr.o Boot routine boot.o init.o SIT file sit.o SCT file sct.o Link editor Nucleus library libch.a Runtime Library rxcore.o librx.a Link editor Load module for the user program (including ROM information) ap.out User's Manual U13687EJ1V2UM Load module for the kernel (including ROM information) sys.out 33 CHAPTER 3 SYSTEM CONSTRUCTION 3.2 CREATING A CF DEFINITION FILE Create an information table (CF definition file) containing data to be distributed to RX4000. The following data is required to create the CF definition file. • Space information − Physical memory information • SIT information The following information is required to run RX4000: − System information − System maximum value information − System memory information − Task information − Semaphore information − Event flag information − Mailbox information − Memory pool information − Interrupt handler information − Cyclic handler information − Extended SVC handler information − Initialization handler information − Idle handler information − Exception handler information − Signal handler information • SCT information The following information is used to identify whether the application system uses the functions (system calls): − Task management function system call information − Task-associated synchronization function system call information − Synchronous communication (semaphore) management function system call information − Synchronous communication (event flag) management function system call information − Synchronous communication (mailbox) management function system call information − Memory pool management function system call information − Interrupt management function system call information − Time management function system call information − System management function system call information − Signal handler management function system call information See Chapter 8 for details of the CF definition file description format. Caution The contents of the configuration definition file (sys.cf) that is supplied as standard with RX4000 must be changed to satisfy the specific needs of the user. 34 User's Manual U13687EJ1V2UM CHAPTER 3 SYSTEM CONSTRUCTION 3.3 GENERATING THE USER OWN CODING PART Generate the functions for processing the part that depends on the environment (of the target application system) for running RX4000, set apart from the RX4000 main program operation. Furthermore, generate those functions that should be provided to make the user software environment more useful and for other specific purposes. • Boot processing (hardware initialization section) This function is provided to initialize the hardware in the environment (of the target application system) for running RX4000. • Initialization handler and idle handler These functions are provided to make the user software environment more useful. • Interrupt/exception entry This function is provided as a routine that is dedicated to the processing of the branch to the interrupt/exception processing management, activated when an interrupt/exception occurs. See Chapter 4 for details of the user own coding part. User's Manual U13687EJ1V2UM 35 CHAPTER 3 SYSTEM CONSTRUCTION 3.4 CREATING PROCESSING PROGRAMS Create the processing (processing programs) required by the system. The processing programs are classified as follows, based on their usage. • Task Minimum unit in which processing programs can be executed under RX4000 control • Interrupt handler An interrupt handler is a routine dedicated to interrupt processing. When the maskable interrupt occurs, this handler is activated upon the completion of the preprocessing by RX4000 (such as saving the contents of the registers or switching the stack) and handled independently of all other tasks. Upon the maskable interrupt occurrence, thus, control is passed to the interrupt handler, stopping the processing of the task being executed, even if that task has the highest priority in the system. • Cyclic handler A cyclic handler is a routine dedicated to cyclic processing. Every time the specified time elapses, this handler is activated immediately. This routine is handled independently of tasks. At the cyclic activation time, thus, control is passed to the cyclic handler, stopping the processing of the task being executed, even the task of the highest priority in the system. A cyclic handler incurs a smaller overhead before the start of execution, relative to any other cyclic processing programs written by the user. • Extended SVC handler An extended SVC handler is a processing routine registered with RX4000 to call a function coded by the user as an extended system call. RX4000 positions the extended SVC handler as the continuation of an execution procedure from which the extended SVC handler has been called. Therefore, if an extended SVC handler is called from a task, it is possible to issue only those system calls that can be issued from the task. If an extended SVC handler is called from a non-task, it is possible to issue only those system calls that can be issued from the non-task. Pay careful attention to this point. • Signal handler A signal handler is a routine dedicated to those tasks that process external events (signals) that occur in individual tasks. It is regarded as an extension of the task that experiences the event, and is therefore executed in the same context as that target task. Since the signal handler has the same priority as the target task, the handler and the task are scheduled at the same time. • CPU exception handler A CPU exception handler is a routine dedicated to CPU exception processing. It is activated in response to a CPU exception. RX4000 regards the CPU exception handler as an extension of the processing program in which the CPU exception has occurred. Therefore, if the CPU exception handler is activated by a CPU exception that has occurred in a task, it is possible to issue only those system calls that can be issued from the task. If the CPU exception handler is activated by a CPU exception that has occurred in a non-task, it is possible to issue only those system calls that can be issued from the non-task. Pay careful attention to this point. 36 User's Manual U13687EJ1V2UM CHAPTER 3 SYSTEM CONSTRUCTION • System call exception handler A system call exception handler is a routine dedicated to the system call exception processing, which is activated in response to a system call exception. RX4000 regards the system call exception handler as an extension of the processing program in which the system call exception has occurred. Therefore, if the system call exception handler is activated by a system call exception that has occurred in a task, it is possible to issue only those system calls that can be issued from the task. If the system call exception handler is activated by a system call exception that has occurred in a non-task, it is possible to issue only those system calls that can be issued from the nontask. Pay careful attention to this point. • Idle handler An idle handler is activated when there are no tasks that are in the run or ready state (namely, when the system has no tasks that are to be scheduled by RX4000). The idle handler is a processing routine provided to make the most efficient use of the power mode functions offered by the VR4100 Series. Refer to the RX4000 User's Manual, Fundamental (U13422E) for details of the processing program description format. 3.5 CREATING A LINK DIRECTIVE FILE (ONLY WHEN SUPPORTING THE CCMIPE COMPILER) Create the link directive file used to fix the address assignment to be performed by the link editor. For details of the link directive file's format, refer to the user's manual for the C compiler package being used. 3.6 CREATING A LOAD MODULE The processing flow for creating a load module after the necessary files described in Sections 3.2 to 3.5 have been created is shown below. (1) Creating an information file Create the information file (including the system information table, the system call table, and the system information header file) by applying the configurator to the CF definition file. (2) Creating object files Create object files by executing the C compiler or assembler for the following source files: • Information file − System information table − System call table • System initialization − Hardware initialization section (boot processing) − Initialization handler − Interrupt/exception entry User's Manual U13687EJ1V2UM 37 CHAPTER 3 SYSTEM CONSTRUCTION • Processing programs − Task − Interrupt handler − Cyclic handler − Extended SVC handler − Signal handler − CPU exception handler − System call exception handler − Idle handler − Extended SVC handler interface library (3) Creating a load module Create a load module by executing the link editor for the following object files, link directive file, and library files: • Information file − System information table − System call table • System initialization − Hardware initialization section − Interrupt/exception entry − Software initialization section • Processing programs − Task − Signal handler − Interrupt handler − Cyclic handler − Extended SVC handler − Extended SVC handler interface library • Link directive file (RX4000 version for CCMIPE only) • Library files − Common nucleus part − Nucleus library − System call interface library − Runtime library 38 User's Manual U13687EJ1V2UM CHAPTER 4 USER OWN CODING PART This chapter describes the functions and design of the user own coding part. 4.1 OUTLINE The user own coding part is a group of functions provided for processing that part that varies with the user operating environment (of the target application system), set apart from the RX4000 main program operation, thus improving the portability of the RX4000, and making the RX4000 easy to customize. The standard user own coding part should be rewritten according to the user operating environment. Table 4-1 lists the entities that constitute the user own coding part. Table 4-1. Structure of the User Own Coding Part Entity Function name Provided function Boot processing (hardware initialization section) boot System boot processing, hardware initialization Initialization handler initial_handler Adaptive software environment setup Idle handler idle_handler Interrupt/exception entry exception_entry Processing of the branch to the interrupt/exception processing management User's Manual U13687EJ1V2UM 39 CHAPTER 4 USER OWN CODING PART 4.2 BOOT PROCESSING Boot processing is the function allocated to the reset entry of the VR4100 Series and VR4300 Series. Boot processing is performed as the first procedure of the system initialization processing. As provided as standard, the boot processing (function name: boot) executes the following: Note • Setting the system register • Initializing the cache • Setting up the gp and tp registers • Initializing the memory areas, clearing to the state without initial values • Invoking the hardware initialization section • Transferring control to the nucleus initialization section Note The system reserves the KI register as the base register for the SBT. Do not set the KI register in the boot processing. Caution The boot processing program (hardware initialization section) that is provided as standard with RX4000 is coded on the assumption that the system operates in one of the environments specified below. Therefore, if the user deploys an operating environment other than those specified below or changes the mode setting of the peripheral controller, the boot processing program needs to be rewritten. • VR4100 Series board produced by Midas Lab Co., Ltd.: RTE- VR4100-PC • VR4300 Series board produced by Midas Lab Co., Ltd.: RTE- VR4300-PC Remark The coding as the standard provision for boot processing is found in the following file (directory): nectools32\smp4100_mwerks\rx4000\src\boot.s nectools32\smp4300_mwerks\rx4000\src\boot.s nectools32\smp4100_ghs\rx4000\src\boot.mip nectools32\smp4300_ghs\rx4000\src\boot.mip Figure 4-1 shows the position of the boot processing. 40 User's Manual U13687EJ1V2UM CHAPTER 4 USER OWN CODING PART Figure 4-1. Position of Boot Processing Reset entry of VR4100/VR4300 Series Boot processing Nucleus Hardware initialization section Nucleus initialization section Initialization handler Scheduler User's Manual U13687EJ1V2UM Task 41 CHAPTER 4 USER OWN CODING PART 4.3 HARDWARE INITIALIZATION SECTION The hardware initialization section is provided to initialize the hardware in the operating environment (of the target application system), which is invoked from the boot processing. As the standard provision, the hardware initialization section (function name: boot) executes the following: • Initializing the peripheral controllers • Returning control to the boot processing Remark The standard hardware initialization section is stored at the following location: nectools32\smp4100_mwerks\rx4000\src\boot.s nectools32\smp4300_mwerks\rx4000\src\boot.s nectools32\smp4100_ghs\rx4000\src\boot.mip nectools32\smp4300_ghs\rx4000\src\boot.mip Figure 4-2 shows the positioning of the hardware initialization section. Figure 4-2. Position of Hardware Initialization Section Reset entry of VR4100/VR4300 Series Boot processing Nucleus Hardware initialization section Nucleus initialization section Initialization handler Scheduler 42 User's Manual U13687EJ1V2UM Task CHAPTER 4 USER OWN CODING PART 4.4 INITIALIZATION HANDLER The initialization handler is provided to make the user software environment more useful, which is invoked from the nucleus initialization section. The initialization handler (function name: initial-handler) that is provided as standard with RX4000 does not perform any specific processing. Caution The user is required to rewrite the contents of the standard initialization handler as necessary. Remark The coding provided as standard for the initialization handler is found in the following file (directory): nectools32\smp4100_mwerks\rx4000\src\init.c nectools32\smp4300_mwerks\rx4000\src\init.c nectools32\smp4100_ghs\rx4000\src\init.c nectools32\smp4300_ghs\rx4000\src\init.c Figure 4-3 shows the position of the initialization handler. Figure 4-3. Position of Initialization Handler Reset entry of VR4100/VR4300 Series Boot processing Nucleus Hardware initialization section Nucleus initialization section Initialization handler Scheduler User's Manual U13687EJ1V2UM Task 43 CHAPTER 4 USER OWN CODING PART 4.5 INTERRUPT/EXCEPTION ENTRY The interrupt/exception entry is provided as the instruction of the branch to the interrupt/exception processing management, activated when an interrupt/exception occurs. It is allocated to the handler address held by the VR4000 Series. In the standard configuration, the interrupt/exception entry executes the following: • Jump to the entry of the interrupt/exception processing management (in the RX4000). Caution The user is required to rewrite the contents of the standard interrupt/exception entry as necessary. Remark The coding provided as standard for interrupt/exception entry is found in the following file (directory): nectools32\smp4100_mwerks\rx4000\src\entry.s nectools32\smp4100_mwerks\rx4000\src\except.s nectools32\smp4300_mwerks\rx4000\src\entry.s nectools32\smp4300_mwerks\rx4000\src\except.s nectools32\smp4100_ghs\rx4000\src\entry.mip nectools32\smp4100_ghs\rx4000\src\except.mip nectools32\smp4300_ghs\rx4000\src\entry.mip nectools32\smp4300_ghs\rx4000\src\except.mip 44 User's Manual U13687EJ1V2UM CHAPTER 5 INTERFACE LIBRARIES This chapter describes the interface libraries provided by RX4000. 5.1 OUTLINE RX4000 provides an interface library that is positioned between the user's processing program and the nucleus of RX4000. The interface library performs the data setting and other processing required for the nucleus to carry out its functions, before passing control to the nucleus. Processing programs (tasks, non-tasks) coded in C are generated in the external function format which is used to issue system calls and call extended SVC handlers. The format for issue (to the nucleus), which can be recognized by the nucleus, however, differs from the external function format. This necessitates a procedure (interface) for converting the external function format, used to issue system calls and to call extended SVC handlers, into a format that can be issued to the nucleus. This type of interface between a processing program and the nucleus is provided for each system call. The interface library contains a collection of such interfaces. Figure 5-1 shows the interface library position. Figure 5-1. Position of Interface Library Task System call issue Interface library External function format Interface processing Nucleus Format for issue to the nucleus System call processing The use of the interface library makes it easy to separate the nucleus from the processing programs of the user. For instance, if a need to modify the user's processing programs arises after the nucleus has been stored in ROM, it is unnecessary to modify the contents of ROM in which the nucleus is stored. Also, the user can create load modules while separating them into different sections. RX4000 provides interface libraries for the following two VR Series C compiler packages: • CodeWarrior (produced by Metrowerks Co., Ltd.) • CCMIPE compiler (produced by Green Hills Software, Inc.) User's Manual U13687EJ1V2UM 45 CHAPTER 5 INTERFACE LIBRARIES 5.2 SYSTEM CALL INTERFACE LIBRARY The main operation of the system call interface library is detailed below. The method of system call parameter hand-over, however, complies with the C compiler used. • Saves the address setting for the return from the system call into the ra ($31) register. • Sets E_OK = 0 in the v0 ($2) register. • Sets the system call function number in the v1 ($3) register. • Checks the system call parameters. • Transfers control to the system call entry by using the syscall statement. If an error is detected as the result of the system call parameter check, the interface library executes the following: • Sets the error code associated with the detected error into the v0 ($2) register. • Transfers control to the system call entry by using the syscall statement. 5.3 EXTENDED SVC HANDLER INTERFACE LIBRARY The main operation of the extended SVC handler interface library is detailed below. The method of extended SVC handler parameter hand-over, however, complies with the C compiler being used. • Saves the address setting for the return from the extended SVC handler into the ra ($31) register. • Sets E_OK = 0 in the v0 ($2) register. • Sets the extended SVC handler function number in the v1 ($3) register. • Checks the extended SVC handler parameters. • Transfers control to the extended SVC handler entry by using the syscall statement. If an error is detected as a result of the extended SVC handler parameter check, the interface library executes the following: • Sets the error code associated with the detected error into the v0 ($2) register. • Transfers control to the system call entry by using the syscall statement. 46 User's Manual U13687EJ1V2UM CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES This chapter provides information to help you to estimate the total memory space required for the RX4000 management region (system memory region and user memory region). 6.1 OUTLINE The RX4000 management region is divided into two regions: system memory and user memory. • System memory region The system memory region consists of System Memory Pool. The management objects, the stack area for tasks, and the stack area for interrupt handlers are allocated to this region. • User memory region The user memory region consists of User Memory Pool, to which memory pools are allocated. 6.2 REQUIRED MEMORY SPACE CALCULATION FORMULAS 6.2.1 Management Objects The formulas provided in this section are used to calculate the memory space (in units of bytes) required for the management objects. The whole management object area, which should be allocated to the system memory, is estimated as the sum of the values calculated using these formulas. • System base table (SBT) SBT_SIZ = align4(320 + align32(pri_lvl + 4)/8) + {(pri_lvl + 4) x 4)} Remarks 1. pri_lvl corresponds to the value assigned when you define the task priority range in the system maximum value information as one of the RX4000 configuration settings. 2. SBT_SIZ corresponds to the memory size of the system base table (SBT). • Task management block TSK_SIZ = tsk_cnt x 80 Remark tsk_cnt corresponds to the value assigned when you define the maximum number of tasks that can be created in the system maximum value information as one of the RX4000 configuration settings. User's Manual U13687EJ1V2UM 47 CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES • Semaphore management block SEM_SIZ = sem_cnt x 32 Remark sem_cnt corresponds to the value assigned when you define the maximum number of semaphores that can be created in the system maximum value information as one of the RX4000 configuration settings. • Event flag management block FLG_SIZ = flg_cnt x 32 Remark flg_cnt corresponds to the value assigned when you define the maximum number of event flags that can be created in the system maximum value information as one of the RX4000 configuration settings. • Mailbox management block MBX_SIZ = mbx_cnt x 32 Remark mbx_cnt corresponds to the value assigned when you define the maximum number of mailboxes that can be created in the system maximum value information as one of the RX4000 configuration settings. • Memory pool management block MPL_SIZ = mpl_cnt x 32 Remark mpl_cnt corresponds to the value assigned when you define the maximum number of memory pools that can be created in the system maximum value information as one of the RX4000 configuration settings. • Time management block for cyclic wake-up CYC_SIZ = cyc_cnt x 48 Remark cyc_cnt corresponds to the value assigned when you define the maximum number of cyclic handlers that can be created in the system maximum value information as one of the RX4000 configuration settings. • Extended SVC handler management block SVC_SIZ = svc_cnt x 16 Remark svc_cnt corresponds to the value assigned when you define the maximum number of extended SVC handlers that can be created in the system maximum value information as one of the RX4000 configuration settings. 48 User's Manual U13687EJ1V2UM CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES 6.2.2 Stack Area for Tasks The formula of calculating the memory space (in units of bytes) required for the stack area per task is given below. The entire stack area for tasks, which should be allocated to the system memory, is estimated as the sum of the stack areas for all tasks, each of which is calculated by using the following formula: STK_SIZ = align4(stk_siz + 108) Caution The 108 bytes shown in the above formula correspond to the task context size plus the stack management table size. Therefore, stk_siz must include the size of the register in which data is saved in the event of an interrupt. The frame size of the register in which data is saved if an OS interrupt occurs is 80 bytes. stk_siz corresponds to the value assigned when you define the stack data for a task in the task information, or the value assigned when you define the stack size as the task generation data at cre_tsk system call issue. 6.2.3 Stack Area for Interrupt Handlers The following formula should be used to calculate the memory space (in units of bytes) required for the stack area for interrupt handlers: INTSTK_SIZ = align4(intstk_siz) Caution intstk_siz corresponds to the value assigned when you define the stack data for interrupt handler in the system information as one of the RX4000 configuration settings. 6.2.4 Memory Pools The formula of calculating the memory space (in units of bytes) required for each memory pool is given below. The entire memory pool area, which should be allocated to the user memory, is estimated as the sum of the memory pool areas, each of which is calculated by using the following formula: MPL_SIZ = align4(mpl_siz) Caution mpl_siz corresponds to the value assigned when you define the memory pool information as one of the RX4000 configuration settings, or the value assigned when you define the memory pool size in the memory pool information at cre_mpl system call issue. User's Manual U13687EJ1V2UM 49 CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES 6.3 EXAMPLE ESTIMATE OF REQUIRED MEMORY SPACE This section describes how to estimate the memory space required for the RX4000 management region (system memory region and user memory region). [Prerequisites] • System information Stack data for interrupt handlers: Memory area of 0x100 bytes must be reserved in System Memory Pool. • System maximum value information Task priority range : 0xf Maximum number of tasks that can be created : 0x2 Maximum number of semaphores that can be created : 0x1 Maximum number of event flags that can be created : 0x2 Maximum number of mailboxes that can be created : 0x3 Maximum number of indirectly activated interrupt handlers that can be created : 0x4 Maximum number of memory pools that can be created : 0x2 Maximum number of cyclic handlers that can be registered : 0x1 Maximum number of extended SVC handlers that can be registered : 0x1 • Task information Stack data for task: A memory area of 0x100 bytes must be reserved in System Memory Pool. • Memory pool information Memory pool information: A memory area of 0x1000 bytes must be reserved in User Memory Pool. Caution It is assumed that the cre_tsk and cre_mpl system calls have not been issued in the user processing program. [Estimating method] • Management objects OBJ_SIZ = {align4(320 + align32(0xf + 4)/8)} + {(0xf + 4) x 4} + {0x2 x 80} + {0x1 x 32} + {0x2 x 32} + {0x3 x 32} + {0x2 x 32} + {0x1 x 48} + {0x1 x 16} = 908 • Stack area for tasks STK_SIZ = {align4(0x100 + 108) + align16(0x100 + 108)} = 728 • Stack area for interrupt handlers INTSTK_SIZ = 256 50 User's Manual U13687EJ1V2UM CHAPTER 6 REQUIRED MEMORY SPACE ESTIMATES • Memory pools MPL_SIZ = 0x1000 + 0x2000 = 12,288 From the above calculation, the following RX4000 management region is estimated to be required: System memory region System Memory Pool: 1,892 bytes User memory region User Memory Pool: 12,288 bytes User's Manual U13687EJ1V2UM 51 [MEMO] 52 User's Manual U13687EJ1V2UM CHAPTER 7 CONFIGURATOR CF4000 This chapter explains the role and operating environment of configurator CF4000. 7.1 OUTLINE When RX4000 is used to construct a system, information files (system information table, system call table, and system information header file) containing data to be distributed to RX4000 become necessary. Because the data arrangement in these information files conforms to a prescribed format they can, in principle, be described using any standard editor. Because, however, the files are relatively difficult to describe and subsequently understand, considerable skill is required to describe them. To overcome this difficulty, therefore, RX4000 provides a utility tool that converts a file (CF definition file) created in a proprietary coding format with improved coding ease, and decodes into an information file. This utility tool is called the configurator. The configurator reads a CF definition file created in a proprietary coding format as the input and outputs an information file, such as a system information table, system call table, and system information header file. The configurator outputs the following information files: • System information table This information file contains the required data (such as basic clock cycle and the task priority range) for RX4000 operation. • System call table This information file contains the data of the optional setting of whether each function (system call) is used by the system. By restricting the functions used by the system, the amount of memory required for RX4000 can be reduced. • System information header file This information file defines the correspondence between object names described in the CF definition file (such as task names and semaphore names) and their ID numbers. User's Manual U13687EJ1V2UM 53 CHAPTER 7 CONFIGURATOR CF4000 7.2 CONFIGURATION The configurator consists of the CF definition file conversion tool (CF4000). In this manual, the CF definition file conversion tool (CF4000) is referred to as the configurator unless otherwise noted. Figure 7-1 shows the system construction procedure using the configurator. Figure 7-1. System Construction Procedure Tasks, handlers, and libraries CF definition file Configurator SIT file SCT file User program Boot routine Header file Boot routine Nucleus library Compiler/assembler SIT file SCT file User program Link editor Kernel and runtime libraries Load module for the user program Load module for the kernel 7.3 OPERATING ENVIRONMENT Table 7-1 defines the system operating environment. Table 7-1. Configurator Operating Environment User development environment (host machine) 54 Operating system PC-9800 Series Windows 95 (MS-DOS prompt) IBM-PC/AT-compatible machine Windows 95 (MS-DOS prompt) SPARCstation UNIX (SunOSTM/SolarisTM) (planned) User's Manual U13687EJ1V2UM CHAPTER 7 CONFIGURATOR CF4000 7.4 LOAD MODULE CREATION PROCEDURE The procedure for creating load modules using the configurator is described below. <1> Create a CF definition file based on the specifics of the user's system. The CF definition file is a text file. The sample procedure described herein assumes that the user has created a CF definition file named "cfdef.cf." <2> Create the following three files by using the CF definition file conversion tool (CF4000) of the configurator: • SIT file • SCT file • Header file [Names of the files to be created] • sit.c (SIT file) • sct.c (SCT file) • cf.h (C language header file) Figure 7-2 shows an example illustrating how to activate CF4000. In this example, "A>" represents the shell prompt, and "<↵ ↵>" indicates that the user must press the return key. Figure 7-2. Example of Activating CF Definition File Conversion Tool A>cf4000 –o sit.c –i cf.h –t sct.c cfdef.cf ↵ <3> Create the source file of the user program. <4> Compile the user program source file, SIT file, SCT file, and user own coding part to create object files. <5> Link the object files created in <4> to create load modules. Create the load module for the user program and that for the kernel separately. In this sample procedure, these two load modules are named "user" and "kern," respectively. The load modules consist of the following object files: • user: User program object file, SIT object file, runtime library, and startup routine • kern: Kernel object file and SCT object file <6> Load the load modules into the target machine and execute them. User's Manual U13687EJ1V2UM 55 CHAPTER 7 CONFIGURATOR CF4000 7.5 COMMAND INPUT FORMAT The format of the command specified for the configurator is described below. In the following text describing the command input format, those parameters for which the user can input any given character string are shown in italics. Those activation options enclosed within square brackets "[ ]" can be omitted. 7.5.1 Command Input Format for the CF Definition File Conversion Tool (CF4000) Figure 7-3 shows the input format of the command used to activate the CF definition file conversion tool (CF4000). For file, enter the name of the CF definition file. Usually, the CF definition file name cannot be omitted. However, when the -V or -help option is specified, the CF definition file name can be omitted. Figure 7-3. Command Input Format for the CF Definition File Conversion Tool (cf) A>cf4000 [-n][–o sitfile][–i includefile][-t sctfile][-V][-help] file ↵ -n : Restricts the output of the default files. -o SIT-file-name : Specifies the name of the SIT file. -i header-file-name : Specifies the name of the header file. -t SCT-file-name : Specifies the name of the SCT file. -V : Outputs the version information. -help : Displays brief explanations of individual options. Each option is described in detail below. -n Restricts the output of the default files. Usually, CF4000 outputs the relevant files even if the -o, -i, and -t options are not specified. When the -n option is entered, only those files specified by the -o, -i, and -t options are output. This option cannot be specified more than once. Caution When the -n option is specified, the -o, -i, and -t options specified prior to the -n option become invalid. Therefore, specify the -n option before other options. -o sitfile When the -o option is specified, sitfile is assigned as the SIT file name. When the -o option is omitted, the SIT file is output to the current directory, with the extension of the CF definition file name changed to ".c" (if the file name does not have an extension, ".c" is appended). This option cannot be specified more than once. -i includefile When the -i option is specified, includefile is assigned as the C header file name. When the -i option is omitted, the header file is output to the current directory, with the extension of the CF definition file name changed to ".h" (if the file name does not have an extension, ".h" is appended). This option cannot be specified more than once. 56 User's Manual U13687EJ1V2UM CHAPTER 7 CONFIGURATOR CF4000 -t sctfile When the -t option is specified, sctfile is assigned as the SCT file name. When the -t option is omitted, the SCT file is output to the current directory, with the extension of the CF definition file name changed to ".sct.c" (if the file name does not have an extension, ".sct.c" is appended). This option cannot be specified more than once. -V When the -V option is specified, version information about the CF definition file conversion tool is output to the standard output. The processing carried out intrinsically by the configurator (such as output of the SCT file) is not performed. Remark If the -V and -help options are specified simultaneously, the former option becomes invalid while the latter takes effect. When the -V option is specified, all other options become invalid. -help When the -help option is specified, brief explanations of the individual options of the CF definition file conversion tool are output to the standard output. The processing performed intrinsically by the configurator (such as output of the SCT file) is not performed. Remark If the -V and -help options are specified simultaneously, the former option becomes invalid while the latter takes effect. When the -help option is specified, all other options become invalid. User's Manual U13687EJ1V2UM 57 [MEMO] 58 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE This chapter describes how to code a CF definition file that is required to create information files (system information table, system call table, and system information header file) using configurator CF4000. 8.1 DECLARATION The following shows how to make the necessary declaration when describing a CF definition file. (1) Elements and character codes (a) Character codes A CF definition file is described in ASCII code. Kanji character codes (SJIS and EUC only) can be used only in comments. (b) Words In a CF definition file, any series of characters that does not contain any blank characters (space code, tab code, or carriage return code) is called a word. In the following explanations, values, symbol names, and keywords are all words. The configurator distinguishes between upper-case and lower-case characters. For example, "ABC," "Abc," and "abc" are handled as three different words. (c) Statements In a CF definition file, a series of words delimited by one or more spaces is called a statement. Since the syntax of a CF definition file is context-free, a carriage return code does not indicate the end of a statement. Instead, a semicolon (;) is placed at the end of a statement. The semicolon cannot be omitted, although it does not need to be preceded or followed by a space. (d) Blocks A group of statements enclosed within brackets ({ and }) is called a block. The two brackets are always used in pairs; omitting either is not allowed. (2) Values Any word beginning with a numerical code is treated as a value. Values are classified as shown in Table 8-1, according to the numerical code that appears at their beginning. Unless otherwise specified, any 32-bit value (0x0 to 0xFFFFFFFF) can be specified. User's Manual U13687EJ1V2UM 59 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Table 8-1. Types of Values Type (3) Numerical code at the beginning Characters used Example Decimal Numerical code other than 0 0 to 9 123 0 689525 Octal 0 0 to 7 0123 0 056712 Hexadecimal 0x 0 to 9, a to f (A to F), x, X 0x12C 0X0 0xabcdef Names Names can be assigned to those resources (tasks and semaphores) defined in a CF definition file. These names can be used as resource IDs in user programs. A name may consist of up to 255 alphanumeric characters (note that it must begin with an alphabetic character). (4) Symbol names Symbol names are distinguished from names according to context. A symbol name indicates the name of a function or variable in a user program. Note, however, that the first character of a symbol name must be an alphabetic character or an underline. (5) Comments Within a CF definition file, all text between "--" and the end of the line is handled as a comment. (6) Keywords The character strings shown below are reserved keywords for use with the configurator. The use of these character strings for any other purpose is prohibited. action addr auto clktim cychdr default defstk eventflag exchdr exinf flgsvc gp id idlehdr initcnt inithdr initptn inthdr intr intstk intsvc intvl kind lang mailbox mask maxcnt maxcyc maxflg maxmbx maxmpl maxpri maxsem maxsvc maxtsk mbxsvc memorypool mplsvc name nouse number pooladdr poolsize pri semaphore semsvc sighdr sigsvc size sncsvc staaddr stack StackPool stacode status svchdr syscall syssvc SystemPool task TA_ASM TA_CPU TA_ENAINT TA_DISINT TA_HLNG TA_MFIFO TA_MPRI TA_SYSCALL TA_TFIFO TA_TPRI TA_WMUL TA_WSGL TCY_OFF TCY_ON timsvc tsksvc TTS_DMT TTS_RDY UserPool waiopt All system call names 60 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE 8.2 DESCRIPTION SEQUENCE Generally, different types of information can be written in a CF definition file in any order. Note that, however, some types of information need to be described before other types of information because of their nature. Figure 8-1 outlines the CF definition file description sequence. Figure 8-1. CF Definition File Description Sequence CF definition file SIT information System information Resource information (task information, semaphore information, mailbox information, etc.) SCT information User's Manual U13687EJ1V2UM 61 CHAPTER 8 DESCRIBING A CF DEFINITION FILE 8.3 CONFIGURATION INFORMATION The configuration information that is described in a CF definition file is divided into the following two main types. • System Information Table (SIT) information Data that is necessary to the operation of RX4000. • System Call Table (SCT) information Data that is used to select whether a system function (system call) is to be used. 8.3.1 SIT Information The SIT information that is described in a CF definition file consists of the following fifteen items. (1) System information The following data is defined as system information. • Basic clock cycle • Operating frequency of the processor • Default stack size for task • Stack size for interrupt handler (2) System maximum value information The following data is defined as system maximum value information. • Task priority range • Maximum number of tasks that can be created • Maximum number of semaphores that can be created • Maximum number of event flags that can be created • Maximum number of mailboxes that can be created • Maximum number of memory pools that can be created • Maximum number of cyclic handlers that can be registered • Maximum number of extended SVC handlers that can be registered (3) System memory information For each system memory, the following data is defined. • System memory name • Start address of system memory • Size of system memory 62 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE (4) Task information For each task, the following data is defined. • Task ID number • Task name • Task initial status • Task activation code • Task extended information • Language used to describe the task • Task activation address • Task initial priority (assigned upon activation) • Interrupt mask status at the time of task activation • Size of stack used by task • GP register-specific value for a task (5) Semaphore information For each semaphore, the following data is defined. • Semaphore ID • Semaphore name • Method used to queue semaphore • Semaphore extended information • Initial resource count for semaphore • Maximum resource count for semaphore (6) Event flag information For each event flag, the following data is defined. • Event flag ID • Event flag name • Whether waiting for multiple tasks is enabled/prohibited • Event flag extended information • Initial bit pattern of event flag (7) Mailbox information For each mailbox, the following data can be defined. • Mailbox ID • Mailbox name • Method used to queue tasks • Method used to queue messages • Mailbox extended information User's Manual U13687EJ1V2UM 63 CHAPTER 8 DESCRIBING A CF DEFINITION FILE (8) Memory pool information For each memory pool, the following data is defined. • Memory pool ID • Memory pool name • Method used to queue tasks • Memory pool extended information • Memory pool size (9) Interrupt handler information For each interrupt handler, the following data is defined. • Interrupt source number • Language used to describe the interrupt handler • Activation address of interrupt handler • GP register-specific value for interrupt handler (10) Cyclic handler information For each cyclic handler, the following data is defined. • Specification number of cyclic handler • Cyclic handler name • Extended information for cyclic handler • Language used to describe the cyclic handler • Initial activation status of cyclic handler • Activation interval for cyclic handler • Activation address of the cyclic handler • GP register-specific value for cyclic handler (11) Extended SVC handler information For each extended SVC handler, the following data is defined. • Function number of extended SVC handler • Extended SVC handler name • Language used to describe the extended SVC handler • Activation address of extended SVC handler • GP register-specific value for extended SVC handler (12) Initialization handler information The following data is defined as initialization handler information. • Language used to describe the initialization handler • Activation address of initialization handler • GP register-specific value for initialization handler 64 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE (13) Idle handler information For each idle handler, the following data is defined. • Language used to describe the idle handler • Activation address of the idle handler • GP register-specific value for the idle handler (14) Exception handler information For each exception handler, the following data is defined. • Language used to describe the exception handler • Activation address of the exception handler • Type of processing performed by the exception handler • GP register-specific value for the exception handler (15) Signal handler information For each signal handler, the following data is defined. • Name of the task to which the signal handler belongs • Language used to describe the signal handler • Activation address of the signal handler • Initial mask value of the signal handler • GP register-specific value for the signal handler 8.3.2 SCT Information The SCT information that is described in a CF definition file consists of the following ten items. (1) Task management system call information Defines, as the task management system call information, the task management system calls used by a user program. The task management system calls supported by RX4000 are listed below. (2) cre_tsk del_tsk sta_tsk ext_tsk exd_tsk ter_tsk dis_dsp ena_dsp chg_pri rot_rdq rel_wai get_tid ref_tsk Task-associated synchronization management system call information Defines, as the task-associated synchronization management system call information, the task-associated synchronization management system calls used by a user program. The task-associated synchronization management system calls supported by RX4000 are listed below. sus_tsk rsm_tsk wup_tsk can_wup frsm_tsk User's Manual U13687EJ1V2UM slp_tsk tslp_tsk 65 CHAPTER 8 DESCRIBING A CF DEFINITION FILE (3) Synchronous communication (semaphore) management system call information Defines, as the semaphore management system call information, the semaphore management system calls used by a user program. The semaphore management system calls supported by RX4000 are listed below. (4) cre_sem del_sem twai_sem ref_sem sig_sem preq_sem wai_sem Synchronous communication (event flag) management system call information Defines, as the event flag management system call information, the event flag management system calls used by a user program. The event flag management system calls supported by RX4000 are listed below. (5) cre_flg del_flg set_flg pol_flg twai_flg ref_flg clr_flg wai_flg Synchronous communication (mailbox) management system call information Defines, as the mailbox management system call information, the mailbox management system calls used by a user program. The mailbox management system calls supported by RX4000 are listed below. (6) cre_mbx del_mbx trcv_msg ref_mbx snd_msg rcv_msg prcv_msg Memory pool management system call information Defines, as memory pool management system call information, the memory pool management system calls used by a user program. The memory pool management system calls supported by RX4000 are listed below. (7) cre_mpl del_mpl rel_blk ref_mpl get_blk pget_blk tget_blk Interrupt processing management system call information Defines, as the interrupt processing management system call information, the interrupt processing management system calls used by a user program. The interrupt processing management system calls supported by RX4000 are listed below. (8) def_int loc_cpu dis_int ena_int unl_cpu chg_ims ref_ims Time management system call information Defines, as the time management system call information, the time management system calls used by a user program. The time management system calls supported by RX4000 are listed below. set_tim get_tim dly_tsk ref_cyc 66 User's Manual U13687EJ1V2UM def_cyc act_cyc CHAPTER 8 DESCRIBING A CF DEFINITION FILE (9) System management system call information Defines, as the system management system call information, the system management system calls used by a user program. The system management system calls supported by RX4000 are listed below. get_ver ref_sys def_svc viss_svc def_exc (10) Signal handler management system call information Defines, as the signal handler management system call information, the signal handler management system calls used by a user program. The signal handler management system calls supported by RX4000 are listed below. vdef_sig vchg_sms vsnd_sig User's Manual U13687EJ1V2UM vref_sms 67 CHAPTER 8 DESCRIBING A CF DEFINITION FILE 8.4 SPECIFICATION FORMAT FOR SIT INFORMATION The following shows the specification format that must be observed when describing SIT information in a CF definition file. In the following explanation, boldface text indicates a reserved word, while italics indicate a value, symbol name, or keyword to be supplied by the user. Where multiple values may be selected and specified, the following conventions are used. • • [X] Value X can be omitted. … The value followed by the three dots may be specified repeatedly. 8.4.1 System Information The system information defines the basic clock cycle, operating frequency, default stack size, and interrupt handler stack size. For a CF definition file, the specification of the system information is required. Figure 8-2 shows the specification format for the system information. Figure 8-2. System Information Specification Format clktim clk_base, clk_freq; defstk dflt_siz; intstk istk_siz; The items constituting the system information are as follows. clk_base Specifies the basic clock cycle (ms). A value of between 0x1 and 0x7fffffff can be specified for clk_base. Remark The basic clock cycle is that cycle at which RX4000 generates the clock interrupts necessary to realize the time management function (cycle rise, delay rise, timeout). clk_freq Specifies the operating frequency of the processor (MHz). A value of between 1 and 1,000 can be specified for clk_freq. dflt_siz Specifies the default stack size (bytes). A value of between 0x0 and 0x7fffffff can be specified for dflt_siz. Remark The default stack size is the smallest task stack size that can exist within the system. If, therefore, at system activation, a static task is generated or if an active task is generated as a result of a cre_tsk system call, and a stack size smaller than the default is specified, that specification is ignored and the default size is used. 68 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE istk_siz Specifies the size of the interrupt handler stack (bytes). A value of between 0x0 and 0x7fffffff can be specified for istk_siz. Remark The interrupt handler stack specified by istk_siz is used for all the interrupt handlers. Therefore, the size specified by istk_siz must be large enough for the interrupt handler that requires the largest interrupt handler stack. Also, when maskable interrupt requests are accepted within the interrupt handlers, istk_siz must specify the interrupt handler stack size, taking interrupt nests into consideration. 8.4.2 System Maximum Value Information The system maximum value information defines the values for the task priority range as well as the maximum number of management objects (tasks, semaphores, cyclic handlers, extended SVC handlers, etc.) that can be created and registered. Figure 8-3 shows the specification format for the system maximum value information. Figure 8-3. System Maximum Value Information Specification Format maxpri max_pri; maxtsk max_tsk; maxsem max_sem; maxflg max_flg; maxmbx max_mbx; maxmpl max_mpl; maxcyc max_cyc; maxsvc max_svc; The items constituting the system maximum value information are as follows. max_pri Specifies the priority range (priority values) for the task. A value of between 0x8 and 0xfc can be specified for max_pri. max_tsk Specifies the maximum number of tasks that can be created. A value of between 0x1 and 0x7fff can be specified for max_tsk. max_sem Specifies the maximum number of semaphores that can be created. A value of between 0x0 and 0x7fff can be specified for max_sem. max_flg Specifies the maximum number of event flags that can be created. A value of between 0x0 and 0x7fff can be specified for max_flg. max_mbx Specifies the maximum number of mailboxes that can be created. A value of between 0x0 and 0x7fff can be specified for max_mbx. User's Manual U13687EJ1V2UM 69 CHAPTER 8 DESCRIBING A CF DEFINITION FILE max_mpl Specifies the maximum number of memory pools that can be created. A value of between 0x0 and 0x7fff can be specified for max_mpl. max_cyc Specifies the maximum number of cyclic handlers that can be registered. A value of between 0x0 and 0x7fff can be specified for max_cyc. max_svc Specifies the maximum number of extended SVC handlers that can be registered. A value of between 0x0 and 0x7fff can be specified for max_svc. 8.4.3 System Memory Information As the system memory information define, for each system memory, data that indicates the system memory name, first address, and size. Figure 8-4 shows the specification format for the system memory information. Figure 8-4. System Memory Information Specification Format pooladdr smem_nam,smem_adr; poolsize smem_nam,smem_siz; The items constituting the system memory information are as follows. smem_nam Specifies the name of the system memory (system memory name). The keywords that can be specified for smem_nam are SystemPool, UserPool, and StackPool. SystemPool : This system memory is assigned the management objects that are required by RX4000 to manage the entire system, the management objects that are required to implement the functions provided by RX4000 (semaphores, event flags, etc.), and the interrupt handler stack defined in the system information at configuration. This is essential for defining the start address of the system pool. UserPool : This system memory is assigned the memory pools defined in the memory pool information at configuration and those that are created by issuing the cre_mpl system call. StackPool : This system memory is assigned the task stacks defined in the task information at configuration and those that are created by issuing the cre_tsk system call. smem_adr Specifies the start address of the system memory. A value of between 0x0 and 0xfffffffc, aligned with a 4-byte boundary, can be specified for smem_adr. smem_siz Specifies the size of the system memory (bytes). A value of between 0x0 and 0xffffffff can be specified for smem_siz. 70 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE Systems that use RX4000 have predefined system memory areas. Table 8-2 shows these predefined system memory areas. Table 8-2. Predefined Default System Memory Areas Pool name Resource for which area is reserved Default size SystemPool Tasks, semaphores, and other management areas, as well as interrupt handler stacks Number of resources of each type × management area + interrupt handler stack size UserPool Memory pool Total static memory pool size StackPool Task stack Total static task stack size 8.4.4 Task Information As the task information define, for each task, data that indicates the ID number, task name, initial status, activation code, extended information, description language, activation address, activation priority, interrupt mask status, stack information, and GP register-specific value. For a CF definition file, the specification of at least one item of task information is required. The number of task information items that can be specified is defined as being within the range of 1 to the maximum number of tasks that can be created, max_tsk, as set in the system information. Figure 8-5 shows the specification format for the task information. Figure 8-5. Task Information Specification Format task { id name status stacode exinf lang staaddr pri intr stack gp tsk_id; tsk_nam; tsk_ists; sta_cd; ext_inf; tsk_lng; tsk_adr; tsk_pri; tsk_intr; stk_siz; tsk_gp; } The items constituting the task information are as follows. tsk_id Specifies the ID number of the task. The values and keywords that can be specified for tsk_id are 0x1 to max_tsk and auto. When auto is specified, the configurator checks the task IDs between 0x1 and max_tsk, and automatically assigns an unused task ID. User's Manual U13687EJ1V2UM 71 CHAPTER 8 DESCRIBING A CF DEFINITION FILE tsk_nam Specifies the name of a task (task name). A task name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The task name defined by tsk_nam can be used in place of a task ID in the user programs. tsk_ists Specifies the initial status of a task. The keywords that can be specified for tsk_ists are TTS_DMT and TTS_RDY. TTS_DMT : The system enters the dormant status upon being activated. TTS_RDY : The system enters the ready status upon being activated. Caution If the initial status of every static task is set to TTS_DMT, it is assumed that there are no active tasks when the system is activated. In this case, an appropriate task must be activated using the initialization handler. sta_cd Specifies the task activation code. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for sta_cd. Caution sta_cd is valid only when TTS_RDY is specified for tsk_ists. It is invalid when TTS_DMT is specified for tsk_ists. tsk_lng Specifies the language used to describe a task. The keywords that can be specified for tsk_lng are TA_HLNG and TA_ASM. TA_HLNG : A task is described in C. TA_ASM : A task is described in assembly language. tsk_adr Specifies the activation address for a task. A value of between 0x0 and 0xfffffffc, aligned with a 4-byte boundary, can be specified for tsk_adr. Alternatively, a symbol name can be specified. Caution When specifying a symbol name for tsk_adr, enter the label name to be used when writing in assembly language. A C function name can also be specified. ext_inf Specifies the extended information for a task. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for ext_inf. Caution ext_inf is provided to enable the specification of user own information for the relevant task. The user can specify it as necessary. The value specified for ext_inf can be dynamically allocated upon the issue of a ref_tsk system call by a processing program (task/nontask). tsk_pri Specifies the initial priority for a task. A value of between 0x1 and maximum task priority max_pri can be specified for tsk_pri. 72 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE tsk_intr Specifies the interrupt mask status at task activation. The keywords that can be specified for tsk_intr are TA_ENAINT and TA_DISINT. stk_siz TA_ENAINT : All interrupts are enabled at task activation. TA_DISINT : All interrupts are disabled at task activation. Specifies the stack size (bytes) to be used by a task. The values and keywords that can be specified for stk_siz are 0x0 to 0x7fffffff and default. When default is specified, the default stack size (dflt_siz) defined in the system information is assumed automatically. If a value smaller than that defined by dflt_siz is specified, the system automatically changes the specified value to the dflt_siz value. tsk_gp Specifies a GP register-specific value for a task. A value of between 0x0 and 0xfffffffc aligned with a 4-byte boundary, or a symbol name, can be specified for tsk_gp while, as a keyword, nouse can be specified. When specifying a symbol name for tsk_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. An offset value may be specified in the following format: "symbol name + value." nouse : A GP register-specific value is not set. 8.4.5 Semaphore Information As the semaphore information define, for each semaphore, data that indicates the ID number, semaphore name, task queuing method, extended information, initial resource count, and maximum resource count. The number of semaphore information items that can be specified is defined as being within the range of 0 to the maximum number of semaphores that can be created, max-sem, as set in the system maximum value information. Figure 8-6 shows the specification format for the semaphore information. Figure 8-6. Semaphore Information Specification Format semaphore { id name waiopt exinf initcnt maxcnt sem_id; sem_nam; twai_opt; ext_inf; init_cnt; max_cnt; } The items constituting the semaphore information are as follows. sem_id Specifies the ID of a semaphore. The values and keywords that can be specified for sem_id are 0x1 to max_sem (maximum number of semaphores that can be created) and auto. When auto is specified, the configurator checks the semaphore IDs between 0x1 and max_sem, and automatically assigns an unused semaphore ID. User's Manual U13687EJ1V2UM 73 CHAPTER 8 DESCRIBING A CF DEFINITION FILE sem_nam Specifies the name of a semaphore (semaphore name). A semaphore name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The semaphore name defined by sem_nam can be used in place of a semaphore ID in the user programs. twai_opt Specifies the task queuing method. The keywords that can be specified for the queuing method are TA_TFIFO and TA_TPRI. TA_TFIFO : Tasks are queued in the same order as that in which resource allocation is requested. TA_TPRI ext_inf : Tasks are queued in order of their priority. Specifies the extended information for the semaphore. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for ext_inf. Caution ext_inf is provided to enable the specification of user own information for the relevant semaphore. The user can specify it as necessary. The value specified for ext_inf can be dynamically allocated upon the issue of a ref_sem system call by a processing program (task/nontask). init_cnt Specifies the initial resource count for a semaphore. A value of between 0x0 and the maximum resource count for a semaphore, max_cnt, can be specified for init_cnt. max_cnt Specifies the maximum resource count for a semaphore. A value of between 0x1 and 0x7fffffff can be specified for max_cnt. 8.4.6 Event Flag Information As the event flag information, define an ID number, event flag name, number of tasks that can be placed in the waiting queue, extended information, and the initial bit pattern for each event flag. The number of event flag information items that can be specified is defined as being within the range of 0 to the maximum number of event flags that can be created, max_flg, as set in the system maximum value information. Figure 8-7 shows the specification format for the event flag information. Figure 8-7. Event Flag Information Specification Format eventflag { id name waiopt exinf initptn } 74 fig_id; fig_nam; twai_opt; ext_inf; init_ptn; User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE The items constituting the event flag information are as follows. fig_id Specifies an ID for an event flag. The values and keywords that can be specified for fig_id are 0x1 to max_flg (maximum number of event flags) and auto. When auto is specified, the configurator checks the event flag IDs between 0x1 and max_flg, and automatically assigns an unused event flag ID. fig_nam Specifies the name of an event flag (event flag name). An event flag name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The event flag name defined by fig_nam can be used in place of an event flag ID in the user programs. twai_opt Specifies the number of tasks that can be simultaneously placed in the waiting queue. The keywords that can be specified for twai_opt are TA_WSGL and TA_WMUL. ext_inf TA_WSGL : Only one task can be placed in the waiting queue. TA_WMUL : Two or more tasks can be simultaneously placed in the waiting queue. Specifies the extended information for the event flag. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for ext_inf. Caution ext_inf is provided to enable the specification of user own information for the relevant event flag. The user can specify it as necessary. The value specified for ext_inf can be dynamically allocated upon the issue of a ref_flg system call by a processing program (task/nontask). init_ptn Specifies the initial bit pattern (32-bit width) for the event flag. A value of between 0x0 and 0xffffffff can be specified for init_ptn. 8.4.7 Mailbox Information As the mailbox information define, for each mailbox, data that indicates the ID number, mailbox name, task queuing method, message queuing method, and extended information. The number of mailbox information items that can be specified is defined as being within the range of 0 to the maximum number of mailboxes that can be created, max_mbx, as set in the system maximum value information. Figure 8-8 shows the specification format for the mailbox information. Figure 8-8. Mailbox Information Specification Format mailbox { id name waiopt exinf mbx_id; mbx_nam; twai_opt mwai_opt; ext_inf; } User's Manual U13687EJ1V2UM 75 CHAPTER 8 DESCRIBING A CF DEFINITION FILE The items constituting the mailbox information are as follows. mbx_id Specifies an ID number for a mailbox. A value of between 0x1 and the maximum number of mailboxes that can be created, max_mbx, or auto, can be specified for mbx_id. When auto is specified, the configurator automatically assigns an unused ID number between 0x1 and max_mbx. mbx_nam Specifies the name of a mailbox (mailbox name). A mailbox name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The mailbox name defined by mbx_nam can be used in place of a mailbox ID in the user programs. twai_opt Specifies the task queuing method. The keywords that can be specified for twai_opt are TA_TFIFO and TA_TPRI. TA_TFIFO : Tasks are queued in the same order as that in which message reception is TA_TPRI : Tasks are queued according to their priority. requested. mwai_opt Specifies the message queuing method. The keywords that can be specified for mwai_opt are TA_MFIFO and TA_MPRI. TA_MFIFO : Messages are queued in the same order as that in which they are transmitted. TA_MPRI ext_inf : Messages are queued according to their priority. Specifies the extended information for the mailbox. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for ext_inf. Caution ext_inf is provided to enable the specification of user own information for the relevant mailbox. The user can specify it as necessary. The value specified for ext_inf can be dynamically allocated upon the issue of a ref_mbx system call by a processing program (task/nontask). 8.4.8 Memory Pool Information As the memory pool information define, for each memory pool, data that indicates the ID number, memory pool name, extended information, task queuing method, and size. The number of memory pool information items that can be specified is defined as being within the range of 0 to the maximum number of memory pools that can be created, max_mpl, as set in the system maximum value information. Figure 8-9 shows the specification format for the memory pool information. 76 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-9. Memory Pool Information Specification Format memorypool { id name exinf waiopt size } mpl_id; mpl_nam; ext_inf; twai_opt; mpl_siz; The items constituting the memory pool information are as follows. mpl_id Specifies an ID number for a memory pool. A value of between 0x1 and the maximum number of memory pools that can be created, max_mpl, or auto, can be specified for mpl_id. When auto is specified, the configurator automatically assigns an unused ID number between 0x1 and max_mpl. mpl_nam Specifies the name of a memory pool (memory pool name). A memory pool name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The memory pool name defined by mpl_nam can be used in place of a memory pool ID in the user programs. ext_inf Specifies the extended information for the memory pool. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for ext_inf. Caution ext_inf is provided to enable the specification of user own information for the relevant memory pool. The user can specify it as necessary. The value specified for ext_inf can be dynamically allocated upon the issue of a ref_mpl system call by a processing program (task/nontask). twai_opt Specifies the task queuing method. The keywords that can be specified for twai_opt are TA_TFIFO and TA_TPRI. TA_TFIFO : Tasks are queued in the same order as that in which the allocation of memory blocks is requested. TA_TPRI mpl_siz : Tasks are queued according to their priority. Specifies the memory pool size. A value of between 0x1 and 0x7fffffff can be specified for mpl_siz. 8.4.9 Interrupt Handler Information As the interrupt handler information define, for each interrupt handler, data that indicates the interrupt source, description language, activation address, and GP register-specific value. For each interrupt source, a single item of interrupt handler information can be defined. Figure 8-10 shows the specification format for the interrupt handler information. User's Manual U13687EJ1V2UM 77 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-10. Interrupt Handler Information Specification Format inthdr { number lang addr gp int_num; hdr_lng; hdr_adr; hdr_gp; } The items constituting the interrupt handler information are as follows. int_num Specifies the interrupt source of the maskable interrupt for which the interrupt handler is to be registered. A value of between 0x0 and 0x6 can be specified for int_num. 0x0: Software interrupt 0 0x1: Software interrupt 1 0x2: Normal external interrupt 0 0x3: Normal external interrupt 1 0x4: Normal external interrupt 2 0x5: Normal external interrupt 3 0x6: Normal external interrupt 4 Caution RX4000 implements its software timer using interrupt source 0x7 (timer interrupt). Do not register the interrupt handler corresponding to interrupt source 0x7. Any attempt to do so will result in an error. hdr_lng Specifies the language used to describe the interrupt handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. hdr_adr TA_HLNG : The interrupt handler is described in C. TA_ASM : The interrupt handler is described in assembly language. Specifies the activation address of the interrupt handler. A value of between 0x0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. specified. 78 User's Manual U13687EJ1V2UM A C function name can also be CHAPTER 8 DESCRIBING A CF DEFINITION FILE hdr_gp Specifies the GP register-specific value for the interrupt handler. The values and keywords that can be specified for hdr_gp are 0x0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 8.4.10 Cyclic Handler Information As the cyclic handler information define, for each cyclic handler, data that indicates the specification number, cyclic handler name, extended information, description language, initial activation status, activation interval, activation address, and GP register-specific value. The number of cyclic handler information items that can be specified is defined as being within the range of 0 to the maximum number of cyclic handlers that can be registered, max_cyc, as set in the system maximum value information. Figure 8-11 shows the specification format for the cyclic handler information. Figure 8-11. Cyclic Handler Information Specification Format cychdr { number name exinf lang action intvl addr gp cyc_num; cyc_nam; ext_inf; hdr_lng; cyc_act; cyc_tim; hdr_adr; hdr_gp; } The items constituting the cyclic handler information are as follows. cyc_num Specifies the specification number for the cyclic handler. A value of between 0x1 and the maximum number of cyclic handlers that can be registered, max_cyc, can be specified for cyc_num. cyc_nam Specifies the name of a cyclic handler (cyclic handler name). A cyclic handler name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The cyclic handler name defined by cyc_nam can be used in place of a cyclic handler specification number in a user program. User's Manual U13687EJ1V2UM 79 CHAPTER 8 DESCRIBING A CF DEFINITION FILE ext_inf Specifies the extended information for the cyclic handler. A value of between 0x0 and 0xffffffff, or a symbol name, can be specified for ext_inf. Caution ext_inf is provided to enable the specification of user own information for the relevant cyclic handler. The user can specify it as necessary. The value specified for ext_inf can be dynamically allocated upon the issue of a ref_cyc system call by a processing program (task/nontask). hdr_lng Specifies the language used to describe the cyclic handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. cyc_act TA_HLNG : The cyclic handler is described in C. TA_ASM : The cyclic handler is described in assembly language. Specifies the initial activation status of the cyclic handler. The keywords that can be specified for cyc_act are TCY_ON and TCY_OFF. cyc_tim TCY_ON : At system activation, the activation status is set to ON. TCY_OFF : At system activation, the activation status is set to OFF. Specifies the activation interval (in milliseconds) for the cyclic handler. A value of between 0 and 0x7fffffff can be specified for cyc_tim. hdr_adr Specifies the activation address of the cyclic handler. A value of between 0x0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. A C function name can also be specified. hdr_gp Specifies a GP register-specific value for the cyclic handler. The values and keywords that can be specified for hdr_gp are 0x0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 80 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE 8.4.11 Extended SVC Handler Information As the extended SVC handler information define, for each extended SVC handler, data that indicates the function number, extended SVC handler name, description language, activation address, and GP register-specific value. The number of extended SVC handler information items that can be specified is defined as being within the range of 0 to the maximum number of extended SVC handlers that can be registered, max_svc, as set in the system maximum value information. Figure 8-12 shows the specification format for the extended SVC handler information. Figure 8-12. Extended SVC Handler Information Specification Format svchdr { number name lang addr gp svc_num; svc_nam; hdr_lng; hdr_adr; hdr_gp; } The items constituting the extended SVC handler information are as follows. svc_num Specifies the extended function code for the extended SVC handler. A value of between 0x1 and the maximum number of extended SVC handlers that can be registered, max_svc, can be specified for svc_num. svc_nam Specifies the name of an extended SVC handler (extended SVC handler name). An extended SVC handler name is a character string that begins with an alphabetic character. Its maximum length is 255 characters. The extended SVC handler name defined by svc_nam can be used in place of an extended SVC handler function number in the user programs. hdr_lng Specifies the language used to describe the extended SVC handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. hdr_adr TA_HLNG : The extended SVC handler is described in C. TA_ASM : The extended SVC handler is described in assembly language. Specifies the activation address of the extended SVC handler. A value of between 0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. A C function name can also be specified. User's Manual U13687EJ1V2UM 81 CHAPTER 8 DESCRIBING A CF DEFINITION FILE hdr_gp Specifies a GP register-specific value for the extended SVC handler. The values and keywords that can be specified for hdr_gp are 0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 8.4.12 Initialization Handler Information As the initialization handler information define, for each initialization handler, data that indicates the description language, activation address, and GP register-specific value. A single item of initialization handler information can be defined. Figure 8-13 shows the specification format for the initialization handler information. Figure 8-13. Initialization Handler Information Specification Format inithdr { lang addr gp } hdr_lng; hdr_adr; hdr_gp; The items constituting the initialization handler information are as follows. hdr_lng Specifies the language used to describe the initialization handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. hdr_adr TA_HLNG : The initialization handler is described in C. TA_ASM : The initialization handler is described in assembly language. Specifies the activation address of the initialization handler. A value of between 0x0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. specified. 82 User's Manual U13687EJ1V2UM A C function name can also be CHAPTER 8 DESCRIBING A CF DEFINITION FILE hdr_gp Specifies a GP register-specific value for the initialization handler. The values and keywords that can be specified for hdr_gp are 0x0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 8.4.13 Idle Handler Information As the idle handler information define, for each idle handler, data that indicates the description language, activation address, and GP register-specific value. Figure 8-14 shows the specification format for the idle handler information. Figure 8-14. Idle Handler Information Specification Format idlehdr { lang addr gp } hdr_lng; hdr_adr; hdr_gp; The items constituting the idle handler information are as follows. hdr_lng Specifies the language used to describe the idle handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. hdr_adr TA_HLNG : The idle handler is described in C. TA_ASM : The idle handler is described in assembly language. Specifies the activation address of the idle handler. A value of between 0x0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. A C function name can also be specified. User's Manual U13687EJ1V2UM 83 CHAPTER 8 DESCRIBING A CF DEFINITION FILE hdr_gp Specifies a GP register-specific value for the idle handler. The values and keywords that can be specified for hdr_gp are 0x0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 8.4.14 Exception Handler Information As the exception handler information define, for each exception handler, data that indicates the description language, activation address, kind of exception and GP register-specific value. For each kind of exception, a single item of exception handler information can be defined. Figure 8-15 shows the specification format for the exception handler information. Figure 8-15. Exception Handler Information Specification Format exchdr { lang addr kind gp hdr_lng; hdr_adr; exc_kind; hdr_gp; } The items constituting the exception handler information are as follows. hdr_lng Specifies the language used to describe the exception handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. hdr_adr TA_HLNG : The exception handler is described in C. TA_ASM : The exception handler is described in assembly language. Specifies the activation address of the exception handler. A value of between 0x0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. A C function name can also be specified. exc_kind Specifies the kind of exception for which the exception handler is to be registered. The keywords that can be specified for exc_kind are TA_CPU and TA_SYSCALL. TA_CPU : The exception handler is activated when a CPU exception occurs. TA_SYSCALL : The exception handler is activated when a system call exception occurs. 84 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE hdr_gp Specifies the GP register-specific value for the exception handler. The values and keywords that can be specified for hdr_gp are 0x0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 8.4.15 Signal Handler Information As the signal handler information define, for each signal handler, data that indicates the task name, description language, activation address, initial mask pattern, and GP register-specific value. Figure 8-16 shows the specification format for the signal handler information. Figure 8-16. Signal Handler Information Specification Format sighdr { task lang addr mask gp } tsk_nam[,tsk_nam,…]; hdr_lng; hdr_adr; init_ptn; hdr_gp; The items constituting the signal handler information are as follows. tsk_nam Specifies the name of the task for which the signal handler is to be registered. The values that can be specified for tsk_nam are those task names defined in the task information. hdr_lng Specifies the language used to describe the signal handler. The keywords that can be specified for hdr_lng are TA_HLNG and TA_ASM. hdr_adr TA_HLNG : The signal handler is described in C. TA_ASM : The signal handler is described in assembly language. Specifies the activation address of the signal handler. A value of between 0x0 and 0xfffffffc, aligned with a four-byte boundary, or a symbol name, can be specified for hdr_adr. Caution When specifying a symbol name for hdr_adr, enter the label name to be used when writing in assembly language. A C function name can also be specified. User's Manual U13687EJ1V2UM 85 CHAPTER 8 DESCRIBING A CF DEFINITION FILE init_ptn Specifies the initial mask pattern (32 bits wide) for the signal handler. A value of between 0x0 and 0xffffffff can be specified for init_ptn. Bit 0 corresponds to signal number 0, while bit 31 corresponds to signal number 31. The bit values have the following meanings. 0: The acceptance of the corresponding signal is allowed. 1: The acceptance of the corresponding signal is prohibited. hdr_gp Specifies a GP register-specific value for the signal handler. The values and keywords that can be specified for hdr_gp are 0x0 to 0xfffffffc, aligned with a four-byte boundary, symbol name, and nouse. When entering a symbol name, an offset value may be specified in "symbol name + value" format. nouse: A GP register-specific value is not set. Caution When specifying a symbol name for hdr_gp, enter the label name to be used when writing in assembly language. A C symbol name can also be specified. 86 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE 8.5 SPECIFICATION FORMAT FOR SCT INFORMATION The following describes the format that must be observed when describing the SCT information in the CF definition file. In the following explanation, boldface text indicates a reserved word, while italics indicate a numeric value, symbol name, or keyword to be supplied by the user. Where multiple values may be selected and specified, the following conventions are used. • [X] Value X can be omitted. • … The value followed by the three dots may be specified repeatedly. 8.5.1 Task Management System Call Information As the task management system call information define, for each system call, data that indicates the task management system calls that are used by a user processing program. All the system calls related to task management can be specified collectively by entering "tsksvc" for the parameter. Figure 8-17 shows the specification format for the task management system call information. Figure 8-17. Task Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall tsksvc; <When specifying all system calls collectively> The items constituting the task management system call information are as follows. svc_nam Specifies a task management system call name. The following keywords can be specified for svc_nam. cre_tsk del_tsk sta_tsk ext_tsk exd_tsk ter_tsk dis_dsp ena_dsp chg_pri rot_rdq rel_wai get_tid ref_tsk 8.5.2 Task-Associated Synchronization Management System Call Information As the task-associated synchronization management system call information define, for each system call, data that indicates the task-associated synchronization management system calls that are used by a user processing program. All the system calls related to task-associated synchronization management can be specified collectively by entering "sncsvc" for the parameter. Figure 8-18 shows the specification format for the task-associated synchronization management system call information. User's Manual U13687EJ1V2UM 87 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-18. Task-Associated Synchronization Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall sncsvc; <When specifying all system calls collectively> The items constituting the task-associated synchronization management system call information are as follows. svc_nam Specifies a task-associated synchronization management system call name. The following keywords can be specified for svc_nam. sus_tsk rsm_tsk wup_tsk can_wup frsm_tsk slp_tsk tslp_tsk 8.5.3 Synchronous Communication (Semaphore) Management System Call Information As the semaphore management system call information define, for each system call, data that indicates the semaphore management system calls that are used by a user processing program. All the system calls related to semaphore management can be specified collectively by entering "semsvc" for the parameter. Figure 8-19 shows the specification format for the semaphore management system call information. Figure 8-19. Semaphore Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall semsvc; <When specifying all system calls collectively> The items constituting the semaphore management system call information are as follows. svc_nam Specifies a semaphore management system call name. The following keywords can be specified for svc_nam. cre_sem del_sem twai_sem ref_sem sig_sem preq_sem wai_sem 8.5.4 Synchronous Communication (Event Flag) Management System Call Information As the event flag management system call information define, for each system call, data that indicates the event flag management system calls that are used by a user processing program. All the system calls related to event flag management can be specified collectively by entering "flgsvc" for the parameter. Figure 8-20 shows the specification format for the event flag management system call information. 88 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-20. Event Flag Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall flgsvc; <When specifying all system calls collectively> The items constituting the event flag management system call information are as follows. svc_nam Specifies an event flag management system call name. The following keywords can be specified for svc_nam. cre_flg del_flg set_flg pol_flg twai_flg ref_flg clr_flg wai_flg 8.5.5 Synchronous Communication (Mailbox) Management System Call Information As the mailbox management system call information define, for each system call, data that indicates the mailbox management system calls that are used by a user processing program. All the system calls related to mailbox management can be specified collectively by entering "mbxsvc" for the parameter. Figure 8-21 shows the specification format for the mailbox management system call information. Figure 8-21. Mailbox Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall mbxsvc; <When specifying all system calls collectively> The items constituting the mailbox management system call information are as follows. svc_nam Specifies a mailbox management system call name. The following keywords can be specified for svc_nam. cre_mbx del_mbx trcv_msg ref_mbx snd_msg rcv_msg prcv_msg 8.5.6 Memory Pool Management System Call Information As the memory pool management system call information define, for each system call, data that indicates the memory pool management system calls that are used by a user processing program. All the system calls related to memory pool management can be specified collectively by entering "mplsvc" for the parameter. Figure 8-22 shows the specification format for the memory pool management system call information. User's Manual U13687EJ1V2UM 89 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-22. Memory Pool Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall mplsvc; <When specifying all system calls collectively> The items constituting the memory pool management system call information are as follows. svc_nam Specifies a memory pool management system call name. The following keywords can be specified for svc_nam. cre_mpl del_mpl rel_blk ref_mpl get_blk pget_blk tget_blk 8.5.7 Interrupt Processing Management System Call Information As the interrupt processing management system call information define, for each system call, data that indicates the interrupt processing management system calls that are used by a user processing program. All the system calls related to interrupt processing management can be specified collectively by entering "intsvc" for the parameter. Figure 8-23 shows the specification format for the interrupt processing management system call information. Figure 8-23. Interrupt Processing Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall intsvc; <When specifying all system calls collectively> The items constituting the interrupt processing management system call information are as follows. svc_nam Specifies an interrupt processing management system call name. The following keywords can be specified for svc_nam. def_int loc_cpu dis_int ena_int unl_cpu chg_ims ref_ims 8.5.8 Time Management System Call Information As the time management system call information define, for each system call, data that indicates the time management system calls that are used by a user processing program. All the system calls related to time management can be specified collectively by entering "timsvc" for the parameter. Figure 8-24 shows the specification format for the time management system call information. 90 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-24. Time Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall timsvc; <When specifying all system calls collectively> The items constituting the time management system call information are as follows. svc_nam Specifies a time management system call name. The following keywords can be specified for svc_nam. set_tim get_tim dly_tsk def_cyc act_cyc ref_cyc 8.5.9 System Management System Call Information As the system management system call information define, for each system call, data that indicates the system management system calls used by a user processing program. All the system calls related to system management can be specified collectively by entering "syssvc" for the parameter. Figure 8-25 shows the specification format for the system management system call information. Figure 8-25. System Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall syssvc; <When specifying all system calls collectively> The items constituting the system management system call information are as follows. svc_nam Specifies a system management system call name. The following keywords can be specified for svc_nam. get_ver ref_sys def_svc viss_svc def_exc 8.5.10 Signal Handler Management System Call Information As the signal handler management system call information define, for each system call, data that indicates the signal handler management system calls used by a user processing program. All the system calls related to signal handler management can be specified collectively by entering "sigsvc" for the parameter. Figure 8-26 shows the specification format for the signal handler management system call information. User's Manual U13687EJ1V2UM 91 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-26. Signal Handler Management System Call Information Specification Format syscall svc_nam[,svc_nam,…]; <When specifying system calls individually> syscall sigsvc; <When specifying all system calls collectively> The items constituting the signal handler management system call information are as follows. svc_nam Specifies a signal handler management system call name. The following keywords can be specified for svc_nam. vdef_sig 92 vchg_sms vsnd_sig User's Manual U13687EJ1V2UM vref_sms CHAPTER 8 DESCRIBING A CF DEFINITION FILE 8.6 DESCRIPTION EXAMPLE Figure 8-28 shows an example that illustrates how a CF definition file is described. The example in Figure 8-28 assumes the use of the physical memory areas shown in Figure 8-27. Figure 8-27. Physical Memory Areas Assumed in Description Example 0x80028000 _DATA_ RAM area (allocated data) 0x80018000 0x80010000 ROM area _TEXT_ (text and const allocated) 0x80001000 0x8000FFFF System memory area 0x80001000 0x80000FFF Exception vector 1 page 0x80000000 User's Manual U13687EJ1V2UM 93 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-28. CF Definition File Description Example (1/5) --System information description clktim 10,66; -- The basic clock cycle is 10 ms, and the CPU clock frequency is 66 MHz. defstk 0x1000; -- The default stack size is 4 kilobytes. intstk 0x1000; -- The stack size of the interrupt handler is 4 kilobytes. --System maximum value information maxpri 0xfc; -- The maximum task priority is 0xfc. maxtsk 0x10; -- The maximum number of tasks is 16. maxsem 8; -- The maximum number of semaphores is 8. maxflg 10; -- The maximum number of event flags is 10. maxmbx 4; -- The maximum number of mailboxes is 4. maxmpl 6; -- The maximum number of memory pools is 6. maxcyc 1; -- The maximum number of cyclic handlers is 1. maxsvc 5; -- The maximum number of extended SVC handlers is 5. --System memory information description poolsize UserPool,0x8000; -- The size of UserPool is 32 kilobytes. poolsize StackPool,0x4000; -- The size of StackPool is 16 kilobytes. pooladdr SystemPool,0x80001000; -- The start address of the system pool must always be specified. --Task information description --Two tasks - inittask and maintask - are defined. task{ id auto; -- The ID number is automatically assigned. name inittask; -- The task name is "inittask." status TTS_RDY; -- The task status is "ready" at the time of activation. stacode 0x1234; -- The activation code is 0x1234. exinf 0x0; -- The extended code is not used (any given value may be used). lang TA_HLNG; -- The task is described in C. staaddr initfunc; -- The start address of the task is the initfunc function. pri 0x10; -- The initial priority is 16. intr TA_DISINT; -- No interrupt is allowed at the time of task activation. stack 0x1000; -- The stack size is 4 kilobytes. gp _gp; -- The GP register-specific value is indicated by symbol name _gp. } 94 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-28. CF Definition File Description Example (2/5) task{ id 10; -- The ID number is 10. name maintask; -- The task name is "maintask." status TTS_DMT; -- The task status is "dormant" at the time of activation. stacode 0x0; -- The activation code is meaningless (because the task status is "dormant" exinf 0xabcd; -- The extended code is 0xabcd. lang TA_HLNG; -- The task is described in C. staaddr mainfunc; -- The start address of the task is the mainfunc function. pri 0x10; -- The initial priority is 16. intr TA_DISINT; -- No interrupt is allowed at the time of task activation. stack 0x1000; -- The stack size is 4 kilobytes. gp nouse; -- The GP register is not used. at the time of activation). } --Symbol name "gp" specified for the gp attribute of inittask is a symbol automatically created by the linker. --Semaphore information description --Two semaphores - sem1 and sem2 - are defined. semaphore{ id auto; -- The ID number is automatically assigned. name sem1; -- The semaphore name is "sem1." waiopt TA_TFIFO; -- Tasks are queued in the order in which resource requests are issued. exinf 0x0; -- The extended code is not used (any given value may be used). initcnt 0x0; -- The initial count is 0. maxcnt 0x1; -- The maximum count is 1. id 2; -- The ID number is 2. name sem2; -- The semaphore name is "sem2." waiopt TA_TPRI; -- Tasks are queued according to their priority. exinf 0x5678; -- The extended code is 0x5678. initcnt 0x10; -- The initial count is 16. maxcnt 0x10; -- The maximum count is 16. } semaphore{ } --The configurator detects an error if the maximum count is smaller than either 1 or the initial count value. User's Manual U13687EJ1V2UM 95 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-28. CF Definition File Description Example (3/5) --Event flag information description --Two event flags - flag1 and flag2 - are defined. eventflag{ id auto; -- The ID number is automatically assigned. name flag1; -- The event flag name is "flag1." waiopt TA_WSGL; -- Prohibited from waiting for multiple tasks. exinf 0x0; -- The extended code is not used (any given value may be used). initptn 0x7e; -- The initial bit pattern is 0x7e. id 5; -- The ID number is 5. name flag2; -- The event flag name is "flag2." waiopt TA_TMUL; -- Allowed to wait for multiple tasks. exinf 0x5555; -- The extended code is 0x5555. initptn 0x81; -- The initial bit pattern is 0x81. } eventflag{ } --Mailbox information description --Two mailboxes - mbx1 and mbx2 - are defined. mailbox{ id auto; -- The ID number is automatically assigned. name mbx1; -- The mailbox name is "mbx1." waiopt TA_TFIFO TA_MFIFO; -- Tasks are queued in the order in which resource requests are issued. Messages are queued in the order in which they are sent. 0x0; -- The extended code is not used (any given value may be used). id 1; -- The ID number is 1. name mbx2; -- The mailbox name is "mbx2." waiopt TA_TPRI TA_MPRI; -- Tasks and messages are queued according to their priority. exinf 0xcccc; -- The extended code is 0xcccc. exinf } mailbox{ } --Memory pool information description --Two memory pools - mpl1 and mpl2 - are defined. memorypool{ id auto; -- The ID number is automatically assigned. name mpl1; -- The event flag name is "mpl1." waiopt TA_TFIFO; -- Tasks are queued in the order in which resource requests are issued. exinf 0x0; -- The extended code is not used (any given value may be used). size 0x400; -- The memory pool size is 1 kilobyte. } 96 User's Manual U13687EJ1V2UM CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-28. CF Definition File Description Example (4/5) memorypool{ id 4; -- The ID number is 4. name mpl2; -- The event flag name is "mpl2." waiopt TA_TPRI; -- Tasks are queued according to the priority order. exinf 0x4321; -- The extended code is 0x4321. size 0x1000; -- The memory pool size is 4 kilobytes. } --Interrupt handler information description inthdr{ number 0; -- The interrupt source number is 0. lang TA_ASM; -- The interrupt handler is described in assembly language. addr inthandler; -- The start address is inthandler. gp _gp; -- The GP register-specific value is indicated by symbol name _gp. } --Cyclic handler information description cychdr{ number 1; -- The cyclic handler specification number is 1. name cyc; -- The cyclic handler name is "cyc." exinf 0x0; -- The extended code is 0. lang TA_HLNG; -- The cyclic handler is described in C. action TCY_ON; -- The initial status of the cyclic handler is "ON." intvl 50; -- The cyclic handler is activated at intervals of 50 ms. addr cycfunc; -- The start address is the cycfunc function. gp _gp; -- The GP register-specific value is indicated by symbol name _gp. } --Extended SVC handler information description svchdr{ number 4; -- The extended function code is 4. name svc; -- The extended SVC handler name is "svc." lang TA_HLNG; -- The extended SVC handler is described in C. addr svcfunc; -- The start address is the svcfunc function. gp _gp; -- The GP register-specific value is indicated by symbol name _gp. } --Initialization handler information description inithdr{ lang TA_ASM; -- The initialization handler is described in assembly language. addr init; -- The start address is init. gp nouse; -- The GP register is not used. } User's Manual U13687EJ1V2UM 97 CHAPTER 8 DESCRIBING A CF DEFINITION FILE Figure 8-28. CF Definition File Description Example (5/5) --Idle handler information description idlehdr{ lang TA_HLNG; -- The idle handler is described in C. addr idle; -- The start address is the idle function. gp nouse; -- The GP register is not used. } --Exception handler information description exchdr{ -- The exception handler is described in C. lang TA_HLNG; addr exception; -- The start address is the exception function. kind TA_CPU; -- The exception kind is the CPU exception. gp nouse; -- The GP register is not used. } --Signal handler information description sighdr{ task maintask; -- The task to which the signal handler belongs is maintask. lang TA_HLNG; -- The signal handler is described in C. addr sig; -- The start address is the sig function. mask 0x1; -- The initial mask value is 0x1. gp nouse; -- The GP register is not used. } --SIT information description -- 98 The following system calls are used: -- All task management system calls -- All task-associated synchronization management system calls -- All semaphore management system calls -- All event flag management system calls -- Mailbox management system calls (cre_mbx, del_mbx, snd_mbx, and rcv_msg) -- Memory pool management system calls (cre_mpl, del_mpl, get_blk, and rel_blk) -- All interrupt management system calls -- Time management system calls (set_tim, get_tim, and act_cyc) -- System management function call (def_exc only) -- All signal handler management system calls syscall tsksvc,sncsvc,semsvc,flgsvc; syscall cre_mbx,del_mbx,snd_msg,rcv_msg; syscall cre_mpl,del_mpl,get_blk,rel_blk; syscall intsvc; syscall set_tim,get_tim,act_cyc; syscall def_exc,sigsvc; User's Manual U13687EJ1V2UM CHAPTER 9 INFORMATION FILE GENERATION This chapter explains how an information file (system information table, system call table, system information header file) is created from a CF definition file. 9.1 OUTLINE Figure 9-1 shows how to activate the configurator from the command line. Note that, in the input example, "A>" indicates the shell prompt, while "↵ ↵" indicates that the user must press the return key. Those activation options that appear in square brackets ([ ]) can be omitted. Figure 9-1. Activating the Configurator A>cf4000 [-n][-o sit_tbl][-t brt_tbl][-i h_file][-V][-help] cf_file ↵ The configurator activation options are as follows. -n Restricts the output of the default files. Usually, CF4000 outputs the relevant default files if the -o, -i, and -t options are omitted. When the -n option is specified, only those files specified by the -o, -i, and -t options are output. Caution When the -n option is specified, the -o, -i, and -t options specified prior to the -n option become invalid. Therefore, specify the -n option before the other options. -o sit_tbl Specifies the file (system information table name) output by the configurator. If omitted: The system changes the extension of the CF definition file name, specified with cf_file, to .c, and outputs the file as the system information table. -t brt_tbl Specifies the file (system call table name) output by the configurator. If omitted: The system changes the extension of the CF definition file name, specified with cf_file, to .sct.c, and outputs the file as the system call table. -i h_file Specifies the file (system information header file name) output by the configurator. If omitted: The system changes the extension of the CF definition file name, specified with cf_file, to .h, and outputs the file as the system information header file. User's Manual U13687EJ1V2UM 99 CHAPTER 9 INFORMATION FILE GENERATION -V Outputs the version of the configurator to the standard output. If omitted: The version of the configurator is not output. Remark When the -V option is specified, all other activation options are disabled. -help Outputs, to the standard output, an explanation of how to use the activation options of the configurator. If omitted: An explanation of how to use the activation options of the configurator is not output. Remark When the -help option is specified, all other activation options are disabled. cf_file Specifies the file (CF definition file name) input to the configurator. If omitted: 100 The input file name can be omitted only when the -V or -help option is specified. User's Manual U13687EJ1V2UM CHAPTER 9 INFORMATION FILE GENERATION 9.2 COMMAND INPUT EXAMPLES The following are examples of configurator command input. cf4000 –o sitfile.tbl –t sctfile.tbl –i hfile.h cffile.cf Reads CF definition file cffile.cf, and outputs system information table sitfile.tbl, system call table sctfile.tbl, and system information header file hfile.h. cf4000 –o sitfile.tbl cffile.cf Reads CF definition file cffile.cf, and outputs system information table sitfile.tbl, system call table cffile.sct.c, and system information header file cffile.h. cf4000 –n –o sitfile.tbl cffile.cf Reads CF definition file cffile.cf and outputs system information table sitfile.tbl. Since the -n option is specified, the system call table and system information header file are not output. cf4000 –t sctfile.tbl cffile.cf Reads CF definition file cffile.cf, and outputs system information table cffile.c, system call table sctfile.tbl, and system information header file cffile.h. cf4000 –i hfile.tbl cffile.cf Reads CF definition file cffile.cf, and outputs system information table cffile.c, system call table cffile.sct.c, and system information header file hfile.tbl. cf4000 cffile.cf Reads CF definition file cffile.cf, and outputs system information table cffile.c, system call table cffile.sct.c, and system information header file cffile.h. cf4000 –V Outputs, to the standard output, the version of the configurator. cf4000 –help Outputs, to the standard output, an explanation of how to use the activation options of the configurator. User's Manual U13687EJ1V2UM 101 CHAPTER 9 INFORMATION FILE GENERATION 9.3 MESSAGES Messages are output, to the standard output if, during processing by the configurator, an error is found in the definition of the CF definition file, or in the description of the coding. The messages output by the configurator are divided into three levels (fatal errors, non-fatal errors, and warnings) in the formatter section. Upon the output of a message, its level is indicated by a letter, as follows. F... Fatal error Upon the occurrence of a fatal error, a message is output, after which processing by the configurator is terminated. Example: E... Memory area shortfall. Non-fatal error Upon the occurrence of a non-fatal error, a message is output, after which processing by the configurator is terminated. Example: When a definition is duplicated. W... Warning Upon the occurrence of a warning, a message is output, and processing by the configurator continues. Example: When the specified stack size is smaller than the default size. Figure 9-2 shows the output format of a message. Figure 9-2. Message Output Format F 3001:Not enough memory Cause of the error Identification number Message level 9.3.1 Fatal Errors Listed below are the messages that are output in the event of a fatal error. F3001 : Not enough memory. There is not enough memory. F3002 : Too long line. Too long a line is specified. 102 User's Manual U13687EJ1V2UM CHAPTER 9 INFORMATION FILE GENERATION F3004 : Too complicate syntax. The syntax is too complex. F3005 : Can not open file. The file cannot be opened. F7001 : Can not open file. The file cannot be opened. F7002 : File write error. Data cannot be written to the file. F7003 : File read error. Data cannot be read from the file. 9.3.2 Non-Fatal Errors Listed below are the messages that are output in the event of a non-fatal error. In the messages, the text in italics (e.g., %s) represents a value that changes depending on the circumstances under which the corresponding non-fatal error occurs. E1001 : Illegal option (%s). An illegal activation option is specified. E1002 : Option (%s) needs parameters. The option requires that parameters be input. E1003 : CF file is not specified. The CF definition file is not specified. E1004 : Option (%s) multiple defined. The same option is specified more than once. E1005 : %s and %s are the same file name. The input or output file name is duplicated. E1006 : CF file is not exist (%s). The CF definition file cannot be read. E1007 : Illegal parameters (%s). One or more of the specified parameters is illegal. E1008 : Output file nothing. No output file is specified. E3001 : Illegal keyword or syntax error. Either the specified keyword or syntax is illegal. E3002 : Too long name. The name (physical memory name, pool name, etc.) exceeds the maximum length (255 characters). E3004 : Maximum value is out of range. The specified value falls outside the task priority range or exceeds the maximum number of management objects that can be created or registered. E3005 : Illegal ID. The specified ID number is illegal. E3009 : Name (%s) is already used. An already used name (physical memory name, pool name, etc.) is specified. User's Manual U13687EJ1V2UM 103 CHAPTER 9 INFORMATION FILE GENERATION E3010 : ID (%d) is already used. An already used ID number is specified. E3011 : Keyword (%s) is already defined. An already defined keyword is specified. E3012 : Keyword (%s) is not specified. The keyword is not specified. E3013 : Illegal maximum value (%d). The specified task priority range or maximum number of management objects that can be created or registered is illegal. E3014 : Divide by 0. Division by 0 occurs. E3015 : ID (%d) is bigger than Maximum (%d). The ID number exceeds the maximum number of management objects that can be created, as specified in the system maximum value information. E3016 : Number (%d) is out of range (%d, %d). The specified interrupt source, specification number, or extended function code falls outside the range. E3017 : Number (%d) is already used. An already used interrupt source, specification number, or extended function code is specified. E3019 : Illegal stack size (0x%x). The specified stack size is illegal. E3060 : Illegal base clock interval. The specified base clock interval is illegal. E3061 : Illegal CPU clock. The specified CPU clock is illegal. E3063 : Illegal maximum task priority (%d). The specified maximum task priority is illegal. E3073 : Pool is overlapped. The pool overlaps another. E3076 : Illegal pool size (%d). The specified pool size is illegal. E3077 : Systempool address is not defined. The start address of system memory Systempool is not defined. E3078 : Systempool size too small (%d, %d). The specified size of system memory Systempool is illegal. E3082 : Illegal initial priority (%d). The specified initial task priority is illegal. E3083 : Number of static tasks is out of range. The number of defined tasks exceeds the maximum number of tasks that can be created, as specified in the system maximum value information. E3084 : Initial priority (%d) is out of range. The specified initial task priority falls outside the task priority range, as specified in the system maximum value information. 104 User's Manual U13687EJ1V2UM CHAPTER 9 INFORMATION FILE GENERATION E3085 : Task is not defined. The task information is not defined. E3092 : Illegal initial resource count (%d). The specified initial semaphore resource count is illegal. E3093 : Illegal maximum resource count (%d). The specified maximum semaphore resource count is illegal. E3094 : Illegal resource count is out of range. The specified initial semaphore resource count exceeds the maximum semaphore resource count. E3095 : Number of static semaphore is out of range. The number of defined semaphores exceeds the maximum number of semaphores that can be created, as specified in the system maximum value information. E3102 : Number of static eventflag is out of range. The number of defined event flags exceeds the maximum number of event flags that can be created, as specified in the system maximum value information. E3112 : Number of static mailbox is out of range. The number of defined mailboxes exceeds the maximum number of mailboxes that can be created, as specified in the system maximum value information. E3122 : Illegal memory pool size. The specified memory pool size is illegal. E3123 : Number of static memory pool is out of range. The number of defined memory pools exceeds the maximum number of memory pools that can be created, as specified in the system maximum value information. E3132 : Number of interrupt handler is out of range. The number of defined interrupt handlers exceeds the number of maskable interrupt sources. E3143 : Number of static cyclic handler is out of range. The number of defined cyclic handlers exceeds the maximum number of cyclic handlers that can be registered, as specified in the system maximum value information. E3144 : Illegal interval time (%d). An illegal interval time is specified for the cyclic handler. E3153 : Number of static SVC handler is out of range. The number of defined extended SVC handlers exceeds the maximum number of extended SVC handlers that can be registered, as specified in the system maximum value information. E3160 : Initial handler is defined more than twice. The initial handler is defined more than once. E3170 : Idle handler is defined more than twice. The idle handler is defined more than once. E3180 : CPU exception handler is defined more than twice. The CPU exception handler is defined more than once. E3181 : System call exception handler is defined more than twice. The system call exception handler is defined more than once. E3190 : Task with signal handler specified is undefined. No task information is defined that corresponds to the task name specified in the signal handler information. User's Manual U13687EJ1V2UM 105 CHAPTER 9 INFORMATION FILE GENERATION E3191 : Multiple signal handler defined in a task. Two or more signal handlers are defined for a single task. E3192 : Number of signal handler is overflow. The number of defined signal handlers exceeds the maximum number of tasks that can be created, which is specified in the system maximum value information. E3200 : Undefined system call name (%s). An undefined system call name or system call representative name is specified. E3201 : System call name (%s) is already used. An already used system call name or system call representative name is specified. E3210 : Undefined pool name (%s). An undefined pool name is specified. E3230 : Address (0x%x) is not at the 4-byte boundary. The address is not aligned at the four-byte boundary. E3240 : Illegal overflow (%s). The overflow is illegal. E4001 : Can not get AUTO ID. The AUTO ID number cannot be obtained. 9.3.3 Warnings Listed below are the messages that are output as warnings. In the messages, the text in italics (e.g., %x) represents a value that changes depending on the circumstances under which the warning is issued. W3002 : Stack size (%x) is not at the 4-byte boundary. Cf automatically align by 4 (%x). The stack size is not aligned with a four-byte boundary. The configurator continues processing by aligning the specified value up to the four-byte boundary. W3003 : Address (%x) is not at the 4-byte boundary. Cf automatically align by 4 (%x). The address is not aligned with a four-byte boundary. The configurator continues processing by aligning the specified value with a four-byte boundary. W3004 : Size (%x) is not at the 4-byte boundary. Cf automatically align by 4 (%x). The size is not aligned with a four-byte boundary. The configurator continues processing by aligning the specified value with a four-byte boundary. W3081 : Task stack size (%x) is less than default size. CF select default size (%x). The specified task stack size is smaller than the default size defined in the system information. The configurator continues processing by changing the specified value to the default size. W3120 : Memory pool size (%x) is not at the 4-byte boundary. Cf automatically align by 4 (%x). The memory pool size is not aligned with a four-byte boundary. The configurator continues processing by aligning the specified value with a four-byte boundary. 106 User's Manual U13687EJ1V2UM APPENDIX INDEX # example estimate of required memory space ......... 50 µITRON 3.0 specification ........................................ 16 exception handler information ................................. 65 A extended SVC handler ............................................ 36 execution environment ............................................ 17 extended SVC handler information.......................... 64 activation option ...................................................... 99 extended SVC handler interface library................... 46 ap.out ................................................................ 23, 25 extended SVC handler management block ............. 48 ap.out.s.............................................................. 23, 25 F B fatal error ............................................................... 102 blocks ...................................................................... 59 free disk space ........................................................ 20 boot processing ........................................... 17, 35, 40 H C hardware environment............................................. 18 C compiler package........................................... 16, 18 hardware initialization section ........................... 17, 42 CF definition file....................................................... 34 host machine ........................................................... 18 CF4000.................................................................... 53 how to activate the configurator .............................. 99 character code......................................................... 59 how to code a CF definition file ............................... 59 command input examples ..................................... 101 command input format............................................. 56 comment.................................................................. 60 compact design ....................................................... 16 compatibility............................................................. 16 configuration information ......................................... 62 configurator ....................................................... 16, 53 CPU exception handler............................................ 36 cyclic handler........................................................... 36 cyclic handler information........................................ 64 I IBM-PC/AT-compatible machine ............................. 18 idle handler........................................................ 35, 37 idle handler information ........................................... 65 information file ................................................... 37, 53 information file generation ....................................... 99 initialization handler........................................... 35, 43 initialization handler information .............................. 64 installation ............................................................... 19 installer .................................................................... 20 D installing .................................................................. 20 debugger ................................................................. 18 interface library........................................................ 45 declaration............................................................... 59 interrupt handler ...................................................... 36 default stack size..................................................... 68 interrupt handler information ................................... 64 description example for CF definition file ................ 93 interrupt processing management system call description sequence .............................................. 61 information ........................................................... 66 development environment ....................................... 18 interrupt/exception entry.................................... 35, 44 directory structure.................................................... 21 distribution medium ................................................. 19 K E keyword ................................................................... 60 event flag information .............................................. 63 L event flag management block ................................. 48 event flag management system call information ..... 66 level E...................................................................... 16 User's Manual U13687EJ1V2UM 107 APPENDIX INDEX level S ......................................................................16 libch.a ................................................................25, 26 libch.lib...................................................22, 23, 27, 29 libnc.a ................................................................25, 26 libnc.lib...................................................22, 23, 27, 29 librx.a .................................................................25, 26 librx.lib....................................................22, 23, 27, 29 link directive file .......................................................37 load module .................................................37, 38, 55 S sample source files ..................................................17 SCT information .................................................34, 65 semaphore information ............................................63 semaphore management block ...............................48 semaphore management system call information ...66 signal handler ..........................................................36 signal handler information........................................65 signal handler management system call information ...........................................................67 M SIT information ..................................................34, 62 mailbox information..................................................63 software environment...............................................18 mailbox management block .....................................48 source file distribution format...................................26 mailbox management system call information.........66 space information ....................................................34 management object .................................................47 SPARCstation ..........................................................18 management region.................................................47 specification format for SCT information..................87 memory pool ............................................................49 specification format for SIT information ...................68 memory pool information .........................................64 specification format for the cyclic handler memory pool management block.............................48 memory pool management system call information ...........................................................79 specification format for the event flag information ...74 information ...........................................................66 message ................................................................102 multitasking..............................................................16 specification format for the event flag management system call information.........................................88 specification format for the exception handler information ...........................................................84 N specification format for the extended SVC handler name........................................................................60 non-fatal error ........................................................103 information ...........................................................81 specification format for the idle handler information ...........................................................83 O specification format for the initialization handler object file..................................................................37 object file distribution format ....................................21 operating environment .............................................54 information ...........................................................82 specification format for the interrupt handler information ...........................................................77 specification format for the interrupt processing management system call information...................90 P specification format for the mailbox information ......75 PC-9800 series ........................................................18 peripheral hardware .................................................17 processing program .................................................36 processor .................................................................17 specification format for the mailbox management system call information.........................................89 specification format for the memory pool information ...........................................................76 specification format for the memory pool R management system call information...................89 real-time processing ................................................16 required memory space ...........................................17 required memory space calculation formula ............47 required memory space estimate ............................47 rxcore.o ......................................22, 23, 25, 26, 27, 29 specification format for the semaphore information ...........................................................73 specification format for the semaphore management system call information...................88 specification format for the signal handler information ...........................................................85 108 User's Manual U13687EJ1V2UM APPENDIX INDEX specification format for the signal handler system initialization ................................................. 17 management system call information .................. 91 system management system call information ......... 67 specification format for the system information ....... 68 system maximum value information ........................ 62 specification format for the system management system memory information .................................... 62 system call information ........................................ 91 specification format for the system maximum value information ........................................................... 69 system memory region ............................................ 47 system performance analyzer ................................. 18 SystemPool ............................................................. 70 specification format for the system memory information ........................................................... 70 T specification format for the task-associated task.......................................................................... 36 synchronization management system call task debugger.......................................................... 18 information ........................................................... 87 task information ....................................................... 63 specification format for the task information............ 71 task management block .......................................... 47 specification format for the task management task management system call information .............. 65 system call information ........................................ 87 task-associated synchronization management specification format for the time management system call information ........................................ 65 system call information ........................................ 90 time management block for cyclic wake-up............. 48 stack area for interrupt handlers.............................. 49 time management system call information .............. 66 stack area per task .................................................. 49 StackPool ................................................................ 70 statement................................................................. 59 stdrx.h.................................................... 22, 24, 27, 28 symbol name ........................................................... 60 sys.out ............................................................... 23, 25 sys.out.s ............................................................ 23, 25 system base table ................................................... 47 system call exception handler ................................. 37 system call interface library ..................................... 46 U user memory region ................................................ 47 user own coding part ......................................... 35, 39 UserPool.................................................................. 70 utility ........................................................................ 16 V value........................................................................ 59 system call table...................................................... 53 system construction................................................. 31 W system construction procedure ............................... 31 warning.................................................................. 106 system information .................................................. 62 word......................................................................... 59 system information header file ................................ 53 system information table ......................................... 53 User's Manual U13687EJ1V2UM 109 [MEMO] 110 User's Manual U13687EJ1V2UM Facsimile Message From: Name Company Tel. Although NEC has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. Despite all the care and precautions we've taken, you may encounter problems in the documentation. Please complete this form whenever you'd like to report errors or suggest improvements to us. FAX Address Thank you for your kind support. North America Hong Kong, Philippines, Oceania NEC Electronics Inc. NEC Electronics Hong Kong Ltd. Corporate Communications Dept. Fax: +852-2886-9022/9044 Fax: +1-800-729-9288 +1-408-588-6130 Korea Europe NEC Electronics Hong Kong Ltd. NEC Electronics (Europe) GmbH Seoul Branch Technical Documentation Dept. Fax: +82-2-528-4411 Fax: +49-211-6503-274 South America NEC do Brasil S.A. Fax: +55-11-6462-6829 Asian Nations except Philippines NEC Electronics Singapore Pte. Ltd. Fax: +65-250-3583 Japan NEC Semiconductor Technical Hotline Fax: +81- 44-435-9608 Taiwan NEC Electronics Taiwan Ltd. Fax: +886-2-2719-5951 I would like to report the following error/make the following suggestion: Document title: Document number: Page number: If possible, please fax the referenced page or drawing. Document Rating Excellent Good Acceptable Poor Clarity Technical Accuracy Organization CS 01.2