Memory management device, method, chip, and electronic device

By introducing a request broadcast module, a synchronization module and a cache module into the memory management device, multiple judgment units can simultaneously judge cache hits, solving the problems in the prior art of long cache hit judgment delays and low utilization of the lowest-level cache, and improving Improves the response efficiency and system performance of the memory management device.

CN118193411BActive Publication Date: 2024-10-15MOORE THREADS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410605447.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-10-15
Estimated Expiration
2044-05-15

AI Technical Summary

Technical Problem

In the existing memory management unit (MMU), in the multi-level cache structure, the cache hit situation must be determined serially, which leads to increased latency, reduces the response efficiency and performance of address mapping requests, and the utilization rate of the lowest level cache is low, limiting improve system performance.

Method used

Design a memory management device, including a request broadcast module, a synchronization module and a cache module. It uses multiple judgment units to simultaneously judge the hit status of multiple cache units, and freely selects the first cache unit for query to avoid that the lowest level cache must be the first. Query restrictions improve the flexibility and utilization of cache units.

Benefits of technology

The physical address query delay is reduced, the response efficiency and system performance of the memory management device to address mapping requests are improved, and the utilization rate of the memory management device is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118193411B_ABST
    Figure CN118193411B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of storage technology, and proposes a memory management device, method, chip, and electronic device. The memory management device includes a request broadcast module, a synchronization module, a judgment module, and a cache module. The request broadcast module receives an address mapping request and broadcasts it to an enabled judgment unit in the judgment module; the enabled judgment unit judges whether the address mapping request hits the enabled cache unit corresponding to the cache module, and outputs the judgment result to the synchronization module; the synchronization module determines the first cache unit to be queried based on the judgment result, and the cache module queries one or more enabled cache units with the first cache unit as the query starting point, determines the physical address corresponding to the address mapping request, and outputs it. The memory management device can improve the response efficiency of the memory management device to the address mapping request, improve the utilization rate of the memory management device, and thus improve the performance of the system or chip where the memory management device is located.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of storage technology, and in particular to a memory management device, method, chip, and electronic device. Background Art

[0002] The Memory Management Unit (MMU) is a computer hardware that is responsible for processing the address mapping request of the Central Processing Unit (CPU). The MMU can respond to the address mapping request and return the physical address corresponding to the virtual address included in the address mapping request.

[0003] When the MMU responds to an address mapping request, it needs to perform address retrieval in the off-chip physical address storage module. In order to reduce the complexity of address retrieval, the prior art introduces a multi-level page table solution at the software level. Each level of the page table corresponds to an address space of different granularities on the off-chip physical address storage module. The address space granularity corresponding to the low-level page table is small, and the address space granularity corresponding to the high-level page table is large. At the hardware level, the prior art designs the MMU as a multi-level cache structure, and each level of cache corresponds to a first-level page table. When the MMU of the prior art responds to a certain address mapping request, it sequentially determines the hit situation of the request to the cache at each level, and then determines the cache to be queried based on the hit situation. The hit situation of the multi-level cache must be judged serially. When the number of cache levels is large, the delay caused by judging the hit situation accumulates a lot, reducing the response efficiency of the MMU to the address mapping request and reducing the performance of the MMU. And the cache that is queried first must be the lowest level cache. Whether the lowest level cache can store more address mapping requests directly limits whether the MMU can respond to new address mapping requests, resulting in reduced utilization of the MMU. Summary of the invention

[0004] In view of this, the present disclosure proposes a memory management device, method, chip, and electronic device. The memory management device can simultaneously determine the hit status of an address mapping request to multiple cache units, greatly reducing the delay and improving the efficiency of the memory management device in responding to address mapping requests; and it is no longer restricted that the lowest-level cache unit must be queried first, so whether the lowest-level cache unit can store more address mapping requests, and whether the memory management device can continue to respond to new address mapping requests is reduced. The utilization rate of the memory management device can be improved, and the performance of the system or chip where the memory management device is located can be improved.

[0005] According to one aspect of the present disclosure, a memory management device is provided, including a request broadcast module, a synchronization module, a judgment module and a cache module, the judgment module including multiple judgment units, the cache module including multiple cache units corresponding to the multiple judgment units respectively, the request broadcast module is used to receive an address mapping request and broadcast it to an enabled judgment unit; the enabled judgment unit is used to judge whether the address mapping request hits the corresponding enabled cache unit, and output the judgment result to the synchronization module; the synchronization module is used to determine the first cache unit queried according to the address mapping request based on all judgment results obtained by each enabled judgment unit for the address mapping request, and output the judgment result indicating whether the address mapping request hits the first cache unit to the cache module; the cache module is used to query one or more enabled cache units in the cache module with the first cache unit as the query starting point according to the received judgment result, determine the physical address corresponding to the address mapping request and output it.

[0006] In a possible implementation, the one or more enabled cache units include the first cache unit and other cache units whose query order is lower than that of the first cache unit among the enabled cache units.

[0007] In one possible implementation, each cache unit includes a request allocation subunit, which is also used to store at least one historical address mapping request received in its own storage area; the enabled judgment unit is specifically used to query the historical address mapping request stored in the storage area of ​​the corresponding enabled cache unit according to the address mapping request, and judge whether the address mapping request hits the corresponding enabled cache unit according to the query result; the request allocation subunit is used to update the historical address mapping request stored in the cache unit when receiving a judgment result indicating that the address mapping request does not hit.

[0008] In one possible implementation, the synchronization module is specifically used to, when the address mapping request hits at least one enabled cache unit, use the cache unit with the lowest query order among the hit cache units as the first cache unit; when the address mapping request does not hit any enabled cache unit, use the cache unit with the highest query order among the enabled cache units as the first cache unit.

[0009] In one possible implementation, the synchronization module is specifically used to output to the first cache unit the judgment result indicating whether the address mapping request hits the first cache unit; the first cache unit is used to obtain the physical address according to the received judgment result, wherein when the judgment result indicates a hit, the physical address is obtained from the storage area of ​​the first cache unit itself, and when the judgment result indicates a miss, the physical address is obtained from an off-chip physical address storage module; when there are other cache units with a lower query order than the first cache unit in the enabled cache units, the first cache unit outputs the physical address and the address mapping request to the second cache unit, and the query order of the second cache unit in the enabled cache units is second only to the first cache unit; when the first cache unit is the cache unit with the lowest query order among the enabled cache units, the first cache unit outputs the physical address as the physical address corresponding to the address mapping request.

[0010] In one possible implementation, among the enabled cache units, a first physical address is stored in the cache unit with the highest query order, and the first physical address is the physical address of the cache unit with the highest query order itself. The first cache unit is specifically used to access an off-chip physical address storage module according to the first physical address to obtain the physical address when the judgment result indicates a miss.

[0011] In one possible implementation, any one of the cache units is further used to, when receiving a physical address and an address mapping request from other cache units, access an off-chip physical address storage module according to the received physical address to obtain the physical address; when there are other cache units with a lower query order than any one of the cache units among the enabled cache units, the any one of the cache units will output the obtained physical address and the address mapping request to the cache unit among the enabled cache units whose query order is second only to the any one of the cache units; when the any one of the cache units is the cache unit with the lowest query order among the enabled cache units, the any one of the cache units will output the obtained physical address as the physical address corresponding to the address mapping request.

