32B1H的DSP算力测试与困惑
-
major
用的就是官方Dio例程,IAR环境下,优化等级均为“中等”。默认的链接文件
// 栈空间在DTCM
define exported symbol STACK_memory_start = 0x2001f000;
define exported symbol STACK_memory_end = 537001983;
define region STACK = mem:[from STACK_memory_start to STACK_memory_end]; /4096/// 中断表在DTCM
define exported symbol IVT_memory_start = 0x2000800;
define exported symbol IVT_memory_end = 33557503;
define region IVT = mem:[from IVT_memory_start to IVT_memory_end]; /1024/cache默认也是开着的。
-
Frankie 在 32B1H的DSP算力测试与困惑 中说:
yxydoctor 分享一下你的这个测试工程,我们来看一下?
uint32 precise_us_time(uint8 mode) { static uint32 count[2]; uint32 temp=0; switch(mode){ case 0: // 开始 count[0] = Gpt_GetTimeElapsed(0); break; case 1: // 停止 count[1] = Gpt_GetTimeElapsed(0); if(count[1] >=count[0]) temp =count[1]-count[0]; else temp = 0xffffffff-(count[0]-count[1]-1); temp = temp/50; // 1us(clk=50M) break; default:break; } return(temp); } #define DTCM_VAR __attribute__((section(".dtcm_data"))) #define ITCM_VAR __attribute__((section(".ramcode"))) uint32 precise_us_time(uint8 mode); uint32_t test_led_count[2]={0}; //DTCM_VAR float32_t DspResult=0.0f; //ITCM_VAR void App_Led1(ULONG thread_input) { uint32 i; while (1){ test_led_count[0]++; Dio_FlipChannel(DioConf_DioChannel_D17_PTE16); /* toggle D17 */ // dsp测试 1.54698824 precise_us_time(0); for(i=0;i<10000;i++){ DspResult = arm_cos_f32(0.678f)+arm_sin_f32(0.876f); } debug_time[0]=precise_us_time(1); tx_thread_sleep(500); } }
帮助没办法联网的电脑使用YCT
帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...