KR19980048819A - Electronic control system with memory saving and memory saving method - Google Patents

Electronic control system with memory saving and memory saving method Download PDF

Info

Publication number
KR19980048819A
KR19980048819A KR1019960067467A KR19960067467A KR19980048819A KR 19980048819 A KR19980048819 A KR 19980048819A KR 1019960067467 A KR1019960067467 A KR 1019960067467A KR 19960067467 A KR19960067467 A KR 19960067467A KR 19980048819 A KR19980048819 A KR 19980048819A
Authority
KR
South Korea
Prior art keywords
constant
memory
bank
stored
rom
Prior art date
Application number
KR1019960067467A
Other languages
Korean (ko)
Other versions
KR100199477B1 (en
Inventor
박경록
Original Assignee
김광호
삼성전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 김광호, 삼성전자 주식회사 filed Critical 김광호
Priority to KR1019960067467A priority Critical patent/KR100199477B1/en
Publication of KR19980048819A publication Critical patent/KR19980048819A/en
Application granted granted Critical
Publication of KR100199477B1 publication Critical patent/KR100199477B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0638Combination of memories, e.g. ROM and RAM such as to permit replacement or supplementing of words in one module by words in another module

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

본 발명은 일반적인 전자 제어 시스템의 메모리 절약 방법에 관한 것으로서, 다수의 뱅크를 동일 마이컴에 병렬로 연결하여 사용하는 메모리 운용방법에 있어서, 다수개의 롬(ROM)의 각 루트 영역에 동일 상수 영역이 차지되는 것을 방지할 수 있는 롬(ROM)의 루트 영역에서의 메모리 절약 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory saving method of a general electronic control system. In the memory operating method using a plurality of banks connected in parallel to the same microcomputer, the same constant region occupies each root region of a plurality of ROMs. It relates to a memory saving method in the root area of a ROM that can be prevented.

상수(Constant Variable)를 별도의 파일로 생성하는 과정과, 다수 개의 프로그램 소스(Program Source)를 컴파일링(Compiling) 및 링킹(Linking)하여 별도의 상수 파일에 합치는 과정과, 상수가 저장된 뱅크를 찾는 과정과, 해당 뱅크에서 특정 상수가 저장된 주소를 찾는 과정으로 진행되어 중첩 뱅크 메모리 모델에서 루트영역에 중복되어 저장되는 상수영역을 특정뱅크에 저장하므로써 루트영역을 줄이고 프로그램할 수 있는 공간이 더 늘어나게 되는 효과를 가질 수 있다.The process of creating constant variables in a separate file, the process of compiling and linking a plurality of program sources into a separate constant file, and the bank in which the constants are stored The process of searching for and finding the address where a certain constant is stored in the corresponding bank proceeds to save the constant area, which is duplicated and stored in the root area in a specific bank, in the nested bank memory model, thereby reducing the root area and increasing the space for programming. It can have an effect.

Description

절약된 메모리를 갖는 전자제어 시스템 및 메모리 절약 방법Electronic control system with memory saving and memory saving method

본 발명은 일반적인 전자 제어 시스템의 메모리 절약 방법에 관한 것으로서, 다수의 뱅크를 동일 마이컴(MPU)에 병렬로 연결하여 사용하는 메모리 운용방법에 있어서, 다수개의 롬(ROM)의 각 루트 영역에 동일 상수 영역이 차지되는 것을 방지할 수 있는 롬(ROM)의 루트 영역에서의 메모리 절약 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory saving method of a general electronic control system. In the memory operating method using a plurality of banks connected in parallel to the same microcomputer (MPU), the same constant is applied to each root region of a plurality of ROMs. The present invention relates to a memory saving method in a root area of a ROM that can prevent an area from being occupied.

먼저 일반적으로 사용되는 전자 시스템의 동작원리를 살펴보기 위해 도 1에 나타난 단순 구성도를 참조로 한다.First, to describe the operation principle of a generally used electronic system, the simple configuration shown in FIG. 1 will be referred to.

중앙처리장치(Central Processing Unit) 또는 시스템 콘트롤러(System Controller)로 사용되는 마이크로 프로세서(Micro Processing Unit : 이하 마이컴이라 칭한다.)(10)와, 상기 마이컴(10)에 제공될 콘트롤 프로그램(Control Program)이 포함되어 있으며 데이터의 임시저장소로 사용되는 메모리 장치(20)와, 상기 마이컴(10)의 제어신호에 따라 신호의 입·출력을 담당하는 입·출력부(Input/Output)(30)와, 상기 입·출력부(30)에 입력신호를 제공하는 소스(Source)가 되는 입력장치(Input Device)(31)와, 상기 입·출력부(30)를 통해 실시 동작을 구현하는 출력장치(Output Device)(32)로 구성된다.A microprocessor (hereinafter referred to as a microcomputer) used as a central processing unit or a system controller, and a control program to be provided to the microcomputer 10. A memory device 20 which is used as a temporary storage of data, an input / output unit 30 which is responsible for input / output of signals according to the control signal of the microcomputer 10, An input device 31 serving as a source for providing an input signal to the input / output unit 30 and an output device for implementing the operation through the input / output unit 30. Device) 32.

