KR101548960B1 - Method for making and debuging program using virtual platform and appparatus therof - Google Patents

Method for making and debuging program using virtual platform and appparatus therof Download PDF

Info

Publication number
KR101548960B1
KR101548960B1 KR1020080090606A KR20080090606A KR101548960B1 KR 101548960 B1 KR101548960 B1 KR 101548960B1 KR 1020080090606 A KR1020080090606 A KR 1020080090606A KR 20080090606 A KR20080090606 A KR 20080090606A KR 101548960 B1 KR101548960 B1 KR 101548960B1
Authority
KR
South Korea
Prior art keywords
file
memory
simulation
link
executable
Prior art date
Application number
KR1020080090606A
Other languages
Korean (ko)
Other versions
KR20100031808A (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 KR1020080090606A priority Critical patent/KR101548960B1/en
Publication of KR20100031808A publication Critical patent/KR20100031808A/en
Application granted granted Critical
Publication of KR101548960B1 publication Critical patent/KR101548960B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

본 발명은 가상 플랫폼을 이용한 프로그램 작성과 디버깅 방법 및 장치에 관한 것으로서, 특히 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법은 오브젝트 파일에 포함된 코드 및 데이터를 배열하여 링크하고, 상기 링크에 의해 생성된 실행로드 가능파일을 상기 가상 플랫폼의 제1 메모리에 로드하는 단계, 상기 로드된 실행로드 가능파일에 근거하여 시뮬레이션을 실행하는 단계, 상기 시뮬레이션 결과 프로그램의 수정이 필요한 경우, 소스 파일 수정 후 컴파일하여 시뮬레이션 실행에 필요한 정보를 포함하는 링크형 오브젝트를 생성하고, 상기 생성된 링크형 오브젝트를 상기 가상 플랫폼의 제2 메모리에 로드하여 재시뮬레이션을 실행하는 단계를 포함하는 것을 특징으로 한다. The present invention relates to a program creation and debugging method and apparatus using a virtual platform, and more particularly, to a program creation and debugging method using a virtual platform, comprising arranging and linking code and data included in an object file, Loading the executable loadable file into a first memory of the virtual platform; executing a simulation based on the loaded executable loadable file; if the modification of the program is required as a result of the simulation, Generating a link-type object including information necessary for execution, and loading the generated link-type object into a second memory of the virtual platform, and executing a re-simulation.

가상 플랫폼, 실행로드 가능파일, 디버그 링크, 링크형 오브젝트 Virtual platforms, executable loadable files, debug links, linked objects

Description

가상 플랫폼을 이용한 프로그램 작성과 디버깅 방법 및 장치{METHOD FOR MAKING AND DEBUGING PROGRAM USING VIRTUAL PLATFORM AND APPPARATUS THEROF}[0001] METHOD FOR MAKING AND DEBUGING PROGRAM USING VIRTUAL PLATFORM AND APPARATUS THEROF [0002]

본 발명은 가상 플랫폼을 이용한 프로그램 작성과 디버깅 방법 및 장치에 관한 것이다. 보다 구체적으로 본 발명은 작성된 소스 파일을 수정하고자 하는 경우 수정된 소스 파일을 컴파일하여 생성된 링크형 오브젝트 파일과, 미리 생성된 실행로드 가능파일을 독립된 메모리에 각각 로드함으로써 별도의 링크 과정 없이 시뮬레이션을 실행할 수 있다. The present invention relates to a program creation and debugging method and apparatus using a virtual platform. More specifically, in the present invention, when a created source file is to be modified, the linked object file generated by compiling the modified source file and the previously created executable loadable file are loaded into independent memories, respectively, Can be executed.

가상 플랫폼이란 실제 하드웨어가 아닌 PC 상에서 시뮬레이션을 실행할 수 있도록 구성된 플랫폼을 의미하는 것으로서 이 경우 각 구성 요소를 상위 레벨 언어를 이용하여 구현함으로써 다양한 가상 플랫폼을 쉽게 생성할 수 있다. A virtual platform is a platform configured to execute simulation on a PC rather than actual hardware. In this case, various virtual platforms can be easily created by implementing each component using a high-level language.

종래의 가상 플랫폼에서의 프로그램 작성 방식은 프로그램 개발 및 플랫폼의 성능, 구조 등을 분석할 때, 프로그램을 수정하고 컴파일 및 링크 단계를 거쳐 생성된 바이너리 정보를 이용하여 시뮬레이션을 수행하였다. 이 경우 프로그램을 재작성하거나 수정하는 경우에는 컴파일 및 링크 단계를 다시 거쳐야 한다는 문제점이 발생한다. 특히 프로그램의 사이즈가 커지고 소스 파일의 수가 많아짐에 따라 작은 프로그램의 수정에도 불구하고 다시 컴파일 및 링크를 해야 한다. 또한 수정한 소스 파일의 함수가 다른 소스 파일에서 사용하는 경우 연관된 모든 소스 파일들을 다시 컴파일하고 링크를 해주어야 하기 때문에 많은 시간이 소요된다. In the conventional programming method of the virtual platform, simulation was performed using binary information generated by modifying the program, compiling and linking steps when analyzing program development and platform performance and structure. In this case, if the program is rewritten or modified, the compile and link steps must be repeated. In particular, as the size of the program increases and the number of source files increases, you will have to recompile and link again, despite minor program modifications. Also, if the function in the modified source file is used in another source file, it takes a lot of time to recompile and link all the related source files.

따라서 프로그램 작성을 작성하고 작성된 프로그램을 수정하는 과정에 있어서, 컴파일 및 링크 실행 시간을 감소시키고 효율적으로 디버깅 작업을 할 수 있는 프로그램 작성 및 디버깅 방법에 대한 필요성이 대두된다. Therefore, there is a need for a method for writing and debugging a program that can reduce compilation and link execution time and efficiently perform debugging in the process of writing a program and modifying the program.

본 발명은 상기와 같은 문제점을 해결하기 위하여 안출된 것으로서, 가상 플랫폼에서 프로그램을 효율적으로 수정하고 디버깅할 수 있는 프로그램 작성 방법을 제공하는데 그 목적이 있다. SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and it is an object of the present invention to provide a program creation method capable of efficiently modifying and debugging a program in a virtual platform.

또한 본 발명의 또 다른 목적은 수정된 소스 파일을 컴파일하여 생성된 링크형 오브젝트 파일과, 미리 생성된 실행로드 가능 파일을 각각 로드할 수 있는 독립된 메모리를 구비하는 가상 플랫폼을 제공하는데 그 목적이 있다. It is still another object of the present invention to provide a virtual platform having an independent memory capable of loading a linked object file generated by compiling a modified source file and a previously created executable loadable file .

상기와 같은 문제점을 해결하기 위한 본 발명의 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법은 오브젝트 파일에 포함된 코드 및 데이터를 배열하여 링크하고, 상기 링크에 의해 생성된 실행로드 가능파일을 상기 가상 플랫폼의 제1 메모리에 로드하는 단계, 상기 로드된 실행로드 가능파일에 근거하여 시뮬레이션을 실행하는 단계, 상기 시뮬레이션 결과 프로그램의 수정이 필요한 경우, 소스 파일 수정 후 컴파일하여 시뮬레이션 실행에 필요한 정보를 포함하는 링크형 오브젝트를 생성하고, 상기 생성된 링크형 오브젝트를 상기 가상 플랫폼의 제2 메모리에 로드하여 재시뮬레이션을 실행하는 단계를 포함하는 것을 특징으로 한다. 이 경우 상기 재시뮬레이션을 실행하는 단계는 수정된 정보 사용 시, 상기 제1 메모리에 로드된 상기 실행로드 가능파일로의 접근을 상기 제2 메모리에 로드된 상기 링크형 오브젝트로의 접근으로 스위치 하는 것을 특징하며, 상기 링크는 상기 오브젝트 파일에 포함된 코드 및 데이터에 대해 사용 가능한 예약 영역을 할당하여 링크하는 디버그 링크인 것을 특징으로 한다. According to an embodiment of the present invention, there is provided a method of creating and debugging a program using a virtual platform, the method comprising: arranging and linking code and data included in an object file; Loading the loaded executable loadable file into the first memory, executing a simulation based on the loaded executable loadable file, and if a modification of the program is required as a result of the simulation, Type object, and loading the generated link-type object into the second memory of the virtual platform, and executing the re-simulation. In this case, the step of executing the re-simulation may include switching, when using the modified information, access to the executable loadable file loaded in the first memory to access to the linked object loaded in the second memory And the link is a debug link that allocates and links a usable reservation area to code and data included in the object file.

그리고 본 발명의 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 장치는 오브젝트 파일에 포함된 코드 및 데이터를 배열하여 링크하고, 상기 링크에 의해 상기 실행로드 가능파일을 생성하는 실행로드 가능파일 생성부와, 수정된 소스 파일을 컴파일 하여 시뮬레이션 실행에 필요한 정보를 포함하는 링크형 오브젝트를 생성하는 링크형 오브젝트 생성부와, 상기 실행로드 가능파일과 상기 링크형 오브젝트로의 선택적 접근을 제어하는 메모리 접근 제어부를 구비하는 제어부, 상기 실행로드 가능파일이 로드되는 제1 메모리, 상기 링크형 오브젝트가 로드되는 제2 메모리 및 상기 실행로드 가능파일과, 상기 상기 링크형 오브젝트로의 선택적 접근을 스위치 하는 오브젝트 리매핑 유닛을 포함하는 것을 특징으로 한다. 이 경우, 상기 링크는 오브젝트 파일에 포함된 코드 및 데이터를 사용 가능한 예약 영역을 할당하여 배열하는 디버그 링크이며, 상기 링크형 오브젝트는 상기 시뮬레이션 시, 상기 실행로드 가능파일에 포함된 정보를 참고하여 실행되는 것을 특징으로 한다. An apparatus for creating and debugging a program using a virtual platform of the present invention includes an executable loadable file generation unit for arranging and linking code and data included in an object file and generating the executable loadable file by the link, And a memory access control unit for controlling selective access to the executable loadable file and the link type object, wherein the link type object generation unit generates a link type object including information necessary for execution of simulation by compiling the source file, A control unit, a first memory in which the executable loadable file is loaded, a second memory in which the linked object is loaded, and an executable loadable file and an object remapping unit for switching selective access to the linked object . In this case, the link is a debug link that allocates and arranges a usable reserved area for code and data contained in an object file, and the link-type object refers to information included in the executable loadable file .

본 발명의 실시예에 따른 프로그램 작성 방법 및 가상 플랫폼을 이용하면 별도의 링크과정 없이, 수정된 소스 파일만을 컴파일하여 생성된 링크형 오브젝트 파일과 미리 생성된 실행로드 가능파일만을 이용하여 시뮬레이션을 실행할 수 있으므로 프로그램 수정 및 디버깅 시간을 단축할 수 있다. Using the program creation method and the virtual platform according to the embodiment of the present invention, the simulation can be executed using only the linked object file generated by compiling only the modified source file and the pre-generated executable loadable file without a separate link process So you can shorten program modification and debugging time.

특히 본 발명의 실시예에 따른 프로그램 작성 방법 및 가상 플랫폼은 소스 파일의 수가 많고 파일의 사이즈가 큰 프로그램일수록 디버깅 시간을 더욱 단축할 수 있다. Particularly, the program creation method and the virtual platform according to the embodiment of the present invention can further shorten the debugging time with a program having a large number of source files and a large file size.

본 발명에서 로드라 함은 저장된 프로그램 또는 데이터를 읽어서 메모리에 기억시키는 것을 의미한다. In the present invention, a load means that a stored program or data is read and stored in a memory.

그리고 본 발명에서 재시뮬레이션이라 함은 소스 파일 수정 후 다시 시뮬레이션을 실행하는 것을 의미한다.In the present invention, the re-simulation means that the simulation is executed again after the source file is modified.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시 예들을 상세히 설명한다. 이 때, 첨부된 도면에서 동일한 구성 요소는 가능한 동일한 부호로 나타내고 있음에 유의해야 한다. 또한 본 발명의 요지를 흐리게 할 수 있는 공지 기능 및 구성에 대한 상세한 설명은 생략할 것이다. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Note that, in the drawings, the same components are denoted by the same reference symbols as possible. Further, the detailed description of well-known functions and constructions that may obscure the gist of the present invention will be omitted.

도 1은 본 발명의 실시예에 따른 가상 플랫폼에서 코드 수정 전 생성된 실행로드 가능파일(ELF) 및 코드 수정 후 생성된 링크형 오브젝트(linked object)를 이용하여 시뮬레이션을 실행하는 과정을 나타내는 개략도이다. 1 is a schematic diagram showing a process of executing a simulation using an execution loadable file (ELF) generated before a code modification and a linked object generated after a code modification in a virtual platform according to an embodiment of the present invention .

<코드 수정 전><Before modifying code>

우선, 프로그래머가 제1 소스 파일 및 제2 소스 파일을 작성하였다고 가정한다. 이 경우 제1 소스 파일은 함수 A 및 함수 B를 포함하고 있으며, 제2 소스 파일은 함수 C 및 함수 D를 포함한다. 작성된 제1 및 제2 소스 파일은 컴파일러에 의해 컴파일된다. 이 경우, 컴파일러(Compiler)는 특정 프로그램 언어로 작성된 문장을 처리하여 기계어 또는 컴퓨터가 사용할 수 있는 코드로 변경시켜주는 프로그램이라 고 정의할 수 있다. First, it is assumed that the programmer has created the first source file and the second source file. In this case, the first source file includes function A and function B, and the second source file includes function C and function D. The created first and second source files are compiled by the compiler. In this case, a compiler can be defined as a program that processes a sentence written in a specific programming language and changes it into a code that can be used by a machine language or a computer.

제1 및 제2 소스 파일이 컴파일되면 제1 소스 파일은 제1 오브젝트 파일로 변환되고, 제2 소스 파일은 제2 오브젝트 파일로 변환된다. 상기 컴파일 과정 후 제1 및 제2 오브젝트 파일은 링크 과정을 거치게 된다. 상기 링크 과정은 하나 이상의 오브젝트 모듈이 동시에 실행되고 그것들이 서로의 명령어나 데이터를 상호 참조할 때, 그 명령어나 데이터들 간의 상대적 위치를 정하는 과정이라고 정의될 수 있다. 다시 말해 임의의 함수가 다른 파일에 있는 함수 또는 변수들을 호출하는 경우 컴파일 과정에서는 오브젝트 파일에 어떠한 함수 또는 변수를 참조하는지 표시만을 기록하는데, 이러한 오브젝트 파일들의 의존 관계가 해소되는 과정이 바로 링크 과정이다. 본 발명의 실시예에 따르면 상기 링크는 오브젝트들의 배열 시 예약 영역을 고려하여 오브젝트 파일 및 데이터를 배열하는 디버그 링크(debug link) 과정에 의해 수행될 수 있다.When the first and second source files are compiled, the first source file is converted into a first object file, and the second source file is converted into a second object file. After the compiling process, the first and second object files are linked. The linking process can be defined as a process of determining relative positions of an instruction or data when one or more object modules are executed simultaneously and when they mutually refer to each other's instruction or data. In other words, when an arbitrary function calls a function or a variable in another file, only the indication as to which function or variable is referred to in the object file is recorded in the compilation process. The process of eliminating the dependency of such object files is a link process . According to an embodiment of the present invention, the link may be performed by a debug link process of arranging object files and data in consideration of reserved areas when arranging objects.

제1 및 제2 오브젝트 파일이 링크 과정을 거치게 되면 가상 플랫폼에서 실행될 수 있는 실행로드 가능파일(Executable and Loadable File, ELF)이 생성된다. 이 경우 상기 실행로드 가능파일은 실행 가능한 바이너리, 섹션의 위치, 디버깅 정보 등 바이너리를 실행하는데 필요한 정보, 부가 정보 및 재배치에 관한 정보를 포함한다. When the first and second object files pass through the link process, an Executable and Loadable File (ELF) that can be executed in the virtual platform is generated. In this case, the executable loadable file includes executable binaries, location of sections, information necessary for executing binaries such as debugging information, additional information, and relocation information.

상기 컴파일 및 링크 과정을 통해 생성된 실행로드 가능파일은 시뮬레이션 실행 시 제1 메모리에 로드된다. The executable loadable file generated through the compiling and linking process is loaded into the first memory when the simulation is executed.

<코드 수정 후><After modifying the code>

프로그래머는 상기의 과정을 통하여 생성된 실행로드 가능파일을 이용하여 시뮬레이션 실행 후, 프로그램상의 오류가 발생하거나 또는 함수 내용을 변경할 필요가 있는 경우, 소스 파일을 재작성하거나 수정한 후 다시 시뮬레이션을 실행하는 과정을 거치게 되는데 이러한 과정을 디버깅(debuging)이라고 한다. If a program error occurs or there is a need to change the function contents after execution of the simulation using the executable loadable file generated through the above process, the programmer re-creates or modifies the source file and executes the simulation again This process is called debugging.

본 발명에서는 코드 수정 전에 작성된 제1 소스 파일의 함수 B를 함수 BB 로 수정할 필요가 있다고 가정한다. 종래 디버깅 과정에 따르면, 함수 BB를 수정한 후 제1 및 제2 소스 파일을 다시 컴파일하고, 생성된 제1 오브젝트 파일 및 제2 오브젝트 파일을 다시 링크를 해야 하는 번거로움이 존재하였다. In the present invention, it is assumed that the function B of the first source file created before the code modification needs to be modified to the function BB. According to the conventional debugging process, there is a need to recompile the first and second source files after modifying the function BB, and relink the generated first and second object files.

그러나 본 발명에 따르면 제1 소스 파일의 함수 B를 함수 BB로 수정한 후 본 발명의 실시예에 따른 링크형 컴파일(linked compile)을 수행하면 링크형 제1 오브젝트 파일(a first linked object file)이 생성된다. 이 경우 링크형 제1 오브젝트 파일은 코드 수정 전 단계에서 생성된 실행로드 가능 파일과는 독립적인 코드이며, 상기 링크형 컴파일 과정은 상기 실행로드 가능파일(ELF)을 변경시키지 않는다. However, according to the present invention, if a function B of the first source file is modified to a function BB and a linked compile according to an embodiment of the present invention is performed, a first linked object file . In this case, the link-type first object file is independent of the executable loadable file generated in the step before the code modification, and the linkable compilation process does not change the executable loadable file (ELF).

그리고 시뮬레이션을 실행하면(별도의 링크 과정 없이), 제1 메모리에는 미리 생성된 실행로드 가능파일(ELF)이 로드되고 제2 메모리에는 코드 수정 후 링크형 컴파일에 의해 생성된 링크형 제1 오브젝트 파일이 로드된다. When the simulation is executed (without a separate link process), the pre-generated executable loadable file (ELF) is loaded into the first memory, and the link-type first object file Is loaded.

그리고 시뮬레이션 실행 후, 수정된 함수 BB를 사용할 필요가 있는 경우에는 제1 메모리에 로드된 실행로드 가능 파일(ELF)로의 접근을 제2 메모리에 로드된 링크형 제1 오브젝트 파일로의 접근으로 스위치(switch)할 수 있다. 이 경우 상기 제2 메모리에 로드된 링크형 제1 오브젝트 파일은 독립적으로 수행되는 것이 아니라, 제1 메모리에 로드된 실행로드 가능파일(ELF)의 바이너리 정보들을 참고하여야만 시뮬레이션이 실행될 수 있다. When the modified function BB needs to be used after execution of the simulation, access to the executable loadable file (ELF) loaded in the first memory is switched to access to the linked first object file loaded in the second memory switch. In this case, the link-type first object file loaded in the second memory is not performed independently but the binary information of the executable loadable file (ELF) loaded in the first memory is referred to so that the simulation can be executed.

상기와 같은 방법으로, 수정된 제1 소스 파일이 링크형 컴파일되어 생성된 링크형 제1 오브젝트 파일은 별도의 링크 과정을 거치지 않더라도 이전 단계의 실행로드 가능파일(ELF)의 정보를 참조하여 실행될 수 있는 것이다. The link-type first object file generated by link-compiling the modified first source file can be executed by referring to the information of the execution loadable file (ELF) in the previous step without going through a separate link process It is.

도 2는 본 발명의 실시예에 따라 복수의 오브젝트 파일을 로드하여 시뮬레이션할 수 있는 가상 플랫폼의 내부 구조를 나타내는 블록도이다. 이 경우 상기 가상 플랫폼은 BUS(210), 제1 메모리(220), 제2 메모리(230), 오브젝트 리매핑 유닛(240), 제어부(250)을 포함할 수 있다. 2 is a block diagram illustrating an internal structure of a virtual platform capable of loading and simulating a plurality of object files according to an embodiment of the present invention. In this case, the virtual platform may include a BUS 210, a first memory 220, a second memory 230, an object remapping unit 240, and a controller 250.

BUS(210)는 본 발명의 가상 플랫폼을 구성하는 개별 블록 간 또는 외부 장치 사이에서 신호를 전달하기 위하여 사용되는 선로이다. 일반적으로 데이터 신호가 전달되는 버스를 데이터 버스라 하고, 주소가 전달되는 버스를 주소 버스라고 한다. The BUS 210 is a line used for transferring signals between individual blocks or between external devices constituting the virtual platform of the present invention. Generally, a bus to which a data signal is transmitted is called a data bus, and a bus to which an address is transmitted is called an address bus.

제1 메모리(220)는 본 발명의 실시예에 따른 가상 플랫폼의 전반적인 동작에 필요한 프로그램들과 데이터들을 저장한다. 그리고 제1 메모리(220)에는 시뮬레이션 실행 시 코드 수정 전 컴파일 및 디버그 링크에 의해 생성된 실행로드 가능파일(ELF)이 로드될 수 있다. The first memory 220 stores programs and data necessary for the overall operation of the virtual platform according to the embodiment of the present invention. In the first memory 220, an execution loadable file (ELF) generated by a compile and debug link before code modification can be loaded at the time of simulation execution.

제2 메모리(230)는 본 발명의 실시예에 따른 가상 플랫폼을 구동시키기 위한 가상 플랫폼의 자체 메모리이다. 상기 제2 메모리(230)는 오브젝트 리매핑 유닛(240)에 의해서만 접근이 가능하다. 코드 수정 후 링크형 컴파일(linked compile)을 수행하면 링크형 오브젝트(linked object)가 생성되는데, 시뮬레이션 실행 시 상기 링크형 오브젝트 파일은 제2 메모리(230)에 로드된다. 다시 말해 프로그래머가 코드 수정 후 시뮬레이션을 실행하면, 코드 수정 전 단계에서 생성된 실행로드 가능파일(ELF)은 제1 메모리(220)에, 코드 수정 후 단계에서 생성된 링크형 오브젝트 파일은 제2 메모리(230)에 로드된다. The second memory 230 is a self-memory of the virtual platform for driving the virtual platform according to the embodiment of the present invention. The second memory 230 is only accessible by the object remapping unit 240. When a link is compiled after the code is modified, a linked object is created. When the simulation is executed, the linked object file is loaded into the second memory 230. In other words, when the programmer executes the simulation after the code modification, the execution loadable file (ELF) generated in the stage before the code modification is stored in the first memory 220, the linked object file generated in the step after the code modification is stored in the second memory (230).

오브젝트 리매핑 유닛(240)은 제1 메모리(230)에 로드된 실행로드 가능파일(ELF)과 제2 메모리(240)에 로드된 링크형 오브젝트 파일에 존재하는 함수, 데이터들 중 프로그래머가 선택한 함수, 데이터에 접근할 수 있도록 제어한다. 다시 말해, 제어부(250)가 명령어를 수행하거나 데이터를 로드하는 경우에는 제1 메모리(220) 또는 제2 메모리(230)에 접근해야 하는데, 코드 수정 후 단계에서 수정된 함수에 접근하기 위해서는 제1 메모리(220)의 실행로드 가능파일(ELF)으로의 접근을 제2 메모리(230)의 링크형 오브젝트 파일로의 접근으로 스위치 해야 한다. 이 경우 프로그래머는 어떠한 함수에 접근할지 여부를 스크립트 형식으로 작성하여 설정할 수 있고, 오브젝트 리매핑 유닛(240)은 사용자 설정에 따라 제2 메모리(230)의 링크형 오브젝트 파일에 접근하도록 제어한다. The object remapping unit 240 performs functions such as a function existing in an executable loadable file (ELF) loaded in the first memory 230 and a linked object file loaded in the second memory 240, Control access to data. In other words, when the control unit 250 executes an instruction or loads data, it has to access the first memory 220 or the second memory 230. In order to access the modified function in the step after the code modification, The access to the executable loadable file ELF of the memory 220 should be switched to the access to the linked object file of the second memory 230. [ In this case, the programmer can set whether to access a function in a script format, and the object remapping unit 240 controls access to the linked object file in the second memory 230 according to the user setting.

제어부(250)는 본 발명의 가상 플랫폼을 제어하는 중앙 처리 장치로서 본 발명의 실시예에서는 CPU(Central Processing Unit)일 수 있으며, 논리 연산 및 중앙 제어 기능을 수행한다. 그리고 본 발명의 실시예에 따르면 제어부(250)는 실행로드 가능파일 생성부(250A), 링크형 오브젝트 파일 생성부(250B), 메모리 접근 제어부(250C)를 포함할 수 있다. The control unit 250 is a central processing unit for controlling the virtual platform of the present invention, and may be a central processing unit (CPU) in the embodiment of the present invention, and performs a logical operation and a central control function. According to an embodiment of the present invention, the controller 250 may include an executable loadable file generator 250A, a linked object file generator 250B, and a memory access controller 250C.

상기 제어부(250)는 프로그래머가 작성한 소스 파일을 수정하고자 하는 경우, 링크 과정 없이 시뮬레이션을 실행하는 일련의 과정들을 제어한다. The control unit 250 controls a series of processes for executing a simulation without a link process when a source file created by a programmer is to be modified.

실행로드 가능파일 생성부(250A)는 최초 소스 파일이 작성 되면 이를 컴파일하는 단계를 제어할 수 있다. 그리고 실행로드 가능파일 생성부(250A)는 컴파일되어 생성된 오브젝트 파일들을 시뮬레이션하기 위한 링크 과정에서 디버그 링크(debug link)를 실행하여 실행로드 가능파일을 생성하도록 제어한다. 디버그 링크란 링크 단계에서 오브젝트들의 배열 시 예약 영역을 고려하여 오브젝트 파일 및 데이터를 배열하는 것을 의미한다. 이와 같은 디버그 링크에 대한 구체적인 예시는 도 3에서 도시되었다. The executable loadable file generation unit 250A can control the compiling step when the initial source file is created. In addition, the executable loadable file generation unit 250A executes a debug link in a link process for simulating the compiled and generated object files to control execution loadable files to be generated. The debug link means arranging the object file and the data in consideration of the reserved area when arranging the objects in the link step. A specific example of such a debug link is shown in FIG.

도 3에서 확인할 수 있는 바와 같이, 실행로드 가능파일 생성부(250A)는 본 발명의 디버그 링크는 링크 과정에서, 일반적인 링크 과정에서와 같이 오브젝트 파일들과 오브젝트 데이터들을 연속하여 배열하는 것이 아니라, 각각의 오브제트 코드들과 오브젝트 데이터들에 대해 예약 영역을 할당한다. 즉, 실행로드 가능파일 생성부(250A)는 제1 오브젝트 파일(310)은 예약 영역(310A)를, 제2 오브젝트 파일(320)은 예약 영역(320A)를, 제3 오브젝트 파일(330)은 예약 영역(330A)를, 제1 오브젝트 데이터(340)는 예약 영역(340A)를, 제2 오브젝트 데이터(350)는 예약 영역(350A)를 구비하도록 디버그 링크를 실행한다. 이 경우, 본 발명에서 제안하는 디버그 링크는 링크 과정을 수행하는데 별도의 시간 지연을 발생시키지 않는다.As can be seen from FIG. 3, the executable loadable file generation unit 250A does not arrange the object files and the object data in succession in the link process of the present invention, as in the general link process, And allocates a reserved area for object codes and object data of the object codes. That is, the executable loadable file creating unit 250A is configured such that the first object file 310 is a reserved area 310A, the second object file 320 is a reserved area 320A, the third object file 330 is A debug link is executed so that the first object data 340 includes the reserved area 340A and the second object data 350 includes the reserved area 350A. In this case, the debug link proposed in the present invention does not cause a separate time delay in performing the link process.

이 경우, 제1 오브젝트 파일(310) 및 예약 영역(320A)은 각각의 함수들에 대한 예약 영역을 별도로 구비할 수 있다. 다시 말해 함수a(312)는 예약 영역 (312A) 를, 함수b(314)는 예약 영역(314A)를 별도로 구비할 수 있다. 그러나 본 발명의 다른 실시예에 따르면 반드시 상기한 바와 같이 각각의 함수들이 예약 영역을 별도로 구비하는 것이 아니라, 모든 함수들이 공통의 예약 영역을 구비하는 것도 가능하다.In this case, the first object file 310 and the reserved area 320A may have reserved areas for respective functions. In other words, the function a 312 may have a reserved area 312A and the function b 314 may have a reserved area 314A separately. However, according to another embodiment of the present invention, as described above, each function does not have a reserved area separately, but all functions may have a common reserved area.

별도의 예약 영역을 할당하지 않은 경우에는 수정된 함수의 사이즈가 수정 전 함수의 사이즈보다 큰 경우, 수정된 함수가 컴파일 및 링크 과정에서 다른 함수 또는 다른 데이터 영역을 침범하여 시뮬레이션 실행 시 충돌이 발생할 수 있다는 문제점이 발생한다. 그러나 본 발명에서와 같은 디버그 링크 과정에서는 각 오브젝트 별로 별도의 예약 영역을 할당하므로 수정된 함수의 사이즈가 수정 전 함수의 사이즈보다 커지는 경우, 미리 할당된 예약 영역을 사용할 수 있으므로 다른 함수나 데이터 영역을 침범하는 문제가 발생하지 않는다. If the size of the modified function is larger than the size of the function before modification, the function may invade other functions or other data areas during compilation and linking, causing a collision when executing the simulation. . However, in the debug link process according to the present invention, since a separate reserved area is allocated to each object, if the size of the modified function is larger than the size of the unmodified function, a pre-allocated reserved area can be used. The problem of invasion does not occur.

링크형 오브젝트 파일 생성부(250B)는 링크형 컴파일(linked compile)을 통해 수정된 소스 파일에 대해 링크형 오브젝트(linked object)를 생성하는 단계를 제어한다. 이 경우 상기 링크형 오브젝트 파일이란 상기한 바와 같이 코드 수정 전 단계에서 생성된 실행로드 가능파일(ELF)과는 독립적인 코드이지만 독립적으로는 실행될 수 없고, 시뮬레이션 실행 시 필요한 바이너리 정보 등을 상기 실행로드 가능파일을 참고해야 하는 파일을 의미한다.The linked object file generation unit 250B controls the step of generating a linked object for the modified source file through a linked compile. In this case, the link type object file is a code independent from the executable loadable file (ELF) generated in the step before the code modification as described above, but can not be independently executed, Means a file that should be referred to.

메모리 접근 제어부(250C)는 수정 전 함수의 호출을 수정 후 함수의 호출로 전환할 필요가 있는 함수들에 대한 정보를 획득한다. 그리고 상기 메모리 접근 제어부(250C)는 변경된 함수에 대한 접근이 요구되는 경우, 오브젝트 리매핑 유 닛(240)을 제어하여 제1 메모리의 실행로드 가능파일(ELF)로의 접근을 제2 메모리의 링크형 오브젝트로의 접근으로 스위치한다. The memory access control unit 250C obtains information about functions that need to convert a call of the pre-modification function to a call of a function. When access to the changed function is requested, the memory access controller 250C controls the object remapping unit 240 to access the executable load file (ELF) of the first memory in the linked object of the second memory Lt; / RTI &gt;

도 4는 본 발명의 실시예에 따른 가상 플랫폼을 이용한 프로그램 작성 및 수정 과정을 나타내는 순서도이다. 4 is a flowchart illustrating a process of creating and modifying a program using a virtual platform according to an embodiment of the present invention.

우선, S405 단계에서 소스 파일이 작성되면 작성된 소스 파일은 S410 단계에서 컴파일 된다. 컴파일 단계가 실행되면 소스 파일은 기계어 또는 컴퓨터가 사용할 수 있는 코드에 대한 정보를 포함하는 오브젝트 파일로 변환된다. 그리고 상기 컴파일 과정 이후 생성된 오브젝트 파일은 S415 단계에서 디버그 링크 과정을 통해 S420 단계에서 실행로드 가능파일(ELF)로 변환된다. First, when a source file is created in step S405, the created source file is compiled in step S410. When the compilation step is executed, the source file is converted into an object file containing information about the machine language or code that the computer can use. The object file generated after the compiling process is converted into an executable loadable file (ELF) in step S420 through a debug link process in step S415.

이 경우, S415 단계에서 실행되는 디버그 링크 과정은 각각의 오브젝트 파일 및 오브젝트 데이터들에 대하여 별도의 예약 영역(reserved area)를 할당한 후 배열하는 것을 의미한다. 상기 예약 영역으로 인하여 프로그램 수정 후 함수의 사이즈가 커지더라도 다른 함수 또는 데이터 영역을 침범하는 문제를 할 수 있음은 상기한 바와 같다. In this case, the debug link process executed in step S415 means allocating a reserved area for each object file and object data, and arranging them. Even if the size of the function after the program modification is increased due to the reserved area, it may cause a problem of invading another function or data area.

실행로드 가능파일(ELF)이 생성되면 가상 플랫폼을 통한 시뮬레이션이 실행될 수 있다. 즉, S425 단계에서 시뮬레이션이 실행되면 생성된 실행로드 가능파일(ELF)는 제1 메모리(220)에 로드된다. 그러면 제어부(250)는 상기 제1 메모리에 로드된 실행로드 가능파일(ELF)에 접근하여 명령어를 수행하거나 데이터를 로드한다. Once an Executable Loadable File (ELF) is generated, a simulation through the virtual platform can be executed. That is, when the simulation is executed in step S425, the generated executable loadable file ELF is loaded into the first memory 220. [ Then, the control unit 250 accesses the executable loadable file (ELF) loaded in the first memory and executes a command or loads data.

가상 플랫폼을 통한 시뮬레이션 결과는 S430 단계에서 출력된다. 제어 부(250)는 S435 단계에서 작성된 프로그램이 변경되거나 수정되는지 여부를 판단한다. 만약, 프로그램이 변경되거나 수정되는 경우라면 제어부(250)는 S440 단계에서 프로그램 수정 및 실행 과정을 제어한다. Simulation results through the virtual platform are output in step S430. The control unit 250 determines whether the program created in step S435 is changed or modified. If the program is changed or modified, the controller 250 controls the program modification and execution process in step S440.

그러나 프로그램이 변경되거나 수정되지 않는 경우라면 제어부(250)는 최종적으로 실행될 실행로드 가능파일(ELF)을 생성하는 일련의 과정을 제어한다. 즉, 제어부(250)는 S445 단계에서 최종적으로 확정된 소스 파일들에 대해 컴파일 과정을 실행한다. 컴파일이 실행되면 각각의 소스 파일들에 대한 오브젝트 파일이 생성된다. However, if the program is not changed or modified, the control unit 250 controls a series of processes for generating an executable loadable file (ELF) to be finally executed. That is, the controller 250 executes a compilation process on the finally confirmed source files in step S445. When the compilation is executed, an object file is created for each source file.

그러면 제어부(250)는 S450 단계에서 오브젝트 파일들에 대하여 링크 과정을 실행한다. S450 단계에서 실행되는 링크 과정은 S415 단계에서 실행되는 디버그 링크 과정과는 상이한 것이다. 다시 말해 S415 단계의 디버그 링크 과정은 이후 단계의 디버깅을 전제로 하여 오브젝트 파일 및 오브젝트 데이터들에 대하여 별도의 예약 영역(reserved area)를 할당하는 것임에 반하여, S450 단계에서는 이미 디버깅이 완료된 상태이므로 별도의 예약 영역을 할당할 필요가 없으므로 일반 링크 과정을 실행한다. 상기 링크 과정이 완료되면 S455 단계에서 최종적으로 시뮬레이션될 실행로드 가능파일이 생성된다. In step S450, the controller 250 executes a link process on the object files. The link process executed in step S450 is different from the debug link process executed in step S415. In other words, in step S415, the debug link process allocates a reserved area for the object file and the object data on the premise of debugging at a later stage. On the other hand, since debugging has already been completed in step S450, It is not necessary to allocate the reserved area of the &lt; / RTI &gt; When the link process is completed, an execution loadable file to be finally simulated is generated in step S455.

도 5는 본 발명의 실시예에 따른 가상 플랫폼을 이용하여 디버깅하는 과정을 나타내는 순서도이다. 5 is a flowchart illustrating a process of debugging using a virtual platform according to an embodiment of the present invention.

우선, 도 4 과정에서 작성된 프로그램은 S510 단계에서 수정 또는 변경된다. 프로그램 수정 후 제어부(250)는 S515 단계에서 수정된 소스 파일에 대해 링크형 컴파일(linked complie)을 실행한다. 종래에는 하나의 소스 파일만을 수정하였더라도 시뮬레이션을 위해서는 모든 소스 파일들을 다시 컴파일하고 링크하는 과정이 필요하였으므로 불필요한 시간을 소모한다는 문제점이 있었다. 그러나 본 발명의 실시예에 따르면 수정된 소스 파일만을 컴파일하게 되는데 이러한 컴파일을 링크형 컴파일이라고 한다. 제어부(250)가 링크형 컴파일을 수행하면 수정된 소스 파일은 S520 단계에서 링크형 오브젝트(linked object)로 변환된다. First, the program created in FIG. 4 is modified or changed in step S510. After modifying the program, the control unit 250 executes a linked complication on the modified source file in step S515. Conventionally, even if only one source file is modified, a process of recompiling and linking all the source files is required for simulation, and therefore, there is a problem that unnecessary time is consumed. However, according to the embodiment of the present invention, only the modified source file is compiled. Such compilation is called link-type compilation. When the control unit 250 performs link type compilation, the modified source file is converted into a linked object in step S520.

그리고 제어부(250)는 S525 단계에서 실행로드 가능파일(ELF)로의 접근을 링크형 오브젝트로의 접근으로 스위치할 필요가 있는 함수들에 대한 정보를 입력받고 이를 오브젝트 리매핑 유닛(240)에 전달한다. 이 경우 실행로드 가능파일(ELF)과 링크형 오브젝트에 동시에 존재하는 함수 및 데이터들에 대해서는 어떠한 것을 이용할지 여부, 그리고 수정된 함수를 호출하기 위해 실행로드 가능파일로의 접근을 링크형 오브젝트로의 접근으로 스위할 필요가 있는 함수들에 대한 정보는 개별적으로 입력되거나 또는 스크립트(script)를 이용하여 일괄적으로 지정할 수도 있다. In step S525, the control unit 250 receives information about functions that need to switch access to the executable loadable file (ELF) to access to the linked object, and transfers the information to the object remapping unit 240. [ In this case, it is necessary to decide what to use for functions and data that exist simultaneously in the executable loadable file (ELF) and the linked object, and whether to access the executable loadable file to the linked object Information about functions that need to be switched to access can be entered individually or in batches using a script.

그리고 제어부(250)는 S530 단계에서 시뮬레이션을 실행한다. 이 경우 제어부(250)는 S535 단계에서, S420 단계에서 생성된 실행로드 가능파일(ELF)은 제1 메모리(220)에, S520 단계에서 생성된 링크형 오브젝트는 제2 메모리(230)에 로드하도록 제어한다. Then, the controller 250 executes the simulation in step S530. In this case, in step S535, the controller 250 loads the execution loadable file ELF generated in step S420 into the first memory 220 and loads the linked object generated in step S520 into the second memory 230 .

이하에서는 상기 S525 단계 및 S530 단계에 대해 보다 구체적으로 기술하도록 한다. 예를 들어, 프로그램 수정 소스 파일에 함수A 및 함수B가 작성되었다면 이에 대한 정보는 최초의 컴파일 및 링크 과정에 의해 생성된 실행로드 가능파 일(ELF)에 포함된다. 이후 프로그램 수정에 의해 함수B가 함수BB로 변경되었다면, 본 발명의 실시예에 따른 링크형 컴파일에 의해 함수A 및 함수BB를 포함하는 링크형 오브젝트가 생성된다. 그리고 시뮬레이션이 실행되면 상기 실행로드 가능파일(ELF)은 제1 메모리(220)에, 상기 링크형 오브젝트는 제2 메모리(230)에 로드된다. 시뮬레이션이 실행되면 오브젝트 리매핑 유닛(240)은 S525 단계에서 제어부(250)로부터 전달받은 정보를 기반으로 제1 메모리(220)에 로드된 실행로드 가능파일(ELF)의 함수B로의 접근을 제2 메모리(230)에 로드된 링크형 오브젝트의 함수BB로의 접근으로 스위치한다. Hereinafter, steps S525 and S530 will be described in more detail. For example, if function A and function B are created in the program modification source file, the information is included in the executable loadable file (ELF) generated by the initial compilation and linking process. If the function B is changed to the function BB by the program modification, a linked object including the function A and the function BB is generated by link-type compilation according to the embodiment of the present invention. When the simulation is executed, the execution loadable file ELF is loaded into the first memory 220 and the linked object is loaded into the second memory 230. When the simulation is executed, the object remapping unit 240 accesses the function B of the executable loadable file (ELF) loaded in the first memory 220 based on the information received from the control unit 250 in step S525, To the function BB of the linked object loaded into the function block 230. [

정리하면, 본 발명의 가상 플랫폼에서는 프로그램 수정 전 생성된 실행로드 가능파일(ELF)과, 링크형 컴파일에 의해 변환된 링크형 오브젝트가 별개의 메모리에 독립적으로 로드되어 시뮬레이션 된다. 따라서 수정된 소스 파일은 기존에 생성된 실행로드 가능파일(ELF)을 참고하여 실행될 수 있으므로, 별도의 링크 과정이 필요 없고 또한 수정되지 않은 소스 파일은 다시 컴파일 할 필요가 없으므로 디버깅에 걸리는 시간을 단축할 수 있는 것이다. In summary, in the virtual platform of the present invention, the executable loadable file (ELF) generated before the program modification and the link-type object converted by the link-type compilation are independently loaded into a separate memory and simulated. Therefore, the modified source file can be executed by referring to the existing executable loadable file (ELF) generated, so there is no need for a separate link process, and the unedited source file does not need to be recompiled, You can do it.

가상 플랫폼을 통한 시뮬레이션 결과는 S540 단계에서 출력된다. 제어부(250)는 S545 단계에서 작성된 프로그램이 변경되거나 수정되는지 여부를 판단한다. 만약, 프로그램이 변경되거나 수정되는 경우라면 제어부(250)는 S510 단계 내지 S540 단계의 실행 과정을 제어한다. Simulation results through the virtual platform are output in step S540. The control unit 250 determines whether the program created in step S545 is changed or modified. If the program is changed or modified, the controller 250 controls the execution of steps S510 through S540.

그러나 프로그램이 변경되거나 수정되지 않는 경우라면 제어부(250)는 최종적으로 실행될 실행로드 가능파일(ELF)을 생성하는 일련의 과정을 제어한다. 즉, 제어부(250)는 S555 단계에서 최종적으로 확정된 소스 파일들에 대해 컴파일 과정을 실행한다. 컴파일이 실행되면 각각의 소스 파일들에 대한 오브젝트 파일이 생성된다. However, if the program is not changed or modified, the control unit 250 controls a series of processes for generating an executable loadable file (ELF) to be finally executed. That is, the control unit 250 executes the compiling process for the finally confirmed source files in step S555. When the compilation is executed, an object file is created for each source file.

그러면 제어부(250)는 S555 단계에서 오브젝트 파일들에 대하여 링크 과정을 실행한다. S450 단계에서 실행되는 링크 과정은 S415 단계에서 실행되는 디버그 링크 과정과는 상이한 것이라는 것은 상기한 바와 같다. 상기 링크 과정이 완료되면 S560 단계에서 최종적으로 시뮬레이션될 실행로드 가능파일(ELF)이 생성된다. In step S555, the controller 250 executes a link process on the object files. The link process executed in step S450 is different from the debug link process executed in step S415 as described above. When the link process is completed, an execution loadable file (ELF) to be finally simulated is generated in step S560.

이하에서는 종래의 프로그램 작성, 디버깅 과정 수행에 소요되는 시간과 본 발명의 실시예에 따른 프로그램 작성, 디버깅 과정 수행에 소요되는 시간을 비교하도록 한다.Hereinafter, the time required for performing the conventional program creation and debugging process and the time required for performing the program creation and debugging according to the embodiment of the present invention are compared.

우선 제1 소스 파일, 제2 소스 파일, 제3 소스 파일의 3 개의 파일이 있고, 이 중에서 제1 소스 파일을 수정할 필요가 있다고 가정하도록 한다.First, assume that there are three files: a first source file, a second source file, and a third source file. It is assumed that the first source file needs to be modified.

<종래 방법에 의한 시뮬레이션 시 소요되는 시간>&Lt; Time required for simulation by the conventional method >

우선 상기의 소스 파일들을 이용하여 가상 플랫폼에서 시뮬레이션을 실행하기 위해서는 각각의 소스 파일들을 컴파일 해야 한다. 이 경우 컴파일 하는데 걸리는 시간은 각각 tc(1), tc(2), tc(3) 이다. 그리고 컴파일하여 생성된 각각의 오브젝트 파일들을 링크하는데 걸리는 시간은 Tlink이다. First, in order to execute the simulation in the virtual platform using the above-described source files, the respective source files must be compiled. In this case, the time to compile is tc (1), tc (2), tc (3), respectively. The time taken to link each object file created and compiled is Tlink.

그러면 컴파일 후 링크까지의 최종 시간은 아래의 수학식 1 과 같다.Then, the final time from link to compile is as shown in Equation 1 below.

[수학식 1][Equation 1]

Ttot = tc(1) + tc(2) + tc(3) + TlinkTtot = tc (1) + tc (2) + tc (3) + Tlink

그리고 제1 소스 파일을 수정하는데 걸리는 시간 즉, 디버깅 시간은 아래의 수학식 2와 같다.The time required for correcting the first source file, i.e., the debugging time, is expressed by Equation 2 below.

[수학식 2]&Quot; (2) &quot;

Tdebug = tc(1) + Tlink = TtotTdebug = tc (1) + Tlink = Ttot

프로그램 개발 시에는 디버깅 과정이 빈번하게 발생하는데, n 번의 프로그램 수정이 발생하였다면, 시뮬레이션 시간을 제외한 최종 시간을 아래의 수학식 3과 같다.The debugging process frequently occurs at the time of program development. If n program modifications occur, the final time excluding the simulation time is expressed by Equation 3 below.

[수학식 3]&Quot; (3) &quot;

Tfinish = Ttot + n*Tdebug = Ttot + n*tc(1) + n*TlinkTfinish = Ttot + n * Tdebug = Ttot + n * tc (1) + n * Tlink

<본 발명의 실시예에 의한 시뮬레이션 시 소요되는 시간><Time required for simulation according to the embodiment of the present invention>

본 발명에서 제안한 방법은 종래의 방법과 마찬가지로 가상 플랫폼에서 시뮬레이션을 실행하기 위해서는 우선적으로 상기 제1 소스 파일, 제2 소스 파일, 제3 소스 파일에 대해 컴파일 및 디버그 링크 과정을 실행해야 한다. 이 경우 컴파일 하는데 걸리는 시간은 각각 tc(1), tc(2), tc(3) 이다. 그리고 컴파일하여 생성된 각각의 오브젝트 파일들을 디버그 링크하는데 걸리는 시간은 Tlink이다. 본 발명의 실시예에 따르면 컴파일된 각각의 오브젝트 파일들을 일반적인 링크가 아닌 디버그 링크(debug link) 과정을 실행한다는 점에서 종래 방법과 상이하다. 그리고 이 경 우 디버그 링크는 오프젝트 파일의 코드 및 데이터들을 배열할 때 예약 영역을 고려하여 배열하지만 이는 링크 시간에 영향을 주지 않는다. In the method proposed in the present invention, as in the conventional method, in order to execute the simulation in the virtual platform, a compile and debug link process should be executed for the first source file, the second source file, and the third source file. In this case, the time to compile is tc (1), tc (2), tc (3), respectively. And the time taken to debug link each object file created by compilation is Tlink. The present invention differs from the conventional method in that each compiled object file executes a debug link process rather than a general link. In this case, the debug link arranges the code and data of the object file in consideration of the reserved area, but does not affect the link time.

그러면 컴파일 후 링크까지의 최종 시간은 아래의 수학식 4와 같으며, 이는 종래의 수학식 1과 동일하다. Then, the final time from the link to the compile-time is expressed by Equation (4) below, which is the same as Equation (1).

[수학식 4]&Quot; (4) &quot;

Ttot = tc(1) + tc(2) + tc(3) + TlinkTtot = tc (1) + tc (2) + tc (3) + Tlink

그리고 제1 소스 파일을 수정하고 링크형 컴파일이 실행된 때까지의 시간 즉, 다시 시뮬레이션을 실행할 수 있는 실행로드 가능파일 및 링크형 오브젝트가 생성될 때까지의 시간은 아래의 수학식 5와 같다.The time until the first source file is modified and the link type compilation is executed, that is, the execution loadable file capable of executing the simulation again, and the time until the link type object is generated, is expressed by Equation (5).

[수학식 5]&Quot; (5) &quot;

Tdebug = tc(1)Tdebug = tc (1)

다시 말해 수정된 제1 소스 파일이 링크형 컴파일 되는 시간만이 소요된다. In other words, it only takes time for the modified first source file to be linked compiled.

프로그램 개발 단계에서 n 번의 디버깅 과정을 수행한다면, n 번의 디버깅 과정 까지 걸리는 시간은 아래의 수학식 6과 같다.If n debugging processes are performed in the program development stage, the time required for n debugging processes is expressed by Equation (6) below.

[수학식 6]&Quot; (6) &quot;

Tfinish_tmp = Ttot + n*Tdebug = Ttot + n*tc(1)Tfinish_tmp = Ttot + n * Tdebug = Ttot + n * tc (1)

그리고 디버깅 과정 완료 후, 최종적으로 사용할 실행로드 가능파일(ELF)을 생성하는데 걸리는 시간은 아래의 수학식 7과 같다.After completing the debugging process, the time required to generate an executable loadable file (ELF) to be finally used is expressed by Equation (7) below.

[수학식 7]&Quot; (7) &quot;

Tfinish = Tfinish_tmp + Ttot = 2*Ttot + n*TdebugTfinish = Tfinish_tmp + Ttot = 2 * Ttot + n * Tdebug

종래의 방법에 따른 수학식 3과 본 발명의 실시예에 따른 수학식 7을 비교해 보면 디버깅 횟수 즉, n 이 클수록 최종 프로그램이 완성되기 까지의 시간은 본 발명의 실시예에 따른 수학식 7이 작은 값을 갖는다는 것을 확인할 수 있다. 특히 프로그램 디버그와 구조 분석 및 성능 분석이 복잡해짐에 따라 발생하는 n의 횟수는 커지고, 소스 파일의 수 및 사이즈가 증가할 수록 링크 시간이 길어지기 때문에 본 발명의 실시예에 따르면 많은 시간을 단축시킬 수 있는 것이다. Comparing Equation (3) according to the conventional method with Equation (7) according to the embodiment of the present invention, the number of times of debugging, that is, the time n until the final program is completed, Value. &Lt; / RTI &gt; Particularly, since the number of occurrences of n increases as the program debug and structure analysis and performance analysis become complicated, and the link time becomes longer as the number and size of the source files increase, You can.

본 명세서와 도면에 개시 된 본 발명의 실시예들은 본 발명의 기술 내용을 쉽게 설명하고 본 발명의 이해를 돕기 위해 특정 예를 제시한 것일 뿐이며, 본 발명의 범위를 한정하고자 하는 것은 아니다. 여기에 개시된 실시예들 이외에도 본 발명의 기술적 사상에 바탕을 둔 다른 변형 예들이 실시 가능하다는 것은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에게 자명한 것이다.The embodiments of the present invention disclosed in the present specification and drawings are merely illustrative of specific embodiments of the present invention and are not intended to limit the scope of the present invention in order to facilitate understanding of the present invention. It will be apparent to those skilled in the art that other modifications based on the technical idea of the present invention are possible in addition to the embodiments disclosed herein.

도 1은 본 발명의 실시예에 따른 가상 플랫폼에서 코드 수정 전 생성된 실행로드 가능파일(ELF) 및 코드 수정 후 생성된 링크형 오브젝트(linked object)를 이용하여 시뮬레이션을 실행하는 과정을 나타내는 개략도.FIG. 1 is a schematic diagram showing a process of executing a simulation using an execution loadable file (ELF) generated before a code modification and a linked object created after a code modification in a virtual platform according to an embodiment of the present invention.

도 2는 본 발명의 실시예에 따라 복수의 오브젝트 파일을 로드하여 시뮬레이션할 수 있는 가상 플랫폼의 내부 구조를 나타내는 블록도.2 is a block diagram illustrating an internal structure of a virtual platform capable of loading and simulating a plurality of object files according to an embodiment of the present invention;

도 3은 본 발명의 실시예에 따른 디버그 링크에 대한 구체적인 예시를 나타내는 도면.3 is a diagram illustrating a specific example of a debug link according to an embodiment of the present invention;

도 4는 본 발명의 실시예에 따른 가상 플랫폼을 이용한 프로그램 작성 및 수정 과정을 나타내는 순서도.4 is a flowchart illustrating a process of creating and modifying a program using a virtual platform according to an embodiment of the present invention;

도 5는 본 발명의 실시예에 따른 가상 플랫폼을 이용하여 디버깅하는 과정을 나타내는 순서도.5 is a flowchart illustrating a process of debugging using a virtual platform according to an embodiment of the present invention.

Claims (14)

가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법에 있어서,A method for creating and debugging a program using a virtual platform, 오브젝트 파일에 포함된 코드 및 데이터에 대하여 별도의 예약 영역을 할당한 후 배열하는 디버그 링크를 통해 실행로드 가능 파일을 생성하는 단계;Generating an executable loadable file through a debug link that allocates and arranges a reserved area for code and data contained in an object file; 상기 실행로드 가능파일을 상기 가상 플랫폼의 제1 메모리에 로드하는 단계;Loading the executable loadable file into a first memory of the virtual platform; 상기 로드된 실행로드 가능파일에 근거하여 시뮬레이션을 실행하는 단계; Executing a simulation based on the loaded executable loadable file; 상기 시뮬레이션 결과 프로그램의 수정이 필요한 경우, 소스 파일 수정 후 상기 수정된 소스 파일만을 컴파일하여 시뮬레이션 실행에 필요한 정보를 포함하는 링크형 오브젝트를 생성하는 단계; 및If it is necessary to modify the program as a result of the simulation, compiling only the modified source file after the modification of the source file to generate a linked object including information necessary for executing the simulation; And 상기 생성된 링크형 오브젝트를 상기 가상 플랫폼의 제2 메모리에 로드하여 재시뮬레이션을 실행하는 단계를 포함하며,Loading the generated linked object into a second memory of the virtual platform to execute a re-simulation, 상기 예약 영역은 상기 링크형 오브젝트 생성 시 다른 데이터 영역을 침범하여 발생하는 충돌을 방지하기 위해 할당되는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.Wherein the reserved area is allocated to prevent collision caused by invading another data area when creating the linked object. 제1항에 있어서,The method according to claim 1, 상기 재시뮬레이션을 실행하는 단계는 수정된 정보 사용 시, 상기 제1 메모리에 로드된 상기 실행로드 가능파일로의 접근을 상기 제2 메모리에 로드된 상기 링크형 오브젝트로의 접근으로 스위치 하는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.Wherein the step of executing the re-simulation switches access to the executable loadable file loaded in the first memory to access to the linked object loaded in the second memory when the modified information is used A method for creating and debugging a program using a virtual platform. 삭제delete 제1항에 있어서,The method according to claim 1, 상기 링크형 오브젝트는 상기 재시뮬레이션 시, 상기 실행로드 가능파일에 포함된 정보를 참고하여 실행되는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.Wherein the link-type object is executed by referring to the information included in the executable loadable file during the re-simulation. 제4항에 있어서,5. The method of claim 4, 상기 제1 메모리와 상기 제2 메모리는 독립적인 별개의 메모리인 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.Wherein the first memory and the second memory are independent memories independent of each other. 제1항에 있어서,The method according to claim 1, 프로그램 수정 완료 시, 완성된 소스 파일을 컴파일 하여 오브젝트 파일을 생성하는 단계; 및Compiling the completed source file to generate an object file upon completion of program modification; And 상기 생성된 오브젝트 파일을 링크 하여 최종 실행로드 가능파일을 생성하는 단계를 더 포함하는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.And generating a final executable loadable file by linking the generated object file. &Lt; Desc / Clms Page number 19 &gt; 제1항에 있어서,The method according to claim 1, 상기 링크형 오브젝트를 생성하는 단계는 상기 실행로드 가능파일로의 접근을 상기 링크형 오브젝트로의 접근으로 스위치할 필요가 있는 함수들에 대한 정보가 입력되는 단계를 더 포함하는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.Wherein the step of generating the linked object further comprises the step of inputting information about functions that need to switch access to the executable loadable file to access to the linked object. How to create and debug a program using. 제7항에 있어서,8. The method of claim 7, 상기 스위치할 필요가 있는 함수들에 대한 정보의 입력은 스크립트를 이용하여 입력되는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 방법.Wherein the input of information on the functions to be switched is input using a script. 오브젝트 파일에 포함된 코드 및 데이터에 대하여 별도의 예약 영역을 할당한 후 배열하는 디버그 링크를 통해 실행로드 가능파일을 생성하는 실행로드 가능파일 생성부와, 프로그램의 수정이 필요한 경우 소스 파일 수정 후 상기 수정된 소스 파일만을 컴파일 하여 시뮬레이션 실행에 필요한 정보를 포함하는 링크형 오브젝트를 생성하는 링크형 오브젝트 생성부와, 상기 실행로드 가능파일과 상기 링크형 오브젝트로의 선택적 접근을 제어하는 메모리 접근 제어부를 구비하는 제어부;An executable loadable file generation unit for generating an executable loadable file through a debug link that allocates and arranges a separate reserved area for code and data contained in an object file; A link type object generation unit that compiles only the modified source file and generates a link type object including information necessary for executing a simulation, and a memory access control unit that controls selective access to the executable load file and the link type object ; 상기 실행로드 가능파일이 로드되는 제1 메모리;A first memory in which the executable loadable file is loaded; 상기 링크형 오브젝트가 로드되는 제2 메모리; 및A second memory in which the linked object is loaded; And 상기 실행로드 가능파일과, 상기 상기 링크형 오브젝트로의 선택적 접근을 스위치 하는 오브젝트 리매핑 유닛을 포함하며,An executable loadable file and an object remapping unit for switching selective access to the linked object, 상기 예약 영역은 링크형 오브젝트 생성시 다른 데이터 영역을 침범하여 발생하는 충돌을 방지하기 위해 할당되는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 장치.Wherein the reserved area is allocated to prevent collision caused by invading another data area when creating a linked object. 삭제delete 제9항에 있어서,10. The method of claim 9, 상기 링크형 오브젝트는 상기 시뮬레이션 시, 상기 실행로드 가능파일에 포함된 정보를 참고하여 실행되는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 장치.Wherein the link type object is executed by referring to the information included in the execution loadable file at the time of the simulation. 제11항에 있어서,12. The method of claim 11, 상기 제1 메모리와 상기 제2 메모리는 독립적인 별개의 메모리인 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 장치.Wherein the first memory and the second memory are independent memories independent of each other. 제9항에 있어서,10. The method of claim 9, 상기 제어부는 프로그램 수정 완료 시, 완성된 소스 파일을 컴파일하여 오브젝트 파일을 생성하고, 상기 생성된 오브젝트 파일을 링크하여 최종 실행로드 가능파일을 생성하도록 제어하는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 장치.Wherein the control unit compiles the completed source file to generate an object file and links the generated object file to generate a final executable loadable file when the program modification is completed. And a debugging device. 제9항에 있어서,10. The method of claim 9, 상기 메모리 접근 제어부는 스위치 할 필요가 있는 함수들에 대한 정보의 입력을 스크립트로 입력받는 것을 특징으로 하는 가상 플랫폼을 이용한 프로그램의 작성 및 디버깅 장치.Wherein the memory access controller receives input of information about functions that need to be switched as a script.
KR1020080090606A 2008-09-16 2008-09-16 Method for making and debuging program using virtual platform and appparatus therof KR101548960B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020080090606A KR101548960B1 (en) 2008-09-16 2008-09-16 Method for making and debuging program using virtual platform and appparatus therof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020080090606A KR101548960B1 (en) 2008-09-16 2008-09-16 Method for making and debuging program using virtual platform and appparatus therof

Publications (2)

Publication Number Publication Date
KR20100031808A KR20100031808A (en) 2010-03-25
KR101548960B1 true KR101548960B1 (en) 2015-09-01

Family

ID=42181191

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020080090606A KR101548960B1 (en) 2008-09-16 2008-09-16 Method for making and debuging program using virtual platform and appparatus therof

Country Status (1)

Country Link
KR (1) KR101548960B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116599537A (en) * 2023-05-18 2023-08-15 哈尔滨市科佳通用机电股份有限公司 Unit test method of railway frequency shift signal decoding algorithm

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076094A (en) 1998-09-03 2000-03-14 Ricoh Co Ltd Simulator
JP2003330729A (en) 2002-05-14 2003-11-21 Mitsubishi Electric Corp Compiler device
JP2007188366A (en) * 2006-01-16 2007-07-26 Fuji Electric Fa Components & Systems Co Ltd Compiler

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076094A (en) 1998-09-03 2000-03-14 Ricoh Co Ltd Simulator
JP2003330729A (en) 2002-05-14 2003-11-21 Mitsubishi Electric Corp Compiler device
JP2007188366A (en) * 2006-01-16 2007-07-26 Fuji Electric Fa Components & Systems Co Ltd Compiler

Also Published As

Publication number Publication date
KR20100031808A (en) 2010-03-25

Similar Documents

Publication Publication Date Title
EP0453394B1 (en) Dynamic process for the generation of biased pseudo-random test patterns for the functional verification of hardware designs
US7793270B2 (en) Method and apparatus for performing incremental validation of program code conversion
US20140109045A1 (en) Flexible and run-time-modifiable inclusion of functionality in computer code
KR20010086159A (en) Method for platform specific efficiency enhancement of java programs and software product therefor
US7676774B2 (en) System LSI verification system and system LSI verification method
US20110209004A1 (en) Integrating templates into tests
JP3539613B2 (en) Array summary analysis method for loops containing loop jump statements
Lahti et al. Leveraging modern c++ in high-level synthesis
CN105278445A (en) Secondary development method of synchronous generator excitation regulator control program
KR101548960B1 (en) Method for making and debuging program using virtual platform and appparatus therof
KR0125605B1 (en) Method and device for verifying operation of machine language program
KR20060035077A (en) Data processing device and register allocation method using data processing device
Chung et al. Improvement of compiled instruction set simulator by increasing flexibility and reducing compile time
WO2024069730A1 (en) Debugging device and debugging method
US8914274B1 (en) Method and system for instruction set simulation with concurrent attachment of multiple debuggers
KR20020032256A (en) Integrated Embedded System and Method for Realizing thereof
US9830174B2 (en) Dynamic host code generation from architecture description for fast simulation
CN100357908C (en) Test method for electronic device program
US11630757B1 (en) System and method for developing, testing and debugging software for microcontrollers
JP2009515243A (en) Method for generating a simulation program executable on a host computer
CN114035920A (en) Method and device for symmetric loading and running of DSP (digital Signal processor) program
KR19990030244A (en) Language processing system and method for generating an object program from a source program using two-stage jump
CN117149246A (en) Method and device for upgrading application program of embedded system, excavator and storage medium
CN111176619A (en) FPGA execution flow control method and device, computer equipment and storage medium
CN117435171A (en) Integrated development method for RISC-V architecture processor

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant