The invention relates to a data processing apparatus and to a method of data processing.
From U.S. Pat. No. 4,956,768 a data processing apparatus is known that provides for double buffering of data transferred between a processor and a plurality of outlets. Each outlet is provided with a pair of memories. The processor alternately writes to a first one of the memories and to a second one of the memories. When the processor writes to one memory the other memory is coupled to the outlet. Thus, writing from the processor and output to the outlet can proceed in parallel.
A processor associated with the outlet controls which of the memories is connected to the processor and which is connected to the outlet. U.S. Pat. No. 4,956,768 does not describe how locations within the memories are addressed and under what conditions the role of the memories is switched.
Conventionally double buffering is used to provide decoupling between devices that produce and consume data from a data stream, respectively. A writing device alternately addresses one memory and another to write blocks of data. The reading device reads the block by addressing the memory that is not being addressed for writing. Usually, moreover, some form of signaling is required between the devices to indicate when the writing device switches from one block to another.
Amongst others, it is an object of the invention to provide for a form of double buffering communication between different data processing units in which double buffering is supported transparently for the data processing units.
The invention provides for a data processing apparatus according to Claim 1. According to the invention an independent switching unit controls which memory unit is connected to which data processing unit. Addresses from the data processing units are used to address locations in a memory unit selected by the switching unit, so that a given address may address a location in different ones of the memory units at different times during execution of the same program, depending on the selection by the switching unit. The independent switching unit monitors the addresses supplied by at least one of the data processing units to detect repetitions in the pattern of addresses supplied by the processing unit. Upon detection of a repetition the switching unit switches the selection of the memory unit that is connected to the data processing unit.
Preferably, the criterion for detecting the repetitions is programmable, using for example detection of a repetition of addresses in a programmable range, or a programmable number of repetition, or a programmable combination of repetition of addresses from different ones of the processing units (e.g. alternating after detection of repetitions from both processing units, or alternating for each particular processing unit when a repetition is detected in the address pattern of that particular processing unit, optionally conditional on detection of a repetition by another processing unit after a preceding alternation of the address mapping from the particular one of the processing units.)
Various methods of detecting repetitions may be used, such as after detection of a repetition of an address received from a processing unit, or detection of a certain number of access operations within a certain range, or detection after use of all addresses in a certain range.
In general, the data processing apparatus will contain further memory units whose connections are not switched by the switching unit. Thus, only a subset of the range of addresses that a data processing unit may use to address memory addresses locations in the memory units that are connected via the switching unit. While the addresses in that subset are mapped alternately to different memory units, the remaining addresses are generally mapped to the same memory units. The switching unit preferably only monitors for repetition of addresses in the subset of addresses that address locations in the memory units that are connected to the data processing units via the switching unit. Thus, the alternations between different memory units are not directly dependent on patterns of addressing outside the memory units that are connected via the switching unit.
At least two data processing units and at least two memory units may be connected via the switching unit. However, the invention is easily scalable. Without deviating from the scope of the invention a greater number than two data processing unit and/or memory units may be connected, so that an address from a data processing unit can be mapped to any one of three or more memory units. In this case the switching unit may alternately connect three or more memory units to a data processing unit in a round-robin fashion. Alternatively, the switching unit may be programmable so as to select which subset of the memory units is connected alternately to a specific data processing unit. Thus the data processing apparatus can be configured to provide flexible multiple buffered communication of more than one stream of data between more than two data processing units.
These and other objects and advantageous aspects of the data processing apparatus according to the invention will be described with reference to the following figures:
a shows another embodiment of a switching control unit, and
In operation the processing units 10a,b execute programs that include instructions for reading and/or writing data from and to memory locations. The instructions define the addresses of the relevant memory locations. In response to the instructions, the processing units 10a,b supply these addresses to the memory units 18a-c via the address/control busses 14, 15. Dependent on whether the instructions are read or write instructions, the processing units 10a,b also read data via the data busses 12, 13, or write data via the data busses 12, 13, respectively. The memory units 18a-c that contain the location addressed by the addresses return data from the addressed locations to the data busses 12, 13 or store data from these data busses 12, 13 at the addressed locations.
A first and a second one of the memory units 18b,c contain locations that are addressed by the same addresses. Dependent on a control signal from the switching control unit 16, the switching unit 17 passes these addresses selectively either to the first or the second memory unit 18b,c. Similarly, the data corresponding to these addresses is passed to the selected memory unit 18b,c. Thus, dependent on a state of the switching control unit 16, the address from a processing unit 10a,b either addresses a location in the first memory unit 18b or in the second memory unit 18c. When the address from the first processing unit 10a is outside the range of addresses that address locations in the first and second memory units 18b,c, the address may address a third memory unit 18a directly, that is, not via the switching unit 17.
Although only a single directly addressed third memory unit 18a has been shown, it will be understood that a plurality of such directly connected memory units may in fact be present, some coupled to the address/control bus 14 and the data bus 12 of the first processing unit 10a, and others coupled to the address/control bus 15 and the data bus 13 of the second processing unit 10b.
The switching control unit 16 contains a state holding circuit (not shown), such as a status register, that retains state information which determines which of the memory units 18b,c is connected to the address/control bus 14, 15 and the data bus 12, 13 of which of the processing units 10a,b. The switching control unit 16 updates this state information in dependence on addresses received from the processing units 10a,b via the address/control busses 14, 15. The switching control unit 16 uses these addresses to detect the start of different periods of a periodic pattern in the addresses. Each time the switching control unit 16 detects the start of a period it updates the state information so that the addresses will subsequently be applied to a different memory unit 18b,c. Various ways of detecting the start of a period may be used.
Another embodiment of the switching control unit 16 has the same structure as shown in
In operation this embodiment of the switching control unit 16 detects the start of a new period of addressing by checking for repeated addressing of any address in the first or the second memory unit 18a,b. The read modify write memory 30 keeps information for each address value, indicating whether the address value has been used in a current period. The addresses that address locations in the first or the second memory 18b,c address locations in the read modify write memory 30 as well. Initially, at the start of a period the detector 32 resets the content of the read modify write memory 30. Each time when such an address is received the content of the corresponding location in the read modify write memory 30 is set. The data that was previously stored at that location in the read modify write memory 30 is tested by the detector. If this data has been set, the detector 32 signals a repetition of the period, which causes the data content in the toggle flip-flop 34 to toggle and causes the content of the read modify write memory 30 to be reset. The data content of the toggle flip-flop 34 controls the connection made by the switching unit 17. This embodiment makes it possible to provide a more refined form of period detection, ignoring, for example, when certain addresses are not used in a certain period.
In a further embodiment the detector 32 may be replaced by a counter that counts how many times data read from the read modify write memory 30 indicated that an address is used for the first time in a period. In this embodiment this counter signals a new period (causing switching by the switching unit 17, a reset of the read modify write memory 30 and a new period of the counting process) when a certain count is exceeded. Thus, the switching control unit signals a new period when enough different locations (more than the certain number) have been addressed. The certain number may be predetermined or programmable by the processing units 10a,b, e.g. by means of a register coupled to at least one of the processing units for setting an initial value of the counter. This embodiment makes it possible to realize a more refined period detection, e.g. ignoring repeated access operations with the same address.
Although the embodiments described with reference to the
a shows an example of an embodiment of the switching control unit 16 in which addresses from a combination of busses are used. The embodiment contains a first and a second repetition detection unit 300a,b, a status comparator 302 and a control register 304. Each of the repetition detection units 300a,b may contain an address comparator, or a read-modify write memory with a detector as shown in the
In operation the repetition detection units 300a,b detect repetitions in the pattern of addressing from respective ones of the processing units, for example, as described in the context of the
In another embodiment, the status comparator 302 does not delay the update of the control register 304 until status bits have been set for all processing units, but generates, for example, an update to alternate mapping of addresses from each particular processing unit once a repetition occurs in the address pattern from that particular processing unit, unless no alternation of mapping of addresses from another processing unit has occurred since the last alternation of the mapping of the processing unit, in question.
Although only the use of addresses to control switching has been illustrated in order to provide a simple design, it should be understood that in more complex designs other control signals from the address/control bus 14, 15 may be used as well. For example, the switching control unit 16 may be designed so that it uses addresses only when used for reading or only when used for writing. This makes it possible to realize a more refined period detection, e.g. ignoring read operations.
Furthermore, although the simple switching control units shown in the
Preferably, all the addresses used for the detection of repetitions in the embodiments described with reference to the
The switching unit 17 has an input 44 for a control signal which is coupled to enable inputs of the address/data bus drivers 40a,b, 42a,b, so that either first and fourth address/data bus drivers 40a, 42b are enabled simultaneously or second and third address/data bus drivers 40b, 42a are enabled simultaneously, depending on a control signal from the switch control unit 16 (not shown). When enabled, the address/data bus drivers 40a,b, 42a,b pass data signals and address signals.
Without deviating from the scope of the invention more complex control signals may be used, for example, control signals that allow the first and second address/data bus drivers 40a,b to be controlled independently from the third and fourth address/data bus drivers 42a,b, provided that some sharing mechanism is provided that permits shared access to the memory units 18a,b (for example a time slot multiplexing mechanism, a priority mechanism or an arbitration mechanism).
The switching unit 17 can easily be expanded to support a greater number of processing units and or memory units. More processing units are supported by adding more address/data bus drivers; more memory units are supported by connecting more address/data bus drivers together. More than two memory units may be used, for example, to map addresses from the processing units 10a,b to different memories in a round-robin fashion. For this purpose, instead of the toggle flip-flops shown in the
It will now be appreciated that the apparatus permits a processing unit 10a,b to address locations in respective ones of the memory units 18a,b with the same address. Control of the memory unit in which the location is addressed is exerted by a switching control unit that is external to the processing unit and that selects to switch in dependence on the detection of the start of a repetition of a periodic pattern. Although the same address from any one processing unit 10a,b addresses locations in different memory units 18a,b in dependence on the state of the switching control unit 16, it is not strictly necessary that locations in the memory units 18a,b are addressed by the same addresses from different ones of one processing unit l0a,b. Some address translation mechanism (if only suppression of a more significant part of the address that is not needed to distinguish addresses within the memory units 18a,b) may be included between the processing units 10a,b and the memory units 18a,b so that different addresses address the same locations, in dependence on the processing unit from which the address is supplied.
Number | Date | Country | Kind |
---|---|---|---|
02079612.4 | Nov 2002 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB03/04427 | 10/8/2003 | WO | 5/2/2005 |