Embodiment
In order to make the object of the invention, technical scheme and advantage clearer, describe the present invention below in conjunction with accompanying drawing and specific embodiment.
The embodiment of the invention one provides a kind of method of data processing, and referring to Fig. 1, this method comprises:
11: dispose presently used PDR.
12: with the PDR notice hardware pipeline that is disposed, so that hardware pipeline carries out data processing according to the current PDR that disposes.
Hardware pipeline is made up of each processing unit of mutual collaborative work each other.On hardware pipeline, each processing unit carries out following data processing according to the current PDR that disposes:
13:, from internal memory, read raw data through bus according to the current PDR that disposes;
14: the raw data that reads is carried out corresponding service handle, and the result data that will obtain after will handling is through the bus write memory.
Above-mentioned PDR refers to the data volume that per clock period of each processing unit handles on the hardware pipeline.The synchronizing signal of clock period index word circuit, it is the minimum time unit of data circuit work.
If each processing unit on the hardware pipeline reads and handle N data in 1 clock period, then PDR is N.If the every N of each processing unit on the hardware pipeline clock period handled 1 data, then PDR is 1/N.
In above-mentioned steps 11; The correlation unit or the device that can be provided with through the function software that moves on the hardware chip on several data processing speed and the control hardware streamline move according to set PDR, also can directly realize variable PDR through the correlation unit on the adjustment hardware pipeline or the pin setting of device.
By above-mentioned visible, the technical scheme of the embodiment of the invention can adopt different PDRs according to actual conditions through a kind of variable PDR mechanism is set under different condition, realize the flexible adjustment of PDR on the hardware pipeline.
The method of the data processing that provides in the face of the embodiment of the invention two down describes.The data that present embodiment is mainly handled with needs are that the scene of view data is that example describes.
11: dispose presently used PDR.
The preferred PDR M that adopts the variable pixel of software setting in the embodiment of the invention; As utilize CPU on the hardware chip to adopt the mode of software control to dispose presently used PDR to be M; Then each processing unit on the hardware pipeline reads the mode of M pixel according to each clock period, realizes that the PDR of pixel is adjustable.This set mode has been avoided the change to hardware, can compatible preferably existing hardware equipment, have higher feasibility, and set-up mode is also convenient more flexibly.
Concrete, the PDR in the present embodiment is meant processed pixels data volume in per clock period of hardware pipeline.On hardware pipeline, allow and support multiple different PDR.
For example; When each processing unit on the hardware pipeline reads and handle 1 pixel in per 1 clock period; PDR M is 1 o'clock; If software configuration data processing speed M is 2, then the relevant treatment unit on the hardware pipeline (like the data reading unit) can improve the data volume that at every turn reads, and each clock period reads 2 pixels and handles.If software configuration data processing speed M is 1/2, then each processing unit on the hardware pipeline can be counted the clock period, and per 2 clock period read 1 pixel and handle.
The factor of above-mentioned configuration mode institute foundation comprise that the power consumption of system requires and hardware pipeline on congestion condition and service priority, the internal memory of clock frequency, bus in one or more in the processing speed of result data in generating rate and the internal memory of raw data.From this four aspect, the concrete grammar of presently used PDR is disposed in explanation respectively below:
The power consumption requirement of system and the clock frequency on the hardware pipeline
Power consumption on the different system require and same system different application scene under power consumption require normally differently, can utilize the power consumption requirement after the change, dispose presently used PDR.At this; Require and two factor configuration datas of clock frequency processing speed in conjunction with power consumption; Mainly consider when change that power consumption requires causes clock frequency to change; Can be through changing the change that PDR adapts to power consumption, so other factors that cause power consumption to require to change are no longer gone through at this.
When the change that requires when system power dissipation in the present embodiment causes the clock frequency on the hardware pipeline to change, dispose presently used PDR and satisfy required data volume processing power.
Under the situation that the data volume processing power remains unchanged; If the clock frequency on the current configuration moment hardware pipeline is lower than the clock frequency on first configuration hardware pipeline constantly; Then dispose presently used PDR and be higher than first configuration pairing PDR constantly; Otherwise, dispose presently used PDR and be lower than first configuration pairing PDR constantly.
First configuration can be the moment before the current configuration constantly constantly, also can be the moment after the current configuration constantly.In this case; Be to keep certain data processing capability, when system requirements reduces power consumption and causes the slowing of clocks, improve the data volume that per clock period reads; When system can tolerate that big power consumption improves clock frequency, reduce the data volume that per clock period reads.
The concrete numerical value of the PDR that is disposed can according to the variable quantity of the data-handling capacity that will keep and clock frequency confirm.
The congestion condition of bus and service priority
According to the congested control requirement of bus and the service priority of current business, dispose presently used PDR and satisfy service priority and congested control requirement.
The congested control of above-mentioned bus requires to surpass congested discrimination threshold for the congestion condition differentiation amount that does not allow bus; Promptly the congestion condition to bus is provided with congestion state differentiation amount; And the tolerable congested discrimination threshold of the system that is provided with; When congestion condition differentiation amount surpassed congested discrimination threshold, the congestion situation on the expression bus was more serious, needs to adopt the measure of alleviate congestion.
When utilizing the change alleviate congestion of PDR, a factor also need considering is exactly professional priority, when service priority is higher; For example, current business is the business of relatively paying close attention to, and does not advise coming alleviate congestion through reducing this professional PDR; Have only when service priority is low, for example, the service priority of current business is lower than level threshold; Be the attention rate of current business when low, just come alleviate congestion through reducing this professional PDR.
Surpass congested discrimination threshold if inscribe the congestion condition differentiation amount of bus during current the configuration; And the service priority of current business is lower than level threshold; And first configuration time is inscribed the congestion condition differentiation amount of bus and is lower than congested discrimination threshold, then disposes presently used PDR and is lower than first configuration pairing PDR constantly.
Utilize above-mentioned congestion state to differentiate when scale is levied current configuration and inscribe the congestion situation of bus, this congestion state differentiation amount can be the statistical value to a period of time internal bus congestion situation.The concrete value of above-mentioned congested discrimination threshold can be provided with as required flexibly.
If judge current bus and be in congestion condition, and at this moment a plurality of equipment reduce PDR when needing access bus, just can on average arrive the data volume that all need handle in the longer time period, avoids increasing the weight of the congested of bus.
The generating rate of raw data in the internal memory
According to the generating rate of raw data in the internal memory, dispose the generating rate that presently used PDR is not less than said raw data.
Concrete; If the generating rate of raw data in the internal memory is inscribed in a last configuration when constantly employed PDR is not less than current configuration; Then will go up employed PDR of a configuration moment as current employed PDR of the configuration moment; Otherwise; Increase a last configuration constantly employed PDR when being not less than current configuration, inscribe the generating rate of raw data in the internal memory, with the last employed PDR of a configuration moment after increasing as current employed PDR of the configuration moment.
In this case, when the generating rate of raw data accelerated, this programme can improve PDR, when the generating rate of raw data is slack-off, reduced PDR, thereby had both satisfied the requirement of data processing, had reduced the power consumption of system again.
The processing speed of result data in the internal memory
According to the processing speed of result data in the internal memory, dispose the processing speed that presently used PDR is not more than said result data.
Concrete; If the processing speed that a last configuration is inscribed result data in the internal memory when employed PDR is not more than current the configuration constantly; Then will go up employed PDR of a configuration moment as current employed PDR of the configuration moment; Otherwise; Reduce last one and dispose employed PDR of the moment is inscribed result data in the internal memory when being not more than current configuration processing speed, the last employed PDR of a configuration moment after will reducing is as current employed PDR of the configuration moment.
In this case, can be processed very soon when finishing, can improve the PDR on the hardware pipeline, thereby can improve the processing speed of whole data when result data is follow-up; When result data when follow-up processing speed is slow, can reduce the PDR on the hardware pipeline, with the overlong time of avoiding pending data to wait for, increase the internal memory burden.
When the configuration data processing speed, can consider above-mentioned a kind of factor separately, also can two or more above-mentioned combined factors be considered together.
12: with the PDR notice hardware pipeline that is disposed;
Set up and be connected between first processing unit on CPU and the hardware pipeline and on this first processing unit, command interface be set;
Utilize command interface to receive this configuration order through CPU to said processing first module transmission configuration order and said first processing unit; With first processing unit on the PDR notice hardware pipeline that is disposed; When first processing unit is known the current PDR that disposes and is carried out data processing according to this PDR; Because each processing unit collaborative work on the hardware pipeline; Then all processing units on the hardware pipeline all carry out data processing according to this PDR, shown in the content of stating in the step 13 and 14 specific as follows.
13:, from internal memory, read raw data through bus according to the current PDR that disposes;
According to the PDR that is disposed, the processing unit on the hardware pipeline reads the raw data of corresponding data amount from internal memory.
14: the raw data that reads is carried out corresponding service handle, and the result data that will obtain after will handling is through the bus write memory.
Referring to Fig. 2, shown the schematic flow sheet the when embodiment of the invention is handled view data.Below in conjunction with Fig. 2 the disposal route of above-mentioned steps 11 to step 13 is described.
In the present embodiment, the processing procedure of view data be split as comprise following a plurality of step: as read, denoising, convergent-divergent, level and smooth, color conversion and write back etc., and through a plurality of hardware handles unit, executed in parallel is come speed up processing.Preferably; Speed adjustment function is set in reading unit, has command interface on the reading unit, receive configuration order; The through-rate control function reads raw data through bus from internal memory according to the indicated PDR of configuration order; Be sent to the denoising unit and handle, and pass through unit for scaling successively, the processing of smooth unit, color conversion cell etc., obtain result data.This result data is sent to writes back the unit, by write back the unit with result data through the bus write memory, form a new two field picture again to utilize result data.
The processing speed of above-mentioned each unit can be identical, and for example, the processing speed of each unit is consistent PDR all according to the current PDR that disposes, and the data processing path is more reasonable; Perhaps, the processing speed of above-mentioned each unit also can be different, and at this moment, the processing speed that requires unit for scaling, smooth unit, color conversion cell and write back unit etc. is not less than the PDR that is disposed, and promptly is not less than the data read rates of reading unit.
For example; Unit for scaling, smooth unit, color conversion cell and write back unit etc. according to first rate; Raw data to reading is carried out handled; And the result data that will obtain after will handling is through the bus write memory, and wherein, said first rate is not less than the current PDR that disposes (being the data read rates of reading unit).
Further, the maximum data processing speed in each PDR that is disposed in this programme need be less than the maximum data processing speed of being supported on the hardware pipeline, to guarantee the successful execution of data processing.
From the above mentioned, this programme is the processing time of unit data on the control hardware streamline rationally, satisfies the multiple requirement of data processing, avoids the sudden congested of bus, improves the overall performance of hardware chip.
The embodiment of the invention three also provides a kind of device of data processing, and referring to Fig. 3, this device comprises:
Rate controlled unit 31 is used to dispose presently used PDR, and, with the current PDR notice hardware pipeline that disposes;
Data processing unit 32 is used at hardware pipeline, carries out data processing according to the current PDR of being known that disposes.
Further, comprise first processing unit in each data processing unit, this first processing unit is provided with command interface.This first processing unit can be realized by the data-reading unit on the hardware pipeline.
Referring to Fig. 4, said rate controlled unit 31 also comprises connecting sets up unit 311, is used to set up being connected between rate controlled unit and said first processing unit,
Said rate controlled unit 31; Specifically be used to dispose presently used PDR; And, send configuration order through said connection to first processing unit, with several first processing units on the current PDR notice hardware pipeline that disposes;
Said first processing unit receives configuration order through this command interface, knows the current PDR that disposes.
Further, first processing unit can realize that above-mentioned data processing unit 32 comprises like lower unit by the data-reading unit on the hardware pipeline 321:
Said data-reading unit 321; Be provided with command interface, be used for receiving configuration order, according to the indicated current PDR that disposes of configuration order through this command interface; From internal memory, read raw data through bus, and this raw data is sent to Service Processing Unit 322;
Said Service Processing Unit 322 is used for handling carry out corresponding service from the raw data of data-reading unit, and the result data that obtains after handling is sent to data write unit 323;
Said data write unit 323 is used for said result data through the bus write memory.
Further; Said rate controlled unit 31; Specifically be used at hardware pipeline; At least two kinds of different PDRs are set, when the change of system power dissipation requirement causes the clock frequency variation on the hardware pipeline, dispose presently used PDR and satisfy required data volume processing power; And/or,
Said rate controlled unit 31; Specifically be used at hardware pipeline; At least two kinds of different PDRs are set,, dispose presently used PDR and satisfy service priority and congested control requirement according to the congested control requirement of bus and the service priority of current business; And/or,
Said rate controlled unit 31; Specifically be used at hardware pipeline; At least two kinds of different PDRs are set,, dispose the generating rate that presently used PDR is not less than said raw data according to the generating rate of raw data in the internal memory; And/or,
Said rate controlled unit 31; Specifically be used at hardware pipeline; At least two kinds of different PDRs are set,, dispose the processing speed that presently used PDR is not more than said result data according to the processing speed of result data in the internal memory.
Concrete, rate controlled unit 31 can specifically comprise following at least a operation when carrying out the configuration of PDR according to above-mentioned configuration mode:
Said rate controlled unit 31; Specifically be used under the situation that the data volume processing power remains unchanged; If the clock frequency on the current configuration moment hardware pipeline is lower than the clock frequency on first configuration hardware pipeline constantly; Then dispose presently used PDR and be higher than first configuration pairing PDR constantly, otherwise, dispose presently used PDR and be lower than first configuration pairing PDR constantly; And, with the current PDR notification data processing unit that disposes;
And/or,
Said rate controlled unit 31; Specifically be used for requiring to surpass congested discrimination threshold for the congestion condition differentiation amount that does not allow bus when the congested control of bus; Surpass congested discrimination threshold if inscribe the congestion condition differentiation amount of bus during current the configuration; And the service priority of current business is lower than level threshold, and first configuration time is inscribed the congestion condition differentiation amount of bus and is lower than congested discrimination threshold, then disposes presently used PDR and is lower than first configuration pairing PDR constantly; And, with the current PDR notification data processing unit that disposes; And/or
Said rate controlled unit 31; Specifically be used for if the generating rate of internal memory raw data is inscribed in a last configuration when constantly employed PDR is not less than current configuration; Then will go up employed PDR of a configuration moment as current employed PDR of the configuration moment; Otherwise, increase a last configuration constantly employed PDR when being not less than current configuration, inscribe the generating rate of raw data in the internal memory, with the last employed PDR of a configuration moment after increasing as current employed PDR of the configuration moment; And, with the current PDR notification data processing unit that disposes; And/or,
Said rate controlled unit 31; Specifically be used for if the processing speed that a last configuration is inscribed the internal memory result data when employed PDR is not more than current the configuration constantly; Then will go up employed PDR of a configuration moment as current employed PDR of the configuration moment; Otherwise, reducing last one and dispose employed PDR of the moment is inscribed result data in the internal memory when being not more than current configuration processing speed, the last employed PDR of a configuration moment after will reducing is as current employed PDR of the configuration moment; And, with the current PDR notification data processing unit that disposes.
Further, said rate controlled unit 31 also specifically is used for when the presently used PDR of configuration, and the maximum data processing speed in the PDR that is disposed is less than the maximum data processing speed of being supported on the hardware pipeline.
The speed of data is handled or write to the speed of above-mentioned data-reading unit reading of data and Service Processing Unit, data write unit can be identical; Also can be different; For example: said Service Processing Unit; Specifically be used for according to first rate, handle, the result data that obtains after handling is sent to data write unit carry out corresponding service from the raw data of data-reading unit; Said data write unit specifically is used for according to first rate, and said result data is passed through the bus write memory; Wherein, said first rate is not less than the current PDR that disposes in said rate controlled unit (promptly being not less than the speed of data-reading unit reading of data).
Above-mentioned each unit can be realized separately, also can some unit be integrated realization.Exemplary, above-mentioned rate controlled unit can be realized in the CPU of hardware chip.
By above-mentioned visible, the technical scheme of the embodiment of the invention can adopt different PDRs according to actual conditions through a kind of variable PDR mechanism is set under different condition, realize the flexible adjustment of PDR on the hardware pipeline.
This programme is the processing time of unit data on the control hardware streamline rationally, satisfies the multiple requirement of data processing, avoids the sudden congested of bus, improves the overall performance of hardware chip.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.