[go: up one dir, main page]

CN101495940A - System with multiple hardware blocks and method of operating the same - Google Patents

System with multiple hardware blocks and method of operating the same Download PDF

Info

Publication number
CN101495940A
CN101495940A CNA2007800277440A CN200780027744A CN101495940A CN 101495940 A CN101495940 A CN 101495940A CN A2007800277440 A CNA2007800277440 A CN A2007800277440A CN 200780027744 A CN200780027744 A CN 200780027744A CN 101495940 A CN101495940 A CN 101495940A
Authority
CN
China
Prior art keywords
hardware
counter
hardware block
block
tasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2007800277440A
Other languages
Chinese (zh)
Inventor
O·埃尔斯霍赫特
J·霍恩斯比
J·格拉德
P·阿库多普洛斯
P·马里维特
T·阿佩蒙特
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Europe BV United Kingdom Branch
Original Assignee
Sony Service Center Europe NV
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Service Center Europe NV filed Critical Sony Service Center Europe NV
Publication of CN101495940A publication Critical patent/CN101495940A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Circuits Of Receivers In General (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a system having a plurality of hardware blocks, and a method of operating the system, in which power to each hardware block is independently controlled according to whether the respective hardware block needs to be used. A counter is provided in the respective device driver of each hardware block, the counter being configured to increment each time a task requests use of the respective hardware block and to decrement each time the task stops use of the respective hardware block. The value of the counter is then used to control whether the corresponding hardware block is powered on or off.

Description

具有多个硬件块的系统和操作该系统的方法 System with multiple hardware blocks and method of operating the system

本发明涉及一种具有多个硬件块(hardware block)的系统以及操作该系统的方法,特别地,所述系统和方法适用于电源消耗被关注的情形,例如数字电视接收机的解调器中。The present invention relates to a system with a plurality of hardware blocks and a method of operating the system, in particular, said system and method are suitable for use in situations where power consumption is a concern, such as in demodulators of digital television receivers .

已知,在例如用于数字电视接收机的解调器的系统中需要操作多个硬件块。该系统可以运行多个不同任务,这些任务会在不同时间使用这些硬件块。特别地,如果在电池供电的设备、例如在符合手持式数字广播(DVB-H)标准的数字电视接收机中提供该系统,那么电量消耗将会是非常重要的。It is known that in systems such as demodulators for digital television receivers it is necessary to operate a number of hardware blocks. The system can run several different tasks that use these hardware blocks at different times. Especially if the system is provided in a battery operated device, eg in a digital television receiver conforming to the Digital Broadcast Handheld (DVB-H) standard, the power consumption will be very important.

本申请基于这样一种认识,那就是通过控制硬件块,可以有助于节电。This application is based on the realization that by controlling hardware blocks, it is possible to contribute to power saving.

根据本发明,在这里提供了一种用于操作系统的方法,其中该系统具有多个硬件块,该方法包括:根据是否需要使用相应块来独立控制至每一个硬件块的电源。According to the present invention, there is provided a method for an operating system having a plurality of hardware blocks, the method comprising independently controlling power to each hardware block according to whether the corresponding block is required to be used.

根据本发明,在这里还提供了一种具有多个硬件块的系统,该系统被配置成根据是否需要使用相应硬件块来独立控制至每一个硬件块的电源。According to the present invention, there is also provided a system having a plurality of hardware blocks configured to independently control the power supply to each hardware block according to whether the corresponding hardware block is used or not.

由此,只有在特定硬件块作为特定服务或在系统中运行的任务的一部分被使用的时候,所述硬件块才会通电。而在其他任何时间,该硬件块可被断电,从而降低系统的电量消耗。Thus, a particular hardware block is only powered on when it is being used as part of a particular service or task running in the system. At any other time, the hardware block can be powered down, thereby reducing power consumption of the system.

优选地,该系统包括用于相应硬件块的设备驱动器,并且被配置成支持多个任务,其中每一个任务都通过与相应设备驱动器进行通信来使用一个或多个硬件块。Preferably, the system includes device drivers for respective hardware blocks and is configured to support a plurality of tasks, each of which uses one or more hardware blocks by communicating with the respective device drivers.

利用此方案,要想确定硬件块应该通电还是断电是相对困难的,并且由此将会需要进行大量处理。在多个任务、事实上是在供这些任务使用的服务中,任何一个任务或服务都有可能在某个时间使用特定硬件块。当某一个特定任务不再需要使用某个硬件块时,这时并不意味着所述硬件块可以断电,因为别的任务同样有可能需要使用该硬件块。With this approach, it is relatively difficult to determine whether a hardware block should be powered on or off, and thus would require a lot of processing. Among multiple tasks, and indeed among the services used by those tasks, it is possible for any one task or service to use a particular block of hardware at some time. When a specific task no longer needs to use a certain hardware block, it does not mean that said hardware block can be powered off, because other tasks may also need to use this hardware block.

优选地,在每一个相应设备驱动器中都会实施计数器,该计数器被配置成在多个任务之一每次请求使用相应硬件块时递增,并且被配置成在多个任务之一每次停止使用相应硬件块时递减。Preferably, a counter is implemented in each respective device driver, the counter being configured to increment each time one of the plurality of tasks requests to use the corresponding hardware block, and configured to be incremented each time one of the plurality of tasks stops using the corresponding hardware block. Decrements when hardware blocks.

这样做提供了一种极为有效和有利的方式来确定应该为特定硬件块加电还是断电。举个例子,如果计数器的初始值为0,那么当计数器是非零值时,很容易就可以确定应该为相应硬件块加电。Doing so provides an extremely efficient and advantageous way of determining whether a particular piece of hardware should be powered up or down. For example, if the initial value of the counter is 0, it is easy to determine that the corresponding hardware block should be powered up when the counter is non-zero.

优选地,该计数器是作为应用编程接口实施的。Preferably, the counter is implemented as an application programming interface.

这样做提供了一种简单的实施方式,否则它将是一个非常复杂的处理。Doing so provides a simple implementation of what would otherwise be a very complex process.

优选地,该计数器提供了一个输出,以便在计数器指示没有要求使用相应硬件块的未完成请求的时候将相应硬件块断电。由此,其言外之意是计数器类似地可以提供一个输出,以便在计数器指示需要使用相应硬件块的时候为相应硬件块通电。Preferably, the counter provides an output for powering down the respective hardware block when the counter indicates that there are no outstanding requests for use of the respective hardware block. By this, the implication is that the counter can similarly provide an output for energizing the corresponding hardware block when the counter indicates that the corresponding hardware block needs to be used.

优选地,该计数器具有初始值零,以使该输出能够只在计数器具有非零值时为相应的硬件块通电。Preferably, the counter has an initial value of zero, so that the output can only energize the corresponding hardware block when the counter has a non-zero value.

该系统还可以包括一个硬件时钟块,其中该块具有:用于系统时钟信号的时钟输出,用于接收所述计数器的相应输出的电源输入,用于相应硬件块的时钟输出,以及多个相应的逻辑门。每一个相应逻辑门都与时钟输入、相应的电源输入以及相应的时钟输出相连,并且被配置成根据电源输入来有选择地向相应时钟输出提供时钟信号。The system may also include a hardware clock block, wherein the block has: a clock output for a system clock signal, a power input for receiving a corresponding output of the counter, a clock output for a corresponding hardware block, and a plurality of corresponding logic gates. Each respective logic gate is coupled to a clock input, a respective power input, and a respective clock output, and is configured to selectively provide a clock signal to the respective clock output based on the power input.

由此应该理解,硬件块是通过将其从系统时钟信号中移除而被断电的。关于这一点,应该了解的是,大多数能量消耗是因为时钟转变产生的。计数器的输出可以容易地被用来控制是否将系统时钟信号提供给相应的硬件块。硬件块可以包括定时器、UART、SPI、SDIO、调谐器、解调器、滤波器以及MPE-FEC中的至少一个。It should thus be understood that a hardware block is powered down by removing it from the system clock signal. At this point, it should be understood that most power consumption is due to clock transitions. The output of the counter can easily be used to control whether the system clock signal is provided to the corresponding hardware block. The hardware block may include at least one of a timer, UART, SPI, SDIO, tuner, demodulator, filter, and MPE-FEC.

定时器提供系统时间的指示,并且允许将警报配置成在经过预定时间量之后消失。UART(通用异步接收机/发射机)是标准串行通信数据链路,所述串行通信数据链路用于在DVB-H接收机中将活动的日志跟踪到例如用于调试的计算机。SPI(串行外围接口)是一个用于将集成电路这类在DVB-H接收机中使用的设备相互连接来与主机应用处理器进行通信并受其控制(也就是接收命令以及发送包含命令结果的响应)的标准同步通信数据链路。作为SPI的可行替换方案,SDIO(安全数字输入/输出)是一种用于将附属设备连接到DVB-H接收机中使用的主机应用处理器的标准。调谐器是用于提取和隔离频谱中的特定射频信道并将其向下变换到基带(也就是将载频带到0Hz)的模拟集成电路。解调器是用于解调DVB-H信号的数字集成电路。滤波器是用于提取作为MPEG-2传输流的子集或是来自该传输流的特定数据分组的数字集成电路,其中这些数据分组是用其分组ID(PID)和表格ID表示的。MPE-FEC(多协议封装-前向纠错)是一种在MPEG-2传输流中封装任何类型的数据(例如就DVB-H来说的IP分组)的标准方式。FEC是一种包含下列处理的方法:在发射机侧将额外的代码封装在MPEG-2传输流中,以及在接收机侧使用这些代码来检测和纠正MPE数据中的传输差错。The timer provides an indication of the system time and allows the alarm to be configured to go away after a predetermined amount of time has elapsed. A UART (Universal Asynchronous Receiver/Transmitter) is a standard serial communication data link used in a DVB-H receiver to track a log of activity to eg a computer for debugging. SPI (Serial Peripheral Interface) is an interface used to interconnect devices such as integrated circuits used in DVB-H receivers to communicate with and be controlled by the host application processor (that is, receive commands and send commands containing results) response) standard synchronous communication data link. As a viable alternative to SPI, SDIO (Secure Digital Input/Output) is a standard for connecting accessory devices to the host application processor used in DVB-H receivers. A tuner is an analog integrated circuit used to extract and isolate a specific radio frequency channel in the spectrum and convert it down to baseband (that is, bring the carrier frequency to 0 Hz). Demodulators are digital integrated circuits used to demodulate DVB-H signals. Filters are digital integrated circuits used to extract specific data packets that are a subset of or from an MPEG-2 transport stream, where these data packets are identified by their Packet ID (PID) and Table ID. MPE-FEC (Multiprotocol Encapsulation - Forward Error Correction) is a standard way of encapsulating any type of data (eg IP packets in the case of DVB-H) in an MPEG-2 transport stream. FEC is a method involving the encapsulation of additional codes in the MPEG-2 transport stream at the transmitter side and the use of these codes at the receiver side to detect and correct transmission errors in the MPE data.