여기에서 메모리장치(20)는 읽기/쓰기가 가능한 램(RAM : Random Access Memory)와 읽기 전용 메모리인 롬(ROM : Read Only Memory)을 포함한다. 롬(ROM)은 전원이 차단되어도 내장된 프로그램 등의 자료가 사라지지 않는다. 따라서 이러한 롬(ROM)은 전원 공급과 동시에 마이컴(10)이 처리할 동작에 대한 정보를 제공하는 동작을 하게된다.The memory device 20 may include a read / write random access memory (RAM) and a read only memory (ROM). ROM does not disappear even if the power is cut off. Therefore, such a ROM (ROM) is to provide the information on the operation to be processed by the microcomputer 10 at the same time the power supply.

여기에서 상기 롬(ROM)에 저장된 내역에 대하여 좀 더 상세히 살펴보기로 한다. 도 2 는 롬(ROM)의 메모리 구조(MAP)을 나타내고 있다. 도시된 바와 같이Here, the details stored in the ROM will be described in more detail. 2 shows a memory structure MAP of a ROM. As shown

롬은 루트 영역(Root)과 프로그램소스 영역(Bank)으로 분리되어 있다. 롬(ROM)의 루트영역(Root)에는 스타트업 코드(201)와 ISR(Interrupt Service Routine)(202)과 커먼루틴(Common Routine)(203)과 빠른 처리속도가 필요한 기능함수(204)와 상수저장영역(205)으로 구성된다.ROM is divided into root area and program source area. Root of ROM includes startup code 201, Interrupt Service Routine (202) and Common Routine (203), function functions (204) and constants that require fast processing speed. It consists of a storage area 205.

한편 마이컴에서 제어할 수 있는 롬(ROM)의 어드레스 영역이 제한되어 있다 . 대표적인 예로 8051의 경우 원래 사용 영역은 0000H ∼FFFFH로 64 K Byte이다. 루트 영역이 커지게 되면 뱅크를 위한 어드레스 스페이스(Address Space)가 줄어들게되고 결과적으로 뱅크영역(또는 프로그램 소스영역)에 들어갈 프로그램 코드가 들어갈 수 있는 공간이 줄어들게 된다.On the other hand, the address area of the ROM that can be controlled by the microcomputer is limited. For example, in the case of 8051, the original use area is 0000H to FFFFH, which is 64 KByte. As the root area becomes larger, the address space for the bank is reduced, and as a result, the space for program code to enter the bank area (or program source area) is reduced.

