검색 상세

임베디드 시스템 코드 최적화를 위한 프레임워크

A Framework for Code Optimization of Embedded Systems

초록/요약

임베디드 시스템의 특성 상 제한된 시스템 자원의 효율적인 사용은 시스템 비용 및 효과와 긴밀한 관계를 가지고 있으며, 이러한 시스템 자원의 이상적인 최대 사용을 위한 과정을 시스템 최적화라고 부르며, 최적화의 대상이 되는 코드크기, 실행시간의 관계는 상충되는 면을 가지기 때문에 임베디드 시스템의 설계 및 성능향상에 있어서 이러한 최적화 목표의 연관성을 고려하는 것은 매우 중요하며, 따라서 본 논문에서는 임베디드 시스템에서의 목표성능 도달을 위한 코드 크기, 실행 속도를 절충 할 수 있는 최적화 절차를 제안한다. 본 논문에서는 임베디드 시스템에서 메모리크기가 고정되어 있는 점에 주목하여, 코드크기의 절감과 이에 따른 메모리의 여유분을 성능향상에 반영하는 일련의 프레임워크를 다음과 같이 제안 한다. 먼저 임베디드 시스템의 실질적인 성능 측정을 위하여 실행시의 코드크기 및 명령 사이클을 측정할 수 있는 프로파일링 기법을 적용하여 개별 함수의 연관된 점유율 및 호출회수 데이터를 측정하고, 수집된 프로파일링 데이터를 판단근거로 하여 소스 프로그램을 함수단위로 분류한다. 함수는 단편적인 점유율에 의해서만 분류되는 것이 아니라 상한, 하한 값을 가지는 점유율 임계값과 함수의 호출회수에 의해 적용될 명령어 세트가 선택된다. 축약된 명령어 세트를 적용하도록 선택된 함수의 개수와 크기에 의해 절감될 코드 크기가 정해지며, 물리적인 메모리를 기준으로 사용가능한 메모리크기를 활용하여 실행속도의 향상 절차가 수행된다. 실행속도 향상을 위한 방법인 테이블참조연산, 연산비용 줄이기 및 루프최적화 기법이 적용되며, 이 과정에서 증가된 코드크기는 사용가능한 메모리 범위를 초과하지 못한다. 제안된 임베디드 시스템 최적화의 성능검증을 위해 세 종류의 검증된 성능평가 프로그램을 대상으로 하여 대량 데이터 처리, 영상 및 신호처리 및 음성 압축 및 복원의 응용 범위에 따른 대상 프로그램을 선정하여 사용하였으며, 이들을 대상으로 수행한 성능측정 실험에서 기존의 성능을 유지하면서 코드크기를 평균적으로 20%정도 절감 할 수 있었으며, 추가적인 실행속도 개선을 위하여 절감된 코드크기를 실행속도의 개선에 활용 할 수 있으며, 시스템 최적화의 목표에 따라 성능에 상관없는 최소 코드 크기의 구현 및 대용량의 코드 메모리를 보유한 시스템에서의 최대 성능 향상에 선택적으로 적용 가능하다. 이를 통해 기존의 메모리절감 또는 성능향상이라는 선택적 최적화가 아닌 메모리절감을 성능향상으로 변환하여 성능극대화를 이루거나, 코드크기 절감 목표를 설정하여 물리적인 메모리를 더 작은 메모리로 교체하는 선택적인 최적화가 가능하고, 신규 기능 추가를 위해 새로운 하드웨어를 추가하는 대신 최적화 프레임워크의 제약조건을 변경하여 사용가능한 메모리를 확보한 후 신규코드를 추가함으로서 기존 임베디드 시스템의 성능향상 및 비용절감에 광범위하게 적용 될 수 있다.

more

초록/요약

Embedded systems are required to use their resources effectively in a variety of application areas depending on the product in which these systems are incorporated. Due to the diversified nature, embedded systems typically have requirements in different aspects of the system, such as code size, execution speed, and cost. Usually, there is a tradeoff relationship between code size and execution speed of a system. For example, code size reduction is often achieved at the expense of a prolonged execution time. In a similar way, performance improvement may enlarge the code size. Based on these observations, we propose optimization methods for embedded systems using dual instruction processor. The proposed optimization methods are capable to select instruction sets depending on the target goals. Our proposed integrated framework consists of three steps for the optimization of code size and execution time. As a first step, we configure target code size and execution speed to check whether the goals have been achieved and profile the source program to evaluate its current performance. Next, we determine the instruction set of each function to transform into the full instruction that needs high performance. Finally, we enhance performance of the entire system using selective methods that improve the execution speed by limiting the configured code size. Performance is evaluated under a variety of benchmark programs and really produced embedded system. When the results are compared to the original benchmark program, it gives about 20% of the code reduction effects without any loss of the performance. In our work, we also utilized the saved memory space for improving the execution speed. By defining a higher limit of system memory and applying the proposed optimization framework, we have achieved improved code size and also enhanced performance. When we applied our optimized framework into code size reduction, it is found that a smaller memory is sufficient for cost effective design or to implement a new function in the extra space for system up-gradation. Our studies clearly show that the proposed framework could provide selective optimization methods which are applied widely in real field situations.

more

목차

제1장 서론 = 1
제2장 시스템 최적화 이론 = 7
제1절 실행 코드의 생성 = 8
제2절 소스코드 최적화 기법 = 12
제3절 중간코드 최적화 = 21
제4절 목적코드 최적화 = 31
제3장 임베디드 시스템 최적화 기법 = 37
제1절 시스템 최적화 기술의 분류 = 38
제2절 주요 최적화 기술의 비교 = 40
제3절 제안하는 최적화 방법 및 절차 = 44
제4장 최적화를 위한 프로파일링 = 48
제1절 프로파일링 = 48
제2절 프로파일링의 수집 정보 = 51
제3절 프로파일링 방법 = 54
제5장 선택적 명령어 적용에 의한 코드 최적화 = 67
제1절 명령어 세트의 선택 = 68
제2절 관련 연구 = 73
제3절 제안하는 명령어의 선택적 적용 방안 = 76
제6장 최적화 프레임워크 및 성능평가 = 84
제1절 최적화 프레임워크(optimization framework) = 84
제2절 성능평가 환경 = 86
제3절 성능평가 결과 및 고찰 = 91
제7장 결론 = 106
ABSTRACT = 113

more