[0012] In one possible implementation, each cache unit corresponds to a first identifier, which indicates the current physical address storage capacity of the corresponding cache unit. Any cache unit is also used to, when the first identifier corresponding to itself is less than a first threshold, receive a judgment result indicating a miss or receive a physical address from other cache units, increase its corresponding first identifier by one; after obtaining the physical address from an off-chip physical address storage module, store the obtained physical address in its own storage area, and reduce its corresponding first identifier by one.

[0013] According to another aspect of the present disclosure, a chip is provided, comprising the memory management device described above.

[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising the chip mentioned above and an off-chip physical address storage module.

[0015] According to another aspect of the present disclosure, a memory management method is provided, which is applied to a memory management device, wherein the memory management device includes a request broadcast module, a synchronization module, a judgment module and a cache module, wherein the judgment module includes multiple judgment units, and the cache module includes multiple cache units corresponding to the multiple judgment units, respectively. The method includes: the request broadcast module receives an address mapping request and broadcasts it to an enabled judgment unit; the enabled judgment unit judges whether the address mapping request hits the corresponding enabled cache unit, and outputs the judgment result to the synchronization module; the synchronization module determines a first cache unit to be queried according to the address mapping request based on the judgment results obtained by each enabled judgment unit for the address mapping request, and outputs a judgment result indicating whether the address mapping request hits the first cache unit to the cache module; the cache module queries one or more enabled cache units in the cache module based on the received judgment result, taking the first cache unit as the query starting point, determines the physical address corresponding to the address mapping request, and outputs it.

[0016] In a possible implementation, the one or more enabled cache units include the first cache unit and other cache units whose query order is lower than that of the first cache unit among the enabled cache units.

[0017] In one possible implementation, each cache unit includes a request allocation subunit, and the method further includes: the cache unit stores at least one historical address mapping request that has been received in its own storage area; when the request allocation subunit receives a judgment result indicating that the address mapping request does not hit, the historical address mapping request stored in the cache unit is updated; and the judgment of whether the address mapping request hits the corresponding enabled cache unit includes: querying the historical address mapping request stored in the storage area of ​​the corresponding enabled cache unit according to the address mapping request, and judging whether the address mapping request hits the corresponding enabled cache unit according to the query result.

[0018] In a possible implementation, the first cache unit to be queried according to the address mapping request is determined based on all judgment results obtained by each enabled judgment unit for the address mapping request, including: when the address mapping request hits at least one enabled cache unit, the cache unit with the lowest query order among the hit cache units is used as the first cache unit; when the address mapping request does not hit any enabled cache unit, the cache unit with the highest query order among the enabled cache units is used as the first cache unit.

[0019] In a possible implementation, the outputting to the cache module a judgment result indicating whether the address mapping request hits the first cache unit includes: outputting to the first cache unit a judgment result indicating whether the address mapping request hits the first cache unit;

[0020] The method of querying one or more enabled cache units in the cache module based on the received judgment result and taking the first cache unit as the query starting point to determine and output the physical address corresponding to the address mapping request includes: the first cache unit obtains the physical address based on the received judgment result, wherein when the judgment result indicates a hit, the physical address is obtained from the storage area of ​​the first cache unit itself, and when the judgment result indicates a miss, the physical address is obtained from the off-chip physical address storage module; when there are other cache units with a lower query order than the first cache unit in the enabled cache units, the first cache unit outputs the physical address and the address mapping request to the second cache unit, and the query order of the second cache unit in the enabled cache units is second only to the first cache unit; when the first cache unit is the cache unit with the lowest query order among the enabled cache units, the first cache unit outputs the physical address as the physical address corresponding to the address mapping request.

[0021] In one possible implementation, among the enabled cache units, a first physical address is stored on the cache unit with the highest query order, and the first physical address is the physical address of the cache unit with the highest query order itself. When the judgment result indicates a miss, the physical address is obtained from the off-chip physical address storage module, including: when the judgment result indicates a miss, the off-chip physical address storage module is accessed according to the first physical address to obtain the physical address.

[0022] In a possible implementation, based on the received judgment result, one or more enabled cache units in the cache module are queried with the first cache unit as the query starting point to determine and output the physical address corresponding to the address mapping request, and also includes: when any cache unit receives the physical address and address mapping request from other cache units, accesses the off-chip physical address storage module according to the received physical address to obtain the physical address; when there are other cache units with a query order lower than any one of the enabled cache units, the any one of the cache units outputs the obtained physical address and the address mapping request to the cache unit with a query order second only to the any one of the cache units among the enabled cache units; when the any one of the cache units is the cache unit with the lowest query order among the enabled cache units, the any one of the cache units outputs the obtained physical address as the physical address corresponding to the address mapping request.

[0023] In one possible implementation, each cache unit corresponds to a first identifier, and the first identifier indicates the current physical address storage capacity of the corresponding cache unit. The method also includes: when any cache unit receives a judgment result indicating a miss or receives a physical address from another cache unit when the first identifier corresponding to itself is less than a first threshold, the first identifier corresponding to itself is increased by one; after any cache unit obtains the physical address from an off-chip physical address storage module, the obtained physical address is stored in its own storage area, and the first identifier corresponding to itself is decreased by one.

[0024] According to the memory management device of the embodiment of the present disclosure, by setting a request broadcast module, a synchronization module, a judgment module and a cache module, the judgment module includes multiple judgment units, and the cache module includes multiple cache units corresponding to the multiple judgment units respectively. The request broadcast module receives the address mapping request and broadcasts it to the enabled judgment unit. The enabled judgment unit judges whether the address mapping request hits the corresponding enabled cache unit, thereby realizing free selection of the cache unit that allows hit judgment, and can judge the hit conditions of multiple cache units at the same time, so that the delay is greatly reduced; the synchronization module determines the address mapping request according to all the judgment results obtained by each enabled judgment unit for the address mapping request. The first cache unit to be queried is requested, so that the first cache unit to be queried is no longer restricted to be the lowest-level cache unit, and the restriction on whether the lowest-level cache unit can store more address mapping requests on whether the memory management device can continue to respond to new address mapping requests is reduced, which can improve the utilization rate of the memory management device; the synchronization module outputs a judgment result indicating whether the address mapping request hits the first cache unit to the cache module, and the cache module uses the first cache unit as the query starting point based on the received judgment result, queries one or more enabled cache units in the cache module, determines the physical address corresponding to the address mapping request and outputs it, and completes the response to the address mapping request. In summary, the memory management device disclosed in the present invention can reduce the physical address query delay, improve the response efficiency of the memory management device to the address mapping request, improve the utilization rate of the memory management device, and thereby improve the performance of the system or chip where the memory management device is located.

[0025] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0027] Figure 1 A schematic diagram showing the structure of a conventional MMU.

[0028] Figure 2 An exemplary application scenario of the memory management device according to an embodiment of the present disclosure is shown.

[0029] Figure 3 A schematic diagram showing the structure of a memory management device according to an embodiment of the present disclosure.

[0030] Figure 4 A schematic diagram showing the structure of a cache unit according to an embodiment of the present disclosure.

[0031] Figure 5A schematic diagram showing the process of a memory management method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0033] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0034] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0035] The Memory Management Unit (MMU) is a computer hardware that is responsible for processing the address mapping request of the Central Processing Unit (CPU). The MMU can respond to the address mapping request and return the physical address corresponding to the virtual address included in the address mapping request.