이를 극복하기 위해 도 3과 같이 다수개의 롬(ROM)을 병렬로 연결하여 사용하게 된다. 이러한 방법이 적용된 모델을 뱅키드 메모리 모델(Banked Memory Model)이라 한다.To overcome this, a plurality of ROMs are connected in parallel as shown in FIG. 3. The model to which this method is applied is called the Banked Memory Model.

즉 루트영역에는 ISR(Interrupt Service Routine)과, 스타트업 코드, 상수영역과 그 외에 여러 뱅크(Bank)에서 공통적으로 필요한 루틴(Routine), 빠른 실행이 필요한 루틴(Routine)이 사용된다.In other words, the Interrupt Service Routine (ISR), the startup code, the constant region, and other routines commonly used in various banks are used for the root region, and a routine that requires fast execution is used.

그 외의 프로그램 소스는 뱅크영역에 저장된다. 이 때 각 뱅크(Bank)는 같은 어드레스 스페이스(Address Space)상에 놓이게 된다.Other program sources are stored in the bank area. At this time, each bank is placed in the same address space.

뱅크 선택은 기능 콜(Function Call)시에 마이컴의 출력 포트로 제어하게 된다.Bank selection is controlled by the microcomputer's output port during a function call.

여기에서 각 루트 영역(Root)에는 동일한 내역 즉 스타트업 코드(201)로부터 상수영역(205)가 중복되어 저장된다. 상수(Constant Variable)는 변수(Variable)중에서 프로그램 도중에 변경되지 않은 변수로 램(RAM)이 아닌 롬(ROM)에 저장된다. 또한 뱅키드 메모리 모델의 경우에는 무조건 루트 영역으로 포함되게 되어있다.Here, in each root area Root, constant areas 205 are duplicated and stored from the same details, that is, the startup code 201. Constant Variables are variables that are not changed during the program among Variables and are stored in ROM rather than RAM. In the case of the banked memory model, the root region is unconditionally included.

여기에서 루트영역이 커지게 되면 뱅크영역이 상대적으로 작아지게 되고, 많은 뱅크를 사용하게 되므로써 그 만큼의 마이컴의 포트를 차지하게 된다. 이 때 마이컴에서의 잦은 뱅크 스위칭으로 시스템의 실질적인 능률에 저하를 나타내게 된다.In this case, when the root area becomes larger, the bank area becomes relatively small, and many banks are used, thus occupying as many microcomputer ports. Frequent bank switching at the microcomputer will degrade the system's practical efficiency.

본 발명은 롬(ROM)의 루트영역(Root)의 크기를 줄여 뱅크(Bank)에 더 많은 프로그램 소스를 입력할 수 있도록 뱅크 영역을 넓게 확보하는 것을 목적으로 한다.An object of the present invention is to secure a wider bank area so that a larger program source can be input to a bank by reducing the size of a root of a ROM.

본 발명의 다른 목적은 각 루트(Root)영역에서 공통적으로 자리를 차지하고 있는 상수영역(Constant Variable)을 뱅크 영역으로 옮겨 루트영역의 사이즈를 줄이는 점에 있다.Another object of the present invention is to reduce the size of the root region by moving a constant region, which is commonly occupied in each root region, to a bank region.

루트 영역에 들어가는 요소중 기능함수(Function)를 뱅키드 영역으로 옮기는 것은 손쉬운 작업이지만 그 기능함수(Function)을 루트영역으로 넣은 본래의 의미를 상실하게 되는 것이다.It is easy to move the function to the banked area among the elements that enter the root area, but it loses its original meaning of putting the function into the root area.

이러한 목적을 달성하기 위한 본 발명의 특징은 루트 영역(Root Area)에는 상수가 저장된 뱅커 및 주소(Address)를 저장하고, 실제 상수의 내역을 다수의 뱅크에 저장하여 롬(ROM)의 루트 영역에서 상수 저장 영역이 중복되는 것을 방지하는 점에 있다.A feature of the present invention for achieving this purpose is to store a banker and an address in which a constant is stored in a root area, and store details of actual constants in a plurality of banks in a root area of a ROM. The purpose is to prevent the constant storage area from overlapping.