该系统可以作为解调器、例如作为集成电路的可互换式模块来提供。同样,在数字电视接收机中也可以提供该系统,例如将其作为接收机内部的解调器来加以提供。优选地,所述解调器和/或接收机符合DVB-H标准。The system may be provided as a demodulator, eg as an interchangeable module of an integrated circuit. Likewise, the system can also be provided in a digital television receiver, for example as a demodulator inside the receiver. Preferably, said demodulator and/or receiver conform to the DVB-H standard.

本发明还提供了一种用于实施所述处理的计算机程序。例如应用程序接口的计算机程序可以被提供来用在所描述的设备驱动器中。The present invention also provides a computer program for implementing said processing. A computer program such as an application program interface may be provided for use in the described device drivers.

从以下参考附图并且只作为实例给出的描述中可以更清楚地了解本发明,其中:The invention will be more clearly understood from the following description, given by way of example only, with reference to the accompanying drawings, in which:

图1描述的是可以实现本发明的设备的实例;What Fig. 1 has described is the example that can realize the equipment of the present invention;

图2示意性描述了一个使用本发明的系统;Fig. 2 has schematically described a system using the present invention;

图3提供了本申请实施例的备选示意图;Figure 3 provides an alternative schematic diagram of an embodiment of the present application;

图4描述的是用于图3装置的复位处理;What Fig. 4 described is to be used for the reset processing of Fig. 3 device;

图5描述的是用于图3装置的取消(abort)处理;What Fig. 5 has described is the cancellation (abort) process for Fig. 3 apparatus;

图6示意性描述了在图3装置中工作的任务、服务和设备驱动器的实例;Figure 6 schematically depicts examples of tasks, services and device drivers working in the apparatus of Figure 3;

图7示意性描述了一个设备驱动器;Figure 7 schematically depicts a device driver;

图8示意性描述了硬件设备的功率控制;Fig. 8 schematically describes the power control of the hardware device;

图9描述了各种通电和断电状态;Figure 9 depicts the various power-on and power-off states;

图10描述了带有附加时间片任务的、图6的方案;以及Figure 10 depicts the scheme of Figure 6 with additional time sliced tasks; and

图11描述了各种任务的相对优先级。Figure 11 depicts the relative priority of the various tasks.

本发明旨在应用于移动电视接收机(2)中,例如图1所示的移动电话设备(2)。这种移动电视接收机可以依照欧洲使用的DVB-H(手持式数字视频广播)标准来工作。The invention is intended to be applied in a mobile television receiver (2), such as the mobile telephone device (2) shown in Fig. 1 . Such a mobile television receiver may operate according to the DVB-H (Digital Video Broadcasting-Handheld) standard used in Europe.

图示接收机(2)包括:用于显示接收到的电视节目图像的显示器(4),以及允许用户操作或控制接收机(2)的用户接口(6),其中该用户接口例如包含多个按键(8)。接收到的电视节目的音频部分的音频再现可以借助一对耳机(10)而被提供给用户。The illustrated receiver (2) includes a display (4) for displaying images of received television programs, and a user interface (6) allowing the user to operate or control the receiver (2), wherein the user interface includes, for example, a plurality of Press the button (8). An audio reproduction of the audio portion of a received television program may be provided to the user via a pair of headphones (10).

图2示意性描述了在接收数字电视信号的过程中使用的接收机(2)的一部分。Figure 2 schematically depicts a part of a receiver (2) used in the process of receiving digital television signals.

在图示实施例中,接收机(2)包括它自己的应用处理器或主机(12),其中所述应用处理器或主机可以用于操作接收机(2)的电视功能和其他功能、例如在将接收机(2)也当作电话时的电话操作。就此而论,该应用处理器(12)可以包括多种中间件(14)以及用于存储此类中间件的相关存储器。In the illustrated embodiment, the receiver (2) includes its own applications processor or host (12), which can be used to operate television functions and other functions of the receiver (2), such as Telephone operation when using the receiver (2) also as a telephone. In this regard, the application processor (12) may include various middleware (14) and associated memory for storing such middleware.

同样,如所示,接收机(2)包括专门被配置成处理电视功能的模块(16)。该模块(16)可以单独制造和销售,并且被提供在众多不同的接收机中使用。虽然没有描述,但是该模块(16)被配置成输出用于在显示器(4)上显示的视频数据以及由耳机(10)再现的音频数据。在用户接口(6)的控制下,借助应用处理器(12)可以对模块(16)进行控制,例如改变电视频道。Also, as shown, the receiver (2) includes a module (16) specifically configured to handle television functions. The module (16) can be manufactured and sold separately and provided for use in a number of different receivers. Although not depicted, the module (16) is configured to output video data for display on the display (4) and audio data reproduced by the earphone (10). Under the control of the user interface (6), by means of the application processor (12) it is possible to control the module (16), for example to change the TV channel.

提供了天线(18),以便接收调制在各种射频载波上的多个电视信号。An antenna (18) is provided for receiving a plurality of television signals modulated on various radio frequency carriers.

在模块(16)内部,调谐器(20)被配置成调谐特定的载波频率,并且将接收到的调制信号提供给解调器(22)。该解调器(22)包括多个硬件单元(24)(除了调谐器(20)之外),例如解调器和滤波器块。这些部件是在先前从应用处理器(12)下载的固件(26)的控制下工作的,由此可以提供针对模块(16)的完整操作并且根据需要来输出音频/视频信号。Inside the module (16), a tuner (20) is configured to tune a particular carrier frequency and provide the received modulated signal to a demodulator (22). The demodulator (22) includes a number of hardware units (24) (in addition to the tuner (20)), such as demodulator and filter blocks. These components work under the control of firmware (26) previously downloaded from the application processor (12), thereby providing complete operation for the module (16) and outputting audio/video signals as required.

图3提供的是模块(16)的结构的代替的示意图。Figure 3 provides an alternative schematic view of the structure of the module (16).

总线(28)允许在模块(16)的块之间进行通信。调谐器(20)和其他硬件块(24)则被连接,以便与处理器(30)进行通信。在这里还提供了串行外围接口(32),以便与接收机(2)的应用处理器(12)进行通信。此外,在这里还提供了ROM(34)和RAM(36)。A bus (28) allows communication between the blocks of the module (16). A tuner (20) and other hardware blocks (24) are then connected to communicate with the processor (30). A serial peripheral interface (32) is also provided here to communicate with the application processor (12) of the receiver (2). Additionally, ROM (34) and RAM (36) are provided here.

图4是示意性描述在模块(16)的启动过程中在图3的装置中发生的过程的流程图。在步骤S10,其中为模块(16)和处理器(30)提供了一个复位信号。这样则会导致处理器(30)开始执行位于地址0x0000的指令,其中该地址在物理上映射到ROM(34),并且所述ROM自身包含了用于从接收机(2)的应用处理器(12)下载代码的引导装载器。在步骤S12,通过使用串行外围接口(32),引导装载器从应用处理器(12)接收引导配置参数并且将其存入RAM(36)。举例来说,这些参数可以包括设备的带宽(例如5、6、7或8MHz)以及接收机源时钟的频率。Fig. 4 is a flowchart schematically describing the process that takes place in the device of Fig. 3 during the start-up of the module (16). In step S10, where a reset signal is provided to the module (16) and processor (30). This will cause the processor (30) to start executing instructions at address 0x0000, which is physically mapped to the ROM (34), and which itself contains the application processor ( 12) Download the bootloader code. At step S12, using the serial peripheral interface (32), the boot loader receives boot configuration parameters from the application processor (12) and stores them in RAM (36). These parameters may include, for example, the bandwidth of the device (eg, 5, 6, 7 or 8 MHz) and the frequency of the receiver source clock.

然后,在步骤S14,引导装载器从应用处理器(12)下载固件(26)并且将其保存在RAM(36)中。保存在RAM(36)中的下载图像将包括用于该模块(16)的操作系统。很明显,出于所论述的原因,这个处理将会占用明显的时间量,例如大约200ms。Then, at step S14, the boot loader downloads the firmware (26) from the application processor (12) and saves it in RAM (36). The downloaded image saved in RAM (36) will include the operating system for that module (16). Obviously, for the reasons discussed, this process will take a significant amount of time, eg around 200ms.

在步骤S16,ROM引导装载器重新映射存储器,使得地址0x0000现在在物理上是指向RAM(36)而不是ROM(34)的。在步骤S18,使得处理器(30)再次开始执行位于地址0x0000的指令,该指令现在(由于步骤S16)在物理上将会映射到RAM(36),而所述RAM(36)自身则包含了固件(26)。At step S16, the ROM bootloader remaps the memory so that address 0x0000 now physically points to RAM (36) instead of ROM (34). In step S18, the processor (30) is caused to begin executing again the instruction at address 0x0000, which will now (due to step S16) be physically mapped to RAM (36), which itself contains firmware(26).

在步骤S20,保存在RAM(36)中的固件促使处理器(30)启动同样保存在RAM(36)中的操作系统。At step S20, the firmware stored in RAM (36) causes processor (30) to start the operating system, also stored in RAM (36).

在步骤S22,固件(26)收回那些在步骤S12中存储的配置参数值。优选地,这些参数值是保存在RAM(36)中的预定或固定位置的。然后,这些值将会根据需要而被输入存储器,由此在步骤S24中可以对包括调谐器和滤波器等等的硬件块进行初始化。特别地,该固件在硬件初始化中使用这些配置参数。In step S22, the firmware (26) retrieves those configuration parameter values stored in step S12. Preferably, these parameter values are stored at predetermined or fixed locations in RAM (36). Then, these values will be entered into the memory as needed, whereby the hardware blocks including the tuner and filter etc. can be initialized in step S24. In particular, the firmware uses these configuration parameters during hardware initialization.

最后,在步骤S26中创建用于执行各种任务的恰当线程(在下文中将会进一步论述)。这时,模块(16)仍旧会等待来自应用处理器(12)的、关于为恰当电视节目等等调谐或创建滤波器的命令。Finally, appropriate threads for performing various tasks are created in step S26 (discussed further below). At this point, the module (16) will still be waiting for commands from the application processor (12) to tune or create filters for the appropriate TV program or the like.

在使用接收机(2)的过程中,如果需要重新初始化大量的硬件元件或块(20,24),那么将会耗费时间。例如,有可能决定改变RF信道,也就是改变载波。实际上,如果接收信号丢失,那么应用处理器(12)可以决定移动到一个不同载波,而不是仅仅等待恢复接收。During use of the receiver (2), it is time consuming if a large number of hardware elements or blocks (20, 24) need to be reinitialized. For example, it may be decided to change the RF channel, ie to change the carrier. In fact, if the received signal is lost, the application processor (12) can decide to move to a different carrier instead of just waiting for reception to resume.