[0036] When the MMU responds to an address mapping request, it needs to perform address retrieval in the off-chip physical address storage module. In order to reduce the complexity of address retrieval, the prior art introduces a multi-level page table solution at the software level. Each level of the page table corresponds to an address space of different granularities on the off-chip physical address storage module. The address space granularity corresponding to the low-level page table is small, and the address space granularity corresponding to the high-level page table is large. At the hardware level, the prior art designs the MMU as a multi-level cache structure. Each level of cache corresponds to a first-level page table, and the level of the cache is the same as the level of the corresponding page table. The page table entries are used to maintain the association between the page tables. The page table entry corresponding to each page table records the base address of the lower-level page table of the page table, so that each level of cache can find the lower-level cache of the cache according to the content recorded in the corresponding page table entry.

[0037] When responding to an address mapping request, the MMU determines whether the address mapping request hits the current cache in order of cache levels from low to high, starting from the lowest level cache, until a certain level is hit. The hit conditions of all caches with a level lower than the hit cache must be judged. If the highest level cache also does not hit, then the hit conditions of all caches in the MMU must be judged. When querying the physical address, the hit cache is used as the query starting point. If there is no hit cache, the highest level cache is used as the query starting point, and all caches with a level lower than the query starting point must be queried. Each level of cache accesses the off-chip physical address storage module to query the address based on the address queried by the higher level cache, and outputs the address queried by itself to the lower level cache. Finally, after the lowest level cache returns the address queried by accessing the off-chip physical address storage module to the initiator of the address mapping request, the MMU completes the response to the address mapping request.

[0038] Figure 1 A schematic diagram showing the structure of a conventional MMU.

[0039] like Figure 1 As shown, the MMU is set on a chip (not shown), including a first-level cache and a second-level cache, each of which includes a virtual address selection allocation unit, a physical address storage unit, an off-chip memory access unit, and a historical request storage unit. The level of the second-level cache is higher than that of the first-level cache.

[0040] The historical request storage unit stores at least one historical address mapping request received by the cache where it is located. The physical address storage unit stores the physical address of a lower level cache (compared with the cache where it is located) used to respond to the historical address mapping request stored in the historical request storage unit. If the cache where it is located is already the lowest level cache, the physical address storage unit may store the physical address corresponding to the historical address mapping request. The virtual address selection allocation unit is used to determine whether the address mapping request hits the cache where it is located, and if it does not hit, it updates the contents stored in the historical request storage unit and the physical address storage unit on the cache where it is located. The off-chip memory access unit is used to access the off-chip physical address storage module.

[0041] Combine the following Figure 1 The working process of the MMU in the prior art is introduced.

[0042] Since the level of the secondary cache is higher than that of the primary cache, when the MMU responds to an address mapping request, the address mapping request is first input into the virtual address selection and allocation unit of the primary cache. The address mapping request includes a virtual address. The virtual address selection and allocation unit of the primary cache first determines whether a historical address mapping request carrying the same virtual address is stored in the historical request storage unit of the primary cache based on the newly received address mapping request. If there is a qualified historical address mapping request, it can be considered that the newly received address mapping request and the qualified historical address mapping request are the same request, and it is determined that the address mapping request hits the primary cache; if there is no qualified historical address mapping request, the newly received address mapping request is different from the historical address mapping request stored in the current cache, and it is determined that the address mapping request misses the primary cache.

[0043] When it is determined that the address mapping request hits the first-level cache, the virtual address selection allocation unit of the first-level cache queries the physical address storage unit of the first-level cache according to the newly received address mapping request. Since the first-level cache is already the lowest level cache, the physical address corresponding to the newly received address mapping request may be found. The virtual address selection allocation unit of the first-level cache directly returns the found physical address to the initiator of the address mapping request (not shown).

[0044] When it is determined that the address mapping request does not hit the first-level cache, the virtual address selection and allocation unit of the first-level cache determines whether the history request storage unit of the first-level cache can still store more address mapping requests based on the query result of the history request storage unit of the first-level cache. When more address mapping requests can be stored, the newly received address mapping request is stored in the history request storage unit of the first-level cache, that is, the history address mapping request stored on the first-level cache is updated.

[0045] When it is determined that the address mapping request does not hit the first-level cache, it starts to determine whether the address mapping request hits the second-level cache, and inputs the address mapping request into the virtual address selection allocation unit of the second-level cache. The working mode of the virtual address selection allocation unit of the second-level cache is consistent with that of the virtual address selection allocation unit of the first-level cache, which will not be repeated here.

[0046] When determining that the address mapping request hits the L2 cache, the virtual address selection allocation unit of the L2 cache queries the physical address storage unit of the L2 cache according to the newly received address mapping request. Since the L2 cache is not the lowest level cache, the cache found may be a lower level cache (in the L2 cache) used to respond to the newly received address mapping request. Figure 1 The physical address storage unit of the second-level cache transmits the found physical address to the off-chip memory access unit of the first-level cache.

[0047] The off-chip memory access unit of the first-level cache accesses the off-chip physical address storage module according to the received physical address, and obtains the physical address corresponding to the newly received address mapping request in the address space corresponding to the first-level cache. The off-chip memory access unit of the first-level cache stores the obtained physical address in the physical address storage unit of the first-level cache, and records the correspondence between the physical address and the newly received address mapping request stored in the historical request storage unit of the first-level cache, that is, updates the physical address stored in the first-level cache. The physical address storage unit of the first-level cache can directly return the physical address to the initiator of the address mapping request (not shown).

[0048] When it is determined that the address mapping request does not hit the secondary cache, the virtual address selection and allocation unit of the secondary cache determines whether the historical request storage unit of the secondary cache can store more address mapping requests based on the query result of the historical request storage unit of the secondary cache. When more address mapping requests can be stored, the newly received address mapping request is stored in the historical request storage unit of the secondary cache, that is, the historical address mapping request stored in the secondary cache is updated.

[0049] When it is determined that the address mapping request does not hit the secondary cache, the virtual address selection and allocation unit of the secondary cache controls the off-chip memory access unit of the secondary cache to access the off-chip physical address storage module, and obtains the physical address of the primary cache in the address space corresponding to the secondary cache. The off-chip memory access unit of the secondary cache stores the obtained physical address in the physical address storage unit of the secondary cache, and records the corresponding relationship between the physical address and the newly received address mapping request stored in the historical request storage unit of the secondary cache, that is, updates the physical address stored on the secondary cache.

[0050] The physical address storage unit of the L2 cache transmits the newly stored physical address to the off-chip memory access unit of the L1 cache. The response mode of the off-chip memory access unit of the L1 cache to the received physical address has been described above and will not be repeated here.

[0051] As the actual addressing space of the operating system increases, in order to achieve a higher cache hit rate, the cache capacity is usually increased. The prior art solution needs to determine the storage status of the historical address mapping request on each cache when determining the hit result, and update the storage status of the historical address mapping request and the physical address on each cache according to the hit result. To ensure the accuracy of the judgment, it is necessary to wait until the update is completed before continuing to judge. The judgment and update must be completed by the virtual address selection allocation unit, so they are also completed in the same pipeline. The larger the cache capacity, the longer the judgment and update time, and the greater the addressing delay. In other words, due to the physical limitations of the pipeline, it is difficult to increase the cache capacity.

[0052] In addition, the corresponding address space of each cache level in the MMU increases exponentially in the order of cache level from low to high. For the same address mapping request, the hit rate of the high-level cache is relatively higher, and the hit rate of the low-level cache is relatively lower. According to the prior art's step-by-step judgment method, the hit situation of the multi-level cache must be judged serially. When the number of cache levels is large, the delay caused by judging the hit situation accumulates a lot, reducing the response efficiency of the MMU to the address mapping request and reducing the performance of the MMU.

