快乐虾
http://blog.csdn.net/lights_joy/
lights@hb165.com
本文适用于
ADI bf561 DSP
uclinux-2008r1.5-rc3 (移植到vdsp5)
Visual DSP++ 5.0(update 5)
欢迎转载,但请保留作者信息
/* Enable Cycle Counter and Nesting Of Interrupts */
#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
R0 = SYSCFG_SNEN;
#else
R0 = SYSCFG_SNEN | SYSCFG_CCEN;
#endif
SYSCFG = R0;
这几行代码用于设置SYSCFG的值,关于SYSCFG这个寄存器,vdsp文件这样说:
The System Configuration Register (SYSCFG) shown in Figure 4-3 controls the configuration of the processor
对于BF561而言,只有CCEN和SSSTEP两位有效,在这里将CCEN位设置为1,表示要启用64位的cycle counter。而对SNEN的置位将被忽略。
在启用了CCEN之后,CYCLES和CYCLES2两个寄存器将开始统计CCLK的个数。
下面是vdsp文档中对CYCLES和CYCLES2这两个寄存器的一个说明:
The cycle counter counts CCLK cycles while the program is executing. All cycles, including execution, wait state, interrupts, and events, are counted while the processor is in User or Supervisor mode, but the cycle counter stops counting in Emulator mode.
The cycle counter is 64 bits wide and increments every cycle. The count value is stored in two 32-bit registers, CYCLES and CYCLES2. The least significant 32 bits (LSBs) are stored in CYCLES. The most significant 32 bits (MSBs) are stored in CYCLES2.
Note: To ensure read coherency, first read CYCLES, then CYCLES2, and then CYCLES again, to detect if an overflow has occurred in the LSBs during the read operations.
In User mode, these two registers may be read, but not written. In Supervisor and Emulator modes, they are read/write registers.
To enable the cycle counters, set the CCEN bit in the SYSCFG register. The following example shows how to use the cycle counter:
R2 = 0;
CYCLES = R2;
CYCLES2 = R2;
R2 = SYSCFG;
BITSET(R2,1);
SYSCFG = R2;
/* Insert code to be benchmarked here. */
R2 = SYSCFG;
BITCLR(R2,1);
SYSCFG = R2;
通常这两个寄存器可以用于性能统计。但是由于这两个寄存器在几种模式下均是可写的,因此也可以将它们当成通用寄存器使用。在uclinux内核中,提供了一个叫CONFIG_BFIN_SCRATCH_REG_CYCLES的选项来控制CYCLES的用途:
config BFIN_SCRATCH_REG_CYCLES
bool "CYCLES"
help
Use the CYCLES register in the Blackfin exception handler
as a stack scratch register. This means you cannot
safely use the CYCLES performance registers on a Blackfin
board at anytime, but you can debug the system with a JTAG
ICE and use the NMI.
当设置了CONFIG_BFIN_SCRATCH_REG_CYCLES后,在linux-2.6.x\arch\blackfin\mach-common\entry.S文件中将CYCLES做为普通寄存器使用:
#if defined(CONFIG_BFIN_SCRATCH_REG_RETN)
# define EX_SCRATCH_REG RETN
#elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)
# define EX_SCRATCH_REG RETE
#else
# define EX_SCRATCH_REG CYCLES
#endif
自然,在此时CYCLES是不应该自动计数的,因此SYSCFG_CCEN应该保持为0。
在uclinux内核代码中搜索CYCLES,可以发现有以下几个文件使用了它:
linux-2.6.x\drivers\char\bfin_timer_latency.c
linux-2.6.x\drivers\media\video\blackfin\blackfin_cam.c
linux-2.6.x\drivers\zaptel\bfsi-spi-framework.c
linux-2.6.x\drivers\zaptel\bfsi.c
当要使用这几个驱动时,就一定需要使SYSCFG_CCEN=1。
head.s分析(1):保存u-boot传递过来的指针(2009-1-19)
分享到:
相关推荐
[CC2642R1][VSCODE+Embedded IDE+Cortex-Debug] TI CC2642R1 快速搭建VsCode开发环境 原理:通过cmd,调用syscfg。...role.syscfg --board \ti\boards\CC26X2R1_LAUNCHXL F:\\ti_test\multi_role\multi_role.syscfg
STM32L4系统配置(SYSCFG)介绍
STM32F7x6培训_系统配置控制器(SYSCFG)
STM32G4-System-System_Configuration_Controller_SYSCFG(STM32G4-系统 - 系统配置控制器SYSCFG).pdf
电子-STM32L15x04系统配置管理SYSCFG和ROUTINGINTERFACERI.pdf,单片机/嵌入式STM32-F0/F1/F2
低功耗系列芯片 STM32L15x_系统配置SYSCFG和路由选择RI
Linus Arver的Dotfiles 使用风险自负! 另外,我会(经常)强制推送到此仓库。... 例如,要设置Emacs和Vim配置,请执行以下操作: make emacs vim 已知的问题 缺省存储库名称syscfg在某些地方进行了硬编码。
内附文件如下: 0.u-boot.bin 1.u_env.bin 2.s_env.bin 3.kernel1.bin 4.ubi.bin 5.kernel2.bin 6.rootfs2.bin 7.syscfg.bin 8.unused.bin 备份记录.txt
x:\ti\simplelink_cc13x2_26x2_sdk_5_20_00_52\source\ti\ 将文件夹[ble5stack][drivers],解压到上面目录,并替换全部。 使用参考下面链接: https://blog.csdn.net/qq_29246181/article/details/126611930 ...
详细介绍了TI公司的CCS使用方法,应用技巧,是DSP学习必备资料
8. 时钟配置控制器(SYSCFG) 194 9. DMA 控制器 201 10. 中断和事件 233 11. 模数转换器(ADC) 248 12. 数模转换器(DAC) 288 13. 数字摄像头接口(DCMI) 308 14. 高级控制定时器 (TIM1 和TIM8 ) 329 15. 通用定时器(TM2...
update SysDB..Syscfg set ItemValue='2007-04-10 1' where ItemName='OVERSTATUS' update VipDB..Syscfg set ItemValue='2007-04-10 1' where ItemName='OVERSTATUS' use Xvipdb /*将储值卡会员变成非储值卡...
A reset controller which groups together a set of related reset bits, which may be located in different system configuration registers.
[CC2642r1][syscfg][] 中文图形化界面,方便快速熟悉工具使用 syscfg_ble5stack
iPhone 配置实用工具
Key1为PA0,Key2为PC13 BOOTloader程序起始地址`0x0800 0000`分配大小为`0xA000`,40KB, APP程序起始地址`0x0800 A000`分配的大小为`0xF6000`,984KB。 注意按照扇区对齐(比如4KB一个扇区) 通过软件复位 + 一个...
// RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG,ENABLE);//使能SYScfg时钟 //GPIOFC8,9,10,11初始化设置 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_11;//PC8,9,11输出 GPIO_...
FT61F14 系列进入 SLEEP模式设置方法
gd32f4系列固件库,keil工程demo用例,欢迎下载使用gpio,adc,uart,printf,timer等等
CCS5.5工程中文件禁用的方法