对处理器(30)来说,还可以安排来释放并且随后单独地重启每一个硬件块(20,24)。但是,本申请首次认定这种处理是非常复杂和耗时的。本申请还考虑到了重新应用参考图4所描述的复位处理的可能性。这个处理是一个非常简单和有效的处理。但是,这个处理有可能会很耗时,此外,参考如上所述的步骤S14,将固件下载到RAM(36)是需要耗费时间的。It can also be arranged for the processor (30) to release and then restart each hardware block (20, 24) individually. However, the present application for the first time recognizes that this process is very complex and time-consuming. The present application also contemplates the possibility of reapplying the reset process described with reference to FIG. 4 . This process is a very simple and effective one. However, this process may be very time-consuming. In addition, referring to step S14 as described above, downloading the firmware to RAM (36) is time-consuming.

本申请首次考虑使用取消命令,其中与操作图4的整个复位处理不同,该命令将会促使模块(16)停止任何的和所有当前操作,并且释放所有资源,而不需要处理器(30)单独停止每一个单个操作。就此而论,控制处理器(30)的固件(26)并没有单独停止操作和释放资源,而是单纯地重新初始化了操作系统核心。This application considers for the first time the use of a cancel command, where unlike the entire reset process of operating Figure 4, this command will cause the module (16) to stop any and all current operations and release all resources without requiring the processor (30) to separate Stop every single operation. As such, the firmware (26) of the control processor (30) does not stop operation and release resources alone, but simply reinitializes the operating system core.

图5是示意性描述在接收取消命令时发生的处理的流程图。Fig. 5 is a flowchart schematically describing the processing that occurs upon receipt of a cancel command.

在步骤S30,从应用处理器(12)向模块(16)发送取消命令。At step S30, a cancel command is sent from the application processor (12) to the module (16).

作为响应,在步骤(S32),固件不但会终止(kill)所有线程、定时器和事件,而且还会终止互斥体,借助于此,由两个线程执行的同时操作被阻止。这样一来,模块(16)执行的所有进程都会停止其正在执行的工作,并且所有的操作系统存储器结构都会被清空。在实践中,一部分存储器包含了用于激活线程的操作系统数据,由此操作系统将会知道那些活动的线程。当固件终止所有线程时,没有必要删除所有已存储线程,而是仅仅清除操作系统用以存储活动线程列表的存储块。由此,操作系统不会看到曾经存在的任何线程。很明显,这个处理几乎是即时的。In response, at step (S32), the firmware not only kills all threads, timers and events, but also kills the mutex, by means of which simultaneous operations performed by the two threads are blocked. In this way, all processes executed by the module (16) will stop their ongoing work, and all operating system memory structures will be cleared. In practice, a portion of memory contains operating system data for active threads, whereby the operating system will know which threads are active. When the firmware terminates all threads, it does not necessarily delete all stored threads, but only clears the memory block used by the operating system to store the list of active threads. From this, the operating system doesn't see any threads that ever existed. Obviously, this processing is almost instant.

在步骤S34,固件再次启动操作系统。换句话说,它会重新初始化引导功能,并且执行与图4中的S20相似的处理。In step S34, the firmware starts the operating system again. In other words, it reinitializes the boot function, and performs processing similar to S20 in FIG. 4 .

然后,与图4相比,则没有必要执行步骤S22,这是因为在这里没有必要重新存储配置参数;这些配置参数已经被正确保存在了存储器中。这时,值得一提的是,如果需要使用不同的配置参数,例如使用不同的带宽,那么一个全复位处理是需要的。Then, compared with FIG. 4, there is no need to execute step S22, because there is no need to re-store the configuration parameters here; these configuration parameters have been correctly saved in the memory. At this point, it is worth mentioning that if a different configuration parameter needs to be used, such as using a different bandwidth, then a full reset process is required.

然后,该处理跳转到步骤S36,在那里,固件将会初始化硬件。与复位处理的步骤S24相比,取消处理的步骤S36更简单。尤其是,并未重新初始化那些涉及通信的硬件,尤其是串行外围接口(32)。在优选实施例中,由于串行外围接口(32)处理的是与应用处理器(12)进行且涉及取消处理的通信,因此串行外围接口(32)并未重新初始化。另一方面,如果在存储器中保持了处理状态并且在初始化之后将其恢复至串行外围接口(32),那么将可以执行与复位处理中的步骤S24相类似的完整的硬件重新初始化。Then, the process jumps to step S36, where the firmware will initialize the hardware. Step S36 of the cancel process is simpler than step S24 of the reset process. In particular, those hardware involved in communication, especially the serial peripheral interface (32), are not reinitialized. In the preferred embodiment, the serial peripheral interface (32) is not reinitialized since it handles communications with the application processor (12) that involve cancel processing. On the other hand, if the processing state is kept in memory and restored to the serial peripheral interface (32) after initialization, then a complete hardware reinitialization similar to step S24 in the reset process can be performed.

在步骤S38,以与复位处理中的步骤S26相类似的方式来创建恰当的线程。此外,在步骤S40中,固件借助串行外围接口(32)来向应用处理器(12)发送一个取消响应,由此向应用处理器(12)确认该取消处理已经完成。In step S38, an appropriate thread is created in a similar manner to step S26 in the reset process. Furthermore, in step S40, the firmware sends a cancel response to the application processor (12) via the serial peripheral interface (32), thereby confirming to the application processor (12) that the cancellation process has been completed.

以下各项并未重新初始化:模块配置(在步骤S22中进行了),VIC(矢量化中断控制器)。某些其他块仅仅被部分地重新初始化:解调器,SPI和SDIO控制器(用于主机协议通信),以及DMA(直接存储器存取)控制器。The following items are not reinitialized: module configuration (done in step S22), VIC (Vectorized Interrupt Controller). Certain other blocks are only partially reinitialized: demodulator, SPI and SDIO controllers (for host protocol communication), and DMA (direct memory access) controller.

由此,在这里可以提供一种解调器设备以及一种用于操作该解调器设备的方法,其中为了通过释放单个资源来避免关机,引导(bootstrap)操作系统核心来停止接收机。模块(16)可以作为解调器芯片来提供,例如DVB-H解调器芯片。可以为DVB-H解调器芯片提供嵌入式固件。Thus, there may be provided a demodulator device and a method for operating the demodulator device in which the operating system kernel is bootstraped to stop the receiver in order to avoid shutdown by releasing a single resource. The module (16) may be provided as a demodulator chip, such as a DVB-H demodulator chip. Embedded firmware can be provided for DVB-H demodulator chip.

对执行单个基本操作的任何软件系统来说,无论该软件系统是否为嵌入式,这种通用方法都是适用的;如果在取消或停止当前操作之后系统状态与通电之后的初始状态等价,那么这种通用方法尤其是适用的。This general approach is applicable to any software system that performs a single elementary operation, whether embedded or not; if the state of the system after canceling or stopping the current operation is equivalent to the initial state after power-up, then This general approach is especially applicable.

如从上文中可以清楚了解的一样,接收机(16)实施使能主机应用处理器(12)对其进行控制的通信协议。这个协议包含了用于配置和启动接收机(16)的主要功能的命令,例如扫描频谱来发现DVB-H信号,调谐到特定频率并且设置SI和MPE滤波器,以及接收净荷数据。与任何控制系统一样,该协议还包括用于停止操作的命令,例如停止正在执行的频谱扫描处理,以及停止和释放(清除)SI和MPE滤波器。As is clear from the above, the receiver (16) implements a communication protocol that enables the host application processor (12) to control it. This protocol contains commands for configuring and starting the main functions of the receiver (16), such as scanning the spectrum to find DVB-H signals, tuning to a specific frequency and setting SI and MPE filters, and receiving payload data. As with any control system, the protocol also includes commands for stopping operations, such as stopping ongoing spectral scanning processing, and stopping and releasing (clearing) SI and MPE filters.

但是,接收机(2)实施的是这样一种通信协议,其中该通信协议的新颖之处在于:1)定义了一个附加的#ABORT命令,该命令促使接收机停止任何的和所有当前操作并释放所有资源,而不需要主机应用处理器单独停止每一个单个的任务,以及2)提供#ABORT命令自身的固件实施方式,它不会单独停止操作和释放资源,但取而代之的是,它会重新初始化操作系统核心。However, the receiver (2) implements a communication protocol which is novel in that: 1) an additional #ABORT command is defined which causes the receiver to abort any and all current operations and release all resources without requiring the host application processor to individually abort each individual task, and 2) provide a firmware implementation of the #ABORT command itself that does not individually abort operations and release resources, but instead restarts Initialize the operating system core.

例如在调谐到不同频率或是创建SI和MPE滤波器的不同集合的预备中,#ABORT命令为主机应用处理器(12)提供了一种将接收机(16)返回到干净状态的快速简单的方式。此外,如果不必循环经过所有操作来将其停止以及不需要释放所有资源,那么将会减少代码数量,并且将会使嵌入式固件更小,由此节约嵌入式存储器。For example in preparation for tuning to a different frequency or creating a different set of SI and MPE filters, the #ABORT command provides a quick and easy way for the host application processor (12) to return the receiver (16) to a clean state Way. Furthermore, if not having to cycle through all operations to stop them and not having to release all resources, the code size will be reduced and the embedded firmware will be made smaller, thus saving embedded memory.

在一个特定实施例中,接收机软件(先前被描述成是固件)实施方式在来自Express Logic,Inc.的嵌入式实时核心操作系统ThreadX上运行。在ThreadX系统的初始化过程中,可以区别多个步骤:In one particular embodiment, the receiver software (previously described as firmware) implementation runs on ThreadX, an embedded real-time core operating system from Express Logic, Inc. During the initialization process of the ThreadX system, several steps can be distinguished:

初始化过程initialization process

0.系统复位(中断被禁用)0. System reset (interrupts are disabled)

1.跳转到图像输入点1. Jump to the image input point

2.开发工具初始化(包括全局变量初始化)(在某些实施例中可以移除该步骤)。2. Development tool initialization (including global variable initialization) (this step can be removed in some embodiments).

3.main():执行预备处理(这包括设置定时器之类的硬件初始化)(该步骤作为图像输入点的可以组合地完成,由此将不存在main()函数)。3. main(): Execute preparatory processing (this includes hardware initialization such as setting a timer) (this step can be completed in combination as an image input point, so there will be no main() function).

4.通过调用tx_kernel_enter()来启动ThreadX。4. Start ThreadX by calling tx_kernel_enter().

5.由ThreadX调用tx_application_define()来:5. Call tx_application_define() by ThreadX:

a.创建系统资源(应用线程,互斥体,事件标志,定时器)a. Create system resources (application threads, mutexes, event flags, timers)

b.执行设备初始化,以及b. perform device initialization, and

c.调用软件模块的初始化方法。c. Call the initialization method of the software module.

6.进入线程调度循环(中断被使能)。6. Enter the thread scheduling loop (interrupts are enabled).

在这个初始化处理之后,系统处于已知状态X,其中,它可以开始接收来自主机的命令。After this initialization process, the system is in a known state X where it can start receiving commands from the host.

在接收到#ABORT命令时,通过重新执行上述初始化序列的一部分来迫使系统进入相同的已知状态X。On receipt of the #ABORT command, force the system into the same known state X by re-executing part of the initialization sequence described above.

取消处理:Cancellation processing:

0.主机发送#ABORT。0. Host sends #ABORT.

1.在定时器线程中:1. In the timer thread:

a.禁用中断a. Disable interrupts

b.通过将OS资源结构重新初始化到0来废弃所有OS资源(应用线程,互斥体,事件标志,定时器)。b. Discard all OS resources (application threads, mutexes, event flags, timers) by reinitializing OS resource structures to 0.

c.设置PostABORT标志(可供模块实施方式查询以识别跟随在#ABORT之后的初始化处理的全局变量)c. Set the PostABORT flag (a global variable that can be queried by module implementations to identify initialization processing following #ABORT)

现在,该状态与初始化步骤3之后的状态相匹配。The state now matches the state after initialization step 3.

2.通过调用tx_kernel_enter()来重启ThreadX。2. Restart ThreadX by calling tx_kernel_enter().

3.ThreadX将会调用tx_application_define()来:3.ThreadX will call tx_application_define() to:

a.重新创建系统资源(应用线程,互斥体,事件标志,定时器)a. Recreate system resources (application threads, mutexes, event flags, timers)

b.重新执行设备初始化b. Re-execute device initialization

c.调用软件模块的初始化方法,以及c. call the initialization method of the software module, and

d.向主机发送关于#ABORT的响应。d. Send a response about #ABORT to the host.

4.进入线程调度循环(启用中断)。4. Enter the thread scheduling loop (with interrupts enabled).

作为步骤3.c的一部分,软件模块的实施应该考虑到只在初始化处理的步骤2中对全局和静态变量执行初始化。如果根据#ABORT预期重新初始化任一全局或静态变量,那么应该在特定模块的初始化方法中显性执行该处理。As part of step 3.c, the implementation of the software module should take into account that initialization of global and static variables is only performed in step 2 of the initialization process. If any global or static variables are reinitialized in anticipation of #ABORT, then this processing should be performed explicitly in the initialization method of the particular module.

图6示意性描述了数字电视接收中的软件端的实例,其中举例来说,所述数字电视接收例如可以在如上面所述的模块(16)的模块中工作。Fig. 6 schematically depicts an example of a software side in a digital television reception, which can work, for example, in a module such as the module (16) described above.

在顶层,正在由模块(16)执行的多个功能被图示为线程或任务(40)。这些线程和任务中的每一个都使用了可以从处于其下方的层中得到的一个或多个服务(42)。至少在某些环境中,为了执行用于这些任务的服务(42)的功能,这些服务(42)将需要使用模块(16)中的硬件(20,24)。为此目的,每一个服务都可以使用与相应设备或硬件块(20,24)相对应的一个或多个设备驱动器(44)。At the top level, the various functions being performed by the modules (16) are illustrated as threads or tasks (40). Each of these threads and tasks uses one or more services (42) available from the layer below it. In at least some circumstances, the services (42) will require the use of hardware (20, 24) in the module (16) in order to perform the functions of the services (42) for these tasks. For this purpose, each service may use one or more device drivers (44) corresponding to the respective device or hardware block (20, 24).

本申请首次考虑到了不同设备或硬件块(20,24)的电量消耗问题。当开启这些设备或硬件块(20,24)时,它们将会消耗电量,而本申请认为,在不使用这些设备或硬件块(20,24)时,将其关闭,那么将会是有益的,对电池供电的设备来说尤其如此。例如,对于数字电视接收机来说,接收和处理突发(burst)中的数据块是相当常见的。因此,在接收和处理这些突发的过程中,在不同时间,各种硬件块或设备既有可能处于使用之中,也有可能未被使用。For the first time, the application takes into account the power consumption of different devices or hardware blocks (20, 24). When these devices or hardware blocks (20, 24) are turned on, they will consume power, and the application believes that it will be beneficial to turn off these devices or hardware blocks (20, 24) when they are not in use , especially for battery-operated devices. For example, it is quite common for digital television receivers to receive and process blocks of data in bursts. Consequently, various hardware blocks or devices may or may not be in use at different times during the reception and processing of these bursts.

再次参考图6,应该理解的是,对同时运行的不同任务和服务来说,不同的任务和服务有可能会在同一时间需要设备和设备驱动器。这样则很难在任一时间确定是否应该为特定设备或硬件块(20,24)通电还是断电。特别地,单个的任务会以彼此独立的方式工作,同样,单独的服务也会以彼此独立的方式工作,由此一般来说,一个任务或一个服务将不知道其他任务或服务正在使用哪些设备或硬件。Referring again to FIG. 6, it should be understood that for different tasks and services running concurrently, different tasks and services may require devices and device drivers at the same time. This makes it difficult to determine whether a particular device or hardware block (20, 24) should be powered on or off at any one time. In particular, individual tasks will work independently of each other, and likewise, individual services will work independently of each other, whereby in general, one task or one service will not know which devices are being used by other tasks or services or hardware.

作为该问题的解决方案,本申请提出了为每一个驱动器(44)使用电源管理应用编程接口(API)(46)。在图7中对此进行了示意性描述。As a solution to this problem, the present application proposes the use of a power management application programming interface (API) (46) for each driver (44). This is schematically depicted in FIG. 7 .

实际上,电源管理API包括计数器,该计数器在服务(42)每次请求使用相应设备或硬件块(20,24)的时候递增,并且会在每次停止使用设备或硬件块(20,24)的时候递减。对该装置来说,应该了解的是,只要计数器具有递增或非零状态,那么将会存在一个指示,该指示表明至少一个服务需要使用相应的设备或硬件时钟(20,24),由此应该保持通电。只有当计数器处于零值或者未递增时,相应设备或硬件块(20,24)才可以断电。In fact, the power management API includes counters that are incremented each time the service (42) requests to use the corresponding device or hardware block (20, 24), and will be stopped each time the device or hardware block is used (20, 24) decrements when. To the apparatus, it should be understood that as long as the counter has an incremented or non-zero state, there will be an indication that at least one service requires the use of the corresponding device or hardware clock (20, 24), whereby it should Stay powered up. The corresponding device or hardware block (20, 24) may be powered down only when the counter is at zero value or not incremented.

如图7示意性描述的那样,电源管理API(46)为相应设备或硬件块(20,24)提供了一个电源信号(48)。响应于这个电源信号(48),相应的设备或硬件块(20,24)可以通电或断电。As schematically depicted in Figure 7, the power management API (46) provides a power signal (48) to the corresponding device or hardware block (20, 24). In response to this power signal (48), the corresponding device or hardware block (20, 24) can be powered on or off.

该电源信号(48)可以用多种不同方式来使用,以便控制相应设备或硬件块(20,24)的电源。The power signal (48) can be used in a number of different ways to control the power of the corresponding device or hardware block (20, 24).

图8示意性描述了一种装置,在该装置中,电源信号(48)是与主时钟信号(50)和时钟块(52)结合使用的。Figure 8 schematically depicts an arrangement in which a power supply signal (48) is used in conjunction with a master clock signal (50) and a clock block (52).

在设备或硬件块(20,24)中存在两个主要的电量消耗源。首先,依照时钟信号的每一次转换都具有相对显著的电量消耗。其次,在不考虑时钟信号的情况下也是存在泄露的。例如依照如图8所示的优选实施例,至特定设备或硬件块(20,24)的所有电源可以被关闭,但是仅仅停止用于相应设备或硬件块(20,24)的时钟来阻止因为转换所导致的电源损失,这是不能满足需要的。There are two main sources of power consumption in a device or hardware block (20, 24). First, each transition according to the clock signal has a relatively significant power consumption. Second, there is leakage even when the clock signal is not considered. For example, according to a preferred embodiment as shown in FIG. 8, all power to a particular device or hardware block (20, 24) may be turned off, but only the clock for the corresponding device or hardware block (20, 24) is stopped to prevent the The power loss caused by the conversion, which cannot meet the needs.

在图8所示的实施例中,时钟信号(50)借助时钟块(52)被提供给硬件块(20,24)。这可以作为一个包含了分别与硬件块(20,24)相对应的多个门(54)的硬件块来实现。每一个门根据相应的电源信号(48)而被使能或禁用。这样,驱动器(44)的电源管理API(46)对是否将时钟信号(50)提供给相应的硬件块(20,24)进行控制。In the embodiment shown in Figure 8, the clock signal (50) is provided to the hardware blocks (20, 24) by means of a clock block (52). This can be implemented as a hardware block comprising a plurality of gates (54) respectively corresponding to the hardware blocks (20, 24). Each gate is enabled or disabled according to a corresponding power signal (48). Thus, the power management API (46) of the driver (44) controls whether the clock signal (50) is provided to the corresponding hardware block (20, 24).

可以使用“或”或“与”门。对“与”门来说,如果将电源信号(48)设置成1,那么将会为硬件通电;如果将其设置为“零”,则会将硬件断电。对“或”门来说,如果将电源信号(48)设置成“1”,那么会将时钟块保持在“1”,由此冻结时钟并且由此将该块断电;如果将电源信号(48)设置成零,那么将会使得块时钟与系统时钟等价,由此将会为该块通电。优选地,该硬件使用“或”门,并且由此必须反转电源信号(1表示切断,0表示接通)。An OR or AND gate can be used. For the AND gate, if the power signal (48) is set to 1, then the hardware will be powered on; if it is set to "zero", the hardware will be powered off. For the "OR" gate, if the power signal (48) is set to "1", it will hold the clock block at "1", thereby freezing the clock and thereby powering down the block; if the power signal ( 48) Set to zero, then the block clock will be made equivalent to the system clock, and thus the block will be powered on. Preferably, the hardware uses OR gates, and thus must invert the power signal (1 for off, 0 for on).

应该了解的是,这种装置可以使用在任何一种其中存在多个单独硬件块的电路中,其中这些硬件块可以有选择地通电或断电。这种装置在数字电视接收机、例如DVB-H接收机或模块中是尤其有用的,其中所述模块例如是在此类接收机中使用的模块(16)。但是,它还具有其他应用,例如在移动电话或个人计算机中应用。It should be appreciated that such an arrangement may be used in any circuit in which there are multiple individual hardware blocks that can be selectively powered on and off. Such an arrangement is particularly useful in digital television receivers, such as DVB-H receivers, or in modules such as those used in such receivers (16). However, it also has other applications, for example in mobile phones or personal computers.

由此可以提供一种系统和操作系统的方法,尤其是所述系统和方法使用了参考计数,以便通过禁用那些不需要的单独硬件块的时钟来节约电量。对于任何在其中能够单独控制硬件块的电源状态并且由多个软件任务或线程异步使用硬件块的系统,该方法都是适用的。Thereby a system and method of operating the system, in particular using a reference count, can be provided to save power by disabling the clocks of individual hardware blocks that are not needed. This approach is applicable to any system where the power states of hardware blocks can be individually controlled and used asynchronously by multiple software tasks or threads.

对电源管理来说,与具有单独的主电源状态(接通或切断)不同,接收机硬件(20,24,52)将会允许单独控制每一个块(20,24)的电源,以便节约更多的电力。例如,一旦接收到突发并且将其存入MPE-FEC存储器(24),则可以在对突发纠错以及将其传送到主机或应用处理器(12)的时候关闭调谐器(20)、解调器(24)以及滤波器块(24)。只有在此之后,MPE-FEC块才会关闭。如上所述,嵌入式固件实施方式中的难题源于这样一个事实,即单个硬件块(20,24)的电源状态有可能依赖于多个任务(40)的活动。例如,调谐器可以供接口处理机(或接口处理机任务(40))使用,以便执行SCAN命令,此外它也可以由时间切片器(或时间切片器(40))使用,以便接收突发。或者,所述MPE-FEC可能要处理并行的IP服务。For power management, instead of having a separate main power state (on or off), the receiver hardware (20, 24, 52) will allow individual control of the power of each block (20, 24) in order to save more much electricity. For example, once a burst is received and stored in MPE-FEC memory (24), the tuner (20) can be turned off while the burst is error-corrected and transmitted to the host or application processor (12), A demodulator (24) and a filter block (24). Only after that, the MPE-FEC block is turned off. As noted above, difficulties in embedded firmware implementations stem from the fact that the power state of a single hardware block (20, 24) may depend on the activity of multiple tasks (40). For example, a tuner can be used by an interface handler (or interface handler task (40)) to execute SCAN commands, and it can also be used by a time slicer (or time slicer (40)) to receive bursts. Alternatively, the MPE-FEC may handle parallel IP services.

为了简化实施方式,每一个设备驱动器(44)都可以独立管理受其控制的硬件块的电源状态。就此而论,同步电源管理API的实例如下:To simplify implementation, each device driver (44) can independently manage the power state of the hardware blocks it controls. In this regard, examples of synchronous power management APIs are as follows:

  请求设备将其电源状态保持在POWERED_ON上 Request the device to keep its power state on POWERED_ON   Err_t DrvXXX_PowerUp() Err_t DrvXXX_PowerUp()   放弃保持在该电源状态上 Give up staying on this power state   Err_t DrvXXX_PowerDown() Err_t DrvXXX_PowerDown()

客户机或服务(42)将会调用PowerUp()函数来表明其需要将设备的电源状态保持在POWERED_ON。如果设备(20,24)尚未开启,那么驱动器(44)将会立即开启该设备。然后,在可以放弃所述保持时,客户机或服务(42)将会调用PowerDown()。但是,实际上,只有在没有其他客户机或服务(42)保持通电的时候,该设备的电源状态才会切换到POWERED_OFF。这种处理是通过让驱动器(44)保持一个电源状态计数器来实现的。该状态被初始化为0,并且会在每一次调用PowerUp()的时候递增,以及在每次调用PowerDown()的时候递减。当计数器值为零时,设备(20,24)将会关闭。The client or service (42) will call the PowerUp() function to indicate that it needs to keep the device's power state at POWERED_ON. If the device (20, 24) is not already on, the driver (44) will immediately turn on the device. Then, the client or service (42) will call PowerDown() when the hold can be relinquished. In practice, however, the device's power state will only switch to POWERED_OFF if no other clients or services (42) remain powered on. This processing is accomplished by having the driver (44) maintain a power state counter. The state is initialized to 0, and is incremented each time PowerUp() is called, and decremented each time PowerDown() is called. When the counter value is zero, the device (20, 24) will be turned off.

一些服务(42)(调谐,SI提取和IP提取)将实施相同的API。每一个设备驱动器实施电源管理API,并且服务或任务可以通过使用所述API来控制相应硬件块的电源状态。只有系统任务才需要具有例如何时需要为调谐器和解调器通电的观点。例如,调谐服务知道必须将调谐器和解调器块通电来执行调谐操作。但是,它不知道何时可以将这些块断电,其中该时间有可能处于接收当前突发(也就是时间片)的末期,只有IP接收任务才知道这个时间。Some services (42) (tuning, SI extraction and IP extraction) will implement the same API. Each device driver implements a power management API, and a service or task can control the power state of a corresponding hardware block by using the API. Only system tasks need to have a view of when, for example, the tuner and demodulator need to be powered on. For example, the tuning service knows that the tuner and demodulator blocks must be powered on to perform tuning operations. However, it does not know when these blocks can be powered down, which may be at the end of receiving the current burst (ie time slice), only the IP receive task knows this time.

在优选的固件架构中,任务并未直接访问设备驱动器及其API,而是仅仅通过服务层中的中间服务块来对其进行访问。优选地,在这里应该存在一种可供服务将来自任务的电源管理请求转发到设备驱动器的方法。这通过让服务与设备驱动器实施相同的电源管理API来实现。In a preferred firmware architecture, tasks do not directly access device drivers and their APIs, but only through intermediate service blocks in the service layer. Preferably, there should be a way for the service to forward power management requests from the task to the device driver. This is accomplished by having the service implement the same power management API as the device driver.

在服务中,电源管理API是以一种与其在设备驱动器中相同的方式来实施的,也就是说,它借助参考计数来实施。这其中的唯一区别在于:代替控制电源信号,当参考计数分别是非零或零时,服务调用底层设备驱动器的PowerUp()和PowerDown()函数。In a service, the power management API is implemented in the same way as it is in a device driver, that is, it is implemented with reference counting. The only difference here is that instead of controlling the power signal, the service calls the underlying device driver's PowerUp() and PowerDown() functions when the reference count is non-zero or zero, respectively.

举个例子,借助上述API,图6所示的时间切片器任务很容易就可以如以下伪代码显示的那样实施:As an example, with the above API, the time slicer task shown in Figure 6 can be easily implemented as shown in the following pseudocode:

永远重复:Repeat forever:

SrvTune_PowerUp()SrvTune_PowerUp()

SrvTune_AcquireSignalLock()/*异步的*/SrvTune_AcquireSignalLock()/*asynchronous*/

SrvSi_PowerUp()SrvSi_PowerUp()

Srvlp_PowerU p()Srvlp_PowerUp()

SrvIp_ReceiveBurst()                    /*异步的*/SrvIp_ReceiveBurst() /*Asynchronous*/

SrvTune_PowerDown()SrvTune_PowerDown()

SrvSi_PowerDown()SrvSi_PowerDown()

SrvIp_ProcessBurst()                    /*异步的*/SrvIp_ProcessBurst() /*Asynchronous*/

SrvIp_PowerDown()SrvIp_PowerDown()

RTOS sleep until SrvIp_GetNextTimeSlice()/*阻止*/RTOS sleep until SrvIp_GetNextTimeSlice()/*block*/

本申请提出了一种新的系统,在该系统中,由多个软件任务组合使用的单独硬件块(20,24)的电源状态,可以通过禁用单独硬件块(20,24)的单独时钟信号来独立控制。在最低的软件层(设备驱动器)(44)中,当1)有多个软件任务共享相同的硬件资源时;以及2)当多个软件任务异步使用所述硬件资源(并且需要将其通电)的时候,可以使用参考计数来确定何时可以为硬件块通电或断电。This application proposes a new system in which the power states of individual hardware blocks (20, 24) used in combination by multiple software tasks can be controlled by disabling the individual clock signals of the individual hardware blocks (20, 24) to control independently. In the lowest software layer (device driver) (44), when 1) there are multiple software tasks sharing the same hardware resource; and 2) when multiple software tasks use said hardware resource asynchronously (and need to power it on) , a reference count can be used to determine when a hardware block can be powered on or off.