[0053] After the hit status of each level of cache is judged, the cache that the MMU of the prior art first queries must be the lowest level cache. When the address mapping request does not hit the lowest level cache and the historical request storage unit of the lowest level cache can no longer store more address mapping requests, even if the address mapping request hits a higher level cache and the historical request storage unit of the higher level cache can still store more address mapping requests, the MMU will not respond to the address mapping request. At this time, the MMU of the prior art will back pressure the initiator of the address mapping request to suspend the output of the address mapping request, that is, whether the lowest level cache unit can still store more address mapping requests directly limits whether the MMU can respond to new address mapping requests, resulting in a decrease in MMU utilization, and then resulting in a decrease in the performance of the system or chip where the MMU is located.

[0054] In view of this, the present disclosure proposes a memory management device, method, chip, and electronic device. The memory management device can simultaneously determine the hit status of an address mapping request to multiple cache units, greatly reducing the delay and improving the efficiency of the memory management device in responding to address mapping requests; and it is no longer restricted that the lowest-level cache unit must be queried first, so whether the lowest-level cache unit can store more address mapping requests, and whether the memory management device can continue to respond to new address mapping requests is reduced. The utilization rate of the memory management device can be improved, and the performance of the system or chip where the memory management device is located can be improved.

[0055] Furthermore, the memory management device of the present invention no longer restricts the cache to be queried level by level, further reducing the number of cache units to be queried, improving the flexibility of querying cache units, and reducing query delays.

[0056] Furthermore, the memory management device disclosed in the present invention decouples the work of judging the hit situation and updating the historical address mapping request and the physical address, which were originally completed in one pipeline, into different pipelines. The restrictions on the capacity of the cache unit due to the physical conditions of a single pipeline are reduced, so that the capacity of the cache unit can be greatly improved.

[0057] Figure 2 An exemplary application scenario of the memory management device according to an embodiment of the present disclosure is shown.

[0058] like Figure 2 As shown, the application scenario may include a memory management device and a central processing unit arranged on a chip, and an off-chip physical address storage module that can communicate with the memory management device. When the central processing unit needs to access the memory (which may be an off-chip physical address storage module or other memory), an address mapping request may be generated, and the address mapping request includes a virtual address. The address mapping request is output to the memory management device.

[0059] The memory management device may respond to the address mapping request by querying one or more enabled cache units included in the memory management device (see for example Figure 3 ), determine the physical address corresponding to the address mapping request and return it to the central processor. Optionally, when any cache unit is queried, it may additionally trigger a query of the off-chip physical address storage module. The exemplary query method can be found in the following and Figure 3 Related description.

[0060] Figure 3 A schematic diagram showing the structure of a memory management device according to an embodiment of the present disclosure.

[0061] like Figure 3 As shown, in a possible implementation, the memory management device includes a request broadcast module, a synchronization module, a judgment module and a cache module, the judgment module includes multiple judgment units, and the cache module includes multiple cache units corresponding to the multiple judgment units respectively.

[0062] The request broadcast module is used to receive the address mapping request and broadcast it to the enabled judgment unit;

[0063] The enabled judgment unit is used to judge whether the address mapping request hits the corresponding enabled cache unit, and output the judgment result to the synchronization module;

[0064] The synchronization module is used to determine the first cache unit queried according to the address mapping request based on all the judgment results obtained by each enabled judgment unit for the address mapping request, and output the judgment result indicating whether the address mapping request hits the first cache unit to the cache module;

[0065] The cache module is used to query one or more enabled cache units in the cache module based on the received judgment result, taking the first cache unit as the query starting point, determine the physical address corresponding to the address mapping request and output it.

[0066] For example, the memory management device includes a request broadcast module, a synchronization module, a judgment module and a cache module. The judgment module includes a plurality of judgment units. Figure 3The example includes judgment units A1, A2, ..., AN. The cache module includes multiple cache units corresponding to the multiple judgment units respectively. Figure 3 The example includes cache units B1, B2, ..., BN, where judgment unit A1 corresponds to cache unit B1, judgment unit A2 corresponds to cache unit B2, and judgment unit AN corresponds to cache unit BN. Different cache units correspond to page tables of different levels. Each cache unit may be in two states: enabled or disabled. When enabled, the cache unit can be queried; when disabled, the cache unit will not be queried. The corresponding judgment unit and cache unit can maintain the same enable state.

[0067] The information of the enabled cache units can be notified to the request broadcast module by configuring the register of the request broadcast module. The request broadcast module can parse out which cache units are enabled according to the register configuration.

[0068] In a possible implementation of the present disclosure, the selection and allocation unit is decoupled, the judgment unit is separated out, and multiple judgment units involved are merged into a judgment module. The hit status of the address mapping request on multiple cache units can be judged at the same time, and the processing and transmission are carried out through the synchronization module, which significantly reduces the delay.

[0069] The judgment module of the disclosed embodiment is mainly used to complete the judgment work of the MMU of the prior art on the hit situation. Since the cache unit corresponding to the enabled judgment unit is also enabled, and the cache unit corresponding to the disabled judgment unit is also disabled, and the disabled cache unit does not need to work, it is only necessary to judge the hit situation of the enabled cache unit, and it is not necessary to judge the hit situation of the disabled cache unit. Therefore, the request broadcast module only needs to receive the address mapping request and broadcast it to the enabled judgment unit.

[0070] In the judgment module, the enabled judgment unit is used to judge whether the address mapping request hits the corresponding enabled cache unit. Taking judgment unit A1 as an example, it corresponds to cache unit B1. At this time, judgment unit A1 is used to judge whether the address mapping request hits cache unit B1. The judgment result can indicate the hit of the address mapping request to cache unit B1. An exemplary judgment method is given later.

[0071] The judgment result may only include a numerical value indicating a hit situation, such as 0 may indicate a miss, and 1 may indicate a hit. At this time, when the enabled judgment unit outputs the judgment result to the synchronization module, it may synchronously transmit the identifier of the cache unit corresponding to the judgment result, and the address mapping request corresponding to the judgment result or the identifier of the address mapping request corresponding to the judgment result, so that the synchronization module can determine which address mapping request indicates a hit situation for which cache unit according to the information received from the judgment unit. The judgment result may also include a numerical value indicating a hit situation, an identifier of the address mapping request, and an identifier of the cache unit at the same time. At this time, the enabled judgment unit only outputs the judgment result to the synchronization module, and there is no restriction on whether other information is synchronously transmitted. The synchronization module can determine which address mapping request indicates a hit situation for which cache unit according to the information included in the judgment result.

[0072] Those skilled in the art should understand that as long as the synchronization module can determine that the received judgment result indicates which address mapping request hits which cache unit, the present disclosure does not limit the specific content of the information output by the judgment unit to the synchronization module.

[0073] In some application scenarios, the request broadcast module may simultaneously broadcast the judgment results corresponding to multiple different address mapping requests. That is to say, the judgment results received by the synchronization module may include judgment results for different address mapping requests. However, the number of enabled judgment units is certain, so the maximum number of judgment results that can be obtained for a certain address mapping request may be equal to the number of enabled judgment units. In other words, when the synchronization module receives all the judgment results obtained for the address mapping request, it can be considered that the hit judgment for the address mapping request has been synchronized.

[0074] In this case, the synchronization module can determine the first cache unit to be queried according to the address mapping request based on all the judgment results obtained by each enabled judgment unit for the address mapping request. The first cache unit can be one of the enabled cache units. Figure 3 In the example of , the first cache unit may be cache unit B2. The synchronization module may output to the cache module a judgment result indicating whether the address mapping request hits the first cache unit, the judgment result being generated by the judgment unit corresponding to the first cache unit. Figure 3 In the example of , it may be generated by the determination unit A2. Details of the method for determining the first cache unit are given later.