또한 그 구체적인 실시방법의 특징은 상수(Constant Variable)를 별도의 파일로 생성하는 과정과, 다수 개의 프로그램 소스(Program Source)를 컴파일링(Compiling) 및 링킹(Linking)하여 별도의 상수 파일에 합치는 과정과, 상수가 저장된 뱅크를 찾는 과정과, 해당 뱅크에서 특정 상수가 저장된 주소를 찾는 과정으로 진행되는 점에 있다.In addition, the characteristic of the specific implementation method is the process of creating a constant (Constant Variable) as a separate file, and by compiling and linking a plurality of program sources (Combining) to a separate constant file And the process of finding a bank in which a constant is stored and finding an address in which a specific constant is stored in the bank.

도 1은 일반적인 전자 기기 시스템의 기초적인 구성을 나타내는 블록도,1 is a block diagram showing the basic configuration of a general electronic device system;

도 2는 롬(ROM)의 메모리 구조도,2 is a memory structure diagram of a ROM;

도 3은 종래 뱅키드 메모리 모델 신호 처리 구조도,3 is a block diagram of a conventional banked memory model signal processing structure;

도 4는 본 발명에 따른 롬(ROM)의 메모리 구조도,4 is a memory structure diagram of a ROM according to the present invention;

도 5는 본 발명의 실행방법을 나타내는 동작흐름도이다.5 is an operational flowchart showing an implementation method of the present invention.

도 4는 본 발명의 실시에 따른 메모리의 구조를 나타내는 구성도이다. 도시된 바와 같이 종래의 메모리 구조와 달리 상수(Constant Variable) 영역이 루트영역(Root)에 있지 않고 뱅크영역(Bank) 즉 프로그램 소스영역에 있다는 것을 알 수 있다.4 is a block diagram illustrating a structure of a memory according to an embodiment of the present invention. As shown, unlike the conventional memory structure, it can be seen that the constant variable area is not in the root area but in the bank area, that is, the program source area.

이 때 루트영역에는 상수가 포함되어 있는 뱅크번호와 어드레스(Address)를 저장하고 있어야 한다.At this time, the root area should store a bank number and an address including a constant.

좀 더 구체적으로 설명하자면 각 롬(ROM)의 루트영역에는 공통적으로 필요한 스타트업 코드(201)와 ISR(Interrupt Service Routine)(202)와 공통 루틴(COmmon Routine)(203)과 빠른 처리속도가 필요한 기능함수(Function)(204)가 포함된다.More specifically, the root region of each ROM requires a startup code 201, an interrupt service routine (ISR) 202, a common routine 203, and a fast processing speed. A function 204 is included.

각 뱅크영역에는 마이컴(10)의 동작을 위한 프로그램이 포함되며 특정 뱅크에 상수영역이 자리한다.Each bank area includes a program for operating the microcomputer 10 and a constant area is located in a specific bank.

이와 같이 구성하기 위한 실행과정을 도 5의 흐름도를 통해 살펴보기로 한다.An execution process for this configuration will be described with reference to the flowchart of FIG. 5.

먼저 상수화일(Constant Variable File)을 별도로 만들어 놓는다( S1 ).First, make a constant variable file separately (S1).

각 프로그램 소스(Program Source)를 컴파일링(Compile)한다(S2). 이 때 상기 상수화일(Constant Variable)은 제외된다.Each program source is compiled (S2). At this time, the constant variable is excluded.

상기 컴파일링(S2)과정에 의해 생성된 다수의 오브젝트 파일(*.obj)을 서로 링킹(Linking)시킨다(S3).The plurality of object files (* .obj) generated by the compilation (S2) are linked to each other (S3).

