Bus band control device and bus band control method
Patent Information
- Application Number
- JP2024552474
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-10-27
- Filing Date
- 2022-10-27
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-10-27
AI Technical Summary
Existing bus bandwidth control methods fail to effectively prevent resource availability impairment when a CPU core is hijacked, as they do not adequately control access to resources other than shared memory and cannot block hijacked CPU cores from accessing these resources, leading to bandwidth pressure and interference with other CPU cores.
A bus bandwidth control device and method that utilize a resource separation mechanism and hardware timer to interrupt CPU cores at predetermined times, executing exclusive processing by the bus bandwidth suppression program, which controls access to shared memory and other resources, ensuring only the suppression program can access critical areas, thereby preventing hijacked CPU cores from impairing resource availability.
This solution effectively prevents resource availability impairment by limiting hijacked CPU core access, securing bus bandwidth for other CPU cores and ensuring resource availability, even if a CPU core is compromised.
Abstract
Description
Bus bandwidth control device and bus bandwidth control method
[0001] The present application relates to a bus bandwidth control device and a bus bandwidth control method.
[0002] Computer configurations include bus masters that actively initiate data transfers and bus slaves that passively wait for requests from the bus master. The bus master is, for example, a central processing unit (CPU), while the bus slaves are hardware resources, i.e., resources, such as memory, storage, and other peripheral devices. The CPU and each resource are connected via a bus. A CPU may have multiple CPU cores, and multiple software programs (hereinafter simply referred to as programs) running on each CPU core may share and use the resources. When multiple programs share and use resources, the resource usage range is divided into areas or units that require dilution of the influence between programs, taking into account the processing content, services, and security of each program within the system. Another method is to divide the resource usage range for each CPU core on which each software runs. In such a method, the resource usage range must be considered when designing and implementing the programs running on each CPU core so as not to interfere with the operation of other CPU cores.
[0003] Among the programs running on CPU cores are communication programs that connect to the outside of the system. Because such communication programs maintain connections to the outside of the system by enabling external access, there is a possibility that unknown security holes could be exploited to hijack the CPU core on which the communication program runs. A hijacked CPU core may execute unintended processes, but it is difficult to completely counter unknown security holes. Therefore, even if one CPU core is hijacked, it is necessary to prevent the effects of the hijack from spreading to other CPU cores.
[0004] In order to protect other CPU cores from the effects of takeover, it is necessary to limit or control access to resources shared by multiple CPU cores. For example, Patent Document 1 discloses a bus system in which a bus access control unit provided in a bus bridge circuit that relays data transfer between an internal bus and a peripheral bus allows access to a shared memory only when certain conditions are met, such as key data for receiving access permission matching unique data held by the CPU.
[0005] Japanese Patent Application Laid-Open No. 2006-293536
[0006] However, the technology of Patent Document 1 described above has a problem in that if a CPU core is hijacked, the availability of resources for other CPU cores may be impaired. First, in the technology of Patent Document 1, connections to resources other than the shared memory do not go through a bus access control unit, and access to resources other than the shared memory is not controlled. Even if connections to resources other than the shared memory go through a bus access control unit, the method described in Patent Document 1 may result in the hijacked CPU core satisfying the access permission conditions. This is because the CPU's unique data does not change when a CPU core is hijacked, and bus access cannot be blocked in response to the hijack. If the hijacked CPU core is granted access permission to a specific resource, the hijacked CPU core may frequently access the resource, constricting the bus bandwidth of the bus connecting the CPU core and the resource and potentially inhibiting access to the resource by other CPU cores. When access to a resource is inhibited in this way, the availability of the resource is impaired.
[0007] The present application has been made to solve the above-mentioned problems, and has as its object to provide a bus bandwidth control device and a bus bandwidth control method that prevent the availability of resources from being impaired.
[0008] The bus bandwidth control device disclosed in the present application is a bus bandwidth control device that controls the bus bandwidth used by programs in a system in which a CPU core set that executes multiple programs and a multiple number of resources are connected via a bus, and includes: a resource isolation mechanism that is connected to the bus and determines the range of resources that each program can access; a hardware timer that interrupts the CPU core set at a predetermined timing; shared memory that is one of the resources and has memory areas allocated to each of the multiple programs by the resource isolation mechanism; and a bus bandwidth suppression program that is executed by the CPU core set and, when an interrupt occurs, executes exclusive processing for the CPU core set, and, when the exclusive processing ends, returns the processing of the CPU core set to before the interrupt.The memory area includes a vector table that indicates the processing to be executed when an interrupt occurs, and a memory area used by the bus bandwidth suppression program, and the resource isolation mechanism allows only the bus bandwidth suppression program to access the hardware timer, the vector table, and the memory area used by the bus bandwidth suppression program.
[0009] In addition, the bus bandwidth control method disclosed in the present application is a bus bandwidth control method for controlling the bandwidth of the bus used by a program in a system in which a CPU core set executing multiple programs and multiple resources are connected via a bus, and includes a step of a hardware timer interrupting the CPU core set at a predetermined timing, a step of executing exclusive processing for the CPU core set when the interrupt occurs, and a step of returning the processing of the CPU core set to the state before the interrupt when the exclusive processing is completed, and the memory area of the shared memory, which is one of the resources, includes a vector table indicating the processing to be executed when an interrupt occurs, and a memory area used by a bus bandwidth suppression program that executes the exclusive processing, and access to the hardware timer, the vector table, and the memory area used by the bus bandwidth suppression program is permitted only to the bus bandwidth suppression program.
[0010] The bus bandwidth control device and bus bandwidth control method disclosed in the present application can prevent resource availability from being impaired.
[0011] Fig. 1 is a schematic configuration diagram showing a bus bandwidth control device in embodiment 1. Fig. 2 is a block diagram showing a bus bandwidth suppression program according to embodiment 1. Fig. 3 is a flow diagram showing the operation of the bus bandwidth control device in embodiment 1. Fig. 4 is a schematic configuration diagram showing a bus bandwidth control device in embodiment 2. Fig. 5 is a block diagram showing a bus bandwidth suppression program according to embodiment 2. Fig. 6 is a flow diagram showing the operation of the bus bandwidth control device in embodiment 2.
[0012] First Embodiment. A first embodiment will be described with reference to FIGS. 1 and 2. FIG. 1 is a schematic diagram showing the configuration of a bus access control device according to the first embodiment. In a system having a CPU core set 111 and a CPU core set 112, each of which executes a plurality of programs 101 and 109 and is connected to a plurality of resources via a resource isolation mechanism 140 and an interconnect 150 ("Interconnect" in FIG. 1 ), a bus bandwidth control device 100 controls the bandwidth of the bus used by the program 101 executed in the CPU core set 111. Note that the "resources" in the first embodiment include a shared memory 120, a hardware timer 130, and a non-controllable resource 190.
[0013] The program 101 executed in the CPU core set 111 includes a communication program 102 for communicating with the outside of the system and a bus bandwidth throttling program 105. On the other hand, the program 109 executed in the CPU core set 112 does not include the communication program 102 or the bus bandwidth throttling program 105.
[0014] The shared memory 120 is shared by the program 101 executed in the CPU core set 111 and the program 109 executed in the CPU core set 112, and the storage areas (accessible areas) used by each program 101 are allocated by the resource separation mechanism 140. In FIG. 1 , only the storage area allocated to the bus bandwidth throttling program 105 is illustrated. Of the storage areas in the shared memory 120, the storage areas allocated to the bus bandwidth throttling program 105 are the storage area in which the vector table 121 is stored and the storage area 122 used by the bus bandwidth throttling program 105. The vector table 121 registers an address indicating the process to be executed by the CPU core set 111 when the hardware timer 130 issues an interrupt to the CPU core set 111, and in the first embodiment, the address of the bus bandwidth throttling program 105 is registered therein.
[0015] The hardware timer 130 issues an interrupt to the CPU core set 111 at a predetermined timing. This interrupt causes the bus bandwidth throttling program 105 to start operating, and the bus bandwidth throttling program 105 executes an occupation process. The bus bandwidth throttling program 105 will be described in detail later.
[0016] The resource isolation mechanism 140 determines the range of resources that each program 101 can access, and is configured, for example, by an Input Output Memory Management Unit (IOMMU). The resource isolation mechanism 140 may also be configured using a hardware module that has a register for storing setting information and that permits or prohibits access to the bus when a bus master (CPU core set) accesses a bus slave (shared memory, etc.) according to the setting information.
[0017] The resource isolation mechanism 140 in the first embodiment allows only programs 101 executed in the CPU core set 111 that have a preset key ID to access the configuration shown by double lines in FIG. 1 , i.e., the vector table 121, the memory area 122, and the hardware timer 130. Furthermore, in the first embodiment, only the bus bandwidth throttling program 105 has the "preset key ID." Therefore, only the bus bandwidth throttling program 105 can access the vector table 121, the memory area 122, and the hardware timer 130. However, because the resource isolation mechanism 140 controls access only to the program 101 executed in the CPU core set 111 (shown shaded in FIG. 1 ), access by the program 109 executed in the CPU core set 112 to the hardware timer 130 and the like (configuration shown by double lines) is not restricted.
[0018] The CPU core set 111 and the resource isolation mechanism 140 are connected by a controlled system bus 181. The CPU core set 112 and the resource isolation mechanism 140 are connected by a non-controlled system bus 182.
[0019] The resource separation mechanism 140 is connected to each resource via an interconnect 150 (Interconnect in FIG. 1). The resource separation mechanism 140 is connected to the shared memory 120 and the hardware timer 130 via a controlled external bus 183. The resource separation mechanism 140 is connected to the non-controlled resource 190 via a non-controlled external bus 184.
[0020] 1, there are configurations indicated by solid lines and configurations indicated by dashed lines, with the configurations indicated by solid lines being subject to access control by the bus bandwidth control device 100, and the configurations indicated by dashed lines being not subject to access control by the bus bandwidth control device 100. In other words, the control targets are the program 101 (including the communication program 102 and the bus bandwidth throttling program 105) executed in the CPU core set 111, the shared memory 120, the hardware timer 130, the resource separation mechanism 140, the controlled system bus 181, and the controlled external bus 183. On the other hand, the control targets are the program 109 executed in the CPU core set 112, the uncontrolled resource 190, the uncontrolled system bus 182, and the uncontrolled external bus 184.
[0021] 2 is a block diagram showing a bus bandwidth throttling program according to the first embodiment. The bus bandwidth throttling program 105 starts operation when triggered by an interrupt from the hardware timer 130. The hardware timer 130 issues an interrupt by transmitting an interrupt notification IN. The interrupt notification IN is received by an interrupt reception unit 1112 provided in the CPU core set 111. Upon receiving the interrupt notification IN, the CPU core set 111 references the vector table 121 and starts processing of the bus bandwidth throttling program 105. The processing executed by the bus bandwidth throttling program 105 includes a bus access frequency acquisition process 1051 that acquires a bus access frequency F for the control target buses (the control target system bus 181 and the control target external bus 183), an occupation time setting process 1052 that sets an occupation time T, which is the time for executing the occupation process, based on the bus access frequency F, an occupation process 1053 that occupies the processing time of the CPU core set 111 for only the occupation time T, and a return process 1059.
[0022] The bus access frequency acquisition process 1051 is a process that, for example, reads the register content R stored in the register 1111 of the CPU core set 111, and acquires the bus access frequency F to the bus to be controlled from the register content R by counting the number of instructions related to bus access, such as LD / ST instructions (load / store instructions) to the bus to be controlled from the previous interrupt to the current interrupt. The acquired bus access frequency F is also used in the next interrupt, and is therefore retained until the next interrupt.
[0023] The occupation time setting process 1052 includes, for example, a process of setting the occupation time T so that it is proportional to the bus access frequency F. It may also include a process of setting a specific occupation time T depending on whether the bus access frequency F is less than a predetermined threshold or equal to or greater than a threshold. The occupation time setting process 1052 may be a combination of the process of proportionally setting the occupation time T to the bus access frequency F as described above and the process of determining the occupation time T based on a threshold.
[0024] The occupation time setting process 1052 may also include a process for setting the next interrupt time TN and adjusting the frequency at which the interrupt and occupation process are performed. When the occupation time setting process 1052 sets the next interrupt time TN, the next interrupt time TN is transmitted to the hardware timer 130 as shown in FIG. 2 .
[0025] After the occupancy process 1053 ends, the bus bandwidth throttling program 105 executes a return process 1059 to return the processing of the CPU core set 111 to the state before the interrupt.
[0026] Note that specific examples of the occupancy process 1053 include a process whose processing time can be set, such as a sleep process, or a combination of processes whose processing time can be measured in advance. The occupancy process 1053 is not particularly limited, and may be any process that occupies the processing time of the CPU core set 111 to prevent the execution of processing of programs 101 other than the bus bandwidth throttling program 105. By preventing the execution of processing of programs 101 other than the bus bandwidth throttling program 105, the bus bandwidth of the bus to be controlled is prevented from being used by programs 101 other than the bus bandwidth throttling program 105. In other words, during the occupancy time T during which the occupancy process 1053 is executed, the use of the bus bandwidth of the bus to be controlled is suppressed.
[0027] In addition, the bus access frequency F may be obtained not from the counted number of LD / ST instructions as described above, but from the proportion of the counted number of LD / ST instructions (load / store instructions) among a certain number of instructions around the program counter address immediately before the interrupt, that is, the proportion of load instructions and store instructions among a certain number of instructions centered on the program counter address when the interrupt occurred.
[0028] Furthermore, since it is only necessary to adjust how much the occupation process 1053 is executed in a certain period of time, it is possible to set either the occupation time T or the next interrupt time TN by the occupation time setting process 1052, or both. That is, the time of the occupation process 1053 in one interrupt may be adjusted by setting the occupation time T, or the frequency of the interrupt and the occupation process 1053 may be adjusted by setting the next interrupt time TN while fixing the time of the occupation process 1053 in one interrupt.
[0029] Furthermore, to prevent the occupancy process 1053 executed by the bus bandwidth throttling program 105 from affecting other components, such as the CPU core set 112, the occupancy time T may be set as described above and then modified based on the overall system status, for example, the operating status of each component of the system (e.g., startup, normal operation, abnormal processing, termination processing, stopped, etc.). The system may also be configured to determine whether or not to execute the occupancy process 1053. For example, if a specific component is in startup or termination processing, the occupancy process 1053 may not be executed. One possible method for determining the overall system status is to obtain, for example, the operating status of the program 101 running on the CPU core set 111, such as the CPU utilization rate, or the resource usage status of the program 101 running on the CPU core set 111. Alternatively, the occupancy time T or the next interrupt time TN may be randomized to make it difficult to predict the timing and time of executing the occupancy process 1053.
[0030] 3 is a flowchart showing the operation of the bus bandwidth control device, i.e., the bus bandwidth control method, in embodiment 1. First, before an interrupt by the hardware timer 130, the CPU core set 111 is executing normal processing (step ST01).
[0031] When the CPU core set 111 is executing normal processing, the hardware timer 130 interrupts the CPU core set 111 at a predetermined timing (at the next interrupt time TN if the next interrupt time TN has been set) (step ST02). This causes the bus bandwidth throttling program 105 to start operating. As described above, the resource isolation mechanism 140 allows only the bus bandwidth throttling program 105 to access the vector table 121, memory area 122, and hardware timer 130; other programs 101 in the CPU core set 111 (programs other than the bus bandwidth throttling program 105) cannot physically access them and therefore cannot participate in subsequent processing.
[0032] Next, the bus bandwidth throttling program 105 acquires the bus access frequency F (step ST03).
[0033] Next, the occupation time T is set. In the first embodiment, as shown in Fig. 3, the bus access frequency F obtained in the previous interrupt is compared with the bus access frequency F obtained this time (step ST04), and if the bus access frequency F has increased compared to the previous time, the occupation time T is set longer than the previous time (step ST05). Conversely, if the bus access frequency has decreased compared to the previous time, the occupation time T is set shorter than the previous time (step ST06). If the bus access frequency F is the same as the previous time, the occupation time T from the previous interrupt is used, and therefore the processes of steps ST05 and ST06 described above are omitted.
[0034] In the processing of step ST04, when the occupancy time T is set, the bus access frequency F obtained in the previous interrupt is used as the threshold value, but the threshold value may be set in advance.
[0035] After the occupancy time T is set, the bus bandwidth throttling program 105 executes occupancy processing for the occupancy time T (step ST07).
[0036] When the occupation process is completed, the bus bandwidth throttling program 105 executes a return process to return the process of the CPU core set 111 to the state before the interrupt (step ST08).
[0037] Note that there may be multiple CPU core sets that execute the bus bandwidth throttling program 105. In this case, the operation shown in Fig. 3 is performed for each CPU core set. The CPU core set that executes the bus bandwidth throttling program 105 is not particularly limited, but since the program that causes the takeover is the communication program 102, the bus bandwidth throttling program 105 is usually also executed in the CPU core set that executes the communication program 102.
[0038] According to the first embodiment, it is possible to prevent the availability of resources from being impaired. More specifically, in a system in which a CPU core set that executes a plurality of programs and a plurality of resources are connected via a bus, a bus bandwidth control device includes: a resource isolation mechanism that is connected to the bus and determines a range of resources that each program can access; a hardware timer that interrupts the CPU core set at a predetermined timing; a shared memory that is one of the resources and has a memory area allocated to each of the plurality of programs by the resource isolation mechanism; and a bus bandwidth throttling program that is executed by the CPU core set and that, when an interrupt occurs, causes an exclusive process for the CPU core set to be executed and, when the exclusive process ends, returns the processing of the CPU core set to the state before the interrupt, the memory area of the shared memory includes a vector table that indicates the process to be executed when an interrupt occurs and a memory area used by the bus bandwidth throttling program, and the resource isolation mechanism permits only the bus bandwidth throttling program to access the hardware timer, the vector table, and the memory area used by the bus bandwidth throttling program. As a result, programs other than the bus bandwidth throttling program cannot access the storage areas used by the hardware timer, vector table, and bus bandwidth throttling program, and therefore programs other than the bus bandwidth throttling program cannot be involved in the execution of the occupancy processing by the bus bandwidth throttling program from the notification of an interrupt by the hardware timer. Therefore, even if a CPU core set is taken over and there is a risk that other programs will perform unintended processing, the occupancy processing by the bus bandwidth throttling program will be reliably performed and will occupy the processing time of the CPU core set. As a result, the use of bus bandwidth by the taken over CPU core set is restricted, and bus bandwidth is secured for other CPU core sets to use resources, preventing a loss of resource availability.
[0039] Second Embodiment. Next, a second embodiment will be described with reference to FIGS. 4 to 6. Components identical or equivalent to those shown in FIGS. 1 to 3 are designated by the same reference numerals, and their description will be omitted. The second embodiment illustrates a case in which a shared memory is accessed via another bus slave, such as when a DMA (Direct Memory Access) controller is present. FIG. 4 is a schematic diagram illustrating a bus bandwidth control device in the second embodiment. The bus bandwidth control device 200 has essentially the same configuration as the bus bandwidth control device 100 described in the first embodiment, except that the system includes a DMA controller 250, and the CPU core set 111 and the CPU core set 112 may issue commands to the shared memory 120 via the DMA controller 250. Therefore, as will be described later, the configuration of the bus bandwidth throttling program 205 differs from that of the bus bandwidth throttling program 105. The DMA controller 250 is connected to the resource isolation mechanism 140 via a dynamically controlled external bus 285.
[0040] 5 is a block diagram showing a bus bandwidth throttling program according to the second embodiment. Similar to the bus bandwidth throttling program 105, the bus bandwidth throttling program 205 is triggered to start operation by an interrupt notification IN from the hardware timer 130. The interrupt notification IN is received by an interrupt reception unit 1112 provided in the CPU core set 111. Upon receiving the interrupt notification IN, the CPU core set 111 references the vector table 121 and executes the bus bandwidth throttling program 205. The processes executed by the bus bandwidth throttling program 205 include a bus access frequency acquisition process 2051 that acquires a bus access frequency F and a bus access instruction frequency FT for the bus to be controlled, an occupation time setting process 1052 that sets an occupation time T, which is the time for executing the occupation process, based on the bus access frequency F, an occupation process 1053 that occupies the processing time of the CPU core set 111 for only the occupation time T, a return process 1059, and a DMA access permission determination process 2054 that permits or prohibits access to the shared memory 120 by the DMA controller 250 based on the bus access instruction frequency FT.
[0041] The bus access frequency acquisition process 2051, similar to the first embodiment, acquires the bus access frequency F for the bus to be controlled, and also acquires a DMA transfer command to the DMA controller 250 by scanning a certain number of commands around the program counter address immediately before the interrupt. The bus access frequency acquisition process 2051 acquires the bus access command frequency FT for the bus to be controlled via the DMA controller 250 from the content of the acquired transfer command. Although the second embodiment describes the case of a DMA controller, the command to be acquired is an command that accesses the bus by operating another bus slave, such as a DMA transfer command. By acquiring the bus access frequency F and the bus access command frequency FT, it is possible to grasp not only the frequency of bus access by the CPU core set 111 but also the frequency of bus access via another bus slave (the DMA controller 250 in the second embodiment), thereby more accurately grasping the bandwidth usage status of the bus to be controlled.
[0042] The occupation time setting process 1052 and the occupation process 1053 are the same as those in the first embodiment.
[0043] The DMA access permission determination process 2054 determines whether the DMA controller 250 is permitted to access the shared memory 120 based on whether the bus access command frequency FT is equal to or greater than a predetermined threshold. If the bus access command frequency FT is equal to or greater than the threshold, the DMA controller 250 is blocked from accessing the shared memory 120. More specifically, the resource isolation mechanism 140 sends setting information CF prohibiting the DMA controller 250 from accessing the shared memory 120 to the resource isolation mechanism 140, and updates the setting information of the resource isolation mechanism 140. The resource isolation mechanism 140 blocks the dynamically controlled external bus 285 to prohibit access to the shared memory 120 by programs other than those holding a preset key ID. If the bus access command frequency FT is less than the threshold, the resource isolation mechanism 140 sends setting information CF to the resource isolation mechanism 140 permitting the DMA controller 250 to access the shared memory 120. If the dynamically controlled external bus 285 is blocked, the resource isolation mechanism 140 unblocks it.
[0044] The disconnection of the dynamic control target external bus 285 is performed in accordance with the occupancy process 1053 in order to ensure the effectiveness of the occupancy process 1053 .
[0045] Next, the operation will be described. Fig. 6 is a flow diagram showing the operation of the bus bandwidth control device, i.e., the bus bandwidth control method, in the second embodiment. First, the processing from step ST01 to step ST06 described in the first embodiment (Fig. 3) is performed (step ST11). That is, the process from the interrupt by the hardware timer 130 to the setting of the occupation time T is the same as in the first embodiment.
[0046] Next, the bus bandwidth throttling program 205 acquires the bus access command frequency FT (step ST12).
[0047] Next, it is determined whether the DMA controller 250 is allowed to access the shared memory 120. As described above, it is determined whether the DMA controller 250 is allowed to access the shared memory 120 based on whether the bus access command frequency FT is equal to or greater than a predetermined threshold. If the bus access command frequency FT is equal to or greater than the predetermined threshold, the setting information of the resource isolation mechanism 140 is updated to block the DMA controller 250 from accessing the shared memory 120. If the bus access command frequency FT is less than the predetermined threshold, the DMA controller 250 is allowed to access the shared memory 120 (Step ST03).
[0048] Next, the bus bandwidth throttling program 205 executes the occupancy process for the occupancy time T (step ST16), and when the occupancy process ends, it performs a restoration process to return the process of the CPU core set 111 to the state before the interrupt (step ST17). Also, if the access to the shared memory 120 by the DMA controller 250 is blocked, the blockage is released.
[0049] According to the second embodiment, the same effects as those of the first embodiment can be obtained. Furthermore, it is possible to more reliably secure bus bandwidth for other CPU core sets to use resources. More specifically, the frequency of bus access commands to the DMA controller for the bus to be controlled is grasped, and whether access by the DMA controller is permitted (permitted or blocked) is determined based on the frequency of the bus access commands. This prevents not only direct bus bandwidth compression by the CPU core set, but also indirect bus bandwidth compression via the bus slave (DMA controller). Therefore, it is possible to more reliably secure bus bandwidth.
[0050] Although various exemplary embodiments and examples are described in this application, the various features, aspects, and functions described in one or more embodiments are not limited to the application of a particular embodiment, but may be applied to the embodiments alone or in various combinations. Therefore, countless modifications not illustrated are contemplated within the scope of the technology disclosed in this application. For example, this includes cases where at least one component is modified, added, or omitted, or where at least one component is extracted and combined with components of another embodiment.
[0051] 100, 200 bus bandwidth control device, 101, 109 program, 102 communication program, 105, 205 bus bandwidth suppression program, 111, 112 CPU core set, 120 shared memory, 121 vector table, 122 storage area, 130 hardware timer, 140 resource separation mechanism, 181 controlled system bus, 182 non-controlled system bus, 183 controlled external bus, 184 non-controlled external bus, 190 non-controlled resource, 250 DMA controller, 285 dynamically controlled external bus, 1111 register, 1112 interrupt acceptance unit, 1051, 2051 bus access frequency acquisition processing, 1052 occupation time setting processing, 1053 occupation processing, 1059 return processing, 2054 DMA access permission determination processing, CF setting information, F bus access frequency, FT bus access command frequency, IN Interrupt notification, R register contents, T occupied time, TN interrupt time
Claims
1. 1. A bus bandwidth control device for controlling a bandwidth of a bus used by a plurality of programs in a system in which a CPU core set for executing a plurality of programs and a plurality of resources are connected via a bus, comprising: a resource isolation mechanism connected to the bus and determining a range of the resources that each of the programs can access; a hardware timer that interrupts the CPU core set at a predetermined timing; a shared memory, which is one of the resources and has a storage area allocated to each of the plurality of programs by the resource isolation mechanism; a bus bandwidth throttling program which is executed by the CPU core set, and which, when the interrupt occurs, causes an exclusive process to be executed for the CPU core set, and which, when the exclusive process ends, returns the process of the CPU core set to a state before the interrupt; the storage area includes a vector table indicating a process to be executed when the interrupt occurs, and a storage area used by the bus bandwidth throttling program; A bus bandwidth control device, characterized in that the resource isolation mechanism permits access to the hardware timer, the vector table, and an area used by the bus bandwidth throttling program only to the bus bandwidth throttling program.
2. The bus bandwidth throttling program a bus access frequency acquisition process for acquiring a content of a register of the CPU core set and acquiring a bus access frequency to the bus from the content of the register; 2. The bus bandwidth control device according to claim 1, further comprising an occupancy time setting process for setting an occupancy time for said occupancy process based on said bus access frequency.
3. When there is a bus slave that accesses the resource by an instruction of the CPU core set, the bus bandwidth throttling program 3. A bus bandwidth control device as described in claim 2, which executes a process of acquiring a frequency of bus access commands to the bus slave, a process of determining whether the frequency of the bus access commands is equal to or greater than a predetermined threshold, and a process of causing the resource isolation mechanism to block access from the bus slave to the resource in accordance with the occupancy process if the frequency of the bus access commands is equal to or greater than the predetermined threshold.
4. 3. The bus bandwidth control device according to claim 2, wherein the bus access frequency acquisition process includes a process of acquiring the bus access frequency based on a load instruction and a store instruction included in the contents of the register.
5. 3. A bus bandwidth control device as described in claim 2, wherein the bus access frequency acquisition process includes a process of acquiring the bus access frequency based on the ratio of load instructions and store instructions among a certain number of instructions centered on the program counter address when the interrupt occurs.
6. 6. The bus bandwidth control device according to claim 1, wherein the bus bandwidth throttling program adjusts the frequency of the interrupts within a certain period of time.
7. 6. The bus bandwidth control device according to claim 2, wherein the occupancy time setting process includes a process of setting the occupancy time in proportion to the bus access frequency.
8. 6. The bus bandwidth control device according to claim 2, wherein the occupancy time setting process includes a process of setting the occupancy time depending on whether the bus access frequency is equal to or greater than a predetermined threshold value.
9. A bus bandwidth control device as described in any one of claims 1 to 5. When there is another CPU core set in the system, the bandwidth of the bus is controlled by treating the program executed by the CPU core set as the control object, and the program executed by the other CPU core set is not controlled.
10. 1. A bus bandwidth control method for controlling a bandwidth of a bus used by a plurality of programs in a system in which a CPU core set for executing a plurality of programs and a plurality of resources are connected via a bus, comprising: A step of causing a hardware timer to interrupt the CPU core set at a predetermined timing; executing an occupation process for the CPU core set when the interrupt occurs; when the occupation process is completed, returning the process of the CPU core set to a state before the interrupt; a storage area of a shared memory that is one of the resources includes a vector table that indicates a process to be executed when the interrupt occurs, and a storage area used by a bus bandwidth throttling program that executes the occupancy process; A bus bandwidth control method, characterized in that access to the hardware timer, the vector table, and the memory area used by the bus bandwidth suppression program is permitted only to the bus bandwidth suppression program.
11. acquiring a content of a register of the CPU core set when the interrupt occurs, and acquiring a bus access frequency to the bus from the content of the register; 11. The bus bandwidth control method according to claim 10, further comprising the step of: setting an occupation time for said occupancy process based on said bus access frequency.
12. When there is a bus slave that accesses the resource by an instruction of the CPU core set, obtaining a frequency of bus access commands to the bus slave when the interrupt occurs; determining whether a frequency of the bus access command is equal to or greater than a predetermined threshold; 12. The bus bandwidth control method according to claim 11, further comprising the step of blocking access from the bus slave to the resource in accordance with the occupancy process when a frequency of the bus access command is equal to or greater than the predetermined threshold value.
13. 12. The bus bandwidth control method according to claim 11, wherein in the step of acquiring the bus access frequency, the bus access frequency is acquired based on a load instruction and a store instruction included in the contents of the register.
14. 12. A bus bandwidth control method as described in claim 11, wherein in the step of acquiring the bus access frequency, the bus access frequency is acquired based on the ratio of load instructions and store instructions among a certain number of instructions centered on the program counter address at the time the interrupt was generated.
15. 15. The bus bandwidth control method according to claim 10, further comprising the step of adjusting a frequency of the interrupt within a certain period of time.
16. 15. The bus bandwidth control method according to claim 11, wherein in the step of setting the occupancy time, the occupancy time is set in proportion to the bus access frequency.
17. 15. The bus bandwidth control method according to claim 11, wherein in the step of setting the occupancy time, the occupancy time is set depending on whether the bus access frequency is equal to or higher than a predetermined threshold value.
18. A bus bandwidth control method according to any one of claims 10 to 14, wherein when there is another CPU core set in the system, the bandwidth of the bus is controlled with only the program executed by the CPU core set as the control object, and the program executed by the other CPU core set is not controlled.