标准的电源控制参考计数API不但可以在驱动器层中实施,而且可以在其上的所有软件层中实施,以使得顶层不必知道哪些硬件块通过对于中间层的函数调用被间接使用。A standard power control reference count API can be implemented not only in the driver layer, but in all software layers above it, so that the top layer does not have to know which hardware blocks are used indirectly through function calls to the middle layer.

这样,在多任务多线程系统中可以节约电力。此外,由于某全局状态不需要被利用受电源控制的硬件块的所有软件元件查询或修改,因此,该系统的架构和实施方式可以被简化。In this way, power can be saved in a multitasking multithreaded system. Furthermore, the architecture and implementation of the system can be simplified because a certain global state does not need to be queried or modified by all software elements utilizing power-controlled hardware blocks.

以下实例是以图2和6的实施例为基础的,该实例假设IP提取主要需要的是使用三个主硬件元件,即调谐器/解调器块、传输滤波器块以及FEC帧控制器块。软件架构包括处于服务顶层之上的任务,其中所述服务处于驱动器之上。The following example is based on the embodiment of Figures 2 and 6, which assumes that IP extraction mainly requires the use of three main hardware elements, namely, a tuner/demodulator block, a transport filter block, and a FEC frame controller block . The software architecture includes tasks on top of the services on top of the drivers.

如上所述,每一个硬件块(20,24)都是由驱动器(44)控制的。实施电源管理功能的硬件块(20,24)具有其PowerUp()和PowerDown()函数对。每一个PowerUp()函数都会对其被调用的次数进行计数,在其首次被调用时,硬件块将会通电,并且计数器使用将会递增。而针对该PowerUp()的所有后续调用将只会递增该使用计数器。PowerDown()是以相同的方式工作的,但是它会递减其使用计数器,直至该计数器达到0,这时,硬件(20,24)实际是断电的。As mentioned above, each hardware block (20, 24) is controlled by a driver (44). A hardware block (20, 24) implementing a power management function has its PowerUp() and PowerDown() function pair. Each PowerUp() function counts the number of times it is called, the first time it is called the hardware block will be powered on and the counter usage will be incremented. And all subsequent calls to that PowerUp() will just increment the usage counter. PowerDown() works in the same way, but it decrements its usage counter until it reaches 0, at which point the hardware (20, 24) is actually powered down.