상기 컴파일/링크 단계(S2/S3)를 거쳐 생성된 파일과 별도로 구비된(S1) 상수 화일(Constant Variable File)을 합친다(Merge)(S4).The file generated through the compilation / linking step S2 / S3 and the constant variable file provided separately (S1) are merged (S4).

이 때 상수영역(Constant Variable)은 특정 뱅크(Bank)의 특정 어드레스(Address)로 넣어야 한다. 또한 프로그래머는 이 뱅크의 번호와 주소(Address)를 알고 있어야 한다.At this time, the constant variable should be put in a specific address of a specific bank. The programmer also needs to know the number and address of this bank.

이와 같은 과정을 통해 생성된 롬(ROM)내의 프로그램에서 상수를 억세스(Access)하는 방법은 다음과 같이 진행된다.The method of accessing a constant in a program in a ROM created by the above process proceeds as follows.

하나 또는 그 이상의 포인터를 선언하여 프로그램에서 필요로하는 상수가 위치한 뱅크를 찾아낸다(S5).Declare one or more pointers to find the bank where the constant required by the program is located (S5).

특정 뱅크내에 특정상수가 위치한 어드레스를 찾는다(S5).The address in which the specific constant is located in the specific bank is found (S5).

찾아낸 상수의 주소를 주기억장치(RAM)으로 복사하여 사용한다(S6).The address of the found constant is copied to the main memory (RAM) and used (S6).

중첩 뱅크 메모리 모델에서 루트영역에 중복되어 저장되는 상수영역을 특정뱅크에 저장하므로써 루트영역을 줄이고 프로그램할 수 있는 공간이 더 늘어나게 된다.In the nested bank memory model, the constant area, which is duplicated in the root area, is stored in a specific bank, thereby reducing the root area and increasing the space for programming.

Claims (5)

기기 전반에 걸친 동작 제어 신호를 나타내는 마이컴(10)과,A microcomputer 10 representing an operation control signal throughout the apparatus, 상기 마이컴(10)에 동작의 실시에 필요한 프로그램을 제공하는 롬(ROM)과,A ROM for providing a program necessary for the operation of the microcomputer 10 to the microcomputer 10; 상기 마이컴(10)의 제어 신호에 따라 프로그램이 실행되는데 필요한 데이터가 저장되어 있는 램(RAM)을 포함하는 전자제어 시스템에 있어서,In the electronic control system including a RAM (RAM) is stored in the data necessary to execute the program according to the control signal of the microcomputer 10, 상기 롬(ROM)의 루트영역에서 상수영역을 제외시키고, 뱅크 영역에 상수 영역을 저장하는 것을 특징으로 하는 전자제어 시스템.And a constant region is stored in a bank region by excluding a constant region from a root region of the ROM. 제 1 항에 있어서,The method of claim 1, 상기 마이컴은 16 비트의 데이터 전송속도를 가지는 것을 특징으로 하는 전자제어 시스템.The microcomputer has a data transfer rate of 16 bits. 제 1 항에 있어서,The method of claim 1, 상기 롬(ROM)의 크기는 64 K 바이트인 것을 특징으로 하는 전자제어 시스템.The size of the ROM (ROM) is an electronic control system, characterized in that 64K bytes. 다수의 뱅크를 동일 마이컴(MPU)에 병렬로 연결하여 사용하는 메모리 운용방법에 있어서, 루트 영역(Root Area)에는 상수가 저장된 뱅커 및 주소(Address)를 저장하고, 실제 상수의 내역을 다수의 뱅크에 저장하여 롬(ROM)의 루트 영역에서 상수 저장 영역이 중복되는 것을 방지하므로써 메모리를 절약할 수 있는 전자제어 시스템에서의 메모리 절약 방법.In a memory operation method using a plurality of banks connected in parallel to the same microcomputer (MPU), a banker and an address in which constants are stored are stored in a root area, and details of actual constants are stored in a plurality of banks. A method of saving memory in an electronic control system that can save memory by preventing the constant storage area from overlapping in the root area of a ROM by storing the data in a memory. 상수(Constant Variable)를 별도의 파일로 생성하는 단계와,Creating a constant variable in a separate file, 다수 개의 프로그램 소스(Program Source)를 컴파일링(Compiling)하는 단계와,Compiling a plurality of program sources (Program Source), 컴파일된 다수의 오브젝트(Object)화일을 서로 링킹(Linking)하는 단계와,Linking a plurality of compiled object files with each other, 상기 컴파일/링크 단계를 거쳐 생성된 파일과 별도로 구비된 상수 화일(Constant Variable File)을 합치는(Merge)단계와,Merging a constant file provided separately from a file generated through the compilation / linking step; 특정 상수가 포함된 뱅크의 영역을 포인터 변수로 나타낼 수 있도록 하는 단계와,Allowing a pointer variable to represent an area of the bank containing a particular constant; 뱅크에서 실제 사용되는 특정 상수의 주소를 찾아내는 단계와,Finding the address of a specific constant actually used in the bank, 찾아낸 상수의 주소를 주기억장치(RAM)으로 복사하는 단계로 이루어지는 전자 제어 시스템에서의 메모리 절약방법.A method for saving memory in an electronic control system, comprising copying the address of a found constant to main memory (RAM).
KR1019960067467A 1996-12-18 1996-12-18 Memory saving method and system KR100199477B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019960067467A KR100199477B1 (en) 1996-12-18 1996-12-18 Memory saving method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019960067467A KR100199477B1 (en) 1996-12-18 1996-12-18 Memory saving method and system

