TI C66x DSP 系统events及其应用 - 1

时间:2021-11-08 00:01:09

      TI C66x dsp的每个corePac(cpu及其属于该cpu的资源的package)有12个可屏蔽的中断,一个可屏蔽的异常,一个不可屏蔽的中断/异常。每个corePac包括一个INTC(中断控制器),INTC支持128个系统events(即每个corePac的INTC均支持属于自己处理的128个系统events,各个corePac的128个event相同。这128个events由corePac内部的event与chip-level event组成,corePac内部的event如可以是CPU访问L2非法内存对应的corePac内部的124 event,corePac内部event是每个corePac各有相同的一份,chip-level event实际上每个corePac也各有相同的一份,即下面要讲的available event,但因为是chip-level的,实际使用中各个协处理器共同配合使用一份available event,即使用event 15~95),并且允许128个系统事件作为该cpu中断/异常的输入。这128个事件可以直接连接到可屏蔽的中断,也可以分成组作为中断。

      corePac支持很多系统消息,INTC提供了可以从系统消息中选择一些必要的消息(设置mask寄存器实现)并把它们路由作为cpu中断与异常的输入,即INTC是架起系统event与cpu中断/异常输入的桥梁记住INTC是在corePac内部的,每个corePac都有一个INTC。

The interrupt controller outputs various signals to the C66x DSP from these event

inputs:

• One maskable, hardware exception (EXCEP)

• Twelve maskable hardware interrupts (INT4 through INT15)

• One non-maskable signal that you can use as either an interrupt or an exception(NMI)

• One reset signal (RESET)

       Terms of specific importance in this chapter are:
• System Event: any signal that generates internally or externally that is intended tonotify the DSP that some activity has occurred and/or requires a response.
• Interrupts: provide the means to redirect normal program flow due to the presence of an external or internal hardware signal (event).
• Exceptions are similar to interrupts in that they also redirect program flow, but exceptions are normally associated with error conditions in the system.

      C66x CorePac Interrupt Controller Block Diagram:interrupt controller = INTC (in corePac)

TI C66x DSP 系统events及其应用 - 1

          DSP Event Routing Diagram:There are a number of events that the various components of the C66x CorePac generates. These events are routed to the interrupt controller so that when asserted,they can be serviced by the DSP.TI C66x DSP 系统events及其应用 - 1

       C66x CorePac Events mapping:The events that are shown asavailable events are to the C66x CorePac forchip-level events(即dsp的协处理器可以使用,如Queue Manager。对于Nyuist来说,有四个corePac,在实际开发中,每个core上都会有自己的一份平台代码。chip-level event指的是四个core均可使用,是开放给协处理器的,从而协处理器可以与CPU交互,available event是chip-level event,各个协处理器可以使用这些event。对于各个corePac来说,128个event中除了available event外的其他event都是corePac内部event,各个corePac均相同). Therefore, each new C66x device can use these event inputs as necessary. See the device-specific data manual for more information about how these available events are used.

TI C66x DSP 系统events及其应用 - 1

      event that Queue Manager used:queue manager使用了128个system event中的32~55,前面讲到每个corePac都有128个event,每个corePac对这个128个event定义都是相同的(如上图),例如,如果配置了在core2(N=2)上,PDSP监控(利用channel)queue 706 (high priority queue:704~735),并配置event 48与监控的queue联系起来,则条件满足时会通过event 48产生中断通知core2,所以这里的event 48就是指core2中的128个event中的event 48.

      如下平台代码中,DNUM表示core num(0~3),HIGH_PRIO_EVENT_BASE = 48,例如,如果channel = 6,DNUM =2,则cpuEventNumValue 就等于1+48 = 49,用于服务queue 710.

       #define QM_ACCUMULATOR_HIGH_PRIO_EVENT_BASE   (48)
       #define QM_NUM_OF_CORES                      (4)      
       cpuEventNumValue =  ((channel-DNUM) / QM_NUM_OF_CORES) + 

                                                    QM_ACCUMULATOR_HIGH_PRIO_EVENT_BASE;                   

TI C66x DSP 系统events及其应用 - 1

TI C66x DSP 系统events及其应用 - 1

            根据上图,各个core(0,1,2,3)可以使用的监控queue的channel为下面红色字体所述,channel与event之间的映射是fixed的,channel与其监控的queue的映射不是fixed的,文档中的建议是high priority queue704~735(与channel也不是一一对应的),实际上channel可以监控任何queue:

         Core0只使用0,4,8,12,…28channel;

         Core1只使用1,5,9,13,…29channel;

         Core2只使用2,6,10,14,…30channel;

         Core3只使用3,7,11,15,…31channel.

注释:

1.      priority accumulator queue

·         1nyquist 32

·         序号0…31

2.      PDSP channel

·         1nyquist 32

·         序号0…31

·         用于监视32priority accumulator queue,但是两者序号不是一一对应,需平台动态配置

·         每个core仅用8channel产生的中断才能路由到此core,分配原则4*n+NUM (n=0…3)

·         ChannelINP绑定。

3.      The queue map(low/high) in UG is recommended one, actually accumulator can monitor any general queues.The channel to  event map is fixed, but queue to channel can be configured. For accumulation purposes, the PDSP firmware will read the queue status RAM to obtain status information on the programmed queues. So if the host software program the Queue N Status and   Configuration Register D registers with the value 0x81 for that queue ,then it can be examined by the firmware.