The present invention relates to an automobile controller, as well as a method of and a system for generating software for a microprocessor constituting part of the automobile controller.
Microprocessors including a CPU, a ROM, a RAM, an input/output signal processor, and other components have been used as controllers intended for automobile engine control and the like. Software installed in this type of microprocessor comprises application programs that perform control processing and device drivers that perform input and output operations so that a desired control operation is achieved. When hardware used is modified, the device drivers for input and output operations are easily affected and a large number of person-hours involved in the modification become problematic.
Modifications of hardware are broadly classified into two types; modifications of sensors and actuators that are subject to control and modifications of the microprocessor that performs control. When a sensor, an actuator, or other hardware subject to control is modified, software is developed so that a target control operation is achieved, with reference to a hardware manual or another document in which its characteristics and specifications are described. When the microprocessor is modified, many person-hours are needed to extract portions to be modified, determine new specifications, perform a modification, and verify the modification with reference to a manual in which the specifications of the microprocessor are described.
To reduce person-hours required for a software modification involved in a hardware modification, UNIX (a registered trademark), which is a general-purpose operating system (OS) intended for information systems, is available, as disclosed in Non-patent Document 1. In UNIX, interfaces to the hardware subject to control are classified into three standard interfaces, which are block-type interfaces, message channel-type interfaces, and character-type interfaces. All input/output programs each use any one of the three types of virtual interfaces. Accordingly, software is structured with three layers, which are applications, virtual drivers, and actual driver programs, enabling application programs to be developed without having to worry about the modification of the hardware.
In Patent Document 1, a device driver is divided into three layers so that a modification of a program responsive to a modification of a device can be localized.
In Non-patent Document 2, a device driver is created as a high-order driver and a low-order driver; the high-order driver uses an interface for the low-order driver to perform processing, eliminating effects by modifications of the microprocessor and other hardware.
In a known technique to speed up processing performed through an interface, macros are used for expansion. The calling of the processing performed through an interface is speeded up by macro substitution, as disclosed in Patent Document 2.
Non-patent Document 1: S. J. Leffler, et al., translated by Akira Nakamura, et al., The Design and Implementation of the 4.3 BSD UNIX Operating System, Maruzen Co., Ltd. (1991)
Patent Document 1: Japanese Patent Laid-open No. 2000-97102
Non-patent Document 2: μITRON4.0 Specification Study Group, Device Driver Design Guides, μITRON4.0 Specification Study Group (1999)
Patent Document 2: Japanese Patent Laid-open No. 2002-287981
However, in processing performed by general preprocessors, which process macros in C and other languages, character strings are replaced in succession, so they cannot process processing comprising a plurality of layers at high speed. Accordingly, the conventional technologies cannot suppress a processing overhead generated each time processing passes through a layer. A device driver comprising, for example, three layers calls the three layers to perform one type of input/output processing, resulting in a long program execution time and a large program size. To achieve real-time control suitable for automobiles and the like, processing for calculation, input/output processing, and other processing must be performed individually at an optimum timing; a delay of even several microseconds is not often allowed. When layered software is implemented in an ordinary manner, functions calls and system calls are generated between each two layers and a non-negligible delay is caused. When these calls are translated into machine instructions by a compiler or the like in a microprocessor, the calling processing resulting from each call comprises one to eight instructions, taking an execution time of several microseconds to tens of microseconds. Data corresponding to connection between layers needs to be stored in a storage means such as a ROM, RAM, or disk, increasing a necessary memory capacity.
For automobile engine controllers and other systems mounted, there are requests for reducing capacities of ROMs and RAMs, which directly affect costs. Since control of these systems is performed in real time, there are also difficult requests for response speeds. These overheads become a significant problem in practical use.
An object of the present invention is to reduce person-hours taken for software modification involved in modification of hardware or a control method so as to increase application execution speeds and reduce necessary storage unit capacities.
The present invention, in one aspect, generates a first processing description part divided into a plurality of layers, an identifier expanding part for expanding an identifier used in the first processing description part, and a hierarchical configuration description part in which to describe the hierarchical configuration of the first processing description part, and also generates a second processing description part comprising a single layer, which results from an expansion of the hierarchical configuration of the first processing description part into a single layer in accordance with data described in the hierarchical configuration description part and the identifier expanding part.
In a preferred embodiment of the present invention, desired executable software can be obtained in a second processing description part, which is expanded into a single layer by using a first processing description part, a hierarchical configuration description part, an identifier expanding part, a preprocessor, and a compiler; in the first processing description part, processing for each layer is described by using macros representing labels defined for the each layer; in the hierarchical configuration description part, connection relationships among layers are defined by using macros representing the labels for each layer; the identifier expanding part performing macro expansion according to the hierarchical configuration description part.
In a software generating system for an automobile controller that uses a microprocessor to control an automobile, a software generating system in another aspect of the present invention comprises a means for generating a first processing description part divided into a plurality of layers, a means for generating an identifier expanding part for expanding an identifier used in the first processing description part, a means for generating a hierarchical configuration description part in which to describe the hierarchical configuration of the first processing description part, and a means for generating a second processing description part comprising a single layer, which results from an expansion of the hierarchical configuration of the first processing description part in accordance with data described in the hierarchical configuration description part and the identifier expanding part.
In the preferred embodiment of the present invention, there are provided a preprocessor for generating the second processing description part, a compiler for translating the second processing description part into an object file, and a linker for generating control software to be written in a storage unit of the automobile controller by linking the object file to an application object file.
According to the present invention, software designed as a plurality of hierarchical layers is compiled into software that includes only a single layer and thereby does not suffer an overhead between layers.
Other objects and features of the present invention will be clarified in the description of embodiments described below.
100 . . . application program, 101 . . . injection control application, 102 . . . ignition control application, 110 . . . operating system, 120 . . . device driver, 121 . . . intake air amount calculation (IAA), 122 . . . intake air temperature calculation (IAT), 130, 201 microprocessor (CPU), 131 to 133, 203 . . . input/output port, 140 . . . application program interface (API), 150 . . . hardware interface (HWI), 160 . . . upper layer (L1), 170 . . . lower layer (L2), 171 . . . first-order filter analog input (FAI), 172 . . . Vcc correction analog input (VAI), 180 identifier expanding part, 191 . . . hierarchical configuration description part, 192 . . . identifier expanding part, 200 . . . control unit, 220 . . . sensor actuator, 71 . . . device driver program source code, 72 build, 73 . . . device driver object file, 902 . . . device driver repository, 905 . . . input/output terminal list, 906 . . . hierarchical configuration generator, 911 . . . preprocessor, 913 . . . expanded processing description part, 914 . . . compiler, 916 . . . device driver object file, 917 . . . application source code, 918 . . . application object file, 919 . . . linker, 921 . . . control software
Embodiments of the present invention will be described below with reference to the drawings.
A sensor actuator 220 to be controlled is connected to the control unit 200 through the input/output port 208. The sensor actuator 220 comprises an air flow sensor 221, an electronically controlled throttle 222, an injector 223, an ignition plug 224, an air-to-fuel ratio sensor 225 such as a lean air fuel (LAF) sensor, and a crank angle sensor 226. The control unit 200 controls these components. Specifically, to achieve control, the CPU 201 and other components in the control unit 200 write to and read from registers in the input/output port 208. Software in which a control method is described is stored in the ROM 205 and RAM 206 in the control unit 200.
This embodiment relates to a method of generating this type of software in such a way that the software can be modified easily even when, for example, hardware is modified and that applications are executed fast and thus the capacity of memory can be reduced.
The configuration of software executed by the control unit 200 in
The exemplary device driver 120 shown in the drawing performs an intake air amount calculation 121 and an intake air temperature calculation 122 according to inputs obtained from the sensors through the input/output ports 131 to 133 of the microprocessor 130. The device driver 120 accepts requests from an injection control application 101, an ignition control application 102, and the like in the application program 100 through the API 140. The CPU 130 is responsible for control of this; it performs target control by reading from and writing to the analog input/output ports 131 to 133 and the like through the HWI 150.
The device driver 120 is developed in layers by breaking down it into, for example, the upper layer (L1) 160 and lower layer (L2) 170 so that points to modify are localized. There is no restriction on the number of layers; the device driver 120 can be implemented by an appropriate number of layers according to what is responsible for control and how large the software is. The description below assumes a case in which two layers are used.
The upper layer (L1) 160 in the processing description part 180 includes the intake air amount calculation 121, intake air temperature calculation 122, and other modules that require input values needed by the application program 100. In the lower layer (L2) 170 including modules that receive input values and perform general input processing, processing to be performed is described. In the drawing, a first-order filter analog input (FAI) 171 and Vcc correction analogy input (VAI) 172 are indicated. A concrete configuration between layers that indicates which upper layer uses which lower layer is described in the hierarchical configuration description part 191. The identifier expanding part 192 is used to associate the hierarchical configuration defined in the hierarchical configuration description part 191 with the processing description part 180 to obtain desired output.
In the intake air amount calculation processing in
In the intake air amount acquisition processing in
In the Vcc correction analog input value update processing in
In the Vcc correction analog input value acquisition processing in
An electronic control unit in an engine controller mounted in an automobile requires high-speed processing and high reliability and is frequently subject to hardware modifications. When the inventive software generation method and software generation system intended for a microprocessor is used in such an electronic control unit, the burden of the developer can be greatly reduced and a high applicability can be expected.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP04/18197 | 12/7/2004 | WO | 00 | 5/8/2008 |