举个例子,硬件块及其电源控制功能是如下给出的。As an example, the hardware blocks and their power control functions are given below.

调谐器块需要在任何其他块之前被通电。解调器块同样需要在可以提取数据之前活动。在本实例中,为了简化说明,假设调谐器和解调器块是耦合在一起的。但是,调谐器和解调器块可以具有它们自己的PowerUp()和PowerDown()函数,以便节约电力。The tuner block needs to be powered on before any other blocks. The demodulator block also needs to be active before data can be extracted. In this example, for simplicity of illustration, it is assumed that the tuner and demodulator blocks are coupled together. However, the tuner and demodulator blocks can have their own PowerUp() and PowerDown() functions in order to save power.

通过使用DrvDemux_PowerUp()和DrvDemux_PowerDown()函数,可以激活或去激活传输过滤器时钟,以便节约电力。The transmit filter clock can be activated or deactivated to save power by using the DrvDemux_PowerUp() and DrvDemux_PowerDown() functions.

通过使用DrvFec_PowerUp()和DrvFec_PowerDown()函数,可以激活或去激活FEC帧控制器时钟,以便节约电力。FEC块需要传输滤波器块处于活动状态,以便实际接收数据,由此DrvFec_PowerUp()及DrvFec_PowerDown()函数同样在内部分别调用DrvDemux_PowerUp()和DrvDemux_PowerDown()函数。The FEC frame controller clock can be activated or deactivated to save power by using the DrvFec_PowerUp() and DrvFec_PowerDown() functions. The FEC block requires the transmit filter block to be active in order to actually receive data, so the DrvFec_PowerUp() and DrvFec_PowerDown() functions also internally call the DrvDemux_PowerUp() and DrvDemux_PowerDown() functions respectively.

如上所述,软件功能(非特定于硬件的功能)是在使用驱动器(44)的服务(42)中实施的。这些服务(42)也可以具有PowerUp()和PowerDown()函数,这些函数是由任务使用这些服务来调用的。通常,它们同样使用一个使用计数器以及针对驱动器电源控制函数的调用来实施。As mentioned above, software functions (non-hardware specific functions) are implemented in services (42) using drivers (44). These services (42) may also have PowerUp() and PowerDown() functions that are called by tasks using these services. Typically, they are also implemented using a usage counter and calls to the driver's power control functions.

对与SI提取一起工作的多个IP提取处理来说,借助这种架构,可容易地实现精密的电源控制。对从一个任务开始运行的每一个IP滤波提取处理来说,只要其需要特定资源,它就会为所述资源通电,当不再需要这些资源时,它会将这些资源断电,在这里,关键的架构点在于:每一个IP或SI滤波器都是独立地被对待的,并且每一个IP或SI滤波器都使用了每一个共享资源的电源控制功能。With this architecture, sophisticated power control can be easily achieved for multiple IP extraction processes working together with SI extraction. For every IP filtering extraction process running from a task, whenever it needs certain resources, it will power on said resources, when these resources are no longer needed, it will power off these resources, here, The key architectural point is that each IP or SI filter is treated independently, and each IP or SI filter uses the power control function of each shared resource.

以下是调谐器/解调器、解复用器以及FEC帧控制器的电源使用实例,其中假设两个IP滤波器同时工作并且在某段时间共享硬件资源的情形。图9描绘的是三个主驱动器的电源计数器使用值,并且下面示出的是用于两个独立服务的伪代码,其中这两个独立服务是同时运行的,并且括号中的值代表每一个驱动器的电源使用计数器。The following is an example of power usage for the tuner/demodulator, demux, and FEC frame controller, assuming that two IP filters work simultaneously and share hardware resources for a certain period of time. Figure 9 depicts the power counter usage values for the three master drives, and below shows the pseudocode for two independent services running concurrently, and the values in parentheses represent each Drive's power usage counter.

  IP0 IP0   IP1 IP1   SrvIp_GetNextTimeSlice->Sleep DeltaT_0 msecSrvTuning_PowerUp->DrvTuner_PowerUp      (0->1)SrvTuning_TuneSrvIp_PowerUp->DrvFec_PowerUp        (0->1)->DrvDemux_PowerUp      (0->1)SrvSi_PowerUp->DrvDemux_PowerUp      (1->2)SrvIp_ReceiveBurstSrvTuning_PowerDown->DrvTuner_PowerDown    (2->1)SrvSi_PowerDown->DrvDemux_PowerDown    (4->3)SrvIp_PowerDown->DrvDemux_PowerDown    (3->2)->DrvFec_PowerDown      (2->1)SrvIp_Proces sBurst SrvIp_GetNextTimeSlice->Sleep DeltaT_0 msecSrvTuning_PowerUp->DrvTuner_PowerUp      (0->1)SrvTuning_TuneSrvIp_PowerUp->DrvFec_PowerUp        (0->1)->DrvDemux_PowerUp      (0->1)SrvSi_PowerUp->DrvDemux_PowerUp      (1->2)SrvIp_ReceiveBurstSrvTuning_PowerDown->DrvTuner_PowerDown    (2 ->1)SrvSi_PowerDown->DrvDemux_PowerDown (4->3)SrvIp_PowerDown->DrvDemux_PowerDown (3->2)->DrvFec_PowerDown (2->1)SrvIp_Proces sBurst   SrvIp_GetNextTimeSlice->Sleep_DeltaT_1 msecSrvTuning_PowerUp->DrvTuner_PowerUp      (1->2)SrvTuning_TuneSrvIp_PowerUp->DrvFec_PowerUp        (1->2)->DrvDemux_PowerUp      (2->3)SrvSi_PowerUp->DrvDemux_PowerUp      (3->4)SrvIp_ReceiveBurstSrvTuning_PowerDown->DrvTuner_PowerDown    (1->0)SrvSi_PowerDown->DrvDemux_PowerDown    (2->1)SrvIp_PowerDown->DrvDemux_PowerDown    (1->0)->DrvFec_PowerDown      (1->0)SrvIp_ProcessBurst SrvIp_GetNextTimeSlice->Sleep_DeltaT_1 msecSrvTuning_PowerUp->DrvTuner_PowerUp      (1->2)SrvTuning_TuneSrvIp_PowerUp->DrvFec_PowerUp        (1->2)->DrvDemux_PowerUp      (2->3)SrvSi_PowerUp->DrvDemux_PowerUp      (3->4)SrvIp_ReceiveBurstSrvTuning_PowerDown->DrvTuner_PowerDown    (1- >0)SrvSi_PowerDown->DrvDemux_PowerDown (2->1)SrvIp_PowerDown->DrvDemux_PowerDown (1->0)->DrvFec_PowerDown (1->0)SrvIp_ProcessBurst

正如将要针对下文中的特定实施例所论述的那样,在诸如图2的模块(16)这样的设备中,多个任务要求被同时执行或者至少以重叠的方式被执行。例如,在图6之后,如图10所示,有可能存在多个时间切片器任务,其中每一个时间切片器任务都会操作相应的IP(因特网协议)接收程。每一个时间切片器任务可以具有处于使用中的、其自身的相应服务集合(例如调谐、S/PSI:提取和IP:提取服务),并且如所示,更为优选的是共享相同的服务集合。但是,不管怎样,有必要提供某个系统,其允许所有任务在同一时间在模块(16)内部工作。As will be discussed below for certain embodiments, in a device such as module (16) of Figure 2, multiple tasks are required to be performed simultaneously or at least in an overlapping fashion. For example, after FIG. 6 , as shown in FIG. 10 , there may be multiple time slicer tasks, and each time slicer task will operate a corresponding IP (Internet Protocol) receiving process. Each time slicer task may have its own corresponding set of services in use (e.g. tuning, S/PSI:fetch and IP:fetch services), and as shown, more preferably share the same set of services . However, it is necessary to provide some system which allows all tasks to work inside the module (16) at the same time.

众所周知,如果实时操作系统可用,那么可以将单独的任务映射为相应的线程。用于每一个相应线程的堆栈都被提供了一个存储器区域,并且每一个线程都是以与所有其他线程独立的方式处理的,其中所述堆栈允许操作系统在模块(16)中提供资源的时间共享。特别地,该堆栈允许在任何便利时间以优先于别的线程的方式脱离某个线程,以及在可能的时候返回该线程。It is well known that separate tasks can be mapped to corresponding threads if a real-time operating system is available. A memory area is provided with a stack for each respective thread, and each thread is handled independently of all other threads, wherein said stack allows the operating system to provide resources in module (16) time shared. In particular, the stack allows detaching a thread in preference to other threads at any convenient time, and returning it when possible.

这样,图10所示的任务可以被提供单独的相应线程,即空闲线程、接口处理机、信号锁定器以及四个时间切片器。Thus, the tasks shown in FIG. 10 can be provided with separate corresponding threads, namely the idle thread, the interface handler, the signal locker, and the four time slicers.

遗憾的是,以这种方式来使用线程,会同样要求使用那些需要存储器的相应堆栈。在使用实时操作系统的大多数设备中,其中往往具有足够的存储器而使堆栈的需求变得无关紧要。然而,对那些如为手持式电视接收所考虑的设备、例如图2中的模块(16)来说,可以预期的是,其在存储器方面的资源是非常有限的。Unfortunately, using threads in this way also requires the use of corresponding stacks that require memory. In most devices using a real-time operating system, there is often enough memory in there to make the need for a stack irrelevant. However, for devices such as module (16) in Figure 2, which are considered for handheld television reception, it can be expected that their resources in terms of memory are very limited.

作为替换,可能的是:任务的所有单独部分可以组合在一起作为单个的状态机。这样做将不具有相同的存储器需求,但是其灵活性很低。举个例子,就需要步骤A1和A2的任务A以及需要步骤B1、B2和B3的任务B而言,可以构造一个单独的状态机,其中该状态机例如始终按照如下顺序运行步骤:A1、B1、B2、A2、B3。应该了解的是,这种固定装置具有非常有限的灵活性,当出现非预期状况时,这种装置有可能会很不适合。特别地,一种这样的非预期状况可能是必须在实时制约所规定的时间范围中处理的事件。对固定状态机来说,在该事件被处理之前的等待时间可直至通过该状态机的一个完整循环。Alternatively, it is possible that all individual parts of a task can be combined together as a single state machine. Doing so would not have the same memory requirements, but would be less flexible. As an example, in the case of task A requiring steps A1 and A2, and task B requiring steps B1, B2 and B3, a separate state machine can be constructed which, for example, always runs the steps in the following order: A1, B1 , B2, A2, B3. It should be appreciated that such a fastening device has very limited flexibility and may not fit well when unanticipated conditions arise. In particular, one such unexpected situation may be an event that must be handled within the time frame dictated by real-time constraints. For a fixed state machine, the wait time before the event is processed can be up to one full cycle through the state machine.