[0075] If the judgment result only includes a numerical value indicating a hit situation, the synchronization module can also transmit more information when transmitting the judgment result to the cache module, such as the identifier of the cache unit corresponding to the judgment result, and the address mapping request corresponding to the judgment result or the identifier of the address mapping request corresponding to the judgment result, so that the cache module can determine which address mapping request hits which cache unit according to the information received from the synchronization module. If the judgment result includes a numerical value indicating a hit situation, the identifier of the address mapping request, and the identifier of the cache unit at the same time, the synchronization module only outputs the judgment result to the cache module, and there is no restriction on whether other information is transmitted synchronously. The cache module can determine which address mapping request hits which cache unit according to the information included in the judgment result.

[0076] Those skilled in the art should understand that as long as the cache module can determine that the received judgment result indicates which address mapping request hits which cache unit, the present disclosure does not limit the specific content of the information output by the synchronization module to the cache module.

[0077] The cache module can query one or more enabled cache units in the cache module based on the received judgment result, using the first cache unit as the query starting point, determine the physical address corresponding to the address mapping request and output it. The specific cache units included in the one or more enabled cache units and an exemplary query method are given below.

[0078] The cache module may need to use an address mapping request when querying one or more enabled cache units based on the received judgment result. If the synchronization module does not output the address mapping request to the cache module, the cache module can obtain the address mapping request corresponding to the judgment result from the request broadcast module, the judgment module, or the synchronization module. The present disclosure does not limit which module in the memory management device the cache module obtains the address mapping request from.

[0079] According to the memory management device of the embodiment of the present disclosure, by setting a request broadcast module, a synchronization module, a judgment module and a cache module, the judgment module includes multiple judgment units, and the cache module includes multiple cache units corresponding to the multiple judgment units respectively. The request broadcast module receives the address mapping request and broadcasts it to the enabled judgment unit. The enabled judgment unit judges whether the address mapping request hits the corresponding enabled cache unit, thereby realizing free selection of the cache unit that allows hit judgment, and can judge the hit conditions of multiple cache units at the same time, so that the delay is greatly reduced; the synchronization module determines the address mapping request according to all the judgment results obtained by each enabled judgment unit for the address mapping request. The first cache unit to be queried is requested, so that the first cache unit to be queried is no longer restricted to be the lowest-level cache unit, and the restriction on whether the lowest-level cache unit can store more address mapping requests on whether the memory management device can continue to respond to new address mapping requests is reduced, which can improve the utilization rate of the memory management device; the synchronization module outputs a judgment result indicating whether the address mapping request hits the first cache unit to the cache module, and the cache module uses the first cache unit as the query starting point based on the received judgment result, queries one or more enabled cache units in the cache module, determines the physical address corresponding to the address mapping request and outputs it, and completes the response to the address mapping request. In summary, the memory management device disclosed in the present invention can reduce the physical address query delay, improve the response efficiency of the memory management device to the address mapping request, improve the utilization rate of the memory management device, and thereby improve the performance of the system or chip where the memory management device is located.

[0080] In a possible implementation, the one or more enabled cache units include a first cache unit and other cache units whose query order is lower than the first cache unit among the enabled cache units.

[0081] For example, the query order of the cache unit can be determined according to the level of the page table corresponding to the cache unit. The higher the corresponding page table level, the higher the query order of the cache unit; the lower the corresponding page table level, the lower the query order of the cache unit. Since not all cache units are enabled, the cache unit only needs to query the first cache unit and other cache units with a lower query order than the first cache unit among the enabled cache units. Figure 3 For example, assuming that the page table levels corresponding to cache units B1 to BN increase in sequence, cache unit B1 has the lowest query order and cache unit BN has the highest query order. If the first cache unit determined is cache unit B2, the one or more enabled cache units to be queried may include cache unit B2 and cache unit B1.

[0082] It is understandable that if the first cache unit is already the cache unit with the lowest query order among the enabled cache units, then only the first cache unit is queried. Details of the method of querying cache units are given later.

[0083] In this way, the memory management device of the present invention supports skip-level query of cache units, further reducing the number of cache units to be queried, improving the flexibility of querying cache units, and reducing query delays.

[0084] In a possible implementation, each cache unit includes a request allocation subunit.

[0085] The cache unit is also used to store at least one received historical address mapping request in its own storage area;

[0086] The enabled judgment unit is specifically used to query the historical address mapping requests stored in the storage area of ​​the corresponding enabled cache unit according to the address mapping request, and judge whether the address mapping request hits the corresponding enabled cache unit according to the query result;

[0087] The request allocation subunit is used to update the historical address mapping requests stored in the cache unit when receiving a determination result indicating that the address mapping request misses.

[0088] Figure 4 A schematic diagram showing the structure of a cache unit according to an embodiment of the present disclosure.

[0089] For example, each cache unit can store at least one received historical address mapping request in its own storage area. It is understandable that after receiving the historical address mapping request, the cache unit will respond to the historical address mapping request, and the physical address obtained by accessing the off-chip physical address storage module can also be stored in its own storage area. The storage method can be the same as the prior art, for example, see Figure 4 In each cache unit, a historical request storage subunit is set to store historical address mapping requests, a physical address storage subunit is set to store physical addresses obtained from an off-chip physical address storage module, and an off-chip memory access unit is set to access the off-chip physical address storage module. The cache unit can store historical address mapping requests and physical addresses obtained in response to the historical address mapping requests in correspondence, thereby completing the recording of the corresponding relationship between the two.

[0090] The enabled judgment unit can be specifically used to query the historical address mapping requests stored in the storage area of ​​the corresponding enabled cache unit according to the address mapping request, and judge whether the address mapping request hits the corresponding enabled cache unit according to the query result. Exemplarily, the enabled judgment unit can first hash to obtain the storage address of the historical address mapping request in the corresponding cache unit, and then query the corresponding cache unit according to the address. If the query determines that the virtual address included in a historical address mapping request is the same as the virtual address included in the newly received address mapping request, it can be judged that the newly received address mapping request hits the corresponding cache unit. If the query determines that the virtual address included in all historical address mapping requests is different from the virtual address included in the newly received address mapping request, it can be judged that the newly received address mapping request does not hit the corresponding cache unit.

[0091] When an address mapping request (such as the first request) does not hit the cache unit, the cache unit can access the off-chip physical address storage module, obtain the physical address and store it in its own storage area, so that other address mapping requests including the same virtual address can be hit later. Correspondingly, the address mapping request (that is, the first request) is also stored in the cache unit's own storage area. A single cache unit may include more than one historical request storage sub-unit. In this regard, Figure 4 As shown, the cache unit may also include a request allocation subunit, which is used to update the historical address mapping requests stored in the cache unit when receiving a judgment result indicating that the address mapping request misses. Compared with the virtual address selection allocation unit in the prior art, the request allocation subunit disclosed in the present invention can complete other functions in addition to judging the hit situation of the cache unit. The updating method can be to store the address mapping request (that is, the first request) in any historical request storage subunit that still has storage capacity. More details of the update are given later.

[0092] Different modules, different units, and different sub-units work in different pipelines. In this case, the work of judging the hit situation and updating the historical address mapping requests stored thereon, which were originally completed in one pipeline, are decoupled and completed in different pipelines. The physical conditions of a single pipeline reduce the restrictions on the capacity of the cache unit, so that the capacity of the cache unit can be greatly improved.

