Hotspot function locating method, apparatus and navigation receiver for system on chip
By capturing memory read events in real time through the internal monitoring circuit of the system-on-a-chip, counting the access frequency, selecting the high-frequency address range and migrating it to fast memory, the problem of slow execution of hotspot functions in navigation receivers is solved, improving processor performance and reducing power consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGSHA HAIGE BEIDOU INFORMATION TECH CO LTD
- Filing Date
- 2026-05-20
- Publication Date
- 2026-06-16
AI Technical Summary
Existing technologies result in slow execution of hotspot functions in navigation receivers, leading to high processor load and power consumption. Furthermore, traditional software detection methods are prone to errors and are intrusive, affecting function execution timing.
By using the monitoring circuitry inside the system-on-a-chip to capture memory read events of the processor core accessing the on-chip shared memory in real time, recording the memory address sequence, counting the access frequency, selecting the high-frequency address range, and migrating it to fast memory, hotspot function location can be achieved.
It achieves accurate location and migration of hotspot functions, improves processor performance, reduces power consumption, and does not affect function execution timing.
Smart Images

Figure CN122220186A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and specifically to a method, apparatus, and navigation receiver for locating hotspot functions in a system-on-a-chip. Background Technology
[0002] In navigation receivers, hotspot functions often execute slowly, impacting chip performance. If a hotspot function resides in external memory, its frequent and slow execution leads to a consistently high processor load and significant power consumption. Traditional software profiler tools identify hotspot functions by inserting probes or hook functions into the target program to collect data such as the number of executions and execution time. However, this method has significant errors and is intrusive, altering the function execution timing. Therefore, a hotspot function localization scheme that does not affect the function execution timing is needed. Summary of the Invention
[0003] The purpose of this application is to provide a hotspot function localization method, apparatus, and navigation receiver for system-on-a-chip.
[0004] To achieve the above objectives, the first aspect of this application provides a method for hotspot function localization in a system-on-a-chip, comprising: The system-on-chip (SoC) uses its internal monitoring circuitry to capture memory read events of the processor core accessing on-chip shared memory in real time, and records the accessed memory address corresponding to the memory read event to obtain the memory address sequence. In response to the periodic sampling signal, the frequency of access to each accessed memory address in the first memory address range by the processor core is counted based on the memory address sequence of the current sampling period. Based on a preset ratio, select the most frequently accessed memory addresses within the first memory address range to obtain the second memory address range; If the total address length of the second memory address range is greater than the memory address length threshold, the second memory address range is used as the new first memory address range, and the accessed memory addresses with higher access frequency are re-determined according to the preset ratio to obtain a new second memory address range, until the total address length of the second memory address range is less than or equal to the memory address length threshold, and the second memory address range is determined as the hot spot function address of the shared memory.
[0005] In this embodiment of the application, the system-on-a-chip further includes fast memory; determining the second memory address range as the hotspot function address of the on-chip shared memory includes: determining the second memory address range as the hotspot function address of the on-chip shared memory; and migrating the hotspot functions in the on-chip shared memory to fast memory according to the hotspot function address.
[0006] In this embodiment, determining the second memory address range as the hotspot function addresses of the on-chip shared memory includes: determining the second memory address range as the hotspot function addresses of the on-chip shared memory and storing the hotspot function addresses in the cache sequence of the monitoring circuit; migrating the hotspot functions in the on-chip shared memory to fast memory according to the hotspot function addresses includes: if the total number of hotspot function addresses in the cache sequence is greater than or equal to the address quantity threshold, migrating the hotspot functions in the on-chip shared memory to fast memory according to each hotspot function address in the cache sequence; if the total number of hotspot function addresses in the cache sequence is less than the address quantity threshold, re-determining the memory address sequence.
[0007] In this embodiment, determining the second memory address range as the hotspot function addresses of the on-chip shared memory and storing the hotspot function addresses in the cache sequence of the monitoring circuit includes: determining the second memory address range as the hotspot function addresses of the on-chip shared memory; storing the hotspot function addresses in the cache sequence of the monitoring circuit; updating the address whitelist according to the hotspot function addresses; and calculating the access frequency of each accessed memory address in the first memory address range by the processor kernel according to the memory address sequence. This includes: deleting the hotspot function addresses included in the address whitelist from the first memory address range to obtain a new first memory address range; and calculating the access frequency of each accessed memory address in the new first memory address range by the processor kernel according to the memory address sequence.
[0008] In this embodiment of the application, when the total number of hot function addresses in the cache sequence is greater than or equal to the address number threshold, migrating the hot functions in the on-chip shared memory to the fast memory according to each hot function address in the cache sequence includes: when the total number of hot function addresses in the cache sequence is greater than or equal to the address number threshold, migrating the hot functions in the on-chip shared memory to the fast memory according to each hot function address in the cache sequence; clearing the cache sequence and re-determining the memory address sequence.
[0009] In this embodiment, the monitoring circuit includes a timer module and a recursive engine. The recursive engine is used to execute a hotspot function location method for a system-on-a-chip. In response to a periodic sampling signal, the frequency of access to each accessed memory address within the first memory address range by the processor kernel is calculated based on the memory address sequence of the current sampling period. This includes the recursive engine calculating the frequency of access to each accessed memory address within the first memory address range by the processor kernel based on the memory address sequence in response to the sampling signal. The sampling signal is sent to the recursive engine when the timer module reaches a preset interval.
[0010] In this embodiment, the preset interval is obtained based on the processor core settings.
[0011] The second aspect of this application provides a hotspot function location device for a system-on-a-chip (SoC), comprising: a SoC including: a processor core, accessing on-chip shared memory via an on-chip bus and a monitoring circuit, the monitoring circuit being disposed between the on-chip bus and the monitoring circuit, and the monitoring circuit being used to execute the hotspot function location method for a SoC as provided in the first aspect of this application.
[0012] In this embodiment, the system-on-a-chip further includes: fast memory, the processor core is connected to the fast memory and the on-chip bus via a bus distribution bridge, the fast memory is used to store hot functions located according to the hot function location method for the system-on-a-chip; and a monitoring circuit is used to determine the first memory address range as the hot function address of the on-chip shared memory, and to migrate the hot function in the on-chip shared memory to the fast memory according to the hot function address.
[0013] In this embodiment, the monitoring circuit includes a timer module and a recursive engine; the recursive engine is used to execute a hotspot function location method for system-on-a-chip; the timer module is used to send sampling signals to the recursive engine.
[0014] A third aspect of this application provides a navigation receiver, comprising: a hotspot function positioning device for a system-on-a-chip provided in the second aspect of this application, wherein the processor core of the hotspot function positioning device is used to execute a satellite navigation positioning program.
[0015] Through the above technical solution, the hotspot function localization method for system-on-a-chip (SoC) provided in this application embodiment can capture memory read events of the processor core accessing on-chip shared memory in real time based on the monitoring circuit set inside the SoC, and record the accessed memory addresses corresponding to the memory read events to obtain a memory address sequence. Therefore, the access frequency of each accessed memory address within a first memory address range can be determined based on the memory address sequence; by selecting the accessed memory addresses with higher access frequency within the first memory address range according to a preset ratio, a second memory address range is obtained. If the total address length of the second memory address range is greater than a memory address length threshold, the second memory address range is used as the first memory address range, and a new second memory address range is obtained by continuously selecting the accessed memory addresses with higher access frequency based on a preset ratio. By repeatedly selecting from the above loop until the total address length of the second memory address range is less than or equal to the memory address length threshold, the second memory address range is determined as the hot spot function address of the shared memory. The above process is implemented by monitoring memory read events through the monitoring circuit inside the system-on-a-chip. It does not require intrusion into the program executed by the processor kernel, nor does it change the function execution timing. It also achieves the location of hot spot functions during their execution, and users can then optimize and use the located hot spot functions in a targeted manner.
[0016] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings: Figure 1 The illustration shows a flowchart of a hotspot function location method for a system-on-a-chip according to an embodiment of this application; Figure 2 The illustration shows a flowchart of another hotspot function location method for a system-on-a-chip according to an embodiment of this application; Figure 3 A schematic block diagram of a hotspot function location device for a system-on-a-chip according to an embodiment of this application is shown.
[0018] Explanation of reference numerals in the attached figures 302 Processor Core; 304 On-Chip Bus; 306 Monitoring Circuit; 308 Memory; 310 Fast Memory; 312 First Bus Distribution Bridge; 314 Second Bus Distribution Bridge. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0020] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0021] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0022] The acquisition, transmission, storage, use, and processing of data in this application comply with relevant laws and regulations. Furthermore, it should be noted that certain software, components, models, and other existing industry solutions may be mentioned in the embodiments of this application. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0023] Existing hotspot function detection methods, such as Profiler tools, detect hotspot functions in an intrusive manner by inserting probes and hook functions into the target program, thus altering the function execution sequence. While some static analysis tools can predict potential performance bottleneck functions based on code syntax, structure, and coding standards through static scanning, independent of the program's actual runtime state, they cannot capture the execution of dynamic hotspot functions and can only perform static analysis of coding standards. To achieve hotspot function localization, this application provides a hotspot function localization method for system-on-a-chip (SoC). This method uses monitoring circuitry within the SoC to capture memory read events from the SoC's processor core accessing shared memory in real time, obtaining a memory address sequence based on the memory addresses corresponding to these read events. The hotspot function address is then obtained through statistical analysis and processing of this memory address sequence, thereby determining the hotspot function address during its execution.
[0024] Figure 1 A schematic flowchart illustrating a hotspot function localization method for a system-on-a-chip according to an embodiment of this application is shown. Figure 1 As shown in one embodiment of this application, a method for locating hotspot functions in a system-on-a-chip is provided. This method includes the following steps: S102. Through the monitoring circuit inside the system-on-a-chip, the memory read events of the processor core of the system-on-a-chip accessing the on-chip shared memory are captured in real time, and the memory address accessed corresponding to the memory read event is recorded to obtain the memory address sequence.
[0025] Understandably, a system-on-a-chip (SoC) is a chip that integrates multiple functional modules. A SoC may include a processor core, on-chip shared memory, and monitoring circuitry.
[0026] S104. In response to the periodic sampling signal, the frequency of access to each accessed memory address in the first memory address range by the processor core is counted according to the memory address sequence of the current sampling period.
[0027] Specifically, the first memory address range, when counting the access frequency of each accessed memory address within the first memory address range in response to the sampling signal, can refer to the entire address range of the on-chip shared memory, or it can be a specific address range of the on-chip shared memory that has been specified in advance.
[0028] S106. Select the most frequently accessed memory addresses within the first memory address range according to a preset ratio to obtain the second memory address range.
[0029] Specifically, the preset ratio can be, for example, 50%. As an example, when the preset ratio is 50%, the above steps are equivalent to selecting the top 50% of the most frequently accessed memory addresses.
[0030] S108. If the total address length of the second memory address range is greater than the memory address length threshold, the second memory address range is used as the new first memory address range, and the accessed memory addresses with higher access frequency are re-determined according to the preset ratio to obtain a new second memory address range, until the total address length of the second memory address range is less than or equal to the memory address length threshold, and the second memory address range is determined as the hot spot function address of the shared memory.
[0031] Specifically, the memory address length threshold represents the address length of the smallest location unit, which can be, for example, 256B.
[0032] The hotspot function localization method for system-on-a-chip (SoC) provided in this application captures memory read events of the processor core accessing on-chip shared memory in real time through a monitoring circuit set inside the SoC, and records the accessed memory addresses corresponding to the memory read events to obtain a memory address sequence. Based on the memory address sequence, the access frequency of each accessed memory address within a first memory address range can be determined. A second memory address range is obtained by selecting frequently accessed memory addresses within the first memory address range using a preset ratio. If the total address length of the second memory address range is greater than a memory address length threshold, the second memory address range is used as the first memory address range, and frequently accessed memory addresses are continuously selected based on a preset ratio to obtain a new second memory address range. Through this iterative selection, the total address length of the second memory address range is less than or equal to the memory address length threshold, thereby determining the second memory address range as the hotspot function address of the shared memory. The above process is implemented by monitoring memory read events through the monitoring circuit inside the system-on-a-chip. It does not require intrusion into the program executed by the processor core, nor does it change the function execution sequence. It also enables the location of hot functions during their execution, allowing users to then optimize and use the located hot functions in a targeted manner.
[0033] In some embodiments of this application, the system-on-a-chip further includes fast memory, and the processor core connects the fast memory and the on-chip bus via a bus distribution bridge. Step S108, determining the second memory address range as the hotspot function address of the on-chip shared memory, may include: determining the second memory address range as the hotspot function address of the on-chip shared memory; and migrating the hotspot functions in the on-chip shared memory to the fast memory based on the hotspot function addresses.
[0034] The system-on-a-chip (SoC) also includes fast memory, enabling the processor core to quickly fetch instructions from it. The steps described above can migrate hot functions from on-chip shared memory to fast memory based on identified hot function addresses. This allows the processor core to quickly access hot functions via fast memory, thus improving processor core performance. Specifically, fast memory can be tightly coupled memory or core-coupled memory.
[0035] See Figure 2 In some embodiments of this application, determining the second memory address range as the hotspot function addresses of on-chip shared memory includes: S202. Determine the second memory address range as the hotspot function address of the on-chip shared memory, and store the hotspot function address into the cache sequence of the monitoring circuit; Migrating hot functions from on-chip shared memory to fast memory based on their addresses can include: S204. If the total number of hot function addresses in the cache sequence is greater than or equal to the address number threshold, the hot functions in the on-chip shared memory are migrated to fast memory according to the hot function addresses in the cache sequence. If the total number of hot function addresses in the cache sequence is less than the address number threshold, the memory address sequence is redefined.
[0036] In the above embodiments, the hotspot function location method for system-on-a-chip can identify multiple hotspot functions, record the hotspot function addresses of multiple hotspot functions through the cache sequence of the monitoring circuit, and when the total number of hotspot function addresses in the cache sequence is greater than or equal to the address number threshold, migrate the hotspot functions in the on-chip shared memory to the fast memory according to the hotspot function addresses in the cache sequence, thereby enabling multiple hotspot functions in the on-chip shared memory to be migrated to the fast memory.
[0037] In some embodiments of this application, step S202 may include: determining the second memory address range as the hotspot function addresses of the on-chip shared memory; storing the hotspot function addresses in the cache sequence of the monitoring circuit; and updating the address whitelist according to the hotspot function addresses. Step S104, which involves calculating the access frequency of each accessed memory address in the first memory address range based on the memory address sequence, may include: deleting the hotspot function addresses included in the address whitelist from the first memory address range to obtain a new first memory address range; and calculating the access frequency of each accessed memory address in the new first memory address range based on the memory address sequence.
[0038] In the above embodiments, a whitelist of addresses can be used to record the addresses of hot functions that have already been located. After deleting the hot function addresses included in the address whitelist from the first memory address range to obtain a new first memory address range, the access frequency of each accessed memory address by the processor kernel is counted based on the new first memory address range. This avoids repeated location of hot function addresses that have already been located, ensuring that multiple hot function addresses in the cache sequence are different hot function addresses.
[0039] In some embodiments of this application, the hotspot function localization method for system-on-a-chip can repeatedly filter multiple hotspot functions based on a cache sequence and migrate them to fast memory. Step S204 may include, if the total number of hotspot function addresses in the cache sequence is greater than or equal to an address number threshold, migrating the hotspot functions in the on-chip shared memory to fast memory according to the addresses of each hotspot function in the cache sequence; clearing the cache sequence; and re-determining the memory address sequence.
[0040] In some embodiments of this application, the monitoring circuit includes a timer module and a recursive engine. The recursive engine is used to execute a hotspot function location method for a system-on-a-chip. Step S104 may include: the recursive engine responding to the sampling signal and counting the access frequency of each accessed memory address in the first memory address range by the processor kernel according to the memory address sequence. The sampling signal is sent to the recursive engine when the timer module counts the time to a preset interval.
[0041] In some embodiments of this application, the preset interval is obtained based on processor core settings.
[0042] like Figure 3 As shown, this application embodiment also provides a hotspot function location device for a system-on-a-chip, including: a system-on-a-chip, the system-on-a-chip including: a processor core 302, the processor core 302 accesses on-chip shared memory 308 through an on-chip bus 304 and a monitoring circuit 306, the monitoring circuit 306 is disposed between the on-chip bus 304 and the monitoring circuit 306, the monitoring circuit 306 is used to execute the hotspot function location method for a system-on-a-chip provided in this application embodiment.
[0043] In some embodiments of this application, the system-on-a-chip further includes: fast memory 310. The processor core 302 connects the fast memory 310 and the on-chip bus 304 via a bus distribution bridge. The fast memory 310 is used to store hotspot functions located according to a hotspot function location method for the system-on-a-chip. A monitoring circuit 306 is used to determine a first memory address range as the hotspot function address of the on-chip shared memory 308, and to migrate the hotspot functions in the on-chip shared memory 308 to the fast memory 310 based on the hotspot function addresses.
[0044] like Figure 3 As shown, specifically, the bus distribution bridge may include a first bus distribution bridge 312 and a second bus distribution bridge 314. The first bus distribution bridge 312 may correspond to the instruction bus of the processor core 302, and the second bus distribution bridge 314 may correspond to the data bus of the processor core 302.
[0045] In some embodiments of this application, the monitoring circuit includes a timer module and a recursive engine; the recursive engine is used to execute a hotspot function location method for a system-on-a-chip; and the timer module is used to send sampling signals to the recursive engine.
[0046] As an example, the monitoring circuit in the hotspot function location device for system-on-a-chip provided in this application embodiment is directly connected to the interface of the on-chip shared memory, which may be a SARM.
[0047] The following is an exemplary description of the hotspot function localization process performed by the hotspot function localization method for system-on-a-chip provided in the embodiments of this application: Step 1: System initialization. Configure the monitoring range of the SRAM port monitoring circuit (by default, it covers the entire memory address space of the chip), the timer sampling interval (by default, 100ms), and clear the cache queue.
[0048] Step 2: Memory Access Monitoring. The SRAM port monitoring circuit captures memory read events of the processor core in real time, filters out whitelisted address data, and stores the valid access addresses in a temporary register to obtain the memory address sequence.
[0049] Step 3: Recursive Segmentation and Positioning. When the timer triggers the sampling signal, the recursive engine reads the access data from the temporary register and performs recursive segmentation according to the following logic: First sampling: Count the frequency of address access in the initial 1MB range, and select the top 50% of the address ranges by frequency as the next monitoring target (narrowed down to 512KB). The nth sampling: Based on the previous high-frequency address range, continue to divide into two to 2^(10-n)KB, until the range is reduced to 256B; After each segmentation, the 256B high-frequency address unit is added to the whitelist to ensure that subsequent sampling focuses on hotspot areas.
[0050] Step 4: Hotspot Data Output. After the recursive engine completes the filtering of the first 16 hotspot addresses, it writes the hotspot address (accurate to 256B), access frequency (unit: times / sampling interval), and other data into the cache queue, and triggers an interrupt to notify the processor kernel.
[0051] Step 5: Hotspot Function Optimization and Migration. After locating specific functions based on the output hotspot addresses, users can optimize those functions accordingly. Alternatively, hotspot functions can be migrated to fast memory (such as tightly coupled memory (TCM) / kernel coupled memory (CCM) or other zero-wait memory) using compilation scripts.
[0052] This application also provides a navigation receiver, including the hotspot function positioning device for system-on-a-chip described above, wherein the processor core of the hotspot function positioning device is used to execute a satellite navigation positioning program.
[0053] In summary, the embodiments of this application implement a hardware-based hotspot function localization method for system-on-a-chip by setting a monitoring circuit in the system-on-a-chip. This method enables non-intrusive performance optimization of the chip, accurately locates hotspot functions through instruction flow monitoring and recursive segmentation, migrates hotspot functions to fast memory, achieves a performance improvement of more than 40%, and achieves low-cost hotspot function localization without the need for ARM Trace.
[0054] It should be understood that the steps in the flowchart provided in this application are shown sequentially according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0055] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0057] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0058] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0059] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0060] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0061] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0062] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for locating hotspot functions in a system-on-a-chip (SoC), characterized in that, The method includes: The system-on-chip (SoC) uses its internal monitoring circuitry to capture memory read events of the processor core accessing the on-chip shared memory in real time, and records the accessed memory address corresponding to the memory read event to obtain a memory address sequence. In response to the periodic sampling signal, the frequency of access to each of the accessed memory addresses in the first memory address range by the processor core is counted based on the memory address sequence of the current sampling period. Based on a preset ratio, select the most frequently accessed memory addresses from the first memory address range to obtain the second memory address range; If the total address length of the second memory address range is greater than the memory address length threshold, the second memory address range is used as the new first memory address range, and the accessed memory addresses with higher access frequency are re-determined according to the preset ratio to obtain a new second memory address range, until the total address length of the second memory address range is less than or equal to the memory address length threshold, and the second memory address range is determined as the hot spot function address of the shared memory.
2. The hotspot function location method according to claim 1, characterized in that, The system-on-a-chip also includes fast memory; The step of determining the second memory address range as the hotspot function address of the on-chip shared memory includes: The second memory address range is determined as the hotspot function address of the on-chip shared memory; Based on the hotspot function addresses, the hotspot functions in the on-chip shared memory are migrated to the fast memory.
3. The hotspot function location method according to claim 2, characterized in that, The step of determining the second memory address range as the hotspot function address of the on-chip shared memory includes: The second memory address range is determined as the hot spot function address of the on-chip shared memory, and the hot spot function address is stored in the cache sequence of the monitoring circuit; The step of migrating the hot functions in the on-chip shared memory to the fast memory according to the hot function addresses includes: If the total number of hot function addresses in the cache sequence is greater than or equal to the address number threshold, the hot functions in the on-chip shared memory are migrated to the fast memory according to the hot function addresses in the cache sequence. If the total number of hot function addresses in the cache sequence is less than the address number threshold, the memory address sequence is redefined.
4. The hotspot function location method according to claim 3, characterized in that, The step of determining the second memory address range as the hotspot function address of the on-chip shared memory and storing the hotspot function address into the cache sequence of the monitoring circuit includes: The second memory address range is determined as the hotspot function address of the on-chip shared memory; The hotspot function addresses are stored in the cache sequence of the monitoring circuit; Update the address whitelist based on the hotspot function addresses; The step of calculating the frequency of access to each of the accessed memory addresses within the first memory address range by the processor core based on the memory address sequence includes: Remove the hot function addresses included in the address whitelist from the first memory address range to obtain a new first memory address range; The frequency of access to each of the accessed memory addresses within the new first memory address range is calculated based on the memory address sequence.
5. The hotspot function location method according to claim 3, characterized in that, When the total number of hot function addresses in the cache sequence is greater than or equal to the address number threshold, migrating the hot functions in the on-chip shared memory to the fast memory according to each hot function address in the cache sequence includes: If the total number of hot function addresses in the cache sequence is greater than or equal to the address number threshold, the hot functions in the on-chip shared memory are migrated to the fast memory according to the hot function addresses in the cache sequence. Clear the cache sequence and redetermine the memory address sequence.
6. The hotspot function location method according to claim 1, characterized in that, The monitoring circuit includes a timer module and a recursive engine. The recursive engine is used to execute the hotspot function location method for system-on-a-chip. The method of responding to periodic sampling signals and calculating the frequency of accesses of the processor core to each accessed memory address within a first memory address range based on the memory address sequence of the current sampling period includes: The recursive engine responds to the sampling signal by counting the frequency of access to each of the accessed memory addresses in the first memory address range by the processor core according to the memory address sequence. The sampling signal is sent to the recursive engine when the timer module reaches a preset interval.
7. The hotspot function location method according to claim 6, characterized in that, The preset interval is obtained based on the processor core settings.
8. A hotspot function location device for a system-on-a-chip, characterized in that, include: System-on-a-chip, the system-on-a-chip comprising: The processor core accesses on-chip shared memory via an on-chip bus and a monitoring circuit, wherein the monitoring circuit is disposed between the on-chip bus and the monitoring circuit, and the monitoring circuit is used to execute the hotspot function location method for a system-on-a-chip as described in any one of claims 1-7.
9. The hotspot function location device according to claim 8, characterized in that, The system-on-a-chip also includes: The processor core connects the fast memory and the on-chip bus via a bus distribution bridge. The fast memory is used to store hotspot functions located according to the hotspot function location method for system-on-a-chip. The monitoring circuit is used to determine the first memory address range as the hotspot function address of the on-chip shared memory, and to migrate the hotspot function in the on-chip shared memory to the fast memory according to the hotspot function address.
10. The hotspot function location device according to claim 8, characterized in that, The monitoring circuit is equipped with a timer module and a recursive engine; The recursive engine is used to execute the hotspot function location method for system-on-a-chip. The timer module is used to send the sampling signal to the recursive engine.
11. A navigation receiver, characterized in that, include: The hotspot function localization device for a system-on-a-chip as described in any one of claims 8-10, wherein the processor core of the hotspot function localization device is used to execute a satellite navigation and positioning program.