关于协同例程的概念同样是已知的。在协同例程中的预定步骤之后,协同例程会屈让(yield),由此在返回到第一协同例程屈让的点之前允许系统选择有可能来自别的协同例程的步骤。这样,对上文中给出的实例来说,第一协同例程可以在步骤A1和步骤A2之后用屈服点来构造,同样,协同例程可以在步骤B1、在步骤B2以及在步骤B3之后用屈服点来构造。总体处理将会以一种已知的方式继续进行,例如通过以步骤A1为开始,并且在步骤A1末端的屈服点,检查来了解是否系统预备执行步骤B1。如果该系统准备就绪,那么该处理移动到步骤B1,否则该处理移动到A2。这种装置提供了某种灵活度,而没有用于每一个处理的堆栈的存储器需要。The concept of co-routines is also known. After a predetermined step in a co-routine, the co-routine will yield, thereby allowing the system to select steps, possibly from other co-routines, before returning to the point where the first co-routine yielded. Thus, for the example given above, the first co-routine can be constructed with yield points after step A1 and step A2, and likewise, the co-routine can be constructed with step B1, after step B2 and after step B3 with Yield point to construct. The overall process will continue in a known manner, eg by starting with step A1 and at the yield point at the end of step A1, checking to see if the system is ready to perform step B1. If the system is ready, the process moves to step B1, otherwise the process moves to A2. This arrangement provides some flexibility without the need for a stack of memory for each transaction.

本申请首次提出了一种装置,在该装置中,协同例程是内置在单独线程内部的。特别地,具有相同或相似优先级的进程(在这里以另外的方式被描述成是任务)可以被安排成单个线程内部的协同例程,由此允许具有完全不同优先级的进程具有它们自己的单独线程。对图10所示的实施例来说,这意味着对数据突发的滤波进行操作的时间切片器任务全都可以作为单个线程内部的协同例程来工作。因此,对多个时间切片器任务来说,所需要的仅仅是一个单独的存储器堆栈。另一方面,如下所述,如果接口处理机或信号锁定器有可能需要中断时间切片器任务,那么这是可以完成的,这是因为它们是以具有相应存储器堆栈的单独线程来工作的。This application presents for the first time an arrangement in which co-routines are built inside individual threads. In particular, processes of the same or similar priority (here otherwise described as tasks) can be scheduled as co-routines within a single thread, thereby allowing processes of completely different priorities to have their own separate thread. For the embodiment shown in Figure 10, this means that the time slicer tasks that operate on the filtering of data bursts can all work as co-routines inside a single thread. Therefore, for multiple time slicer tasks, all that is required is a single memory stack. On the other hand, as described below, if it is possible that the interface handler or signal locker needs to interrupt the time slicer task, this can be done because they operate as separate threads with corresponding memory stacks.

如果有多个调谐器可用,那么相似的方法也是可以使用的。在这种情况下,多个接口处理机或信号锁定器任务可能经由相应线程内部的协同例程而共存。A similar approach can be used if multiple tuners are available. In this case, multiple interface handler or signal locker tasks may co-exist via co-routines inside the corresponding threads.

由此,在这里可以提供一种系统和优先化方法,尤其是在例如使用实时操作系统的数字电视接收机中优先化那些具有时间重要性的例程。对具有关于所执行的任务子集的硬实时制约的软件系统来说,该建议都是适用的。Thus, there can be provided a system and method of prioritizing, especially those time-critical routines in, for example, a digital television receiver using a real-time operating system. This proposal is applicable to software systems with hard real-time constraints on the subset of tasks performed.

在上述模块(16)以及图6和10的处理的上下文中,由优选实施例的软件执行的任务是1)配置和控制调谐器以及解调器,调度时间片和提取SI/PSI表格及IP服务,以及与主机应用处理器(12)进行通信。该架构的目标是可以在优化定时、电量消耗以及存储器使用的同时执行所有软件任务。In the context of module (16) above and the processing of Figures 6 and 10, the tasks performed by the software of the preferred embodiment are 1) configure and control the tuner and demodulator, schedule time slices and extract SI/PSI tables and IP service, and communicate with a host application processor (12). The goal of the architecture is to be able to execute all software tasks while optimizing timing, power consumption, and memory usage.

假设图3的处理器(30)具有足够电力来执行所有软件任务。但是,也存在因为所施加的实时制约而需要特殊关注的特定事件。一个此类事件是信号锁定丢失中断。为这种中断提供的服务以及自动恢复过程的启动应该尽可能快地进行,如有必要还会暂停其他活动,因为任何延迟都有可能导致IP分组丢失。这意味着在需要运行信号获取任务时,该任务必须先占任何一个正在处理SI/PSI表或MPE-FEC帧(例如通过执行纠错来提取IP数据)的任务。另一方面,与处理MPE-FEC帧和提取IP服务相比,诸如提取SI/PSI表、执行软件AGC或是向UART发调试消息的任务都具有较小的时间重要性。它们可能必须成为可由IP服务任务来先占的。It is assumed that the processor (30) of Figure 3 has sufficient power to perform all software tasks. However, there are also specific events that require special attention because of the real-time constraints imposed. One such event is the semaphore lock loss interrupt. The servicing of such interruptions and the initiation of the automatic recovery process should occur as quickly as possible, suspending other activities if necessary, since any delay may result in loss of IP packets. This means that when a signal acquisition task needs to be run, that task must preempt any task that is processing SI/PSI tables or MPE-FEC frames (eg extracting IP data by performing error correction). On the other hand, tasks such as extracting SI/PSI tables, performing software AGC, or sending debug messages to the UART are less time critical than processing MPE-FEC frames and extracting IP services. They may have to be made preemptible by IP service tasks.

如上所述,在这里设想的是该存储器是多个设备例如DVB-H接收机中的极度稀缺的资源。在某些实施例,可以使用的RAM有可能不超过64kiB。由此,该架构应该以最小化下列各项为目标:代码大小;数据大小;以及堆栈空间。As mentioned above, it is envisaged here that this memory is an extremely scarce resource in devices such as DVB-H receivers. In some embodiments, it is possible that no more than 64kiB of RAM may be used. Thus, the architecture should aim to minimize the following: code size; data size; and stack space.

如上所述,用于实现实时制约的典型方式是使用实时操作系统(RTOS),以及为每一个软件任务(40)指定一个单独的RTOS先占(pre-emptible)线程和优先级。但是,每一个RTOS线程都需要单独的运行堆栈,这样做将会提升系统的总的存储器需求。As noted above, a typical approach for implementing real-time constraints is to use a real-time operating system (RTOS), and assign each software task (40) a separate RTOS pre-emptible thread and priority. However, each RTOS thread requires a separate runtime stack, which increases the overall memory requirements of the system.

依照本申请的建议,可以提供一种DVB-H接收机(2),其中该接收机会将软件任务指定给下列各项的组合:1)RTOS先占线程,用于为具有这些线程的任务(40)实现实时制约,以及2)用于不具有相对实时优先级的任务(40)的典型协作式协同例程。协同例程的群组是在单个RTOS先占线程内部运行的,并且由此将会共享相同的运行堆栈。多任务是借助协作式调度实现的,这意味着每一个任务(即协同例程)协作都会产生随时间变化的控制,以便允许运行其他任务(即协同例程)。这样,使用RTOS先占线程,使得在实时制约非常重要的时候实现实时制约,与此同时,协作式的协同例程将会节约存储器。According to the proposal of this application, it is possible to provide a DVB-H receiver (2) in which the receiver will assign software tasks to a combination of: 1) RTOS preempting threads for tasks with these threads (40 ) implement real-time constraints, and 2) typically cooperative co-routines for tasks (40) that do not have relative real-time priority. Groups of co-routines run inside a single RTOS preempting thread, and thus will share the same execution stack. Multitasking is achieved with cooperative scheduling, which means that each task (i.e. co-routine) cooperates to produce time-varying control in order to allow other tasks (i.e. co-routine) to run. Thus, using an RTOS to pre-empt threads enables real-time control when real-time control is important, and at the same time, cooperative co-routines will save memory.

参考图6和10,应该指出的是,顶层块(40)被称为任务,但是它们也可以被视为线程。在现实中,时间切片器线程运行了若干个协同例程,其中每一个协同例程都会执行一个相应的IP接收任务。为了限制堆栈空间,系统中的RTOS线程数量应该保持在一个严格的最小值。但是如先前所述,某些任务应该在低定时制约内部以异步方式运行。Referring to Figures 6 and 10, it should be noted that the top-level blocks (40) are called tasks, but they can also be considered threads. In reality, the time slicer thread runs several co-routines, each of which performs a corresponding IP receiving task. To limit stack space, the number of RTOS threads in the system should be kept to a strict minimum. But as mentioned earlier, some tasks should run asynchronously within low timing constraints.

在图11中显示了实时任务调度的一个实例。虽然在上文中已经述及了所涉及的任务,但是在下文中还是给出了关于每一个任务的简要概述。An example of real-time task scheduling is shown in Figure 11. Although the tasks involved have been mentioned above, a brief overview of each task is given below.

时间切片器任务是一个控制系统心跳的低优先级任务。对每一个(例如DVB-H)时间片来说,它1)请求调谐设备唤醒硬件并且重新获取信号锁定,2)等待SI/PSI或IP事件并对其进行处理,3)请求调谐服务关闭硬件,以及4)在下一个时间片之前一直休眠。通过使用本申请的建议,这个线程实际运行了若干个协同例程。每一个协同例程都会执行如上列举的接收单个IP服务的任务,其中允许使用协作式调度来处理其他IP服务。The time slicer task is a low priority task that controls the heartbeat of the system. For each (e.g. DVB-H) time slice, it 1) requests the tuner device to wake up the hardware and reacquires signal lock, 2) waits for SI/PSI or IP events and processes them, 3) requests the tuner service to shut down the hardware , and 4) sleep until the next time slice. By using the proposal of this application, this thread actually runs several co-routines. Each co-routine performs the tasks listed above to receive a single IP service, allowing cooperative scheduling to be used to process other IP services.

接口处理机是一个处理主机处理器命令的介质优先级任务,本质上它与流处理是异步的。它对接收机状态进行管理,并且使用调谐服务来实施SCAN和TUNE命令。由于SPI主机接口是一个性能瓶颈,因此,与时间切片器任务相比,该任务必须具有更高的优先级。The interface handler is a media-priority task that processes commands from the host processor, which is asynchronous in nature to stream processing. It manages the receiver state and uses the tuning service to implement SCAN and TUNE commands. Since the SPI host interface is a performance bottleneck, this task must have higher priority than the time slicer task.