[0093] In a possible implementation, the synchronization module is specifically used to:

[0094] When the address mapping request hits at least one enabled cache unit, the cache unit with the lowest query order among the hit cache units is used as the first cache unit;

[0095] When the address mapping request does not hit any enabled cache unit, the cache unit with the highest query order among the enabled cache units is used as the first cache unit.

[0096] For example, when the address mapping request hits at least one enabled cache unit, it means that at least one enabled cache unit hit has responded to a historical address mapping request including the same virtual address as the address mapping request, and has stored the physical address obtained when responding to the historical address mapping request. When the memory management device of the embodiment of the present disclosure queries the cache unit, it starts from the first determined cache unit, queries the first cache unit and other cache units in the enabled cache units whose query order is lower than the first cache unit. Therefore, it can be understood that the lower the query order of the first cache unit, the fewer the total number of cache units to be queried, the shorter the query time, and the higher the query efficiency. Therefore, when the address mapping request hits at least one enabled cache unit, the cache unit with the lowest query order among the hit cache units is used as the first cache unit, which can make the query time shortest and the query efficiency highest. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, if the address mapping request hits cache unit B2 and cache unit BN, it can be determined that cache unit B2 is the first cache unit.

[0097] When the address mapping request misses any enabled cache unit, only the cache unit with the highest query order can directly access the off-chip physical address storage module to obtain the physical address, so the cache unit with the highest query order among the enabled cache units can be used as the first cache unit. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, if the address mapping request misses any of cache units B1, B2, and BN, cache unit BN can be determined to be the first cache unit.

[0098] In this case, the first cache unit may be a cache unit that is hit by the address mapping request, or it may be a cache unit that is not hit by the address mapping request; when the first cache unit is a cache unit that is hit by the address mapping request, it may be any one of multiple cache units, and when the first cache unit is not a cache unit that is hit by the address mapping request, it will only be the cache unit with the highest query order among the enabled cache units; regardless of whether the first cache unit is a cache unit that is hit by the address mapping request, other cache units in the enabled cache units that have a lower query order than the first cache unit will only be cache units that are not hit by the address mapping request.

[0099] In this way, the time consumption of physical address query can be reduced and the efficiency of physical address query can be improved.

[0100] In a possible implementation, the synchronization module is specifically used to output to the first cache unit a determination result indicating whether the address mapping request hits the first cache unit;

[0101] The first cache unit is used to obtain a physical address according to the received judgment result, wherein when the judgment result indicates a hit, the physical address is obtained from a storage area of ​​the first cache unit itself, and when the judgment result indicates a miss, the physical address is obtained from an off-chip physical address storage module;

[0102] When there are other cache units whose query order is lower than the first cache unit among the enabled cache units, the first cache unit outputs the physical address and the address mapping request to the second cache unit, and the query order of the second cache unit among the enabled cache units is second only to the first cache unit;

[0103] When the first cache unit is the cache unit with the lowest query order among the enabled cache units, the first cache unit outputs the physical address as the physical address corresponding to the address mapping request.

[0104] For example, the synchronization module can output a judgment result indicating whether the address mapping request hits the first cache unit to the first cache unit. In this case, when the first cache unit receives the judgment result, it can know that it is determined by the synchronization module as the first cache unit to respond to the address mapping request query. According to the indication of the judgment result, the first cache unit can also determine whether the address mapping request hits itself, and determine whether the address mapping request misses other cache units in the enabled cache units whose query order is lower than itself. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, the address mapping request hits cache unit B2 and cache unit BN. After the synchronization module determines cache unit B2 as the first cache unit, it can output the judgment result indicating that the address mapping request hits cache unit B2 to cache unit B2.

[0105] When the first cache unit receives the judgment result, the physical address can be obtained according to the judgment result. The judgment result is mainly used to determine where to obtain the physical address, wherein when the judgment result indicates a hit, it means that the storage area of ​​the first cache unit stores a historical address mapping request including the same virtual address as the received address mapping request, and also stores the physical address obtained in response to the historical address mapping request, so the physical address can be directly obtained from the storage area of ​​the first cache unit itself (that is, the physical address obtained in response to the historical address mapping request). When the judgment result indicates a miss, it means that the storage area of ​​the first cache unit does not store a historical address mapping request including the same virtual address as the received address mapping request, and also does not store the physical address obtained in response to the historical address mapping request, so the physical address can be obtained from the off-chip physical address storage module. The details of the first cache unit obtaining the physical address from the off-chip physical address storage module are given later.

[0106] If there are other cache units with a lower query order than the first cache unit among the enabled cache units, that is, the first cache unit is not the one with the lowest query order among the enabled cache units, it can be determined to continue querying other enabled cache units, and the next cache unit to be queried can be the cache unit with a query order second only to itself among the enabled cache units. That is, when there are other cache units with a lower query order than the first cache unit among the enabled cache units, the first cache unit outputs the physical address and address mapping request to the second cache unit, and the query order of the second cache unit among the enabled cache units is second only to the first cache unit. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, when cache unit B2 receives the address mapping request and the judgment result, it can be determined that there is a second cache unit to be queried by the address mapping request, and the second cache unit is cache unit B1.

[0107] If the first cache unit is already the cache unit with the lowest query order among the enabled cache units, then there is no need to query other cache units. At this time, the physical address obtained is already the physical address corresponding to the address mapping request and can be output to the initiator of the address mapping request. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, when cache unit B1 receives the address mapping request and the judgment result, it can be determined that there is no second cache unit to be queried by the address mapping request, and the physical address obtained by cache unit B1 is directly output to the initiator of the address mapping request.

[0108] In this way, the first cache unit can determine whether the received address mapping request hits itself based on the received judgment result, and can make different responses to the address mapping request based on different judgment results and its own query order in the enabled cache units, so that the query proceeds smoothly.

[0109] In a possible implementation, among the enabled cache units, the cache unit with the highest query order stores the first physical address, where the first physical address is the physical address of the cache unit with the highest query order.

[0110] The first cache unit is specifically configured to, when the judgment result indicates a miss, access an off-chip physical address storage module according to the first physical address to obtain the physical address.

[0111] For example, since the enabled cache unit will no longer access the disabled cache unit, the cache unit with the highest query order among the enabled cache units can record its own physical address, that is, the first physical address. When the first cache unit receives the judgment result and the judgment result indicates a miss, the first cache unit must be the cache unit with the highest query order among the enabled cache units. At this time, the first cache unit can access its corresponding address space on the off-chip physical address storage module according to the first physical address to obtain the physical address.

[0112] In this way, any cache unit, when being a cache unit with the highest query order among enabled cache units, can accurately obtain the physical address when receiving a determination result indicating a miss.

[0113] In a possible implementation, any cache unit is further used to:

[0114] When receiving a physical address and an address mapping request from other cache units, accessing an off-chip physical address storage module according to the received physical address to obtain the physical address;

[0115] When there are other cache units whose query order is lower than that of any one cache unit among the enabled cache units, the any one cache unit outputs the acquired physical address and the address mapping request to the cache unit whose query order is second only to that of the any one cache unit among the enabled cache units;

[0116] When the any one cache unit is the cache unit with the lowest query order among the enabled cache units, the any one cache unit outputs the acquired physical address as the physical address corresponding to the address mapping request.

