본문 바로가기

728x90
반응형

# RTEMS

(6)
RTEMS 'rtems_rate_monotonic_period'는 정말 "주기적"일까? 파헤치기: RTEMS rtems_rate_monotonic_period는 정말 "주기적"일까?실시간 운영체제(RTOS)에서 주기적인 태스크를 다루는 것은 시스템의 심장과도 같습니다. 우리는 rtems_rate_monotonic_period(100)을 호출하면, 태스크가 t=0, 100, 200...이라는 절대적인 격자(Grid)에 맞춰 깨어날 것이라 기대합니다.하지만 GR740 시뮬레이터에서 일련의 정밀한 실험을 수행한 결과, 이 믿음이 틀렸음을 발견했습니다.이 글은 rtems_rate_monotonic_period가 실제로는 어떻게 동작하는지, 이 함수의 핵심 메커니즘인 "롤링 앵커(Rolling Anchor)" 모델을 완벽하게 분석하고, 이를 이용해 여러 태스크를 동기화하는 영리한 방법까지 소개합니다..
[RTEMS] 캐시 사이즈 측정 uint32_t current_cpu = rtems_scheduler_get_processor(); size_t l1_data_cache_size = rtems_cache_get_data_cache_size(n); size_t l1_instruction_cache_size = rtems_cache_get_instruction_cache_size(n); size_t l1_data_line_size = rtems_cache_get_data_line_size();`n`이 1이면 L1캐시, 2이면 L2캐시를 측정한다.현재 나는 GR740 보드를 타겟으로 하고 있기에 아래와 같은 결과를 얻을 수 있었다.[L1 Cache Information - Per CPU]CPU 0: L1 Data=16 KB,..
[RTEMS] double 소수점 출력 함수 구현 /* Helper function to print double as integer with 2 decimal places */static void print_double_as_int(const char* prefix, double value, const char* suffix) { int integer_part = (int)value; int decimal_part = (int)((value - integer_part) * 100); if (decimal_part
[RTEMS] 수행 시간 time of get nanoseconds : 2,740nsTask Switching Time : about 100,000~150,000nsprintf min Time : 2,700ns ~
[RTEMS] FPU(부동소수점 처리 장치, Floating-Point Unit) 활성화 기본적으로 FPU(부동소수점 처리 장치, Floating-Point Unit)가 비활성화 되어있음. 에러는 아래에 표시함.이를 활성화 시키기 위해서는 다음과 같은 코드를 추가해야함.방법적용 범위설정 위치`rtems_task_create(..., RTEMS_FLOATING_POINT, ...)`개별 태스크태스크 생성 시`CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT`Init 태스크만컴파일 시 설정// Thread(TASK) 생성 시 sc = rtems_task_create( rtems_build_name('T', 'A', 'S', 'K' + i), 1, RTEMS_MINIMUM_STACK_SIZE , ..
[RTEMS] Tick 크기 변경 RTME의 기본 Tick의 크기는 10ms로 설정되어 있음.RTEMS의 기본 tick 설정은 /data/_rtems/rtems-docker/src/rtems/cpukit/include/rtems/confdefs/clock.h 에서 확인#ifndef CONFIGURE_MICROSECONDS_PER_TICK #define CONFIGURE_MICROSECONDS_PER_TICK 10000 // 기본값: 10ms#endif따라서 더 정밀한 Tick 설정을 위해 아래와 같은 설정을 사용하면됨// 1ms tick으로 설정#define CONFIGURE_MICROSECONDS_PER_TICK 1000// 또는 100μs tick으로 설정 #define CONFIGURE_MICROSECONDS_PER_TICK ..

728x90
반응형