The present invention relates to an apparatus for, and method of, buffering and relaying instructions to subsystems within an electronic device.
Some systems, such as mobile telephones and wireless datacards, are composed of various subsystems which need to be individually controlled in order to achieve the desired operation of the device. Some of the devices carry “legacy” architectures and instruction regimes which they need to support.
It is also known that other control architectures can be employed in complex systems.
UMTS mobile telephones need to support the GSM standard such that the mobile telephone can switch modes when moving from an area where the UMTS service is supported to an area where the UMTS service is not supported without interrupting the call. Consequently both the GSM and UMTS components are integrated within a single device.
According to a first aspect of the present invention there is provided an instruction buffer comprising: a store for storing at least one instruction; a timer for issuing an indication that a specific instruction from the instruction store is due for execution; and an instruction dispatcher responsive to the timer for accessing the store to identify the instruction due for execution and for instructing a device responsive to the instruction buffer to execute the instruction.
It is thus possible to provide an instruction buffer which improves the controllability of a complex system. In particular it removes the pressure on a controller, for example a data processor acting in accordance with programmable software, to issue write instructions to various devices controlled by said data processor within a tight time frame.
According to a second aspect of the present invention there is provided an event controller for controlling a timing of a plurality of events that occur in one or more devices responsive to the event controller and which are in communication with the event controller, wherein the event controller is adapted to:
According to a third aspect of the present invention there is provided a prioritised instruction buffer comprising a plurality of memory locations to which instructions can be written, at least one timer for causing an instruction to be retrieved from a memory location for transmission to a slave device, and a prioritiser for identifying a highest priority instruction for transmission in the event that a plurality of instructions fall due for transmission at substantially the same time.
According to a fourth aspect of the present invention there is provided a method of sending instructions from a controller to slave devices responsive to the controller, the method comprising: placing instructions for the devices in an instruction store capable of storing a plurality of instructions; setting a timer to issue an indication that a specific instruction in the instruction store is due for sending; and in response to a signal from the timer retrieving the instruction from the instruction store and sending it to the slave device.
According to a fifth aspect of the present invention there is provided a method of controlling the execution of a plurality of events in a system comprising a plurality of sub-systems, the method comprising the steps of:
The present invention will be described by way of non-limiting example only, with reference to the accompanying drawings in which:
Within a mobile telephone many functions need to occur in order for the device to work properly. Amongst these functions are tasks such as transmit power setting, local oscillator setting, filter setting, gain setting in baseband stages, together with running a plurality of user applications which now occur on mobile telephones such as games, multimedia and the like. Responsibility for running these applications and coordinating these tasks falls on the data processor 20. However there are instances where the instantaneous work load on the data processor may become so high that it cannot issue control instructions to the subsystems 40, 42 and 44 at the correct times. In such circumstances the data processor has to prioritorise issuance of instructions and therefore some lower priority tasks may be missed completely. The workload for a data processor within a complex system, such as a mobile telephone is likely to be highly variable. This therefore gives rise to the possibility of using spare processing capacity during instances where the data processor is less busy in order to set up instructions to the subsystems 40, 42 and 44 as appropriate, for execution at a later time. However, this in itself only partially reduces the data processor workload as, in the prior art systems of
In order to facilitate the sending of instructions at the correct time, an embodiment of the invention has an instruction buffer generally designated 60 interposed between the data processor and the subsystems, and preferably between the data processor and the serial interface 46.
In order to control the various subsystems 40, 42 and 44 across the common serial interface, it is necessary for the data word propagated across the interface to contain various predefined fields. As multiple subsystems or devices are available or may be attached to the serial interface, it is advantageous that the first portion of a data word 70 contains a device identifier 72 (as illustrated in
Normally a single bit modify within a word would be performed by reading the word from the address back into the data processor, modifying one of the bits, and then writing the word back to the target device. However by use of a mask the status of the bits which are not to be changed does not need to be known and hence the read operation could be dispensed with. Instead the bit set or bit clear OP code can be sent and then the data mask could indicate which one or ones of the bits in the data word is to be operated on in accordance with the OP code. Thus the selected bits are either set or cleared whilst the other bits within the address remain unchanged from their previous state.
The instruction buffer also comprises a counter timer unit, generally designated 90, which includes a plurality of individually settable counter/timers designated 90-1, 90-2, 90-3, 90-4, 90-M-1, 90-M. It is advantageous, though not a necessary feature, that the number of timers M is equal to the number of memory locations N.
The instruction store 80 and the counter/timer 90 are in communication with an instruction dispatcher 100.
Each instruction within the instruction store 80 can be associated with a counter/timer within the counter timer unit 90. The instruction dispatcher is arranged to be responsive to the individual counter/timers 90-1 to 90-M such that when any one of the timers counts down to a time which had been loaded into it by the data processor, then it asserts an output to the instruction dispatcher 100 which causes the dispatcher 100 to retrieve the instruction from the relevant memory address 80-1 to 80-N within the instruction store 80 and to issue the instruction on the serial data bus. Therefore the data processor 20 does not have to undertake to issue the instruction itself at the relevant time.
In an embodiment of the present invention the data store 80 is 32 bits wide. 26 bits of the data store are allocated to the data word as described hereinbefore with respect to
One (or more) of the additional bits may be used as a flag for backward compatibility with older software running on the data processor. Therefore one of the bits may be used to indicate whether the instruction would be handled by the instructing unit 12 of the GSM mobile device shown in
One or more of the addressable counters can be loaded with an absolute time value which, once reached, causes the timer to issue an output, which can be regarded as a time strobe. Use of absolute time provides a high degree of certainty about the timing of events. However loading an absolute time, even if in a truncated format, might well be wasteful of memory. It is therefore possible in some embodiments that as the software executing on the data processor can have knowledge of the current time and hence can calculate the time that needs to elapse from the time it writes the instructions to the instruction buffer to the time that the instruction needs to be executed, that the software processor writes a delay time to the individual counter/timer and that this counter then counts down the delay time. This however is a less certain approach but may be acceptable in some systems.
Where timing requirements are particularly strict, such as in mobile telephones, it is preferable that the data processor should also take account of the “set up” time required to transmit the instruction on the serial data interface (assuming that the serial data interface is not busy) and optionally an internal processing time within the subsystem which is being instructed to change its operating state. Therefore, advantageously, the time period that is written into the counter/timer takes account of the set up time, i.e. by subtracting the set up time from the delay time, such that the data transfer process and internal reconfiguration of the subsystem can occur such that the operational change occurs substantially at the desired time.
The data processor 20 has access to both the individual memory locations within the instruction store 80 and the individual timers within the counter timer 90 such that it can set them both to the appropriate values in order to cause in instruction to be executed at a desired time.
For the data write 110 the data processor 20 sets the timer strobe code to “0000” indicating that the write from the instruction buffer to the designated subsystem should be immediate. The data dispatcher 100 is responsive to this code and writes the instruction at time 114 to the serial data bus as soon as possible i.e. as soon as the data bus becomes idle.
In the case of the second data write 112 the data processor sets the timer strobe to a value between “0001” and “1111” to indicate that the dispatcher 100 is to be responsive to a timing pulse/timing strobe from the counter/timer designated by the counter/timer address.
As part of the write process the data process also writes a delay value into the counter/timer indicative of the time period from the end of the write to the counter/timer that the timer should count down before asserting its strobe pulse. The counter/timer then counts down at a known rate until it reaches zero and then issues its timing strobe 116 to the data dispatcher 100. The dispatcher 100 then retrieves the instruction from the appropriate storage location within the data store 80 and writes the instructions to the serial data bus.
As noted hereinbefore, some instructions are more important than others. Whilst the software executing in the data processor should try to avoid issuing instructions that clash, it cannot always guarantee this because some of the systems operate in a closed loop and, for example, if it is determined by a transmit power monitor that the transmit power needs changing, then this must be done as a high priority. The transmit power monitor (or other system) may issue an interrupt to the data processor and hence the data processor is then required to suspend its current operational task and to handle the interrupt as a matter of priority and then to write that instruction to the instruction buffer. Given that the data processor would have no prior knowledge of when the interrupt was going to occur, then it cannot guarantee that two or more instructions will not need to be transmitted over the serial data bus at the same time.
In order to overcome this potential contention on the serial data bus, the instructions may be given relative priorities. The priority associated with an instruction could be explicitly designated by further extending the data word to include a priority value. However, more conveniently, the instructions can be implicitly prioritised within the data store. One end of the address range of the data store can be regarded as being a high priority end and the other end of the data store can be regarded as being a low priority end. Thus, referring to
In such a scheme one could provide a specific address for each instruction that the data processor could send. Alternatively, given that it is highly unlikely that the data processor will issue every single instruction available to it near simultaneously, then the depth of the data store can be much smaller than the total number of instructions that the data processor could conceivably send and the data processor can be arranged to write each instruction that it wants to send to a default address within the data store in accordance with the relative priority of that instruction. However, if at the time of writing or prior to writing the instruction the data processor performs a further check to see whether an instruction is already pending in the target address within the instruction store 80, then it can modify the target address to, for example, write the instruction to the next available address within the data store having a lower priority than the default target priority. The very important instructions could be maintained on a one to one mapping to the addresses in the instruction store 80 thereby ensuring that the very important instructions are never demoted down the instruction list and are never brought into contention with other potential instructions trying to write to the same address within the instruction store 80.
It is thus possible to provide a mechanism such that transfer of any low priority instruction that is pending in the buffer can be interrupted or deferred by a higher priority request.
All of the entries within the instruction store 80 may be accessed by hardware or software. However, where direct memory access is supported for other devices than the controlling data processor, then these addresses are preferably tailored according to the relative importance of the process that can make the direct memory access. Generally, it would be expected that the addresses within the store 80 which would be accessed by direct memory access would be the lower priority ones. However, it would be possible, for some very important tasks to be executed by dedicated hardware and these tasks could be given access to high priority addresses if the system designer felt this appropriate.
As described thus far the dispatcher 100 merely coordinates timing of the instruction dispatches. However, the dispatcher could also provide instruction translation if it was desired to allow old software to be interoperable with more modern hardware having dissimilar instruction addresses and OP codes. Under such circumstances the instruction dispatcher 100 could also perform an instruction translation, for example by referring to a ROM to look up an “old” instruction which is to be replaced by a “new” instruction.
In some systems the serial data bus may support bidirectional communication. In such circumstances the instruction dispatcher may need to wait until the serial bus is idle before attempting to send instructions and/or may be given authority to signal to the slave devices that it is going to take command of the serial bus and that data writes from the subsystems should be suspended.
The instruction buffer may include dedicated hardware for monitoring the memory locations within the store 80 so as to maintain an indication of the most important instruction therein.
Once an instruction has started transmission on the databus the transmission must be completed before any other instructions can be transmitted. During this time one more further transmission instructions may become due and under these circumstances the instruction dispatcher prioritises the transmit requests and services them in order of priority as quickly as possible.
The data processor 20 and the instruction buffer co-operate to form an event controller 150 which causes instructions to be issued at specific times to the subsystems 40, 42, 44.
Given that the instruction store is internal to the instruction buffer 60, it is easy for the logic within the instruction dispatcher to read the bits that designate which one of the counter-timers 90-1 to 90M is associated with the instruction and to set a multiplexer to route the output of the timer a circuit within the dispatcher which acts to place the instruction on the databus.
Although the invention has been discussed herein as only having a single serial interface, it can have two or more serial interfaces, as shown in
The interfaces, interface 1 and interface 2, can request data from the buffer. However, the buffer can also inform the interfaces when data is available (for example by virtue of an address not being empty). The dispatcher 100 acts to ensure that data is only requested from a buffer that contains data.
When the dispatcher or a serial interface therein requests data, the dispatcher can check for entries that have been flagged as ready to be transmitted.
If only one such entry is flagged for transmission it is read from the buffer by one of the serial interfaces, and that buffer entry is then cleared. The data is then transmitted by the serial interface. If two entries are ready to be sent, then they are sent in order of priority—unless they can be sent concurrently over different interfaces.
It is thus possible to provide a instruction buffer which provides enhanced timing control for writing instructions to slave devices or subsystems and which can also resolve conflicting requests for access to the serial data bus.