Hereinafter, a preferred embodiment of the present invention will be described with reference to the accompanying drawings.
The DSPs 2 and 3 perform individual media processing while accessing data in the memory 5 via the memory controller 4. The CPU 1 accesses data in the memory 5 via the bridge 9 and the memory controller 4.
The bridge 9 includes a CPU access control section 942 and a speculative access control section 944. The CPU access control section 942 receives a request of normal access to the memory 5 from the CPU 1 and outputs the request to the memory controller 4. The speculative access control section 944 predicts new access to the memory 5 from the CPU 1 that may follow the requested normal access, based on this normal access from the CPU 1, to thereby issue a speculative access request, and outputs the speculative access request to the memory controller 4.
The memory controller 4, receiving access requests from the bridge 9 and the DSPs 2 and 3, arbitrates the received access requests and accesses the memory 5 according to the arbitration result.
The register block 915 includes an access address register 931, a speculative control register 932, a parameter selection register 933, a weight setting register 934, a speculative multiple control register 935, a request count register 936, a latency register 937 and a requesting master information register 938.
The bridge control section 918 includes the CPU access control section 942 and the speculative access control section 944. The CPU access control section 942 and the speculative access control section 944 bring the components of the bridge 9 into cooperative operation among them. This cooperative operation will be detailed later.
The access address register 931 holds address information given from the buffer read control section 911 in an address field, and also holds a valid bit indicating whether or not the address information is valid.
The speculative control register 932, which is set by the CPU 1, is a register used to permit the speculative access control section 944 to issue a speculative access request.
The parameter selection register 933, which is set by the CPU 1, is a register for setting a combination of registers used by the speculative access control section 944 in speculative access control.
The weight setting register 934, which is set by the CPU 1, is a register for setting weights for speculative control parameters when a plurality of speculative control parameters are used in speculative access control.
The speculative multiple control register 935, which is set by the CPU 1, is a register used to permit the speculative access control section 944 to issue multiple speculative access requests.
The request count register 936 is a register for storing the number of masters that are under access request, which is speculative access information outputted from the memory controller 4 to the bridge 9. The latency register 937 is a register for storing the latency count (number of cycles required to complete an access to the memory 5) as speculative access information outputted from the memory controller 4 to the bridge 9. The requesting master information register 938 is a register for storing information of a master under access request as speculative access information outputted from the memory controller 4 to the bridge 9. The request count register 936, the latency register 937 and the requesting master information register 938 are all set by the CPU 1 and used to set a condition for issuance of a speculative access request.
The CPU interface 910 outputs access information including a read request from the CPU 1 to the buffer read control section 911, and also outputs read data outputted from the buffer read control section 911 to the CPU 1.
The buffer read control section 911 compares a read address requested by the CPU 1 outputted from the CPU interface 910 with an address held in the access address register 931, and activates the CPU access control section 942 if the two addresses do not agree with each other. If the two addresses agree with each other, the buffer read control section 911 reads data corresponding to the read address from the buffer memory 8, and outputs the data to the CPU interface 910.
If the valid bit in the access address register 931 is invalid, the buffer read control section 911 activates the CPU access control section 942 without performing the address comparison described above.
The buffer write control section 912 writes data outputted from the memory controller interface 913 into the buffer memory 8, and notifies the CPU access control section 942 or the speculative access control section 944 of completion of the write into the buffer memory 8.
The memory controller interface 913 transfers a read access request from the memory read issuance section 917 to the memory controller 4, and outputs read data returned from the memory controller 4 to the buffer write control section 912.
The CPU control bus interface 914 transfers an access from the CPU 1 via the CPU control bus 7, provided for control of the DSPs 2 and 3 and the bridge 9 by the CPU 1, to an accessible register in the register block 915 and the speculative control pattern table storage section 919.
The address generation section 916 generates address information to be attached to a read request issued by the memory read issuance section 917 using the output of the access address register 931.
The memory read issuance section 917 issues a read access request to the memory controller interface 913 under control of the CPU access control section 942 or the speculative access control section 944.
The master interface 401 controls transfer of an access request from the bridge 9 to the memory controller 4. The master interface 402 controls transfer of an access request from the DPS 2 to the memory controller 4. The master interface 403 controls transfer of an access request from the DPS 3 to the memory controller 4.
The arbiter 404 arbitrates transfer requests from the master interfaces 401 to 403 and notifies the master selector 405 of the arbitration result. Also, the arbiter 404 outputs the number of pre-arbitrated transfer requests to the memory access counter 410.
The master selector 405 selects one of the transfer requests from the master interfaces 401 to 403 according to the arbitration result from the arbiter 404, issues a request for start of memory access corresponding to the selected transfer request to the memory access sequencer 406, and further executes data transfer between the memory interface 408 and the master interface that has outputted the selected transfer request.
The memory access sequencer 406 executes an access sequence predetermined depending on the memory in response to the request for start of memory access.
The memory address generation section 407 generates a memory address under control of the memory access sequencer 406.
The memory interface 408 controls input/output of data from/to the memory 5. Also, during accessing the memory 5, the memory interface 408 outputs the remaining number of cycles until access completion to the memory access counter 410.
The memory access counter 410 receives the remaining number of access cycles from the memory interface 408 and the number of pre-arbitrated transfer requests from the arbiter 404, calculates the number of memory access cycles based on the received numbers, and outputs the calculated result to the access information output section 409.
The access information output section 409 receives the number of access requests under arbitration from the arbiter 404 and outputs the received number to the bridge 9 as the request count. Also, the access information output section 409 receives information indicating masters under arbitration by the arbiter 404 and the number of memory access cycles from the memory access counter 410, and outputs the information and the number to the bridge 9 as the requesting master information and the latency count, respectively. The request count, the requesting master information and the latency count are all speculative access information.
In step S11, the CPU 1 detects whether or not switching of the system operation state has occurred. If the occurrence is detected, the process proceeds to step S12, or otherwise returns to step S11.
In step S12, the CPU 1 determines whether or not there is a master higher in memory access priority than the CPU 1. If there is such a master, the process proceeds to step S13, or otherwise proceeds to step S17. When being in the system operation state B, the process proceeds to step S13 because the DSPs 2 and 3 are higher in memory access priority than the CPU 1.
In step S13, the CPU 1 sets information indicating that issuance of a speculative access request is prohibited in the speculative control register 932 in the bridge 9. The bridge 9 therefore exerts control so as not to make issuance of a speculative access request for subsequent normal access from the CPU 1.
In step S14, the CPU 1 activates processing by the DSPs 2 and 3. This causes accesses to the memory 5 from the DSPs 2 and 3, and these accesses are arbitrated and processed by the memory controller 4.
In step S15, the CPU 1 detects whether or not processing by the DSPs 2 and 3 higher in priority than the CPU 1 has been terminated. If the processing has been terminated, the process proceeds to step S16, or otherwise returns to step S15.
In step S16, the CPU 1 sets information indicating that issuance of a speculative access request is permitted in the speculative control register 932. The bridge 9 therefore exerts control so as to make issuance of a speculative access request for subsequent normal access from the CPU 1. The process then returns to step S11.
In step S17, like step S16, the CPU 1 sets information indicating that issuance of a speculative access request is permitted in the speculative control register 932.
In step S18, the CPU 1 starts processing by the DSPs 2 and 3, and the process returns to step S11. This causes accesses to the memory 5 from the DSPs 2 and 3, and these accesses are arbitrated and processed by the memory controller 4.
The speculative access hit rate as used herein refers to the ratio of the number of speculative access requests for which data transfer was found useful to the number of speculative access requests already issued for memory access arising from processing by the CPU 1, that is, the ratio of the number of data units that were actually used in subsequent normal access to the number of data units transferred to the buffer as a result of speculative access and held therein. An example of calculation of the speculative access hit rate is as follows. A plurality of processing items to be executed by the CPU 1 in a system are classified into some patterns in advance, and the CPU 1 calculates the speculative access hit rate by allowing the bridge to issue speculative access requests for each pattern in advance. In the subsequent actual operation, the CPU 1 detects to which CPU processing pattern the processing item belongs, to control issuance of a speculative access request. A speculative access request will be issued if the processing item belongs to a CPU processing pattern expected to give a speculative access hit rate equal to or higher than a predetermined value.
Assume herein that the processing by the CPU 1 switches from CPU processing A higher in speculative access hit rate to CPU processing B lower in speculative access hit rate, then to CPU processing C higher in speculative access hit rate sequentially.
In step S21, the CPU 1 detects whether or not switching of the CPU processing has occurred. If switching has occurred, the process proceeds to step S22, or otherwise returns to step S21.
In step S22, the CPU 1 determines whether or not the speculative access hit rate of the CPU processing is equal to or less than a predetermined value. If the speculative access hit rate is equal to or less than the predetermined value, the process proceeds to S23, or otherwise proceeds to step S25. For example, the process proceeds to step S23 if CPU processing B is executed, or proceeds to step S25 if CPU processing A or C is executed.
In step S23, the CPU 1 sets information indicating that issuance of a speculative access request is prohibited in the speculative control register 932 in the bridge 9. The bridge 9 therefore exerts control so as not to make issuance of a speculative access request for subsequent normal access from the CPU 1.
In step S24, the CPU 1 activates processing in the DSPs 2 and 3. This causes accesses to the memory 5 from the DSPs 2 and 3, and these accesses are arbitrated and processed by the memory controller 4. The process then returns to step S21.
In step S25, the CPU 1 sets information indicating that issuance of a speculative access request is permitted in the speculative control register 932. The bridge 9 therefore exerts control so as to make issuance of a speculative access request for subsequent normal access from the CPU 1.
In step S41 in
In step S42, the CPU access control section 942 detects whether or not access to the memory controller 4 is underway, that is, whether or not the memory controller interface 913 is under operation. If access is underway, the process returns to step S42. If not, the process proceeds to step S43. For example, if the memory controller interface 913 is under operation for a speculative access, the process waits for completion of the speculative access.
In step S43, the CPU access control section 942 controls the address generation section 916 and the memory read issuance section 917 to generate and output an address (read address) of data to be requested of the memory controller interface 913. In this address generation, the address generation section 916 refers to the address field of the access address register 931. The address generated is the address requested by the CPU 1.
In step S44, the CPU access control section 942 instructs the memory read issuance section 917 to allow the memory controller interface 913 to start access to the memory controller 4. The memory controller interface 913 sends a read request to the memory controller 4.
In step S45, the memory controller interface 913 receives read data from the memory controller 4 and outputs the data to the buffer write control section 912. The buffer write control section 912 writes the read data into the buffer memory 8. Once completing write of all read data into the buffer memory 8, the buffer write control section 912 notifies the CPU access control section 942 of completion of the write. The process then proceeds to step S46. In this step, the CPU access control section 942 updates the address field of the access address register 931 to the address outputted from the memory read issuance section 917, and also enables the valid bit. If write of all read data has not been terminated, the process returns to step S45.
In step S46, the CPU access control section 942 instructs the buffer read control section 911 to respond to the read request from the CPU 1. The buffer read control section 911 selects the read-requested data from data held in the buffer memory 8, and outputs the selected data to the CPU 1 via the CPU interface 910.
In step S47, the CPU access control section 942 notifies the speculative access control section 944 of completion of the read access (normal access) from the CPU 1. Note that no notification will be made in the case of using data held in the buffer memory 8.
Thereafter, as long as the subsequent read requests from the CPU 1 are for data held in the buffer memory 8, the requested data units are sequentially outputted from the buffer memory 8 to the CPU 1.
In step S51 in
In step S52, the speculative access control section 944 determines whether or not a speculative access request is to be issued based on information such as one in the register block 915. The process proceeds to step S53 if a speculative access request is to be issued, or otherwise returns to step S51.
In step S53, the speculative access control section 944 controls the address generation section 916 and the memory read issuance section 917 to generate and output an address (speculative read address) of data to be requested of the memory controller interface 913. In this address generation, the address generation section 916 adds a transfer size to the address in the address field of the access address register 931, to generate the speculative read address. In other words, the address generation section 916 generates an address consecutively following the address of data transferred last time from the memory according to a request from the CPU 1.
In step S54, the speculative access control section 944 controls the size determination section 920 and the memory read issuance section 917 to output the size of data to be requested of the memory controller interface 913. The size determination section 920 changes the size of data to be transferred to the buffer memory 8 in response to a speculative access request, with the speculative access hit rate and existence/absence of access requests from the DSPs 2 and 3 to the memory controller 4, for example.
In step S55, the speculative access control section 944 instructs the memory read issuance section 917 to allow the memory controller interface 913 to start access to the memory controller 4. The memory controller interface 913 sends a read request to the memory controller 4.
In step S56, the speculative access control section 944 notifies the CPU access control section 942 of start of a speculative access to the memory controller 4. The CPU access control section 942 will wait for completion of the speculative access if a need for normal access from the CPU 1 to the memory arises during the speculative access.
In step S57, the speculative access control section 944 determines whether or not the process by the memory controller 4 has been completed, that is, whether or not the access to the memory controller 4 has been terminated. The process proceeds to step S58 if the access has been terminated, or otherwise returns to step S57.
In step S58, the speculative access control section 944 notifies the CPU access control section 942 of completion of the access to the memory controller, and the process returns to step S51. Receiving this notification, the CPU access control section 942 is allowed to start processing of normal access from the CPU 1 to the memory 5 immediately if required to perform normal access.
In
In cycle T0, the operation switches from the system operation state A (only the CPU 1 operates) to the system operation state B (the CPU 1 and the DSPs 2 and 3 operate). With this switching to the operation of the DSPs 2 and 3 higher in priority than the CPU 1, the CPU 1 sets prohibition of issuance of a speculative access request in the speculative control register 932 in the bridge 9 (step S13).
In cycle T1, the CPU 1 and the DSPs 2 and 3 start their processing. The DSP 2 issues an access request (read R30) to the memory 5 in and after cycle T7, and the DSP 3 issues an access request (read R40) to the memory 5 in and after cycle T13, but no speculative access request is issued from the CPU 1. A normal access from the CPU 1 and the accesses from the DSPs 2 and 3 are therefore arbitrated and processed by the memory controller 4.
In cycle T23, receiving notifications of completion of processing from the DSPs 2 and 3, the CPU 1 sets permission of issuance of a speculative access request in the speculative control register 932 in the bridge 9 via the CPU control bus 7 (step S16). Therefore, upon completion of the normal access in cycle T24, a speculative access request (read R22) is issued in cycle T25.
As described above, with the detection of existence of a master higher in priority and the setting of the speculative control register 932, the CPU 1 suppresses issuance of a speculative access request by the bridge 9. Thus, since the bridge 9 does not issue a speculative access request until completion of processing by a master higher in priority than the CPU 1, memory access can be completed within a predicted time without occurrence of having to wait for completion of speculative access. This prevents the performance of a master higher in priority than the CPU 1 from deteriorating.
Next, the case that the CPU 1 operates according to the flowchart of
In cycle T0, in switching from the CPU processing A (high in speculative access hit rate) to the CPU processing B (low in speculative access hit rate), the CPU 1 detects that the speculative access hit rate of the bridge 9 is low in the CPU processing B, and sets prohibition of issuance of a speculative access request in the speculative control register 932 in the bridge 9 via the CPU control bus 7 (step S23).
In cycle T1, the CPU 1 and DSPs 2 and 3 start their processing. The DSP 2 issues an access request (read R30) to the memory 5 in and after cycle T7, and the DSP 3 issues an access request (read R40) to the memory 5 in and after cycle T13, but no speculative access request is issued from the CPU 1. A normal access from the CPU 1 and the accesses from the DSPs 2 and 3 are therefore arbitrated and processed by the memory controller 4.
In cycle T23, in switching from the CPU processing B to the CPU processing C, the CPU 1 detects that the speculative access hit rate is high in the CPU processing C, and sets permission of issuance of a speculative access request in the speculative control register 932 in the bridge 9 via the CPU control bus 7 (step S25). With completion of the normal access in cycle T24, therefore, a speculative access request (read R22) is issued in cycle T25.
As described above, with the setting of the speculative control register 932, the CPU 1 suppresses issuance of a speculative access request by the bridge 9 when the speculative access hit rate is low. This prevents the performance of another master from deteriorating. Also, since the hit rate of actually issued speculative accesses increases, the processing performance of the CPU 1 can be improved.
The CPU 1 may detect the case that a memory access related to processing by the CPU 1 is to a cacheable region, that is, the case of a mishit, as being high in speculative access hit rate. This is based on the assumption that occurrence of a cache miss may result in subsequent consecutive cache misses.
The CPU 1 may use the priority of process ID assigned to each process in the processing by the CPU 1, to detect a memory access related to a process high in priority as being high in speculative access hit rate. The detection of a cache miss and the detection of process ID may be performed by software processing by the CPU 1, or by exclusive hardware provided in a cache interface or a memory management unit (MMU).
To follow the flowchart of
The CPU 1 sets in advance the condition for issuance of a speculative access request by the bridge 9 in the request count register 936 of the bridge 9. Assume herein that the CPU 1 sets in advance value “0” as the initial value of the request count register 936.
In the memory controller 4 receiving access requests from a plurality of masters, the access information output section 409 outputs the access request count to the request count register 936 to be stored therein. The speculative access control section 944 uses the output of the request count register 936 as the threshold in step S52 in
In cycle T6 in
Read R30 is completed in cycle T12. In cycle T13, the DSP 3 issues an access request (read R40) and the CPU 1 issues a normal access request (read R21). With the access request count exceeding the threshold “0”, the bridge 9 does not issue a speculative access request but waits until the access request count becomes “0”. Read R40 is completed in cycle T18, and thus the access request count is “1” in cycle T19.
The access request count will be “0” once read R21 is completed. In cycle T24, therefore, the speculative access control section 944 starts preparation for issuance of a speculative access request. In cycle T25, in which the access request count becomes “0”, the speculative access control section 944 issues a speculative access request to start speculative access (read R22).
Note that the address accessed during speculative access, the transfer size and the like are determined based on read R21 as the immediately preceding normal access, not based on read R20.
In the operation shown in
The CPU 1 sets in advance the condition for issuance of a speculative access request by the bridge 9 in the latency register 937 of the bridge 9. Assume herein that the CPU 1 sets in advance value “1” in the latency register 937.
The access information output section 409 calculates the latency count for a new request from the number of waiting access requests and the remaining number of cycles in the current memory access, and outputs the result to the latency register 937 to be stored therein. The speculative access control section 944 uses the output of the latency register 937 as the threshold in step S52 in
In cycle T6 in
In cycle T12, in which read R30 will be completed reducing the latency count to “1”, the speculative access control section 944 starts preparation for a speculative access request.
In cycle T13, the DSP 3 issues an access request (read R40) and the CPU 1 issues an access request (read R21). This raises the latency count to “12”. With the latency count exceeding the threshold “1”, no speculative access request is issued.
In cycle T24, in which read R21 will be completed reducing the latency count to “1”, the speculative access control section 944 starts preparation for a speculative access request.
In cycle T25, the latency count becomes “0”. The speculative access control section 944 therefore issues a speculative access request to start speculative access.
In the case of
In the operation shown in
In cycle T6 in
In cycle T10, with the progress of the memory access corresponding to read R30, the latency count decreases to “3” that agrees with the threshold “3”. The speculative access control section 944 therefore starts preparation for a speculative access request.
In cycle T11, the CPU 1 issues an access request (read R12) to the bridge 9. If the requested data in read R12 does not exist in the buffer memory 8, a normal access request (read R21) is to be issued. In this case, the speculative access control section 944 does not issue a speculative access request until completion of read R21.
The requesting master information is information indicating a master currently under issuance of an access request to the memory controller 4, in which each of the bits of the requesting master information is assigned to each master, for example. Assume that the value of the bit corresponding to a given master is “1” if the master is under issuance of an access request and “0” if it is not.
For example, the requesting master information may be made of bits assigned to the CPU 1, the DSP 2 and the DSP 3 in this order. In this case, the information will be encoded to “010” if only the DSP 2, among the CPU 1, the DSP 2 and the DSP 3, is under issuance of an access request, or to “001” if only the DSP 3 is under issuance of an access request. The access information output section 409 outputs the requesting master information indicating the master that is under issuance of an access request to the bridge 9.
The CPU 1 sets in advance the priority of an access request from another master with respect to a speculative access request, as a condition for issuance of a speculative access request by the bridge 9, in the requesting master information register 938 of the bridge 9. Each bit of the requesting master information register 938 is assigned to each master. Assume that the value of the bit assigned to a given master is “1” if the priority of an access request from the master is higher and “0” if it is not.
The requesting master information register 938 has bits assigned to the CPU 1, the DSP 2 and the DSP 3 in the same order as the requesting master information. As an example, assume herein that out of the DSPs 2 and 3, the DSP 2 is a master higher in priority over the CPU 1, that is, the CPU 1 sets “010” in the requesting master information register 938. The speculative access control section 944 uses the output of the requesting master information register 938 and the requesting master information in step S52 in
In cycle T6 in
In cycle T7, the DSP 2 issues an access request (read R30), and thus the requesting master information changes to “010”. Being found that the master (DSP 2) specified by the requesting master information register 938 has issued an access request, priority is given to read R30, and no speculative access request is issued until completion of read R30.
In cycle T13, while read R30 has been completed, the DSP 3 issues an access request (read R40). The requesting master information then becomes “001”. Since the DSP 3 is not a master specified by the requesting master information register 938, the speculative access control section 944 issues a speculative access request (read R21). The access from the DSP 3 must wait for completion of read R21.
In the operation shown in
As an alteration, both the system operation status and the memory access status may be used for speculative access control, as will be described below.
Assume that a plurality of speculative control-related registers used for speculative access control are provided as in the register block 915 in
The CPU 1 detects switching of the system operation state, selects a speculative control parameter to be used and its corresponding register according to the system operation state, and sets the selected results in the parameter selection register 933. The combination of the system operation state and the speculative control-related register may be determined in advance, or may be determined by extracting the system state. In this way, issuance of a speculative access request can be controlled with an appropriate speculative control-related register.
The speculative access control section 944 may perform weighted calculation of determination results on issuance of a speculative access request obtained based on a plurality of selected speculative control parameters, using a value of the weight setting register 934, to execute speculative access control according to the calculation result.
An example of the above speculative access control will be described using the speculative access hit rate outputted from the CPU 1 and the latency count outputted from the memory controller 4 as the speculative control parameters.
The bits of the parameter selection register 933 are assigned to the speculative control-related registers. For example, assume that the bits of the parameter selection register 933 are assigned to the speculative control register 932, the request count register 936, the latency register 937 and the requesting master information register 938 in descending order from the most significant bit, and that “1010” are set in the parameter selection register 933. This indicates that the speculative control register 932 and the latency register 937 are set as the speculative control-related registers to be used.
The CPU 1 sets a value in the speculative control register 932 according to the speculative access hit rate. The memory controller 4 calculates the access latency and outputs the result to the bridge 9.
In the weight setting register 934, a coefficient for weighting the determination results on issuance of a speculative access request based on the speculative control-related registers is set. For example, assuming that the determination result based on the speculative control register 932 is considered in the proportion of 40% while the determination result based on the latency register 937 is considered in the proportion of 60%, “4600” will be set in the weight setting register 934. Upon completion of a normal access from the CPU 1, the bridge 9 will control issuance of a speculative access request in the following steps.
In the first step, the speculative access control section 944 makes determination on issuance of a speculative access request based on the selected speculative control parameters. For each of the speculative control parameters, “1” will be given as the determination result if it is determined that a speculative access request should be issued, and “0” will be given if it is determined that a speculative access request should not be issued.
Assume that the CPU 1 sets “1” in the speculative control register 932 judging that a speculative access request should be issued because the speculative access hit rate is higher than a predetermined value. Assume also that the CPU 1 sets “2” in the latency register 937, and that the memory controller 4 outputs “3” as the latency count. In this case, the speculative access control section 944 gives “1” for the speculative access hit rate, and gives “0” for the latency count because the latency count is larger than the value of the latency register 937, as the determination results.
In the second step, the speculative access control section 944 performs weighted calculation of the determination results for the plurality of speculative control parameters using the value of the weight setting register 934. The result of the weighted calculation is (0×6+1×4)/2=2, which is used as a control value for controlling speculative access.
In the third step, the speculative access control section 944 issues a speculative access request only when the control value for speculative access exceeds a threshold. For example, assuming that the threshold is “3”, the speculative access control section 944 does not issue a speculative access request. Specifically, the speculative access control section 944 suppresses issuance of a speculative access request as long as being notified of a large latency count by the memory controller 4 even if the CPU 1 determines that the speculative access hit rate is high.
If the latency count outputted from the memory controller 4 is small enough to give a determination result of “1” for the latency count, the result of the weighted calculation will be (1×6+1×4)/2=5. In this case, the speculative access control section 944 issues a speculative access request.
As described above, the speculative access control using both the system operation status and the memory access stratus can suppress the possibility that the system performance may greatly deteriorate.
In place of actual weighted calculation of a plurality of speculative control parameters, the speculative access control value may be obtained using the speculative control pattern table storage section 919. The speculative control pattern table storage section 919 stores therein a speculative control pattern table as a lookup table. The speculative control pattern table is configured so that the input address is a value indicating a combination of a plurality of speculative control parameters and the output data is a result of weighted calculation (weighted calculation value) of determination results on issuance of a speculative access request obtained for the respective speculative control parameters.
The speculative access control section 944 enters a combination of a plurality of speculative control parameters into the speculative control pattern table storage section 919, and receives a weighted calculation value as the speculative access control value. This eliminates the necessity of the parameter selection register 933, the weight setting register 934 and an operator for weighted calculation.
Different values may be set in the speculative control pattern table depending on the value of a speculative control parameter. For example, assume that the speculative access hit rate and the latency count are selected as the speculative control parameters. The weight on the determination result for the speculative access hit rate is decreased if the latency count is small and increased if it is large, and the weighted calculation values are calculated in advance for the respective cases. This permits optimum setting for control of issuance of a speculative access request.
If the memory access priority of the CPU 1 is high and the hit rate of speculative access by the bridge 9 is high (that is, a high speculative access hit rate is predicted), the bridge 9 may be allowed to issue a speculative access, not only after completion of a normal access from the CPU 1, but also after completion of a speculative access. That is, the bridge 9 may be allowed to issue speculative accesses consecutively. If the above prediction is made, the CPU 1 may set the speculative multiple control register 935 so as to indicate permission of consecutive issuance of speculative accesses. The CPU 1 and the speculative access control section 944 then set the speculative control register 932 according to the setting of the speculative multiple control register 935.
With the configuration described above, the speculative access hit rate will be further increased when the speculative access hit rate is high enough to allow memory access over continuous regions, and this can further improve the processing performance of the CPU 1.
The hit rate of speculative access by the bridge 9 may be measured by the bridge 9 itself. The bridge 9 manages data held in the buffer memory 8 by differentiating data resulting from normal access from the CPU 1 from data resulting from speculative access by the bridge 9. If data resulting from speculative access is used by normal access, the speculative access hit rate is determined high. The speculative access hit rate measured by the bridge 9 may be used in combination with the speculative access hit rate predicted by the CPU 1. This will further increase the speculative access hit rate, and can further improve the processing performance of the CPU 1.
Consecutive issuance of speculative accesses may be made according to the access request count from the memory controller 4 and information on a master under accessing.
The size determination section 920 may change the size of data to be requested of the memory controller 4, according to the system operation status and the memory access status, so that data transferred in response to a speculative access request or a subsequent consecutively-issued speculative access request has a size corresponding to speculative access information (speculative access hit rate, access request count from the memory controller 4, information on a master under accessing and the like).
The above size change configuration is advantageous for the case that the memory access priority of the CPU 1 is high, the hit rate of speculative access by the bridge 9 is high and no access from other masters to the memory controller 4 is underway. The size of data to be requested may be increased to up to the capacity of the buffer memory 8 as the upper limit, to increase the data pre-read amount. This will further increase the speculative access hit rate, and can further improve the processing performance of the CPU 1.
Although the bridge 9 is provided with the speculative access control section 944 in the above embodiment, the memory controller 4 may be provided with the speculative access control section 944. For example, the bridge 9 and the buffer memory 8 may be incorporated in the memory controller 4.
A specific master may be selected from a plurality of masters, to allow speculative access control for the selected master. For example, in a system in which a plurality of CPUs are connected as masters and the priorities of the CPUs vary with time, the CPU high in priority may be selected to allow speculative access control for the selected CPU. This can improve the processing performance of each CPU. With this configuration, the hardware scale can be reduced compared with the case of having a bridge and a buffer memory for each CPU.
As described above, according to the present invention, the system performance is prevented from deteriorating due to speculative access from the CPU. The present invention is therefore useful as a unified memory system and further applicable to a system LSI and the like adopting unified memory architecture.
While the present invention has been described in a preferred embodiment, it will be apparent to those skilled in the art that the disclosed invention may be modified in numerous ways and may assume many embodiments other than that specifically set out and described above. Accordingly, it is intended by the appended claims to cover all modifications of the invention which fall within the true spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2006-164623 | Jun 2006 | JP | national |