[0117] For example, for any cache unit, if it receives a physical address and an address mapping request from another cache unit, the cache unit can determine that the received physical address is its own physical address and that the received address mapping request does not hit itself. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, after cache unit B1 receives an address mapping request and a physical address, it can determine that the received physical address is the physical address of cache unit B1 and that the received address mapping request does not hit cache unit B1.

[0118] Since the received address mapping request does not hit itself, the cache unit can access the off-chip physical address storage module to obtain the physical address. When there are other cache units with a lower query order than the cache unit in the enabled cache units, it can be determined to continue to query other enabled cache units, and the cache unit can output the obtained physical address and address mapping request to the cache unit with a query order second only to the cache unit in the enabled cache units. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, if cache unit B2 receives the physical address and address mapping request of cache unit B2, cache unit B2 can obtain the physical address of cache unit B1 and transmit the physical address and address mapping request of cache unit B1 to cache unit B1.

[0119] When any one of the cache units is the cache unit with the lowest query order among the enabled cache units, there is no need to query other cache units. Any one of the cache units can use the acquired physical address as the physical address corresponding to the address mapping request and output it to the initiator of the address mapping request. For example, assuming that cache units B1, B2, and BN are enabled, and the query order is cache unit BN>cache unit B2>cache unit B1, when cache unit B1 receives the address mapping request and the physical address of cache unit B1, cache unit B1 can directly output it to the initiator of the address mapping request after acquiring the physical address.

[0120] In this way, when each cache unit receives an address mapping request and a physical address, it can determine that the address mapping request does not hit itself, so as to facilitate determining its own response method to the address mapping request.

[0121] In a possible implementation, each cache unit corresponds to a first identifier, the first identifier indicates a current physical address storage capacity of the corresponding cache unit, and any cache unit is further used to:

[0122] When the first identifier corresponding to itself is less than the first threshold, upon receiving a judgment result indicating a miss or receiving a physical address from another cache unit, the first identifier corresponding to itself is incremented by one;

[0123] After obtaining the physical address from the off-chip physical address storage module, the obtained physical address is stored in its own storage area, and the first identifier corresponding to itself is reduced by one.

[0124] For example, the storage area of ​​the cache unit itself is limited, so there is an upper limit on the number of historical address mapping requests and physical addresses that can be stored in the storage area of ​​the cache unit itself, and the upper limits of the storage number of historical address mapping requests and physical addresses can be equal. A first threshold can be preset so that the first threshold is equal to the upper limit of the number of historical address mapping requests or physical addresses that can be stored in the cache unit. A corresponding first identifier can also be set for the cache unit so that the first identifier indicates the current physical address storage capacity of the cache unit (which is also the storage capacity of historical address mapping requests).

[0125] In this case, for any cache unit, if it receives a judgment result indicating a miss or receives a physical address from another cache unit when its corresponding first identifier is less than the first threshold, the cache unit may increase its corresponding first identifier by 1. Accordingly, when the request allocation subunit receives a judgment result indicating a miss, it may determine that the first identifier is less than the first threshold and then update the historical address mapping request stored in the cache unit.

[0126] After obtaining the physical address from the off-chip physical address storage module, the cache unit may store the obtained physical address in its own storage area and reduce the first identifier corresponding to itself by one.

[0127] Exemplarily, the request allocation subunit in the cache unit may be used to change the value of the first identifier.

[0128] If the judgment unit finds that the first identifier of the corresponding cache unit is less than the first threshold, the cache unit can be controlled to replace the resources used to store the historical address mapping request and the physical address. The replacement can be implemented based on the existing technology and will not be described in detail here. Before the resource replacement is completed, the cache unit no longer stores new address mapping requests and physical addresses.

[0129] In this way, the cache unit can determine whether to continue to store new address mapping requests and physical addresses according to its own physical address storage capacity, and replace full resources in time, thereby improving the storage capacity of the cache unit.

[0130] The present disclosure also provides a chip, including the memory management device described above. The schematic diagram of the chip structure can be found in Figure 2 .

[0131] The present disclosure also provides an electronic device, comprising the above-mentioned chip and an off-chip physical address storage module. The electronic device may be a terminal device or a server, and the present disclosure does not limit the specific type of the electronic device.

[0132] The present disclosure also provides a memory management method. Figure 5 A schematic diagram showing the process of a memory management method according to an embodiment of the present disclosure.

[0133] like Figure 5 As shown, in a possible implementation, the method is applied to a memory management device, the memory management device includes a request broadcast module, a synchronization module, a judgment module and a cache module, the judgment module includes a plurality of judgment units, the cache module includes a plurality of cache units corresponding to the plurality of judgment units, and the method includes steps S51-S54:

[0134] Step S51, the request broadcast module receives the address mapping request and broadcasts it to the enabled judgment unit;

[0135] Step S52, the enabled judgment unit judges whether the address mapping request hits the corresponding enabled cache unit, and outputs the judgment result to the synchronization module;

[0136] Step S53, the synchronization module determines the first cache unit to be queried according to the address mapping request based on the judgment results obtained by each enabled judgment unit for the address mapping request, and outputs the judgment result indicating whether the address mapping request hits the first cache unit to the cache module;

[0137] Step S54: the cache module queries one or more enabled cache units in the cache module based on the received judgment result, taking the first cache unit as the query starting point, determines the physical address corresponding to the address mapping request, and outputs it.

[0138] The request broadcast module, synchronization module, and judgment module of the embodiment of the present disclosure may be software modules or hardware modules, and thus the memory management method of the embodiment of the present disclosure is universal for memory management devices with a multi-level cache structure.

[0139] In a possible implementation, the one or more enabled cache units include the first cache unit and other cache units whose query order is lower than that of the first cache unit among the enabled cache units.

[0140] In a possible implementation, each cache unit includes a request allocation subunit, and the method further includes:

[0141] The cache unit stores at least one received historical address mapping request in its own storage area;

[0142] When the request allocation subunit receives a determination result indicating that the address mapping request misses, the request allocation subunit updates the historical address mapping request stored in the cache unit;

[0143] The determining whether the address mapping request hits a corresponding enabled cache unit includes:

[0144] According to the address mapping request, a historical address mapping request stored in a storage area of ​​a corresponding enabled cache unit is queried, and according to the query result, it is determined whether the address mapping request hits the corresponding enabled cache unit.

[0145] In a possible implementation, determining the first cache unit to be queried according to the address mapping request according to all judgment results obtained by each enabled judgment unit for the address mapping request includes:

[0146] When the address mapping request hits at least one enabled cache unit, the cache unit with the lowest query order among the hit cache units is used as the first cache unit;

[0147] When the address mapping request does not hit any enabled cache unit, the cache unit with the highest query order among the enabled cache units is used as the first cache unit.

[0148] In a possible implementation, the outputting to the cache module a judgment result indicating whether the address mapping request hits the first cache unit includes: outputting to the first cache unit a judgment result indicating whether the address mapping request hits the first cache unit;

[0149] The querying of one or more enabled cache units in the cache module with the first cache unit as a query starting point according to the received judgment result includes:

[0150] The first cache unit acquires the physical address according to the received judgment result, wherein when the judgment result indicates a hit, the physical address is acquired from the storage area of ​​the first cache unit itself, and when the judgment result indicates a miss, the physical address is acquired from the off-chip physical address storage module;

[0151] When there are other cache units whose query order is lower than that of the first cache unit in the enabled cache units, the first cache unit outputs the physical address and the address mapping request to a second cache unit whose query order is second only to that of the first cache unit in the enabled cache units;

