Ignore:
Timestamp:
Jun 26, 2017, 6:45:41 PM (7 years ago)
Author:
ertl-honda
Message:

3.0.0のリリース版に追従

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h

    r302 r305  
    44 *      Advanced Standard Profile Kernel
    55 *
    6  *  Copyright (C) 2006-2015 by Embedded and Real-Time Systems Laboratory
     6 *  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
    77 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    88 *
     
    5151 *  の責任を負わない.
    5252 *
    53  *  $Id: core_test.h 460 2015-08-29 13:04:06Z ertl-hiro $
     53 *  $Id: core_test.h 524 2016-01-14 11:01:56Z ertl-hiro $
    5454 */
    5555
     
    146146
    147147#endif
    148 
    149 /*
    150  *  パフォーマンスモニタによる性能評価
    151  */
    152 #if defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7
    153 
    154 /*
    155  *  パフォーマンスモニタのカウンタのデータ型
    156  */
    157 typedef uint32_t        PMCNT;
    158 
    159 /*
    160  *  パフォーマンスモニタの初期化
    161  */
    162 Inline void
    163 arm_init_pmcnt(void)
    164 {
    165         uint32_t        reg;
    166 
    167         /*
    168          *  パフォーマンスモニタの有効化
    169          *
    170          *  TOPPERS_ARM_PMCNT_DIV64が定義されている場合は,64クロック毎にカ
    171          *  ウントアップする.
    172          */
    173         CP15_READ_PMCR(reg);
    174         reg |= CP15_PMCR_ALLCNTR_ENABLE;
    175 
    176 #ifdef TOPPERS_ARM_PMCNT_DIV64
    177         reg |= CP15_PMCR_PMCCNTR_DIVIDER;
    178 #else /* !TOPPERS_ARM_PMCNT_DIV64 */
    179         reg &= ~CP15_PMCR_PMCCNTR_DIVIDER;
    180 #endif /* TOPPERS_ARM_PMCNT_DIV64 */
    181 
    182         CP15_WRITE_PMCR(reg);
    183 
    184         /*
    185          *  パフォーマンスモニタのカウンタの有効化
    186          */
    187         CP15_READ_PMCNTENSET(reg);
    188         reg |= CP15_PMCNTENSET_CCNTR_ENABLE;
    189         CP15_WRITE_PMCNTENSET(reg);
    190 }
    191 
    192 /*
    193  *  パフォーマンスモニタのカウンタの読み込み
    194  */
    195 Inline void
    196 arm_get_pmcnt(PMCNT *p_count)
    197 {
    198         CP15_READ_PMCCNTR(*p_count);
    199 }
    200 
    201 /*
    202  *  カウンタ値の時間計測単位への変換
    203  *
    204  *  時間計測の単位は,現状はナノ秒になっている(マイクロ秒単位にする設
    205  *  定も欲しいと思われる).
    206  */
    207 Inline uint_t
    208 arm_conv_time(PMCNT count) {
    209 #ifdef TOPPERS_ARM_PMCNT_DIV64
    210         return(((uint_t) count) * (1000 * 64) / CORE_CLK_MHZ);
    211 #else /* !TOPPERS_ARM_PMCNT_DIV64 */
    212         return(((uint_t) count) * 1000 / CORE_CLK_MHZ);
    213 #endif /* TOPPERS_ARM_PMCNT_DIV64 */
    214 }
    215 
    216 #define HISTTIM                                 PMCNT
    217 #define HIST_GET_TIM(p_time)    (arm_get_pmcnt(p_time))
    218 #define HIST_CONV_TIM(time)             (arm_conv_tim(time))
    219 #define HIST_BM_HOOK()                  ((void) 0)
    220 
    221 #endif /* defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7 */
    222148#endif /* TOPPERS_CORE_TEST_H */
Note: See TracChangeset for help on using the changeset viewer.