Summary of the invention
The present invention be for realize to the clock of audio-video collection realize simply, reliably, control flexibly; And the power consumption of effective reduction system when guaranteeing multimedia sensing node performance, thereby a kind of dynamic clock control module is provided and based on the dynamic clock control system towards multimedia sensing network SoC of this module.
The dynamic clock control module, it comprises clock selection module 1, clock frequency division module and Clock gating module; Said clock frequency division module is made up of audio frequency input submodule 21, video input submodule 22, SDRAM submodule 23, an ahb bus submodule 24 and an APB bus submodule 25; The Clock gating module is made up of No. two audio frequency input submodule 31, No. two video input submodules 32, No. two SDRAM submodules 33, No. two ahb bus submodules 34 and No. two APB bus submodules 35;
Clock selection module 1 is used for the clock source is selected, and selected clock source is exported to audio frequency input submodule 21, video input submodule 22, SDRAM submodule 23, ahb bus submodule 24, an APB bus submodule 25 respectively;
No. one audio frequency input submodule 21 is used for producing the required audio clock of system according to the clock source of receiving, and the audio clock that produces is exported to audio frequency input submodule 31 No. two;
No. one video input submodule 22 is used for producing the required video clock of system according to the clock source of receiving, and the video clock that produces is exported to video input submodule 32 No. two;
A SDRAM submodule 23 is used for producing the required SDRAM clock of system according to the clock source of receiving, and the SDRAM clock that produces is exported to SDRAM submodule 33 No. two;
An ahb bus submodule 24 is used for producing the required ahb bus clock of system according to the clock source of receiving, and the ahb bus clock that produces is exported to ahb bus submodule 34 No. two;
An APB bus submodule 25 is used for producing the required APB bus clock of system according to the clock source of receiving, and the APB bus clock that produces is exported to APB bus submodule 35 No. two;
No. two audio frequency input submodule 31 is used for according to the acoustic frequency clock signal that audio frequency input submodule 21 is sent into sound signal being exported;
No. two videos input submodule 32 is used for according to the video clock signal that video input submodule 22 is sent into vision signal being exported;
No. two SDRAM submodules 33 are used for according to the SDRAM clock signal that SDRAM submodule 23 is sent into the SDRAM signal being exported;
No. two ahb bus submodules 34 are used for to the outside ahb bus signal being provided according to the ahb bus clock signal that ahb bus submodule 24 is sent into;
No. two APB bus submodules 35 are used for to the outside APB being provided bus signals according to the APB bus clock signal that APB bus submodule 25 is sent into.
The clock of clock source for obtaining through PLL phaselocked loop 1.
It also comprises PLL configuration register 4, control register 5, frequency division register 6 and control register 7;
Said PLL configuration register 4 is used for PLL phaselocked loop 1 is carried out the clock configuration;
Control register 5 is used for that to carry out register signal mutual with clock selection module 1;
Frequency division register 6 is used for that to carry out register signal mutual with clock frequency division module;
Control register 7 is used for that to carry out register signal mutual with the Clock gating module.
Based on the dynamic clock control system towards multimedia sensing network SoC of above-mentioned module, it comprises audio input interface 7, video input interface 8, Memory Controller 9, AHB-APB bridge 10, DSU debugging unit 11, LEON3 processor 12, GPIO interface 13, APB UART14, I
2C interface 15 and SPI interface 16;
Audio input interface 7 is used to receive the sound signal that the dynamic clock control module is sent;
Video input interface 8 is used to receive the vision signal that the dynamic clock control module is sent;
Memory Controller 9 is used to receive the SDRAM signal that the dynamic clock control module is sent; The control signal output of said Memory Controller 9 or input end input or output end with the control signal of LEON3 processor 12 and are connected;
AHB-APB bridge 10 all is articulated on the ahb bus with DSU debugging unit 11;
GPIO interface 13, APB UART14, I2C interface 15 and SPI interface 16 all are articulated on the APB bus.
It also comprises interruptable controller 10, and said interruptable controller 10 is articulated on the APB bus.
It also comprises timer 11, and said timer 11 is articulated on the APB bus.
Module of the present invention realized the clock of audio-video collection is realized simple, reliable, control flexibly, and the dynamic clock of using this module is controlled at the power consumption of effective reduction system when guaranteeing multimedia sensing node performance.The present invention is particularly useful for the dynamic clock control of multimedia sensing network SoC.
Embodiment
Embodiment one, dynamic clock control module, it comprises clock selection module 1, clock frequency division module and Clock gating module; Said clock frequency division module is made up of audio frequency input submodule 21, video input submodule 22, SDRAM submodule 23, an ahb bus submodule 24 and an APB bus submodule 25; The Clock gating module is made up of No. two audio frequency input submodule 31, No. two video input submodules 32, No. two SDRAM submodules 33, No. two ahb bus submodules 34 and No. two APB bus submodules 35;
Clock selection module 1 is used for the clock source is selected, and selected clock source is exported to audio frequency input submodule 21, video input submodule 22, SDRAM submodule 23, ahb bus submodule 24, an APB bus submodule 25 respectively;
No. one audio frequency input submodule 21 is used for producing the required audio clock of system according to the clock source of receiving, and the audio clock that produces is exported to audio frequency input submodule 31 No. two;
No. one video input submodule 22 is used for producing the required video clock of system according to the clock source of receiving, and the video clock that produces is exported to video input submodule 32 No. two;
A SDRAM submodule 23 is used for producing the required SDRAM clock of system according to the clock source of receiving, and the SDRAM clock that produces is exported to SDRAM submodule 33 No. two;
An ahb bus submodule 24 is used for producing the required ahb bus clock of system according to the clock source of receiving, and the ahb bus clock that produces is exported to ahb bus submodule 34 No. two;
An APB bus submodule 25 is used for producing the required APB bus clock of system according to the clock source of receiving, and the APB bus clock that produces is exported to APB bus submodule 35 No. two;
No. two audio frequency input submodule 31 is used for according to the acoustic frequency clock signal that audio frequency input submodule 21 is sent into sound signal being exported;
No. two videos input submodule 32 is used for according to the video clock signal that video input submodule 22 is sent into vision signal being exported;
No. two SDRAM submodules 33 are used for according to the SDRAM clock signal that SDRAM submodule 23 is sent into the SDRAM signal being exported;
No. two ahb bus submodules 34 are used for to the outside ahb bus signal being provided according to the ahb bus clock signal that ahb bus submodule 24 is sent into;
No. two APB bus submodules 35 are used for to the outside APB being provided bus signals according to the APB bus clock signal that APB bus submodule 25 is sent into.
The clock of clock source for obtaining through PLL phaselocked loop 1.
It also comprises PLL configuration register 4, control register 5, frequency division register 6 and control register 7;
Said PLL configuration register 4 is used for PLL phaselocked loop 1 is carried out the clock configuration;
Control register 5 is used for that to carry out register signal mutual with clock selection module 1;
Frequency division register 6 is used for that to carry out register signal mutual with clock frequency division module;
Control register 7 is used for that to carry out register signal mutual with the Clock gating module.
APB bus: Advanced Peripheral Bus;
Ahb bus: Advanced High performance Bus.
Embodiment two, combination Fig. 1 explain this embodiment; Based on the dynamic clock control system towards multimedia sensing network SoC of embodiment one, it comprises audio input interface 7, video input interface 8, Memory Controller 9, AHB-APB bridge 10, DSU debugging unit 11, LEON3 processor 12, GPIO interface 13, APB UART14, I2C interface 15 and SPI interface 16;
Audio input interface 7 is used to receive the sound signal that the dynamic clock control module is sent;
Video input interface 8 is used to receive the vision signal that the dynamic clock control module is sent;
Memory Controller 9 is used to receive the SDRAM signal that the dynamic clock control module is sent; The control signal output of said Memory Controller 9 or input end input or output end with the control signal of LEON3 processor 12 and are connected;
AHB-APB bridge 10 all is articulated on the ahb bus with DSU debugging unit 11;
GPIO interface 13, APB UART14, I
2C interface 15 all is articulated on the APB bus with SPI interface 16.
It also comprises interruptable controller 10, and said interruptable controller 10 is articulated on the APB bus.
It also comprises timer 11, and said timer 11 is articulated on the APB bus.
Mainly accomplish collection, processing and the transmission of multimedia audio and image information towards the SoC chip of multimedia sensing network.The structure of multimedia sensing node and interface block diagram are as shown in Figure 2 among the present invention, and wherein part of data acquisition comprises the Voice & Video control interface, and the audio frequency control interface passes through I
2S bus and audio collection circuit carry out data transmission; Video interface then comprises clock, the DCB with the camera communication.Tcp data segment mainly is a spi bus interface, carries out data transmission with the wireless communication module of 2.4GHz.Data processing section is accomplished by the LEON3 soft-core processor.This external system also comprises the data storage cell of being made up of SDRAM and Flash.
It is as shown in Figure 3 that (among the figure: the implication of mark Gate is: door; The implication of mark: Subthreshold is: threshold; ), the cmos circuit power consumption mainly is made up of 3 parts: the dynamic power consumption that capacitor charge and discharge causes, the power consumption that power consumption that the knot pull-down current causes and short-circuit current cause.Wherein the proportion that accounts for of dynamic power consumption is maximum, accounts for more than 90% of total power consumption, and its computing formula is seen formula (1):
P=a×C×V
2 dd×f (1)
A is the upset probability of node in the formula, and C is a node capacitor, V
DdBe WV, f is a clock frequency.Clock gating (gated clocking) has not only reduced the clock power consumption, has also reduced the upset probability of node.
The workflow of each module and register with the effect as follows:
Clock selection module 1: start from for the performance of system and taking all factors into consideration of power consumption, the clock of the lower external crystal-controlled oscillation of frequency of utilization can be selected by system, also can obtain higher clock frequency through phaselocked loop (PLL) is set.This module is through reading on the control register selection position about the clock source, if this position is 1, the clock that then uses external crystal-controlled oscillation is as system's input clock, if 0 is used pll clock.The output clock of PLL can be set through the PLL configuration register, thereby changes the input clock of system.
Clock frequency division module: this module can produce the clock of multimedia sensing node image data and the work clock of system bus.For each submodule in the clock frequency division module; All there is a frequency division register corresponding with it; Each register can be provided with one 16 divide ratio; Module through this divide ratio is corresponding just can be carried out frequency division with the system clock of module 1 output, obtains the needed clock of module.For the multimedia sensing node, this module can provide more fine-grained clock control, and each submodule can be provided with divide ratio separately, and configuration provides bigger flexibility ratio for the clock of system.
The Clock gating module: consider the different characteristics of multimedia sensing node and traditional wireless aware node, need be to the clock of data collection according to the opening and closing that need of using.This module is enabling of control audio input clock 3.1, video input clock 3.2, SDRAM synchronous clock and AHB clock separately; And the peripheral hardware on the APB bus does not relate to the work of data acquisition; Power consumption consumption for system is not very big simultaneously, so top clock enables always.For all have on all inner submodule clock-control registers of module 3 one corresponding with it, if this position is 1, then enables corresponding clock and export.If instead be 0, then forbid corresponding clock.
In addition; Ahb bus in the clock frequency division module and APB bus submodule can be provided with the clock of corresponding bus; Like this can be under the relatively little situation of system load the clock rate of dynamic adjustments ahb bus, reduce the power consumption of system and can not influence the performance of system.
Next through concrete instance the course of work of the present invention is described:
Reset initialization: after the multimedia sensing node powered on, clock took place and control module is started working, and at first needs reset initialization PLL module 7, accomplishes the initialization flow process of PLL through PLL configuration register 6 is set, and particular flow sheet is seen Fig. 4.After the PLL initialization, the input clock of system is switched to pll clock through the clock source selection module.The value of ahb bus clock 2.4 and APB bus clock 2.5 all was 50M after module resetted, and ahb bus clock acquiescence is opened, because system program operates among the SDRAM, also enabled so the synchronous clock of SDRAM is given tacit consent to.
Produce audio, video data and gather needed clock: gather needed clock for audio, video data; The present invention's submodule 2.1 and 2.2 through correspondence in module 2 disposes; Like this acquisition clock unified management has been simplified the difficulty of clock setting, accurate control is provided Voice & Video.Obtain the corresponding needed clock of audio frequency and video through the input clock frequency division with system, divide ratio is read by the frequency division register of correspondence.Concrete clock setting flow process is seen Fig. 5.
According to the current task of sensing node enabling of clock is set:
According to the characteristics that the power consumption of multimedia sensing network consumes, the power consumption of system mainly consumes in the collection of audio, video data, the audio frequency and video clock is controlled the power consumption that can largely reduce system.Introduced in the background of invention, the wireless aware node is mainly carried out three types task, is respectively data acquisition, data processing and data transmission.Difference according to task is divided into 4 states, idle condition, acquisition state, treatment state and transmission state with system.System does not carry out any operation under idle condition, at this moment the clock of audio-video collection is closed, and system operates under the low-speed mode.When task switched to data acquisition, the state of system became acquisition state, and this moment, the clock of audio-video collection was opened, the beginning data acquisition.Switch to the data processing state when data acquisition finishes the back system, speed that can ahb bus is set at a high speed, to increase the speed of data processing, the performance of raising system.System got into transmission state after data processing finished, and this moment, radio-frequency module was started working, and carried out data transmission.System gets back to idle condition again after end of transmission (EOT), and close the clock of audio-video collection this moment, is low speed with the ahb bus frequency configuration.The state transitions of system is shown in accompanying drawing 6.
The design that the present invention takes place and controls through the clock that is directed to the multimedia sensing node; Clock to audio-video collection is accurately controlled; Reduce the power consumption of system effectively through software scheduling and hardware gate clock design, and can not influence the performance of system.