[0152] When the first cache unit is the cache unit with the lowest query order among the enabled cache units, the first cache unit outputs the physical address as the physical address corresponding to the address mapping request.

[0153] In a possible implementation, among the enabled cache units, a first physical address is stored in the cache unit with the highest query order, the first physical address is the physical address of the cache unit with the highest query order, and when the judgment result indicates a miss, the physical address is obtained from the off-chip physical address storage module, including:

[0154] When the determination result indicates a miss, an off-chip physical address storage module is accessed according to the first physical address to obtain the physical address.

[0155] In a possible implementation, querying one or more enabled cache units in the cache module based on the received judgment result and taking the first cache unit as a query starting point to determine and output the physical address corresponding to the address mapping request further includes:

[0156] When any cache unit receives a physical address and an address mapping request from another cache unit, it accesses an off-chip physical address storage module according to the received physical address to obtain the physical address;

[0157] When there are other cache units whose query order is lower than that of any one cache unit among the enabled cache units, the any one cache unit outputs the acquired physical address and the address mapping request to the cache unit whose query order is second only to that of the any one cache unit among the enabled cache units;

[0158] When the any one cache unit is the cache unit with the lowest query order among the enabled cache units, the any one cache unit outputs the acquired physical address as the physical address corresponding to the address mapping request.

[0159] In a possible implementation, each cache unit corresponds to a first identifier, and the first identifier indicates a current physical address storage capacity of the corresponding cache unit. The method further includes:

[0160] When any cache unit receives a judgment result indicating a miss or receives a physical address from another cache unit when the first identifier corresponding to the cache unit is less than the first threshold, the first identifier corresponding to the cache unit is incremented by one;

[0161] After any cache unit obtains the physical address from the off-chip physical address storage module, it stores the obtained physical address in its own storage area and reduces its corresponding first identifier by one.

[0162] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0163] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A memory management device, characterized in that: The system comprises a request broadcast module, a synchronization module, a judgment module and a cache module, wherein the judgment module comprises a plurality of judgment units, and the cache module comprises a plurality of cache units respectively corresponding to the plurality of judgment units, wherein each cache unit stores at least one received historical address mapping request and a physical address obtained in response to the historical address mapping request in its own storage area; The request broadcast module is used to receive the address mapping request and broadcast it to the enabled judgment unit; The enabled judgment unit is used to judge whether the address mapping request hits the corresponding enabled cache unit, and output the judgment result to the synchronization module, wherein when it is determined through query that the virtual address included in the historical address mapping request stored in the corresponding cache unit is the same as the virtual address included in the newly received address mapping request, it is judged that the newly received address mapping request hits the corresponding cache unit; The synchronization module is used to determine the first cache unit queried according to the address mapping request according to all judgment results obtained by each enabled judgment unit for the address mapping request, and output to the cache module the judgment result indicating whether the address mapping request hits the first cache unit; The cache module is used to query one or more enabled cache units in the cache module based on the received judgment result, taking the first cache unit as a query starting point, determine the physical address corresponding to the address mapping request and output it.

2. The device according to claim 1, characterized in that The one or more enabled cache units include the first cache unit and other cache units whose query order is lower than that of the first cache unit among the enabled cache units.

3. The device according to claim 1, characterized in that Each cache unit includes a request allocation subunit, and the cache unit is also used to store at least one received historical address mapping request in its own storage area; The enabled judgment unit is specifically used to query the historical address mapping requests stored in the storage area of ​​the corresponding enabled cache unit according to the address mapping request, and judge whether the address mapping request hits the corresponding enabled cache unit according to the query result; The request allocation subunit is used for updating the historical address mapping requests stored in the cache unit when receiving the judgment result indicating that the address mapping request misses.

4. The device according to claim 2 or 3, characterized in that The synchronization module is specifically used for: When the address mapping request hits at least one enabled cache unit, the cache unit with the lowest query order among the hit cache units is used as the first cache unit; When the address mapping request does not hit any enabled cache unit, the cache unit with the highest query order among the enabled cache units is used as the first cache unit.

5. The device according to claim 4, characterized in that The synchronization module is specifically used to output to the first cache unit a judgment result indicating whether the address mapping request hits the first cache unit; The first cache unit is used to obtain a physical address according to the received judgment result, wherein when the judgment result indicates a hit, the physical address is obtained from a storage area of ​​the first cache unit itself, and when the judgment result indicates a miss, the physical address is obtained from an off-chip physical address storage module; When there are other cache units whose query order is lower than that of the first cache unit in the enabled cache units, the first cache unit outputs the physical address and the address mapping request to a second cache unit whose query order is second only to that of the first cache unit in the enabled cache units; When the first cache unit is the cache unit with the lowest query order among the enabled cache units, the first cache unit outputs the physical address as the physical address corresponding to the address mapping request.

6. The device according to claim 5, characterized in that Among the enabled cache units, a cache unit with the highest query order stores a first physical address, where the first physical address is the physical address of the cache unit with the highest query order. The first cache unit is specifically configured to, when the judgment result indicates a miss, access an off-chip physical address storage module according to the first physical address to obtain the physical address.

7. The device according to claim 5, characterized in that Any cache unit is also used to When receiving a physical address and an address mapping request from other cache units, accessing an off-chip physical address storage module according to the received physical address to obtain the physical address; When there are other cache units whose query order is lower than that of any one cache unit among the enabled cache units, the any one cache unit outputs the acquired physical address and the address mapping request to the cache unit whose query order is second only to that of the any one cache unit among the enabled cache units; When the any one cache unit is the cache unit with the lowest query order among the enabled cache units, the any one cache unit outputs the acquired physical address as the physical address corresponding to the address mapping request.

8. The device according to claim 1, characterized in that Each cache unit corresponds to a first identifier, wherein the first identifier indicates the current physical address storage capacity of the corresponding cache unit, and any cache unit is further used to: When the first identifier corresponding to itself is less than the first threshold, upon receiving a judgment result indicating a miss or receiving a physical address from another cache unit, the first identifier corresponding to itself is incremented by one; After obtaining the physical address from the off-chip physical address storage module, the obtained physical address is stored in its own storage area, and the first identifier corresponding to itself is reduced by one.

9. A chip, characterized in that: A memory management device comprising any one of claims 1-8.

10. An electronic device, characterized in that: It comprises the chip as claimed in claim 9, and an off-chip physical address storage module.

11. A memory management method, characterized in that: The method is applied to a memory management device, the memory management device comprising a request broadcast module, a synchronization module, a judgment module and a cache module, the judgment module comprising a plurality of judgment units, the cache module comprising a plurality of cache units respectively corresponding to the plurality of judgment units, each cache unit storing at least one received historical address mapping request and a physical address obtained in response to the historical address mapping request in its own storage area; the method comprising: The request broadcast module receives the address mapping request and broadcasts it to the enabled judgment unit; The enabled judgment unit judges whether the address mapping request hits the corresponding enabled cache unit, and outputs the judgment result to the synchronization module, wherein when it is determined through query that the virtual address included in the historical address mapping request stored in the corresponding cache unit is the same as the virtual address included in the newly received address mapping request, it is judged that the newly received address mapping request hits the corresponding cache unit; The synchronization module determines the first cache unit to be queried according to the address mapping request according to the judgment results obtained by each enabled judgment unit for the address mapping request, and outputs the judgment result indicating whether the address mapping request hits the first cache unit to the cache module; The cache module queries one or more enabled cache units in the cache module based on the received judgment result and takes the first cache unit as a query starting point to determine and output the physical address corresponding to the address mapping request.