信号锁定器是一个对信号锁定丢失事件或是其他任何需要快速处理的事件做出响应的高优先级任务。在信号锁定丢失情况中,它会启动恢复过程。The semaphore locker is a high-priority task that responds to a semaphore lock loss event, or any other event that needs to be handled quickly. In case of loss of signal lock, it starts the recovery process.

空闲任务是系统中优先级最低的任务。只有在所有其他任务全都休眠和或等待处理某个事件时,该任务才会被调度。其唯一的功能是将处理器(30)设置在低电源状态。The idle task is the lowest priority task in the system. The task is only scheduled when all other tasks are sleeping and or waiting to process an event. Its only function is to place the processor (30) in a low power state.

图11描述的是典型的调度方案,并且论证了RTOS如何帮助构造满足低等待时间定时和功率制约的简单设计。Figure 11 depicts a typical scheduling scheme and demonstrates how an RTOS can help construct simple designs that meet low-latency timing and power constraints.

部分(a)示出在时间片之间调度的空闲任务。该任务执行的唯一处理是将处理器(30)置于低电源状态。处理器(30)会在下一个时间片(由时间切片器任务设置的定时器)醒来,或者在接收到主机命令(SPI/SDIO中断)并由接口处理机进行处理的时候醒来。Part (a) shows idle tasks scheduled between time slices. The only processing performed by this task is to place the processor (30) in a low power state. The processor (30) will wake up in the next time slice (timer set by the time slicer task), or wake up when a host command (SPI/SDIO interrupt) is received and processed by the interface processor.

部分(b)描述的是实时调度属性如何快速使能服务主机命令,即使在时间切片器处于运行的时候。例如,如果主机在时间切片器处理SI表格时发送了SEND_STAT_DATA命令,那么在为该请求提供服务之前,唯一的延迟基本上是上下文切换。Part (b) describes how the real-time scheduling property enables fast service host commands even while the time slicer is running. For example, if the host sends a SEND_STAT_DATA command while the time slicer is processing the SI table, the only delay before that request is serviced is essentially a context switch.

部分(c)描述的是多级先占。它显示了RTOS如何有助于处理几乎没有延迟的信号锁定丢失中断。Part (c) describes multi-level preemption. It shows how an RTOS can help handle signal lock loss interrupts with almost no latency.

上述部分中描述的管理单个IP服务是足够简单的。但是,如图10所示,接收机将会支持同时接收多达四个IP服务,其中每一个IP服务都具有自己的delta-t值以及自己的通电周期,该周期可与其他IP服务的通电周期相重叠。Managing a single IP service as described in the above section is simple enough. However, as shown in Figure 10, the receiver will support simultaneous reception of up to four IP services, each of which has its own delta-t value and its own power-up period that can be compared with the power-up periods of the other IP services The cycles overlap.

用于实施这种处理的简单方法是为每一个IP服务创建一个线程,但是如上所述,可取的是限制存储器使用。由于不同属性并不是IP服务的需求,因此,使用协作式多任务。这可以借助状态机来实施,但是优选实施例使用的是更精致、更易于读取以及更易于保持的协同例程。如上所述,协同例程允许在一个函数中具有多个退出点,同时保持执行状态,与基于切换的状态机相比,这样做会使控制流更为明确。实际上,协同例程允许以一种与其他任务相独立的方式来实施协作式任务。A simple way to implement this is to create a thread for each IP service, but as mentioned above, it is advisable to limit memory usage. Since different attributes are not a requirement for IP services, cooperative multitasking is used. This could be implemented with a state machine, but the preferred embodiment uses co-routines which are more refined, easier to read and easier to maintain. As mentioned above, co-routines allow multiple exit points within a function while maintaining execution state, which in doing so results in more explicit control flow than a switch-based state machine. In effect, co-routines allow cooperative tasks to be implemented in a manner independent of other tasks.

Claims (22)

1. system with a plurality of hardware blocks, this system are configured to according to whether needs use the relevant hardware piece independently to be controlled to the power supply of each hardware block.
2. according to the system of claim 1, comprising: be used for the device driver of corresponding hardware block, this system is configured to support a plurality of tasks, and wherein each task has all been used one or more hardware blocks by communicating with the corresponding apparatus driver.
3. according to the system of claim 2, wherein in each relevant device driver, implemented counter, this counter is configured to increase progressively when corresponding hardware block is used in the each request of one of a plurality of tasks, and successively decreases when one of a plurality of tasks are stopped using corresponding hardware block at every turn.
4. according to the system of claim 3, wherein this counter is implemented as application programming interface.
5. according to the system of claim 3 or 4, wherein this counter provides an output, with the indication of convenient counter require to use the relevant hardware piece do not finish request the time with corresponding hardware block outage.
6. according to the system of claim 5, wherein this counter has initial value 0, and has only when this counter has nonzero value, and this output can make the energising of relevant hardware piece.
7. according to the system of claim 5 or 6, also comprise the hardware clock piece, it has the clock input of the clock signal that is used for this system, be used to receive the power supply input of the corresponding output of described counter, be used for the clock output of corresponding hardware block, and a plurality of corresponding logic gates, wherein each corresponding logic gate all links to each other with clock input, corresponding power supply input and corresponding clock output, and is configured to import according to power supply and clock signal is offered corresponding clock selectively exports.
8. according to the system of aforementioned arbitrary claim, wherein said a plurality of hardware blocks comprise at least one among timer, UART, SPI, SDIO, tuner, detuner, wave filter and the MPE-FEC.
9. according to the system of aforementioned arbitrary claim, wherein this system is a detuner.
10. according to the system of aforementioned arbitrary claim, wherein this system is the interchangeable module.
11. according to the system of aforementioned arbitrary claim, wherein this system is an integrated circuit.
12. according to the system of aforementioned arbitrary claim, wherein this system is a digital television receiver.
13. according to the system of aforementioned arbitrary claim, wherein this system meets the DVB-H standard.
14. a method that is used for operating system, wherein this system has a plurality of hardware blocks, and this method comprises: according to whether needs use relevant block independently to be controlled to the power supply of each hardware block.
15. the method according to claim 14 also comprises: the power supply of controlling independent hardware block by the clock of forbidding the relevant hardware piece selectively.
16. the method according to claim 14 or 15 also comprises: use the reference count in the minimum software layer to determine when and with the hardware block energising or to cut off the power supply.
17., also comprise according to claim 14,15 or 16 method:
For each hardware block provides counter;
Use the relevant hardware piece and thus in the request with its energising, increase progressively described counter receiving at every turn;
Stop using the relevant hardware piece and thus in the request with its outage, this counter successively decreases receiving at every turn; And
When counter indication do not require for the hardware block energising do not finish request the time, the signal with corresponding hardware block outage is provided.
18. the method according to claim 17 also comprises:
When the indication of described counter do not require with the hardware block energising do not finish request the time, the relevant hardware piece is cut off the power supply.
19. the method according to claim 17 or 18 also comprises:, and in the corresponding apparatus driver, implement described counter for each hardware block provides device driver.
20. a computer program, this program has comprised program code devices, and when moving described program on computers, described program code devices is used for institute that enforcement of rights requires 14~19 arbitrary claims in steps.
21. according to the computer program of claim 20, wherein said computer program is implemented as the application programming interface of using in device driver.
22. computer program, wherein this product has comprised the program code devices that is kept on the computer-readable medium, when moving described program product on computers, described program code devices is used for the method that enforcement of rights requires 14~19 arbitrary claims.
CNA2007800277440A 2006-07-21 2007-07-09 System with multiple hardware blocks and method of operating the same Pending CN101495940A (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
GB0614547A GB0614547D0 (en) 2006-07-21 2006-07-21 Demodulator device
GB0614549.4 2006-07-21
GB0614548.6 2006-07-21
GB0614547.8 2006-07-21

Publications (1)

Publication Number Publication Date
CN101495940A true CN101495940A (en) 2009-07-29

Family

ID=36998518

Family Applications (2)

Application Number Title Priority Date Filing Date
CNA2007800276185A Pending CN101490649A (en) 2006-07-21 2007-07-09 Demodulator device and method of operating the same
CNA2007800277440A Pending CN101495940A (en) 2006-07-21 2007-07-09 System with multiple hardware blocks and method of operating the same

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CNA2007800276185A Pending CN101490649A (en) 2006-07-21 2007-07-09 Demodulator device and method of operating the same

Country Status (2)

Country Link
CN (2) CN101490649A (en)
GB (1) GB0614547D0 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102970316A (en) * 2012-02-15 2013-03-13 中国人民解放军海军航空工程学院 Real-time propelling multi-platform mixed communication mechanism
CN105426253A (en) * 2015-12-18 2016-03-23 广州广电运通金融电子股份有限公司 Hardware management method and device for self-service equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102970316A (en) * 2012-02-15 2013-03-13 中国人民解放军海军航空工程学院 Real-time propelling multi-platform mixed communication mechanism
CN105426253A (en) * 2015-12-18 2016-03-23 广州广电运通金融电子股份有限公司 Hardware management method and device for self-service equipment

Also Published As

Publication number Publication date
GB0614547D0 (en) 2006-08-30
CN101490649A (en) 2009-07-22

Similar Documents

Publication Publication Date Title
US8161276B2 (en) Demodulator device and method of operating the same
US9189049B2 (en) Power management in a device
US8407714B2 (en) Arithmetic device for processing one or more threads
TWI441083B (en) Apparatus for performing timer management and associated method
US20060010446A1 (en) Method and system for concurrent execution of multiple kernels
US20080168127A1 (en) System and Method For Scheduling Device Management
MX2007011095A (en) Control of sleep modes in a wireless transceiver.
KR20140127341A (en) Method and system for scheduling requests in a portable computing device
JP2006209479A (en) Processor and information processing method
CN103024543A (en) Implementation method and implementation device for low power consumption of set top box
WO2016195778A1 (en) Opportunistic waking of an application processor
CN101884028A (en) Method and apparatus for timer event management
EP2384462B1 (en) Method and system for managing the operation of a multicore data processing device
CN101495940A (en) System with multiple hardware blocks and method of operating the same
CN105376645A (en) Set-top box and power consumption reduction method
US9247372B2 (en) Wireless mobile device network application proxy with exchange sequence generator
CN114153576A (en) Multi-task scheduling method and device based on wearable device and electronic device
US20160246740A1 (en) Processor system having nested vectored interrupt controller
JP2008515355A (en) Apparatus and related method for controlling a digital signal processor for radio isolation
JPWO2018211865A1 (en) Vehicle control device
CN103262032A (en) Information processing device, information processing method, and computer program
CN113596867A (en) 4g module control method and device based on FreeRTOS system
CN119536108A (en) Programmable controller, electronic device and control method
EP4555417A1 (en) Latency and power efficient clock and data recovery in a high-speed one-wire bidirectional bus
JP4548947B2 (en) Demultiplexer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20090729