Abstract:
A method of storing data from a plurality of processors comprising the steps of (a) transferring data along a first bus (b) connectable between a first processor and a synchronising means and operable with a first protocol; (c) synchronising the synchronising means with a second processor; and (d) transferring the data along a second bus to a memory of the second processor wherein the second bus is connectable between the synchronising means and the memory of a second processor and operable with a second protocol.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to a method and system for storing data from a plurality of processors. In particular, the present invention relates to a method and system for storing trace data from a plurality of sensors provided in a same integrated circuit. 
       BACKGROUND OF THE INVENTION 
       [0002]    System-on-a-chip (SoC) technology is the packaging of all the electronic circuits and parts of a system, such as a cell phone or digital camera, on a single integrated circuit (IC). At present, a typical wireless baseband SoC comprises one or more microcontrollers, microprocessors or DSP core(s). The growing complexity of these systems has rendered the process of debugging increasingly difficult. 
         [0003]    There are a number of well-known embedded systems debugging tools including:
       (a) the Joint Test Action Group (JTAG) (IEEE 1149.1 specification);   (b) background debug mode (BDM);   (c) on-chip emulation (OnCE);   (d) break points and watch points.       
 
         [0008]    However, these traditional debugging tools are proving inadequate to cope with the growing complexity of multi-core SoC systems. More recently, hardware tracing has been considered as a means of overcoming this problem. 
         [0009]    Klaus McDonald-Maier &amp; Andrew Hopkins, University of Kent, (http://esemagazine.co.uk/common/viewer/archive/2004/Sep/28/feature6.phtm) highlights the need for multi-core debuggers, but concentrates on the debugging tools aspect rather than the architecture of such systems. 
         [0010]    Abramson, T., C/C++ Users Journal 22 (6), June 2004 and Lemon, D, C/C++ Users Journal 20(4), April 2002 describe techniques for trace buffer manipulation. However, these techniques are mainly software based and targeted at single core architectures. Similarly, Balakrishanan S. et al.; Integrated Circuits and Systems Design, 2002. Proceedings, 15th Symposium 9-14 Sep. 2002 relates to single core tracing for a hyper-threaded processor. 
         [0011]    Debug Support, Calibration and Emulation for Multiple Processor and Powertrain Control SoCs. Mayer, H. Siebert, K. D. McDonald-Maier. Infineon Technologies AG, Automotive &amp; Industrial, Munich, Germany. University of Kent, Department of Electronics, Canterbury, CT2 7NT, UK, describes the inclusion of an additional package connected on an SoC. However, since additional hardware is required to implement this approach, it is likely to increase the die size of an SoC. 
       SUMMARY OF THE INVENTION 
       [0012]    The present invention provides a method and system for storing data from a plurality of processors as described in the accompanying claims. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0013]    An embodiment of the invention will now be described by way of example only with reference to the accompanying Figures in which: 
           [0014]      FIG. 1  is a block diagram of a conventional SoC trace system; and 
           [0015]      FIG. 2  is a block diagram of a SoC trace system in accordance with the invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0016]    A hardware trace comprises a history of the instructions executed by a microprocessor. It may also include context-switches between various tasks and addresses and values written to, or read from, memory. 
         [0017]    In a conventional SoC trace system, each core on the SoC is provided with a dedicated hardware trace module that generates trace information from the core. For instance, the SoC trace system  10  depicted in  FIG. 1  comprises two cores  12   a  and  12   b , wherein cores  12   a  and  12   b  are respectively provided with hardware trace modules  14   a  and  14   b . Each of the cores  12   a  and  12   b  is further provided with an internal trace buffer  16   a  and  16   b  respectively (i.e. an embedded dedicated memory that may be accessed by software as scratch RAM) and/or a trace port  18   a  and  18   b  respectively. The trace ports  18   a  and  18   b  of the cores  12   a  and  12   b  respectively are connected to an external trace buffer (not shown). The trace ports  18   a  and  18   b  may be alternatively connected to external analysis hardware (e.g. a logic analyser) to enable trace data to be analysed by the analysis hardware without first passing through the external trace buffer. 
         [0018]    If any given core  12   a  or  12   b  on the SoC is provided with both an internal trace buffer  16   a  or  16   b  and a trace port  18   a  or  18   b , the core  12   a  or  12   b  is further provided with a trace port controller  20   a  or  20   b  respectively. The trace port controllers  20   a  and  20   b  act as data routers redirecting trace information to the internal trace buffers  16   a  and  16   b  respectively (via a dedicated bus BUS 1a  or BUS 1b  respectively) or the trace ports  18   a  and  18   b  as appropriate. 
         [0019]    In use, trace data from the cores  12   a  and  12   b  is transmitted through their associated trace ports  18   a  and  18   b  respectively to the external trace buffer (not shown) wherein the trace data is stored for later processing. Although it should be noted that trace data may also be transmitted from trace ports  18   a  and  18   b  to external hardware (such as a logic analyser) without passing through an external trace buffer. 
         [0020]    However, trace data may also be stored in each core&#39;s internal trace buffer  16   a  or  16   b  respectively. This is mainly used if a number of events need to be tracked over a short period of time. In particular, the rate at which data may be sampled and stored in the external trace buffer is limited by the response rate of the core&#39;s trace port  18   a  or  18   b . However, if data is stored directly in the core&#39;s internal trace buffer  16   a  or  16   b , the delay associated with core&#39;s trace port  18   a  or  18   b  can be avoided. A core&#39;s internal trace buffer  16   a  or  16   b  is also used if the core&#39;s trace port  18   a  or  18   b  cannot be accessed because it has been multiplexed with another functional interface (e.g. a USB). 
         [0021]    Each core may be further provided with a virtual trace buffer, which is essentially a part of the core&#39;s own memory  22   a  or  22   b  that is reserved for the storage of trace data. 
         [0022]    However, internal trace buffers  16   a  and  16   b  are dedicated memory components, which are not used by the software of an SoC during normal operation. Since the internal trace buffers  16   a  and  16   b  cannot be used both as memory for tracing and as a scratch memory, the inclusion of internal trace buffers  16   a  and  16   b  on an SoC effectively reduces the amount of memory that could otherwise be incorporated in the SoC for the applications running on the SoC. Furthermore, the inclusion of internal trace buffers  16   a  and  16   b  in an SoC increases the die size of the chip and hence the cost of the chip. 
         [0023]    A virtual trace buffer  22   a  or  22   b  does not require the inclusion of an additional memory element on an SoC, since the virtual trace buffer  22   a  or  22   b  is effectively a portion of the core&#39;s own memory. However, it limits the amount of the core&#39;s memory available for programs running thereon. This is likely to be particularly problematic when tracing part of a full production software stack, which uses all the memory available. 
         [0024]    The present invention modifies the traditional SoC trace system by removing the on-chip internal trace buffer(s) of the cores. 
         [0025]    For the sake of simplicity, the SoC trace system in accordance with the invention will be known henceforth as a modified SoC trace system. Similarly, the following discussion of the operation of the modified SoC trace system will focus on an exemplary dual core SoC. However, it will be understood that the modified SoC trace system is not limited to SoCs comprising only two cores, but could instead be extended to SoCs comprising more than two cores. 
         [0026]    Referring to  FIG. 2 , in common with a conventional SoC trace system, each core  112   a  and  112   b  in a modified SoC trace system  110  is provided with a dedicated hardware trace module  114   a  and  114   b  respectively that generates trace information from the core  112   a  or  112   b . In further similarity with a conventional SoC trace system, each core  112   a  and  112   b  in a modified SoC trace system  110  is provided with a trace port  118   a  and  118   b  respectively and a trace port controller  120   a  and  120   b  respectively. 
         [0027]    However, in contrast with a conventional SoC trace system, the cores  112   a  and  112   b  in a modified SoC trace system are not provided with an internal trace buffer. This significantly reduces the cost of the modified SoC trace system. Accordingly, the trace port controller in a modified SoC trace system redirects trace data (from a core) to either the trace port of the core or the memory of any other cores in the SoC (by means of a dedicated bus). 
         [0028]    For simplicity, let the core whose trace data is being acquired be known as a donor core and the core in whose memory the trace data is being stored, be known as the recipient core. Then, using the modified SoC trace system depicted in  FIG. 2 , trace data from donor core  12   a  may be stored inside a memory  122   b  of recipient core  12   b . Alternatively, trace data from donor core  12   b  may be stored inside a memory  122   a  of recipient core  12   a.    
         [0029]    Thus, in contrast with the process of storing trace data in the virtual memory of a core in some prior art SoC trace systems, the modified SoC trace system is non-intrusive on the memory of a donor core. On another note, it should be recognised that since the size of the trace buffers in the modified SoC trace system is largely dependent on the memory available to a recipient core, the trace buffers in the modified SoC trace system can be significantly larger than that of the dedicated internal trace buffers of conventional SoC systems. 
         [0030]    Since the cores in an SoC typically operate at different speeds, the transfer of trace data from a donor core into the memory of a recipient core must be carefully synchronised with the operation of the recipient core. Nonetheless, trace blocks typically have an internal first-in first out (FIFO) register, which partially buffers the flow of trace data. 
         [0031]    In particular, information is transmitted from a donor core&#39;s trace port controller  120   a  or  120   b  to a synchronisation block  30   a  or  30   b  respectively through a dedicated bus BUS 1,a  or BUS 1,b  respectively. The dedicated bus BUS 1,a  or BUS 1,b  is the same as the bus between the trace port controller ( 20   a  and  20   b  respectively) and the internal trace buffer ( 16   a  and  16   b  respectively) in  FIG. 1 . 
         [0032]    The synchronisation block  30   a  or  30   b  is in turn connected to the memory  120   a  or  120   b  of the recipient core by another dedicated bus BUS 2a  or BUS 2b  respectively. This may be a shared bus if the synchronisation block  30   a  or  30   b  is connected to an arbiter (such as a cross-bar switch) to access the memory  120   a  or  120   b.    
         [0033]    The synchronisation block  30   a  or  30   b  synchronises the clock rates of BUS 1a  or BUS 1b  respectively; and BUS 2a  or BUS 2b  respectively. The synchronisation block  30   a  or  30   b  also acts as a bus protocol converter insofar as it converts the protocol of BUS 1a  or BUS 1b  respectively, into that of BUS 2a  or BUS 2b  respectively; for instance if BUS 1a  or BUS 1b  employs the Freescale IP bus protocol and BUS 2a  or BUS 2b  employs the advanced high-performance bus (AHB) protocol. 
         [0034]    The tracing mechanism in the modified SoC trace system remains non-intrusive insofar as once programmed the hardware trace module  114   a  or  114   b  in each core generates trace data as normal. In particular, since the differences between the modified SoC trace system and the conventional SoC trace system are mainly confined to the relationship between the trace port controller of a donor core and the memory of a recipient core, the modified SoC trace system has substantially no impact on the trace blocks and trace ports of the donor and recipient cores. Accordingly, the modified SoC trace system has no impact on multicore tracing to external trace buffers through the trace ports or external hardware (e.g. a logic analyzer) that bypasses the external trace buffers. Furthermore, the modified SoC trace system has limited impact on the trace port controllers of the ports. Similarly, the modified SoC trace system does not impact on static debugging and multicore debugging if trace data is not being acquired. 
         [0035]    The down side of the modified SoC trace system is that it is adapted for single core tracing. In particular, since it is necessary to reserve some space in a recipient core&#39;s memory for receipt of data from a donor core, the architecture of the modified SoC trace system impacts on the recipient core&#39;s software. However, if the software stacks running on the cores in an SoC are highly independent, there is no need to trace all the cores simultaneously. Consequently, it is sufficient to trace each core individually. This is more and more the tendency in wireless applications, wherein a single core modem stack runs on a DSP and applications run on the MCU. 
         [0036]    Similarly, whilst, it is possible for the trace buffers on the different cores on the modified SoC system to be used simultaneously, it is not possible to simultaneously use the trace buffer of a recipient core and the trace port of a donor core. 
         [0037]    Furthermore, accessing the content of the trace buffer at the end of a test is more complex than with a conventional SoC trace system. In particular, trace data analysis software cannot access the memory buffer directly but must setup a direct memory access (DMA) transfer therewith. 
         [0038]    Modifications and alterations may be made to the above without departing from the scope of the invention.