Abstract:
According to an aspect of the invention, there is provided a data transfer control device that carries out data transfer in a data transfer system, in which plural bus masters are connected to a system bus and the data transfer between the bus masters is arbitrated by bus arbitration of each of the bus masters, between the bus masters, the data transfer control device including: an execution cycle monitoring section that monitors an access state for the system bus at the bus master when plural bus masters simultaneously request a use right with respect to the system bus; and a function execution order changing control section that changes an execution order of plural functions included in the bus master to be monitored, based on the access state monitored by the execution cycle monitoring section.

Description:
BACKGROUND 
       [0001]    1. Technical Field 
         [0002]    The present invention relates to a data transfer control device which performs data transfer by making an access request from a bus master to another bus master, in a data transfer system in which the plural bus masters are connected to a system bus and the data transfer is arbitrated among the bus masters by bus arbitration of each bus master. 
         [0003]    2. Related Art 
         [0004]    Conventionally, data transfer is performed among masters when the plural masters structured by a processor, a memory, input and output devices, and the like are accessibly connected to one another through a system bus. 
         [0005]    In such a system, because requests of bus use right (hereinafter referred to as “bus right”) are expected to be simultaneously made from the plural masters, the bus right is arbitrated by a bus arbiter. 
         [0006]    A fixed priority scheme and a round robin scheme are typical example of bus arbitration performed by the bus arbiter. 
         [0007]    In the fixed priority scheme, the priority of the master to which the bus right is given is previously determined when the plural masters simultaneously make the bus right requests, and the master having the higher priority always obtains the bus right. 
         [0008]    In this case, when the master having the higher priority continuously occupies the bus, the master having the lower priority (such as the input and output devices) cannot obtain the bus right for a long time, which eventually generates time-out in the master having the lower priority. 
         [0009]    On the other hand, the round robin scheme is one in which the order of the master to which the bus right is given next is changed when the plural masters simultaneously make the bus right requests. 
         [0010]    In either the fixed priority scheme or the round robin scheme, or in the combined use of the fixed priority scheme and the round robin scheme, the master having the lower priority hardly obtains the bus right when the bus transfer becomes excessively concentrated. That is, in the master having the lower priority, the possibility that the bus right is not obtained is increased in the fixed priority scheme, and there is no guarantee of performance although the order of the bus right comes in the round robin scheme. Furthermore, in either the fixed priority scheme or the round robin scheme, there is also a possibility that deadlock (abnormal stop of system) is locally generated due to the excessively concentrated bus transfer. 
         [0011]    For example, in a case where a main CPU and a main memory are connected to the bus through multi-stage arbiters (arbiter  1  and arbiter  2 ), the deadlock is possibly generated in the following conditions. That is, (1) data writing from the main CPU to an external I/O (through the arbiter  2 ), (2) data reading from the main memory to an external DMA master  1  (through the arbiter  1  and the arbiter  2 ), and (3) data writing from the external DMA master  2  to the main memory (through the arbiter  2 , and the arbiter  1 ) are continuously performed. 
         [0012]    In this case mentioned above, performance of (1)→performance of (2)→retry of (3)→performance of (1)→performance of (2)→retry of (3)→ . . . . is performed by the arbitration, so that performance of (3) is blocked (is not performed) for a long time. 
         [0013]    This is because the arbitration is performed in the multi stages, and the trouble that the performance of (3) is blocked for a long time might always be generated under the condition that the arbitration of the main memory is operated independently of the arbitration of the external masters (DMA masters  1  and  2 ). 
         [0014]    In the techniques, the operation is performed based on the particular bus arbitration, and the priorities are irregularly changed by deviation from the basic bus arbitration rule when some sort of condition holds. Therefore, a configuration of a control circuit for irregularly changing the priorities becomes complicated. 
         [0015]    Furthermore, in the techniques, the circuit configuration is required for the dedicated bus arbitration, and the circuit configuration for the already-existing bus arbitration cannot directly be applied. 
       SUMMARY 
       [0016]    According to an aspect of the invention, there is provided a data transfer control device that carries out data transfer in a data transfer system, in which plural bus masters are connected to a system bus and the data transfer between the bus masters is arbitrated by bus arbitration of each of the bus masters, between the bus masters, the data transfer control device including: an execution cycle monitoring section that monitors an access state for the system bus at the bus master when plural bus masters simultaneously request a use right with respect to the system bus; and a function execution order changing control section that changes an execution order of plural functions included in the bus master to be monitored, based on the access state monitored by the execution cycle monitoring section. 
     
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0017]    Exemplary embodiments of the invention will be described in detail with reference to the following drawings, wherein: 
           [0018]      FIG. 1  is a block diagram showing a network system according to an exemplary embodiment; 
           [0019]      FIG. 2  is a block diagram showing a data transfer control circuit in a bus master according to the exemplary embodiment; 
           [0020]      FIGS. 3A to 3C  are cycle conceptual views,  FIG. 3A  showing a switching pattern performed by an internal bus arbiter in a steady state,  FIG. 3B  showing a switching pattern  1  performed by a request switching circuit when retries are generated predetermined times in a predetermined period, and  FIG. 3C  showing a switching pattern  2  performed by the request switching circuit when the retries are generated predetermined times in a predetermined period; 
           [0021]      FIG. 4  is a flowchart showing a switching control in the data transfer control circuit according to the exemplary embodiment; and 
           [0022]      FIG. 5  is a block diagram showing a data transfer control circuit in a bus master according to a modification. 
       
    
    
     DETAILED DESCRIPTION 
       [0023]      FIG. 1  shows a device system  10  according to an exemplary embodiment of the invention. 
         [0024]    A first bus master  11 , a second bus master  13 , CPU  14 , a primary storage device  15 , a secondary storage device  16 , a printing device  18 , a reading device  17 , and a facsimile device  19  (and the like) are connected to a system bus  12  in the device system  10 , and a signal (data signal, control signal) can be exchanged therebetween. 
         [0025]    The CPU  14  performs editing, processing and computing information (such as image data). 
         [0026]    The pieces of information in which the edit and the like are performed by the CPU  14  are collectively stored and managed in the secondary storage device  16 . The information stored in the secondary storage device  16  can be shared with respect to the information obtaining request from the CPU  14 . 
         [0027]    The information is transmitted to the printing device  18 , and the printing device  18  performs a print process to a predetermined recording sheet by a driver previously installed in CPU  14 . 
         [0028]    In the reading device  17 , scanning is performed by placing an original on an original plate provided in an upper portion of the reading device  17  (for example, in a case of “multi-copier”). A CCD sensor reads an original image to generate digital image data by the scanning. The digital image data is transmitted to CPU  14  which makes the scanning request, the previously assigned CPU  14 , or the secondary storage device  16 . 
         [0029]    In the printing device  18 , the digital image data read by the reading device  17  is directly transmitted to a printer function to be able to print the same image as the original image in the predetermined recording sheet. 
         [0030]    The facsimile device  19  performs transmission and reception of data through public telephone line. The facsimile device  19  transmits the image read by the reading device  17 , and the image received by the facsimile device  19  is printed in the predetermined recording sheet with the printing device  18 . 
         [0031]    In the device system  10  having the above-described configuration, the first bus master  11 , the second bus master  13 , CPU  14 , the primary storage device  15 , the secondary storage device  16 , the printing device  18 , the reading device  17 , and the facsimile device  19  each makes request of the use right with respect to the bus  12 , so that sometimes the requests of use right are concentrated in the same period. 
         [0032]    The arbitration function is provided in each device to perform arbitration to the use request of bus  12  by the arbitration function, the order of the use right is set so as to assign the use right of the bus  12  in non-uniform manner. (The case with the CPU  14 , the secondary storage device  16 , and the printing device  18  will be described below by way of example.) 
         [0033]    Even though the arbitration is performed by the arbitration function, the bus master to which the use right is not given for a long time exists because the priority is basically determined, and the deadlock is generated in this bus master because the state in which the use right is not given continues for a long time. Particularly, when the use right of the bus is not given to one function of the plural functions of the printing device  18 , the trouble that other functions cannot be performed is generated. 
         [0034]    Therefore, a deadlock monitoring unit  20  (see  FIG. 2 ) is provided in the printing device  18  of the exemplary embodiment of the invention. The deadlock monitoring unit  20  monitors a state of the request of the use right of the bus  12 , and give the priority to another function by passing through the function in which the use right is not obtained. 
         [0035]      FIG. 2  schematically shows a data transfer control circuit  22  of the printing device  18 , in which the deadlock monitoring unit  20  is provided. Referring to  FIG. 2 , the deadlock monitoring unit  20  includes a bus monitoring circuit  26  and a request switching circuit  28 . 
         [0036]    An internal bus arbiter  24  which controls the arbitration function is connected to the bus  12 . The bus monitoring circuit  26  which constitutes a part of the deadlock monitoring unit  20  is connected to the bus  12 . 
         [0037]    The internal bus arbiter  24  outputs, between the bus  12 , execute request signals of plural functions (expressed by Func.  1 , Func.  2 , . . . , and Func. N in  FIG. 2 ) which the printing device  18  includes, and reply signals with respect to the requests are inputted to the internal bus arbiter  24 . 
         [0038]    The request switching circuit  28  which constitutes the deadlock monitoring unit  20  together with the bus monitoring circuit  26  is placed between the internal bus arbiter  24  and the Func.  1 , Func.  2 , . . . , and Func. N. 
         [0039]    The request switching circuit  28  and the bus monitoring circuit  26  are directly connected to each other. The bus monitoring circuit  26  sends a signal (switching signal) to the request switching circuit  28  when predetermined condition is satisfied in the bus monitoring circuit  26 . 
         [0040]    An interval counter  30  is connected to the bus monitoring circuit  26 . An interval register  32  is connected to the interval counter  30 . 
         [0041]    A predetermined interval (period) is set to the interval register  32 , and the bus monitoring circuit  26  is started up in each time when a count value counted by the interval counter  30  reaches the predetermined interval. The bus monitoring circuit  26  monitors whether the request of the use right of the bus  12  is normally finished within a predetermined count (predetermined period) or retry (re-request) is requested. 
         [0042]    The bus monitoring circuit  26  counts the number of times of the retry requested, and outputs the switching signal when the number of retry requests reaches predetermined times within the predetermined period. 
         [0043]    On the other hand, N internal connection terminals  28 A corresponding to the functions (Func.  1 , Func.  2 , . . . , and Func. N) are provided in the request switching circuit  28 , and the signals are transmitted and received to and from the Func.  1 , Func.  2 , . . . , and Func. N through the internal connection terminals  28 A respectively. 
         [0044]    N external connection terminals  28 B connected to the internal bus arbiter  24  are also provided in the request switching circuit  28 . 
         [0045]    In the request switching circuit  28 , the internal connection terminals  28 A and the external connection terminals  28 B can be connected to each other. In the steady state (the retry is hardly generated and each function is performed at a predetermined cycle), the connection relationship between the internal connection terminal  28 A and the external connection terminal  28 B is fixed in the request switching circuit  28  (see  FIG. 3A ). When the switching signal is inputted from the bus monitoring circuit  26 , the connection relationship between the internal connection terminal  28 A and the external connection terminal  28 B is changed based on a previously set switching pattern (see  FIG. 3B  or  3 C, the detail thereof will be described later). 
         [0046]    In other words, the connection is established to another function different from the function recognized by the internal bus arbiter  24 . 
         [0047]    The above mentioned two kinds of switching patterns can be explained below as typical representatives. 
         [0048]    (1) One-time order changing switching pattern in cycle 
         [0049]    As shown in  FIG. 3B , for example, in the case of the three kinds of functions (F 1 , F 2 , and F 3 ), the one-time order changing switching pattern is a switching pattern in which the function F 1  and the function F 2  are replaced each other in a particular cycle with respect to the cycle (F 1 →F 2 →F 3 →F 1 → . . . ) in the normal state. 
         [0050]    That is, the function F 2  is executed in advance in a point in which the function F 1  is allocated. At this point, the internal bus arbiter  24  does not recognize this fact. 
         [0051]    (2) Continuous execution switching pattern 
         [0052]    In the continuous execution switching pattern, a point in which the function F 2  is allocated is, what is called, taken away by the function F 1 , and the function F 2  is not permitted to use the bus  12  till the next arbitration. Therefore, the function F 2  is skipped to the next arbitration. At this point, the internal bus arbiter  24  does not recognize this fact. 
         [0053]    The deadlock which may be possibly generated by continuing the steady state is eliminated by one of the above mentioned switching patterns. Because the internal bus arbiter  24  does not recognize the fact as described above, the already-existing data transfer control system can be utilized. 
         [0054]    The operation of the exemplary embodiment will be described with reference to a flowchart shown in  FIG. 4 . 
         [0055]    A retry count value R is reset (R=0) in Step  100 , and each function is executed in the steady state cycle (see  FIG. 3A ) in Step  102 . 
         [0056]    In Step  104 , it is judged whether or not it comes to the monitoring time. When the negative judgment is made in Step  104 , the flow returns to Step  102 . 
         [0057]    When the affirmative judgment is made in Step  104 , the flow goes to Step  106 , and it is judged whether or not the retry request is made. 
         [0058]    When the negative judgment is made in Step  106 , the flow goes to Step  108 , and it is judged whether or not the predetermined time has elapsed. 
         [0059]    When the affirmative judgment is made in Step  106 , the R value is incremented in order to count the number of times of the retry request in Step  110 , and the flow goes to Step  112 . In Step  112 , it is judged whether or not the count value reaches the predetermined value previously set. 
         [0060]    When the negative judgment is made in Step  112 , the flow goes to Step  108 , and it is judged whether or not the predetermined time has elapsed. 
         [0061]    When the negative judgment is made in Step  108 , namely when the predetermined time has not elapsed, the flow returns to Step  102 , and the above steps are repeated. 
         [0062]    When the affirmative judgment is made in Step  108 , it is judged that the waiting time long enough to cause the generation of the deadlock has not elapsed, and the retry count value R is reset in Step  114 . Then the routine is ended. 
         [0063]    When the affirmative judgment is made in Step  112 , it is judged that the dead lock is possibly generated, the flow goes to Step  116 , and the bus monitoring circuit  26  outputs the switching signal to the request switching circuit  28 . 
         [0064]    In Step  118 , the switching pattern (1) or the switching pattern (2), i.e.,  FIG. 3B  or  3 C is read due to the switching signal, and the flow goes to Step  120 . The one kind of switching pattern may be used, or the switching pattern to be read may be changed in a step manner according to a frequency of the retry. 
         [0065]    In Step  120 , the switching control is executed by the read switching pattern (1) or (2). Therefore, because the function different from the function recognized by the internal bus arbiter  24  is executed, the deadlock caused by the continuous retries can be prevented. 
         [0066]    Thus, in the exemplary embodiment of the invention, when the plural bus masters are connected to the bus  12 , the deadlock generated in simultaneously making the requests of the use right of the bus  12  is prevented by switching the functions on the bus master side. In this case, the functions of the internal bus arbiter  24  incorporated into the bus master is not changed, and only the request switching circuit  28  is arranged between the internal bus arbiter  24  and each function. Therefore, the deadlock can be prevented with simple circuit configuration. Furthermore, the internal bus arbiter  24  does not recognize that the functions are switched. Therefore, it is not necessary to largely change the control program and the like. 
         [0067]    In the exemplary embodiment, the request switching circuit  28  is provided between the internal bus arbiter  24  and each of the functions (Func.  1 , Func.  2 , . . . , and Func. N). The function of the request switching circuit  28  may be added to the internal bus arbiter  24  (see  FIG. 5 ). 
         [0068]    In this case, it is necessary to change the already-existing internal bus arbiter  24 , while the already-existing data transfer control system can be used as it is in the above mentioned exemplary embodiment. However, because the device configuration can be simplified, the configuration shown in  FIG. 5  is effectively used when newly manufactured. In the configuration shown in  FIG. 5 , because the internal bus arbiter  24  executes the function of the request switching circuit  28  as shown in  FIG. 2 , the deadlock monitoring unit  20  is formed by the bus monitoring unit  26  and the internal bus arbiter  24 .