Publications (2)

Publication Number Publication Date
KR19980048819A true KR19980048819A (en) 1998-09-15
KR100199477B1 KR100199477B1 (en) 1999-06-15

Family

ID=19488886

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019960067467A KR100199477B1 (en) 1996-12-18 1996-12-18 Memory saving method and system

Country Status (1)

Country Link
KR (1) KR100199477B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10866817B2 (en) 2016-03-14 2020-12-15 Samsung Electronics Co.. Ltd. Computing system, and driving method and compiling method thereof

Also Published As

Publication number Publication date
KR100199477B1 (en) 1999-06-15

Similar Documents

Publication Publication Date Title
RU2212049C2 (en) Mixed file of vector/scalar registers
US5293591A (en) Processing system including memory selection of multiple memories and method in an interrupt environment
US4649476A (en) Microcomputer having an internal address mapper
KR100199477B1 (en) Memory saving method and system
KR19990013576A (en) Forced Page Zero Paging Method of Microcontroller Using Data Random Access Memory
US5450587A (en) Expanded memory addressing scheme
US5355465A (en) Data storing device having a plurality of registers allotted for one address
KR970702522A (en) APPARATUS AND METHOD FOR UPDATING INFORMATION IN A WRITABLE MICROCODE CONTROL STORE
US6886159B2 (en) Computer system, virtual machine, runtime representation of object, storage media and program transmission apparatus
US4675843A (en) Programmable logic controller
JPS62285152A (en) Data processor
US5410665A (en) Process controller single memory chip shadowing technique
JPS6362778B2 (en)
KR100654477B1 (en) Object oriented processing with dedicated pointer memories
KR0164725B1 (en) Cache memory
KR0164769B1 (en) System program execution method
KR920003845B1 (en) Rom region expansion system for users of pc
KR20000048754A (en) Circuit with a microprocessor and a pushdown storage
KR200204909Y1 (en) A microcontroller including an divided internal code memory
KR100261557B1 (en) Local system
KR940027663A (en) Development Method of Data Processing System and Semiconductor Integrated Circuits for Data Processing
KR20010085562A (en) Force page paging scheme for microcontrollers of various sizes using data random access memory
KR19990037395A (en) System and method for executing two word instructions in a single cycle
KR940011045B1 (en) Interrupt vector addressing method in micro controller unit
JPS6226738B2 (en)

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20040227

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee