Virtual address translation method and device, equipment, storage medium and program product

By using address adjustment bit conversion and hit check in the address translation device, the hit rate of virtual addresses is improved, and the problem of low virtual address translation efficiency is solved, and a faster address translation process is achieved.

CN118939576APending Publication Date: 2024-11-12MOORE THREADS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410994061.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, the hit rate of virtual address translation is low, resulting in an increase in the time required for virtual address and physical address translation, affecting efficiency.

Method used

By introducing the conversion of address adjustment bits into the address translation device, the number of address adjustment bits is reduced, the number of address bits is performed, the hit check is performed, the hit rate of the virtual address is improved, and based on the original virtual address, the first virtual address and the first physical address are Determine the destination physical address.

Benefits of technology

It improves the efficiency of virtual address and physical address translation, reduces translation time, and enhances the performance of address translation device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939576A_ABST
    Figure CN118939576A_ABST
Patent Text Reader

Abstract

The invention provides a virtual address translation method and device, equipment, a storage medium and a program product. The virtual address translation method applied to the address translation device comprises the following steps: receiving an address translation command carrying an original virtual address, and translating the original virtual address based on an address adjustment digit; and performing hit check on the first virtual address obtained by conversion, acquiring a first physical address corresponding to the first virtual address under the condition that a hit check result represents that the first virtual address is hit, and determining a target physical address based on the original virtual address, the first virtual address and the first physical address. In the virtual address translation method provided by the invention, the first virtual address reduces the address adjustment bits by the address bits compared with the original virtual address, and the first virtual address is used for hit check, so that the granularity for judging whether the original virtual address is hit or not is reduced; therefore, the hit rate of the original virtual address and the translation efficiency of the virtual address and the physical address are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual address translation method, apparatus, device, storage medium and program product. Background Art

[0002] In chip design, a translation lookaside buffer is usually set up in the memory management unit. When the memory management unit receives a virtual address, it first accesses the local cache of the translation lookaside buffer. When the local cache contains a page table entry base address that is exactly the same as the base address of the virtual address, the virtual address hits.

[0003] However, when a non-repeated virtual address is received, the virtual address cannot be hit, resulting in a low hit rate of the translation lookaside buffer, requiring frequent access to the address mapping of the memory management unit, thereby increasing the time required for virtual address and physical address translation.

[0004] Therefore, how to improve the efficiency of virtual address and physical address translation becomes an urgent problem to be solved. Summary of the invention

[0005] In view of this, embodiments of the present application at least provide a virtual address translation method, apparatus, device, storage medium and program product.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] On the one hand, an embodiment of the present application provides a virtual address translation method, which is applied to an address translation device. The virtual address translation method includes:

[0008] receiving an address translation command carrying an original virtual address, and converting the original virtual address based on the address adjustment bit number to obtain a first virtual address;

[0009] Performing a hit check on the first virtual address to obtain a hit check result;

[0010] When the hit check result indicates that the first virtual address hits, a first physical address corresponding to the first virtual address is obtained, and a target physical address corresponding to the original virtual address is determined based on the original virtual address, the first virtual address and the first physical address.

[0011] On the other hand, an embodiment of the present application provides an address translation device, the address translation device comprising an address adjustment unit, a hit check unit and a physical address calculation unit, wherein the address adjustment unit is used to receive an address translation command carrying an original virtual address, and convert the original virtual address based on the number of address adjustment bits to obtain a first virtual address;

[0012] A hit check unit, used for performing a hit check on the first virtual address to obtain a hit check result;

[0013] The physical address calculation unit is used to obtain the first physical address corresponding to the first virtual address when the hit check result indicates that the first virtual address hits, and determine the target physical address corresponding to the original virtual address based on the original virtual address, the first virtual address and the first physical address.

[0014] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and the processor implements the steps in the aforementioned virtual address translation method when executing the program.

[0015] On the other hand, an embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the aforementioned virtual address translation method are implemented.

[0016] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which implements the steps in the aforementioned virtual address translation method when the computer program or instructions are executed by a processor.

[0017] To summarize, in the virtual address translation method provided in the embodiment of the present application, the address translation device converts the original virtual address based on the number of address adjustment bits to obtain a first virtual address, performs a hit check on the first virtual address to obtain a hit check result, and when the hit check result indicates that the first virtual address hits, translates the original virtual address to obtain a target physical address, and the first virtual address reduces the number of address adjustment bits by address bits compared to the original virtual address. Compared with the technical solution of performing a hit check on the original virtual address in the related art, the granularity of judging whether the original virtual address hits is reduced, so that the original virtual address carried by the address translation command received by the address translation device, whether it is a linear or random non-repetitive virtual address, can be converted into the first virtual address for a hit check, so as to improve the hit rate of the original virtual address and reduce the time required for translating the original virtual address into a physical address, thereby improving the efficiency of virtual address and physical address translation.

[0018] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A block diagram of virtual address translation for related technology;

[0020] Figure 2 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 1 ;

[0021] Figure 3 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 2 ;

[0022] Figure 4 A corresponding relationship diagram of the page table size and the number of bits of its sub-address adjustment;

[0023] Figure 5 A diagram showing the correspondence between compression parameters and the number of bits of their sub-address adjustment;

[0024] Figure 6 A corresponding relationship diagram for determining the number of address adjustment bits for page table parameters;

[0025] Figure 7 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 3 ;

[0026] Figure 8 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 4 ;

[0027] Fig. 9 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 5 ;

[0028] Fig.10 A schematic diagram of the structure of an address translation device provided in an embodiment of the present application Figure 1 ;

[0029] Fig.11 A schematic diagram of the structure of an address translation device provided in an embodiment of the present application Figure 2 ;

[0030] Fig.12 A schematic diagram of the structure of an address translation device provided in an embodiment of the present application Figure 3 ;

[0031] Fig.13 A schematic diagram of the structure of an address translation device provided in an embodiment of the present application Figure 4 ;

[0032] Fig.14 A flowchart of a virtual address translation method provided in an embodiment of the present application;

[0033] Fig.15 for Fig.14 A composition structure diagram of an address translation device to which the virtual address translation method is applied;

[0034] Fig.16 for Fig.15 The operation block diagram of the page table adaptive adjustment unit of the address translation device shown;

[0035] Fig.17 for Fig.15 The operation block diagram of the physical base address calculation unit of the address translation device shown;

[0036] Fig.18 for Fig.15 The operation block diagram of the physical address adaptive calculation unit of the address translation device shown;

[0037] Fig.19 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0039] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0040] Figure 1 FIG. 1 is a block diagram of a virtual address translation of a related technology. Figure 1As shown, the virtual address translation device 10 includes a cache hit check unit 11, a tag cache 12, a data cache 14, a queue 15 and a search output unit 16. Among them, the cache hit check unit 11 receives a virtual address, and the cache hit check unit 11 queries whether the tag cache 12 contains a virtual base address corresponding to the virtual address. The virtual base address can also be understood as a base address tag in the technical knowledge of the art. In the case where the tag cache 12 contains a virtual base address identical to the virtual address, the virtual address and the virtual base address identical to the virtual address are transmitted to the queue 15. The search output unit 16 obtains the virtual address in the queue 15, and the virtual base address identical to the virtual address, to translate the virtual address into a physical address, wherein the search output unit 16 obtains an offset address according to the virtual address and the virtual base address. In addition, the search output unit 16 obtains a physical base address corresponding to the virtual base address from the data cache 14 through the tag cache 12. Since the offset address determined according to the virtual address and the virtual base address is the same as the offset address determined according to the physical address and the physical base address, the offset address obtained according to the virtual address and the virtual base address is added to the physical base address corresponding to the virtual base address, and the sum is the physical address obtained by the virtual address translation device after translating the virtual address.

[0041] On the contrary, when there is no virtual base address identical to the virtual address in the tag cache 12, the virtual address is transmitted to the queue 15, and the virtual address translation device 10 needs to access the memory address mapping of the address management unit to obtain the physical address corresponding to the virtual address. It should be noted that the virtual address translation device 10 stores the mapping relationship between some virtual base addresses and physical base addresses, and the address management unit stores the mapping relationship between all virtual addresses and physical addresses. In the case of a virtual address miss, the virtual address translation device needs to access the address management unit to obtain the physical address corresponding to the virtual address.

[0042] It can be seen that in the process of translating virtual addresses into physical addresses in the related technology, when the virtual address translation device receives a non-duplicate virtual address, the virtual address will not hit. Therefore, the hit rate of the virtual address translation device is low, and it is necessary to frequently access the memory address mapping of the address management unit, thereby increasing the time required for translating virtual addresses and physical addresses, resulting in a significant reduction in the performance of the virtual address translation device.

[0043] Therefore, how to improve the efficiency of virtual address and physical address translation becomes an urgent problem to be solved.

[0044] In view of the above problems, the present application proposes a virtual address translation method. Figure 2 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 1 .like Figure 2 As shown, the method is applied to an address translation device and at least includes steps S201 to S203.

[0045] Step S201: receiving an address translation command carrying an original virtual address, and converting the original virtual address based on the number of address adjustment bits to obtain a first virtual address.

[0046] Here, the address translation command is issued by an access source, which may be, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), or other access sources that access data through virtual addresses.

[0047] Among them, the access source carries the original virtual address in the address translation command based on the access demand, the original virtual address is used to translate into the target physical address, and the target physical address is used to be transmitted to the data source.

[0048] The address adjustment bit number is used to determine the address bit number of the first virtual address. In other words, the first virtual address obtained by converting the original virtual address based on the address adjustment bit number is reduced by the address adjustment bit number compared to the original virtual address. In some embodiments, the aforementioned reduced address bit number corresponds to the address adjustment bit number number of address low bits of the original virtual address.

[0049] Correspondingly, the obtained first virtual address is used to compare with the virtual base address to obtain a hit check result of whether the original virtual address hits.

[0050] In some embodiments, the above conversion of the original virtual address based on the address adjustment bit number can be achieved by right-shifting the original virtual address based on the address adjustment bit number to obtain the first virtual address. That is, the original virtual address is right-shifted by the address adjustment bit number of address bits to obtain the first virtual address.

[0051] For example, if the original virtual address is 12000000 and the address adjustment bit number is 3, then the original virtual address 12000000 is shifted right by 3 address bits to obtain a first virtual address of 12000.

[0052] In some other embodiments, the above-mentioned conversion of the original virtual address based on the address adjustment bit number can be achieved by extracting the address high bit of the original virtual address based on the address adjustment bit number to obtain the first virtual address. That is, the address extraction bit number is obtained based on the address adjustment bit number and the address bit number of the original virtual address, and the address extraction bit number address high bits of the original virtual address are extracted to obtain the first virtual address.

[0053] For example, if the original virtual address is 12000000 and the address adjustment bit number is 3, then the address bit number of the original virtual address is 8. Based on the address bit number 8 of the original virtual address and the address adjustment bit number 3, the address extraction bit number is the difference between 8 and 3, which is equal to 5. The 5 high address bits of the original virtual address 12000000 are extracted to obtain the first virtual address 12000.

[0054] It should be noted that the "original virtual address" mentioned in the embodiments of the present application can be understood as the "virtual address" in the technical knowledge of the technical field to which the present application belongs that can be known to those skilled in the art. The "first virtual address" and "virtual base address" mentioned in the embodiments of the present application can be understood as the "base address of the virtual address" in the technical knowledge of the technical field to which the present application belongs that can be known to those skilled in the art. The "target physical address" mentioned in the embodiments of the present application can all be understood as the "physical address" in the technical knowledge of the technical field to which the present application belongs that can be known to those skilled in the art.

[0055] Step S202: Perform a hit check on the first virtual address to obtain a hit check result.

[0056] Here, the address translation device caches a virtual base address. Hit check refers to determining whether there is a virtual base address identical to the first virtual address in the address translation device. Accordingly, the hit check result may represent a hit of the first virtual address or a miss of the first virtual address. Wherein, in the case where there is a virtual base address identical to the first virtual address in the address translation device, the hit check result represents a hit of the first virtual address; in the case where there is no virtual base address identical to the first virtual address in the address translation device, the hit check result represents a miss of the first virtual address.

[0057] For example, the first virtual address obtained based on step S201 is 0x0000, and the address translation device stores virtual base addresses 0x0000, 0x0010, 0x1000, etc. Then, a hit check is performed on the first virtual address, and it is obtained that there is a virtual base address 0x0000 in the address translation device that is the same as the first virtual address 0x0000. Therefore, the hit check result indicates that the first virtual address hits.

[0058] For another example, the first virtual address obtained based on step S201 is 0x0000, and the address translation device stores virtual base addresses 0x0010, 0x1000, 0x1030, etc., then a hit check is performed on the first virtual address, and it is found that there is no virtual base address in the address translation device that is the same as the first virtual address 0x0000. Therefore, the hit check result indicates that the first virtual address is a miss.

[0059] Step S203: when the hit check result indicates that the first virtual address hits, obtain the first physical address corresponding to the first virtual address, and determine the target physical address corresponding to the original virtual address based on the original virtual address, the first virtual address and the first physical address.

[0060] Here, the address translation device stores a physical base address, and there is a mapping relationship between the physical base address and the aforementioned virtual base address.

[0061] It should be noted that when receiving an address translation command carrying an original virtual address, the first virtual address obtained based on the original virtual address is the current virtual base address; the virtual base address stored in the address translation device for determining whether the first virtual address hits is the cached virtual base address. Similarly, the first physical address obtained based on the current virtual base address is the current physical base address, and the physical base address stored in the address translation device is the cached physical base address.

[0062] Wherein, when the hit check result indicates that the first virtual address is hit, a physical base address mapped by the virtual base address of the first virtual address hit is obtained, and the physical base address is used as the first physical address.

[0063] For example, if the first virtual address is 0x1000, the address translation device stores the virtual base address 0x1000 and the physical base address 0x1000 that has a mapping relationship with the virtual base address 0x1000, then, according to step S202, it can be obtained that the hit check result indicates that the first virtual address 0x1000 hits, the virtual base address hit by the first virtual address is the virtual base address 0x1000, the physical base address 0x1000 mapped by the virtual base address 0x1000 hit by the first virtual address is obtained, and the physical base address 0x1000 is used as the first physical address.

[0064] In the embodiment of the present application, since the offset address between the original virtual address and the first virtual address, and the offset address between the physical base address and the physical address are the same, it can be understood that the above-mentioned first virtual address, original virtual address, physical base address and physical address are in the same corresponding relationship. Therefore, in step S203, the target physical address corresponding to the original virtual address can be determined based on the original virtual address, the first virtual address and the first physical address.

[0065] It should be noted that the “first physical address” and “physical base address” mentioned in the embodiments of the present application can be understood as the “base address of the physical address” in the technical knowledge in the technical field to which the present application belongs, which can be known to technical personnel in this field.

[0066] In some embodiments, an offset address is obtained based on the original virtual address and the first virtual address, and the offset address is also equal to the offset address between the first physical address and the target physical address. Therefore, the target physical address can be obtained based on the offset address and the first physical address.

[0067] For example, the original virtual address is 0x00001000, the first virtual address is 0x0000, and the first physical address obtained is 0x0000. Then, based on the original virtual address 0x00001000 and the first virtual address 0x0000, the offset address 0x1000 is obtained; based on the offset address 0x1000 and the first physical address 0x0000, the target physical address 0x00001000 is obtained. It can be understood that the above example is only used to illustrate the implementation process of step S203. In the actual application scenario of the virtual address translation method, the target physical address corresponding to the original virtual address obtained is not necessarily the same as the original virtual address.

[0068] In an embodiment of the present application, an address translation device converts an original virtual address based on the number of address adjustment bits to obtain a first virtual address, performs a hit check on the first virtual address to obtain a hit check result, and when the hit check result indicates that the first virtual address hits, translates the original virtual address to obtain a target physical address, and the first virtual address is reduced by the number of address adjustment bits compared to the original virtual address, and compared with the technical solution of performing a hit check on the original virtual address in the related art, the granularity of judging whether the original virtual address hits is reduced, so that the original virtual address carried by the address translation command received by the address translation device, whether it is a linear or random non-repetitive virtual address, can be converted into the first virtual address for a hit check, so as to improve the hit rate of the original virtual address and reduce the time required for translating the original virtual address into a physical address, thereby improving the efficiency of virtual address and physical address translation.

[0069] Figure 3 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 2 .like Figure 3 As shown, based on Figure 2 Before step S201, the virtual address translation method may further include the following steps:

[0070] Step S301: Determine at least one page table parameter of a page table; wherein the page table parameter is used to characterize the size of the storage space represented by the page table.

[0071] In some embodiments, determining the page table parameters of the page table includes but is not limited to: at least one of the page table size or compression parameter, wherein the page table size refers to the space size of the storage address correspondence relationship contained in the page table, and the compression parameter refers to the number of physical addresses that can be determined based on the correspondence relationship.

[0072] For example, if the page table size is 4 kilobytes (Kb), the 4Kb is used to store the correspondence between the virtual base address and the physical base address. If the page table size is 8Kb, then the 8Kb is used to store the correspondence between the virtual base address and the physical base address. Because the more correspondences between the virtual base address and the physical base address stored, the larger the size of the storage space represented, therefore, the page table size of the page table is positively correlated with the size of the storage space represented by the page table.

[0073] For example, if the compression parameter is 4, then in the correspondence between a virtual base address and a physical base address, a total of 4 physical addresses can be determined for different original virtual addresses that hit the same virtual base address. In other words, a first physical address can correspond to 4 physical addresses; if the compression parameter is 8, then in the correspondence between a virtual base address and a physical base address, a total of 8 physical addresses can be determined for different original virtual addresses that hit the same virtual base address. In other words, a first physical address can correspond to 8 physical addresses. Therefore, the larger the compression parameter of the page table, the more physical addresses the page table represents, that is, the larger the size of the storage space represented by the page table.

[0074] Step S302: Determine the number of sub-address adjustment bits corresponding to each page table parameter.

[0075] Here, the number of adjustment bits of each sub-address is used to represent the degree of influence of the corresponding page table parameter on the number of address bits of the first virtual address.

[0076] For example, if the number of sub-address adjustment bits corresponding to a page table parameter is 2, then the sub-address adjustment bit number 2 is used to indicate that the impact of the page table parameter on the number of address bits of the first virtual address is two address bits less than the original virtual address. If the number of sub-address adjustment bits corresponding to a page table parameter is 1, then the sub-address adjustment bit number 1 is used to indicate that the impact of the page table parameter on the number of address bits of the first virtual address is one address bit less than the original virtual address.

[0077] In some embodiments, at least one page table parameter includes a page table size, and the above-mentioned determination of the number of sub-address adjustment bits corresponding to each page table parameter can be implemented through steps S3021 and S3022.

[0078] Step S3021, obtaining a multiple of the page table size relative to a standard value of the page table size.

[0079] The standard value of the page table size is determined according to the actual application of the address translation device and is used as a benchmark for the page table size to determine the number of sub-address adjustment bits corresponding to the page table size. It should be noted that the standard value of the page table size can be 4Kb, 8Kb or other values, and the embodiment of the present application does not impose specific restrictions on this.

[0080] In one example, if Figure 4 As shown in the figure, it is the corresponding relationship between the page table size and the number of sub-address adjustment bits. Figure 4 In the example, the standard value of the page table size can be 4Kb. In the case where the page table size of a page table is 8Kb, the multiple of the page table size 8Kb relative to the standard value of the page table size 4Kb is 2;

[0081] In the case of a page table with a page table size of 16Kb, the multiple of the page table size 16Kb relative to the standard value of the page table size 4Kb is 4;

[0082] In the case of a page table with a page table size of 64Kb, the multiple of the page table size of 64Kb relative to the standard value of the page table size of 4Kb is 16;

[0083] In the case of a page table with a page table size of 256Kb, the multiple of the page table size of 256Kb relative to the standard value of the page table size of 4Kb is 64;

[0084] In the case where the page table size of a page table is 2 megabytes (MByte, MB), the multiple of the page table size 2MB relative to the standard value of the page table size 4Kb is 512;

[0085] In the case of a page table with a page table size of 32MB, the multiple of the page table size of 32MB relative to the standard value of the page table size of 4Kb is 8192;

[0086] In the case where the page table size of a page table is 512MB, the multiple of the page table size 512MB relative to the standard value of the page table size 4Kb is 131072, and so on.

[0087] Step S3022: convert the multiple into an exponential power with a base number as the base, and determine that the exponent in the exponential power is the number of sub-address adjustment bits corresponding to the page table size.

[0088] Here, the base of the system is determined by the system used by the address translation device. It can be understood that when the address translation device uses binary, the base of the system is two; when the address translation device uses decimal, the base of the system is ten; when the address translation device uses hexadecimal, the base of the system is sixteen, and so on.

[0089] For example, Figure 4As shown, the address translation device adopts binary, then, when the multiple is 2, 2 is converted into the exponent power 2^1, and the exponent 1 in the exponent power 2^1 is determined to be the number of sub-address adjustment bits corresponding to the page table size;

[0090] When the multiple is 4, 4 is converted into an exponent 2^2, and the exponent 2 in the exponent 2^2 is determined to be the number of sub-address adjustment bits corresponding to the page table size;

[0091] When the multiple is 16, 16 is converted into an exponent 2^4, and the exponent 4 in the exponent 2^4 is determined to be the number of sub-address adjustment bits corresponding to the page table size;

[0092] When the multiple is 64, 64 is converted into an exponent 2^6, and the exponent 6 in the exponent 2^6 is determined to be the number of sub-address adjustment bits corresponding to the page table size;

[0093] When the multiple is 512, 512 is converted into an exponent 2^9, and the exponent 9 in the exponent 2^9 is determined to be the number of sub-address adjustment bits corresponding to the page table size;

[0094] When the multiple is 8192, 8192 is converted into an exponent 2^13, and the exponent 13 in the exponent 2^13 is determined to be the number of sub-address adjustment bits corresponding to the page table size;

[0095] When the multiple is 131072, 131072 is converted into an exponent 2^17, and the exponent 17 in the exponent 2^17 is determined to be the number of sub-address adjustment bits corresponding to the page table size.

[0096] It can be understood that, in the case where the page table size of a page table is 4Kb, the multiple of the page table size 4Kb relative to the standard value of the page table size 4Kb is 1. Accordingly, 2 is converted to the exponent 2^0, and the exponent 0 in the exponent 2^0 is determined to be the number of sub-address adjustment bits corresponding to the page table size.

[0097] In an embodiment of the present application, based on different page table sizes, it is determined that different sub-address adjustment bits correspond to them, which can better adapt to different page table sizes, convert the original virtual address into the first virtual address, improve the hit rate of the first virtual address, and thus effectively improve the efficiency of virtual address and physical address translation.

[0098] In some embodiments, at least one page table parameter includes a compression parameter, and the above-mentioned determination of the number of sub-address adjustment bits corresponding to each page table parameter can be implemented through step S3023.

[0099] Step S3023: convert the compression parameter into an exponential power with a base number as the base, and determine that the exponent in the exponential power is the number of sub-address adjustment bits corresponding to the compression parameter.

[0100] Here, the compression parameter is determined by the compression mode, and the number of consecutive page tables in the compression mode is the compression parameter. For example, when the number of consecutive page tables in the compression mode is 4, the compression parameter is 4; when the number of consecutive page tables in the compression mode is 8, the compression parameter is 8; when the number of consecutive page tables in the compression mode is 16, the compression parameter is 16, and so on.

[0101] In one example, if Figure 5 As shown in FIG. 1 , it is a diagram showing the corresponding relationship between the compression parameters and the number of bits of the sub-address adjustment. Figure 5 In the case where the compression parameter of a page table is 4, the compression parameter 4 is converted into an exponential power 2^2, and the exponent 2 of the exponential power is determined to be the number of sub-address adjustment bits corresponding to the compression parameter;

[0102] When a compression parameter of a page table is 8, the compression parameter 8 is converted into an exponent 2^3, and the exponent 3 of the exponent is determined as the number of sub-address adjustment bits corresponding to the compression parameter;

[0103] When the compression parameter of a page table is 16, the compression parameter 16 is converted into an exponent 2^4, and the exponent 4 of the exponent is determined as the number of sub-address adjustment bits corresponding to the compression parameter, and so on.

[0104] It can be understood that when the compression parameter of a page table is 0, that is, when the page table is not compressed, the number of sub-address adjustment bits corresponding to the compression parameter is 0.

[0105] In an embodiment of the present application, based on the compression parameters of different page tables, it is determined that they correspond to different sub-address adjustment bits, which can better adapt to different compression parameters, convert the original virtual address into the first virtual address, improve the hit rate of the first virtual address, and thus effectively improve the efficiency of virtual address and physical address translation.

[0106] In other embodiments, at least one page table parameter includes a page table size and a compression parameter, and the number of sub-address adjustment bits corresponding to the page table size is determined according to steps S3021 and S3022, and the number of sub-address adjustment bits corresponding to the compression parameter is determined according to step S3023.

[0107] Step S303: Determine the address adjustment bit number based on the number of each sub-address adjustment bit number.

[0108] In some embodiments, when the determined at least one page table parameter includes the page table size, the number of sub-address adjustment bits corresponding to the page table size is determined as the number of address adjustment bits.

[0109] In some embodiments, when the determined at least one page table parameter includes a compression parameter, the number of sub-address adjustment bits corresponding to the compression parameter is determined as the number of address adjustment bits.

[0110] In other embodiments, when at least one determined page table parameter includes a page table size and a compression parameter, the sum of the number of sub-address adjustment bits corresponding to the page table size and the number of sub-address adjustment bits corresponding to the compression parameter is obtained, and the sum of the number of bits is used as the address adjustment bit.

[0111] In one example, the standard value of the page table size is 4Kb, and the address translation device uses binary, such as Figure 6 As shown, it is a corresponding relationship diagram for determining the number of address adjustment bits of page table parameters. When the page table size of the page table is 4Kb, the number of sub-address adjustment bits corresponding to the page table size is determined to be 0. At this time, when the compression parameter of the page table is 0, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 0, the number of sub-address adjustment bits 0 corresponding to the page table size and the number of sub-address adjustment bits 0 corresponding to the compression parameter are summed, and the sum of the number of bits obtained is 2 as the number of address adjustment bits; when the compression parameter of the page table is 4, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 2, the number of sub-address adjustment bits 0 corresponding to the page table size and the number of sub-address adjustment bits 2 corresponding to the compression parameter are summed, and the sum of the number of bits obtained is 2 as the number of address adjustment bits; when the compression parameter of the page table is 8, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 3, the number of sub-address adjustment bits 0 corresponding to the page table size and the number of sub-address adjustment bits 3 corresponding to the compression parameter are summed, and the sum of the number of bits obtained is 3 as the number of address adjustment bits; when the compression parameter of the page table is 16, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 4, the number of sub-address adjustment bits 0 corresponding to the page table size and the number of sub-address adjustment bits 4 corresponding to the compression parameter are summed, and the sum of the number of bits obtained is 4 as the number of address adjustment bits.

[0112] When the page table size of the page table is 8Kb, the number of sub-address adjustment bits corresponding to the page table size is determined to be 1. At this time, when the compression parameter of the page table is 0, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 0, and the number of sub-address adjustment bits 1 corresponding to the page table size and the number of sub-address adjustment bits 0 corresponding to the compression parameter are summed, and the sum of the obtained bits 1 is used as the address adjustment bit; when the compression parameter of the page table is 4, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 2, and the number of sub-address adjustment bits 1 corresponding to the page table size and the number of sub-address adjustment bits 2 corresponding to the compression parameter are summed, and The total number of bits obtained is 3 as the number of address adjustment bits; when the compression parameter of the page table is 8, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 3, and the number of sub-address adjustment bits 1 corresponding to the page table size and the number of sub-address adjustment bits 3 corresponding to the compression parameter are summed, and the total number of bits obtained is 4 as the number of address adjustment bits; when the compression parameter of the page table is 16, the number of sub-address adjustment bits corresponding to the compression parameter is determined to be 4, and the number of sub-address adjustment bits 1 corresponding to the page table size and the number of sub-address adjustment bits 4 corresponding to the compression parameter are summed, and the total number of bits obtained is 5 as the number of address adjustment bits, and so on.

[0113] When the page table sizes are 16Kb, 64Kb, 256Kb, 2Mb, 32Mb, and 512Mb, respectively, the address adjustment bit number determined based on different compression parameters is shown in FIG. Figure 6 shown.

[0114] In an embodiment of the present application, at least one page table parameter of a page table is determined, and the number of sub-address adjustment bits corresponding to each page table parameter is determined respectively, and then the number of address adjustment bits is determined, so that the address adjustment bit can be flexibly determined according to different types and usage of page tables. This can better adapt to the conversion of virtual addresses into first virtual addresses under different page table attributes, improve the hit rate of virtual addresses, and thus effectively improve the efficiency of virtual address translation under different page table types.

[0115] Figure 7 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 3 .like Figure 7 As shown, based on Figure 2 In some embodiments, step S203 may include steps S701 to S702.

[0116] Step S701: determine an offset address based on the original virtual address and the first virtual address.

[0117] Here, the offset address refers to the address difference between the original virtual address and the first virtual address, and the address difference is equal to the difference between the physical address and the physical base address. For details, see the specific implementation of the aforementioned step S203. It can be understood that the offset address is not only used to represent the address difference between the original virtual address and the first virtual address, but also can be used to represent the address offset between the target physical address and the first physical address.

[0118] In some embodiments, the above-mentioned determination of the offset address based on the original virtual address and the first virtual address can be implemented through step S7011.

[0119] Step S7011, align the original virtual address and the first virtual address, and use the obtained alignment result as the offset address.

[0120] Here, the step of obtaining the offset address is also referred to as differential alignment.

[0121] For example, if the original virtual address is 0x1000001000 and the first virtual address is 0x100, then the difference between the original virtual address and the first virtual address is aligned, and the offset address is 0x0001000. If the original virtual address is 0x0100101000 and the first virtual address is 0x010, then the difference between the original virtual address and the first virtual address is aligned, and the offset address is 0x0101000.

[0122] Step S702: Determine a target physical address based on the offset address and the first physical address.

[0123] In some embodiments, the above-mentioned determination of the target physical address based on the offset address and the first physical address can be implemented through step S7021.

[0124] Step S7021, obtain the address sum of the offset address and the first physical address, and use the address sum as the target physical address.

[0125] Here, obtaining the address sum refers to taking the first physical address as the high-order address and the offset address as the low-order address.

[0126] For example, if the first physical address is 100 and the offset address is 0001000, then the target physical address is the sum of the first physical address 100 and the offset address 0001000, and the target physical address obtained is 1000001000.

[0127] It should be noted that the “high address” and “low address” mentioned in the embodiments of the present application can be respectively understood as the “high address” and “low address” in the technical knowledge in the technical field to which the present application belongs, which can be known to those skilled in the art.

[0128] In the embodiment of the present application, the offset address is determined according to the first virtual address and the original virtual address. Because the offset address between the virtual address and the virtual base address is the same as the offset address between the physical base address and the physical address, the target physical address is determined according to the offset address and the obtained first physical address. After the virtual address is converted into the current virtual base address based on the number of address adjustment bits for a hit check, the process of determining the target physical address based on the current virtual base address is very concise and easy to operate, thereby ensuring the efficiency of the translation between the virtual address and the physical address.

[0129] For example, in some address translation devices, the offset address can reach 16 times the maximum value of the page table. Correspondingly, the difference between the virtual address and the virtual base address is large, and the granularity of the hit check on the virtual address is extremely low, thereby improving the hit rate of the current virtual base address and ensuring the efficiency of the virtual address and physical address translation.

[0130] Figure 8 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 4 .like Figure 8 As shown, the virtual address translation method may further include step S801 and step S804.

[0131] Step S801 : when the hit check result indicates that the first virtual address is not hit, determine the corresponding data physical address based on the original virtual address.

[0132] Here, the address management unit stores the mapping relationship between all virtual addresses and physical addresses. Based on the mapping relationship, the data physical address corresponding to the original virtual address is determined.

[0133] It can be understood that the “data physical address” mentioned in the embodiments of the present application can be understood as the “physical address” in the technical knowledge in the technical field to which the present application belongs that can be known to those skilled in the art.

[0134] In some embodiments, when the hit check result indicates that the first virtual address is not hit, the address translation device sends the original virtual address of the miss to the address management unit, and obtains the data physical address corresponding to the original virtual address from the address management unit. Accordingly, the address management unit transmits the page table size and / or compression parameter corresponding to the data physical address to the physical address determination unit of the address translation device.

[0135] Step S802: based on the address adjustment bit number, convert the original virtual address to obtain a second virtual address, and store the second virtual address in the tag cache.

[0136] Here, the address adjustment bit number is determined according to the page table size and / or compression parameter corresponding to the data physical address. The address management unit includes a page table for storing the correspondence between the virtual address and the physical address, and the page table size and / or compression parameter of the page table are used to characterize the size of the storage space represented by the page table.

[0137] Among them, the second virtual address stored in the tag cache is the virtual base address of the cache. When an address translation command carrying the virtual address is subsequently received, the virtual address is converted into the first virtual address to determine whether there is a virtual base address of the cache corresponding to the first virtual address in the tag cache; if there is a virtual base address of the cache corresponding to the first virtual address in the tag cache, the first virtual address hits, and if there is no virtual base address of the cache corresponding to the first virtual address in the tag cache, the first virtual address misses. It can be understood that the "second virtual address" mentioned in the embodiments of the present application can be understood as the "base address of the virtual address" in the technical knowledge in the technical field to which the present application belongs that can be known to those skilled in the art.

[0138] In other embodiments, the tag cache is used to store the virtual base address of the cache and the data pointer corresponding to the virtual base address of the cache, and the data pointer is used to point to the physical base address corresponding to the virtual base address of the cache. Accordingly, in the case of a hit of the first virtual address, the physical base address corresponding to the first virtual address can be obtained according to the data pointer corresponding to the virtual base address of the cache.

[0139] In some other embodiments, the address translation device further includes a data cache, the data cache being used to store a physical base address corresponding to the cached virtual base address. Accordingly, in the case of a first virtual address hit, the physical base address corresponding to the first virtual address can be obtained from the data cache according to the data pointer corresponding to the cached virtual base address.

[0140] In some embodiments, the solution of "determining the number of address adjustment bits according to the page table size and / or compression parameters" can be implemented by referring to the specific implementation method of obtaining the number of address adjustment bits in the aforementioned steps S302 and S303.

[0141] In some embodiments, the above-mentioned solution of converting the original virtual address based on the number of address adjustment bits to obtain the second virtual address can be implemented by referring to the specific implementation method of converting the original virtual address based on the number of address adjustment bits to obtain the first virtual address in S201 above.

[0142] In other embodiments, it can be understood that when the page table size and / or compression parameters corresponding to the data physical address are respectively the same as the page table size and / or compression parameters of the page table where the cached virtual base address is located, the determined number of address adjustment bits is the same as the number of address adjustment bits.

[0143] Step S803: Determine the second physical address based on the original virtual address, the second virtual address and the data physical address.

[0144] Here, the second physical address is used to store in the data cache of the address translation device as the physical base address of the cache. Wherein, when an address translation command carrying a virtual address is subsequently received and the hit check result indicates that the first virtual address hits, the physical base address corresponding to the first virtual address is obtained from the data cache.

[0145] It can be understood that the “second physical address” mentioned in the embodiments of the present application can be understood as the “base address of the physical address” in the technical knowledge in the technical field to which the present application belongs, which can be known to those skilled in the art.

[0146] In some embodiments, the original virtual address and the second virtual address are aligned, and the obtained alignment result is used as the second offset address. Because the offset address between the virtual address and the virtual base address is the same as the offset address between the physical base address and the physical address, the second physical address is determined based on the second offset address and the data physical address. In other words, the original virtual address and the second virtual address are aligned, the obtained alignment result is used as the second offset address, the data physical address is subtracted from the second offset address, and the obtained alignment result is used as the second physical address. The second physical address is used to store in the data cache and serve as the virtual base address of the cache.

[0147] Step S804: store the second physical address in the data cache, and store the address correspondence between the second virtual address and the second physical address in the tag cache, wherein the second physical address is used to determine the target physical address corresponding to the address translation command including the second virtual address.

[0148] In some embodiments, when an address translation command carrying a virtual address is subsequently received and the hit check result indicates that the first virtual address is hit, a physical base address corresponding to the first virtual address is obtained from the data cache based on the correspondence between the hit virtual base address and the physical base address. Accordingly, a target physical address is determined based on the first virtual address, the virtual address and the physical base address.

[0149] Here, the address correspondence between the second virtual address and the second physical address is used to determine the second physical address in the data cache. Exemplarily, the address correspondence can be a pointer to the second physical address in the data cache, or it can be the address of the second physical address in the data cache, which is not limited in this application.

[0150] In an embodiment of the present application, for a missed original virtual address, the data physical address corresponding to the original virtual address is obtained from the address management unit. The address translation device determines the address adjustment bit number according to the page table size and / or compression parameter corresponding to the data physical address, converts the original virtual address based on the address adjustment bit number, obtains the second virtual address, and stores the second virtual address in the tag cache as the virtual base address of the cache. The address translation device obtains the second physical address according to the original virtual address, the second virtual address and the data physical address, and stores the second physical address in the data cache as the physical base address of the cache. It can be understood that the second virtual address stored in the tag cache and the second physical address stored in the data cache expand the correspondence between the virtual base address and the physical base address contained in the address translation device, which is used for hit checking and translation of the virtual address when an address translation command carrying the virtual address is received later, thereby improving the hit rate of the original virtual address, thereby improving the efficiency of virtual address and physical address translation.

[0151] Fig. 9 A schematic diagram of the implementation process of a virtual address translation method provided in an embodiment of the present application Figure 5 .like Fig. 9 As shown, the address translation device includes a tag cache and a data cache, the tag cache is used to store the address correspondence between the historical virtual address and the historical physical address, the data cache includes the historical physical address, step S202 includes step S901, and step S203 also includes step S902.

[0152] Step S901 : performing a hit check on the first virtual address in the tag cache to obtain a hit check result; the hit check result indicates whether there is a historical virtual address corresponding to the first virtual address in the tag cache.

[0153] Here, the historical virtual address refers to the virtual base address of the cache stored in the tag cache. It can be understood that the historical virtual address includes the second virtual address stored in the tag cache in step S802.

[0154] It can also be understood that when the address translation device is reset or cleared, the storage space of the data cache and the tag cache may be empty, and the embodiments of the present application do not impose specific limitations on this.

[0155] Among them, when the hit check result indicates that there is a historical virtual address corresponding to the first virtual address in the tag cache, the hit check result indicates that the first virtual address is hit; when the hit check result indicates that there is no historical virtual address corresponding to the first virtual address in the tag cache, the hit check result indicates that the first virtual address is not hit.

[0156] Step S902: when the hit check result indicates that there is a historical virtual address corresponding to the first virtual address in the tag cache, based on the address correspondence relationship between the historical virtual address and the historical physical address, use the historical physical address as the first physical address.

[0157] Here, the historical physical address refers to the physical base address of the cache stored in the data cache. It can be understood that the historical physical address includes the second physical address stored in the data cache in step S804.

[0158] Taking the address correspondence between the above historical virtual address and the historical physical address as the data pointer corresponding to the historical virtual address as an example, the first virtual address is 0x010, the tag cache has a historical virtual address 0x010, and a data pointer p1 corresponding to the historical virtual address 0x010, and the data cache stores the historical physical address 0x010 corresponding to the historical virtual address 0x010. Then, according to step S201, it can be known that the hit check result indicates that the tag cache has the historical virtual address 0x010 corresponding to the first virtual address 0x010, then, according to the data pointer p1, the historical physical address 0x010 corresponding to the historical virtual address 0x010 is obtained from the data cache; the historical physical address 0x010 is used as the first physical address 0x010.

[0159] Based on the same concept, an embodiment of the present application also provides an address translation device, which includes the units included and the modules included in the units, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0160] like Fig.10 FIG. 1 is a schematic diagram of the structure of an address translation device provided in an embodiment of the present application. Figure 1 An address translation device 200 provided in an embodiment of the present application includes an address adjustment unit 1010, a hit check unit 1020, and a physical address calculation unit 1030, wherein the address adjustment unit 1010 is used to receive an address translation command carrying an original virtual address, and convert the original virtual address based on the address adjustment bit number to obtain a first virtual address;

[0161] A hit check unit 1020, configured to perform a hit check on the first virtual address to obtain a hit check result;

[0162] The physical address calculation unit 1030 is used to obtain the first physical address corresponding to the first virtual address when the hit check result indicates that the first virtual address hits, and determine the target physical address corresponding to the original virtual address based on the original virtual address, the first virtual address and the first physical address.

[0163] In some embodiments, the address adjustment unit 1010 shifts the original virtual address rightward based on the address adjustment bit number to implement the above conversion of the original virtual address based on the address adjustment bit number to obtain the first virtual address. That is, the address adjustment unit 1010 shifts the original virtual address rightward by the address adjustment bit number of address bits to obtain the first virtual address.

[0164] In some other embodiments, the address adjustment unit 1010 extracts the address high bits of the original virtual address based on the address adjustment bit number, and implements the above conversion of the original virtual address based on the address adjustment bit number to obtain the first virtual address. That is, the address adjustment unit 1010 obtains the address extraction bit number based on the address adjustment bit number and the address bit number of the original virtual address, extracts the address extraction bit number address high bits of the original virtual address, and obtains the first virtual address.

[0165] The address translation device 200 stores a virtual base address and a physical base address, and a mapping relationship exists between the physical base address and the virtual base address. The hit check unit 1020 performs a hit check to determine whether there is a virtual base address identical to the first virtual address in the address translation device. When the hit check result indicates that the first virtual address hits, the physical address calculation unit 1030 obtains the physical base address mapped to the virtual base address hit by the first virtual address, and uses the physical base address as the first physical address.

[0166] In an embodiment of the present application, the address translation device 200 converts the original virtual address based on the number of address adjustment bits to obtain a first virtual address, performs a hit check on the first virtual address to obtain a hit check result, and when the hit check result indicates that the first virtual address hits, translates the original virtual address to obtain a target physical address, and the first virtual address is reduced by the number of address adjustment bits compared to the original virtual address, and compared with the technical solution of performing a hit check on the original virtual address in the related art, the granularity of judging whether the original virtual address hits is reduced, so that the original virtual address carried by the address translation command received by the address translation device 200, whether it is a linear or random non-repetitive virtual address, can be converted into the first virtual address for a hit check, so as to improve the hit rate of the original virtual address and reduce the time required for translating the original virtual address into a physical address, thereby improving the efficiency of virtual address and physical address translation.

[0167] like Fig.11 FIG. 1 is a schematic diagram of the structure of an address translation device provided in an embodiment of the present application. Figure 2 .based on Fig.10In some embodiments, the address translation device 200 further includes a granularity determination unit 1040, which is used to determine at least one page table parameter of the page table, wherein the page table parameter is used to characterize the size of the storage space represented by the page table; determine the number of sub-address adjustment bits corresponding to each page table parameter, and determine the number of address adjustment bits based on each sub-address adjustment bit.

[0168] In some embodiments, at least one page table parameter includes a page table size, and the granularity determination unit 1040 is also used to: obtain a multiple of the page table size relative to a standard value of the page table size; convert the multiple into an exponential power with a base as a base, and determine that the exponent in the exponential power is the number of sub-address adjustment bits corresponding to the page table size.

[0169] In some embodiments, at least one page table parameter includes a compression parameter, and the granularity determination unit 1040 is further used to: convert the compression parameter into an exponential power with a base number as the base, and determine that the exponent in the exponential power is the number of sub-address adjustment bits corresponding to the compression parameter.

[0170] In some other embodiments, at least one page table parameter includes a page table size and a compression parameter, and the granularity determination unit 1040 determines the page table size and the number of sub-address adjustment bits corresponding to the compression parameter, respectively.

[0171] In some embodiments, when the determined at least one page table parameter includes the page table size, the granularity determination unit 1040 is configured to determine the number of sub-address adjustment bits corresponding to the page table size as the number of address adjustment bits.

[0172] In some embodiments, when the determined at least one page table parameter includes a compression parameter, the granularity determination unit 1040 is configured to determine the number of sub-address adjustment bits corresponding to the compression parameter as the number of address adjustment bits.

[0173] In other embodiments, when at least one determined page table parameter includes a page table size and a compression parameter, the granularity determination unit 1040 is used to obtain the sum of the number of sub-address adjustment bits corresponding to the page table size and the number of sub-address adjustment bits corresponding to the compression parameter, and use the sum of the number of bits as the address adjustment bit.

[0174] In some embodiments, the physical address calculation unit 1030 is further used to: determine an offset address based on the original virtual address and the first virtual address; and determine a target physical address based on the offset address and the first physical address.

[0175] In some embodiments, the physical address calculation unit 1030 is further used to: align the original virtual address and the first virtual address, and use the obtained alignment result as the offset address.

[0176] In some embodiments, the physical address calculation unit 1030 is further used to obtain the sum of the offset address and the first physical address, and use the sum of the addresses as the target physical address.

[0177] like Fig.12 FIG. 1 is a schematic diagram of the structure of an address translation device provided in an embodiment of the present application. Figure 3 .based on Fig.11 In some embodiments, the address translation device 200 further includes a physical address determination unit 1050, wherein:

[0178] The address adjustment unit 1010 is further configured to: determine the corresponding data physical address based on the original virtual address when the hit check result indicates that the first virtual address is not hit; convert the original virtual address based on the address adjustment bit number to obtain a second virtual address, and store the second virtual address in the tag cache;

[0179] The physical address determination unit 1050 is used to: determine the second physical address based on the original virtual address, the second virtual address and the data physical address; store the second physical address in the data cache, and store the address correspondence between the second virtual address and the second physical address in the tag cache, the second physical address is used to determine the target physical address corresponding to the address translation command including the second virtual address.

[0180] In some embodiments, when the hit check result indicates that the first virtual address is not hit, the address adjustment unit 1010 is used to send the original virtual address of the miss to the address management unit 210, and obtain the data physical address corresponding to the original virtual address from the address management unit 210. Accordingly, the address management unit 210 transmits the page table size and / or compression parameter corresponding to the data physical address to the physical address determination unit 1050.

[0181] Among them, the second virtual address stored in the tag cache is the virtual base address of the cache. When the address translation device 200 subsequently receives an address translation command carrying a virtual address, the address adjustment unit 1010 is used to convert the virtual address into a first virtual address, and the hit check unit 1020 is used to determine whether there is a cached virtual base address corresponding to the first virtual address in the tag cache; if there is a cached virtual base address corresponding to the first virtual address in the tag cache, the first virtual address is hit, and accordingly, the physical address calculation unit 1030 is used to obtain the physical base address corresponding to the first virtual address from the data cache based on the address correspondence between the hit virtual base address and the physical base address. Accordingly, the physical address calculation unit 1030 is used to determine the target physical address based on the first virtual address, the virtual address and the physical base address; if there is no cached virtual base address corresponding to the first virtual address in the tag cache, the first virtual address is not hit.

[0182] like Fig.13 FIG. 1 is a schematic diagram of the structure of an address translation device provided in an embodiment of the present application. Figure 4 .based on Fig.12 In some embodiments, the address translation device 200 further includes a tag cache 1060 and a data cache 1070, wherein the tag cache 1060 is used to store the address correspondence between the historical virtual address and the historical physical address, and the data cache 1070 includes the historical physical address, wherein the hit check unit 1020 is further used to: perform a hit check on the first virtual address in the tag cache 1060 to obtain a hit check result; the hit check result indicates whether there is a historical virtual address corresponding to the first virtual address in the tag cache 1060;

[0183] The physical address calculation unit 1030 is further configured to obtain the historical physical address from the data cache 1070 based on the address correspondence between the historical virtual address and the historical physical address when the hit check result indicates that there is a historical virtual address corresponding to the first virtual address in the tag cache.

[0184] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0185] It should be noted that in the embodiment of the present application, if the above-mentioned virtual address translation method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the virtual address translation method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0186] The following describes the application of the virtual address translation method provided by the embodiment of the present application in a practical scenario. Fig.14, which is a flowchart of the virtual address translation method provided in an embodiment of the present application. Fig.15 for Fig.14 A composition structure diagram of an address translation device to which the virtual address translation method is applied.

[0187] In an embodiment of the present application, a virtual address translation method is applied to an address translation device. The address translation device 100 includes a page table adaptive adjustment unit 110 (corresponding to the granularity determination unit 1040 in the above embodiment), a virtual address adjustment unit 120 (corresponding to the address adjustment unit 1010 in the above embodiment), a cache hit check unit 130 (corresponding to the hit check unit 1020 in the above embodiment), an address management unit 140, a physical base address calculation unit 150 (corresponding to the physical address determination unit 1050 in the above embodiment), a tag cache 160, a data cache 170, a queue 180, and a physical address adaptive calculation unit 190 (corresponding to the physical address calculation unit 1030 in the above embodiment). The method includes at least the following steps:

[0188] Step S1401, when a virtual address (corresponding to the original virtual address in the above embodiment) is received, the page table adaptive adjustment unit 110 obtains a first shift number (corresponding to the number of address adjustment bits in the above embodiment) according to the page table size and the page table compression attribute (corresponding to the compression parameter in the above embodiment), and the virtual address adjustment unit 120 obtains a first shift address (corresponding to the first virtual address in the above embodiment) from the virtual address according to the first shift number.

[0189] The address translation device may be, but is not limited to, a translation lookaside buffer (TLB).

[0190] Here, the virtual address may be sent by an access source, which may be, but is not limited to, a processor or other running processes.

[0191] Among them, when the page table size is the minimum value and the page table compression attribute is also the minimum value, it indicates that there is no offset in the page table, and correspondingly, the first shift number is 0. It can be understood that in some embodiments, it can be set that when the page table size is not the minimum value and / or the page table compression attribute is not the minimum value, the first shift number calculation is performed again, the calculation of the first shift number is reduced, and the efficiency of the virtual address translation method is improved.

[0192] It should be noted that the minimum value of the page table size can be determined according to the actual situation of the virtual address translation system. For example, the minimum value of the page table size is 4Kb, and this embodiment of the application does not impose any specific restrictions on this. The minimum value of the compression attribute is 0, that is, the page table is not compressed.

[0193] For example, Fig.16 for Fig.15 The operation block diagram of the page table adaptive adjustment unit of the address translation device shown in FIG. Fig.16 As shown, the address translation device 100 includes multiple page tables, and the page table adaptive adjustment unit 110 performs page table compression shift calculation according to the compression attributes of the multiple page tables, and also performs page table size shift calculation according to the page table sizes of the multiple page tables, and adds the result of the page table compression shift calculation and the result of the page table size shift calculation to finally obtain the first shift number. It can be understood that the page table is located in the cache area of ​​the address translation device 100.

[0194] Step S1402 : The cache hit checking unit 130 queries whether the tag cache 160 contains a virtual base address corresponding to the first shift address (corresponding to the virtual base address of the cache in the above embodiment).

[0195] If the tag cache contains the same virtual base address as the first shift address, the virtual address hits and step S1407 is implemented. If the tag cache does not contain the same virtual base address as the first shift address, that is, the virtual address misses and step S1403 is implemented.

[0196] Step S1407: based on the tag cache pointer corresponding to the virtual base address in the tag cache 160 (corresponding to the address correspondence in the above embodiment), obtain the physical base address corresponding to the first shift address from the data cache (corresponding to the physical base address of the cache in the above embodiment).

[0197] Here, the tag cache pointer is used to point to the physical base address in the data cache that corresponds to the virtual base address.

[0198] In some embodiments, the address translation device is a TLB, which is arranged in a memory management unit (MMU). Accordingly, the cache hit check unit 130, the tag cache and the data cache can be located in the TLB. The cache hit check unit 130 can be used to query the virtual base address in the tag cache, and based on the tag cache pointer corresponding to the virtual base address, obtain the physical base address corresponding to the first shift address from the data cache.

[0199] Step S1403 : The virtual address adjustment unit 120 sends the virtual address to the address management unit 140 , and records the first shift address in the tag buffer 160 .

[0200] In some embodiments, the address translation device is a TLB, which is disposed in the MMU. The MMU also includes an address management unit 140, which is not specifically limited in the embodiments of the present application.

[0201] The address management unit 140 stores the mapping relationship between all virtual addresses and physical addresses. The tag cache contains the mapping relationship between some virtual base addresses and physical base addresses.

[0202] When the tag cache does not contain the virtual base address corresponding to the first shift address, the virtual address adjustment unit 120 sends the virtual address corresponding to the first shift address to the address management unit 140. Correspondingly, the address management unit 140 finds the physical address corresponding to the virtual address in the mapping relationship.

[0203] Secondly, the address management unit 140 transmits the received virtual address, the queried physical address, and the page table size and page table compression attribute corresponding to the physical address to the physical base address calculation unit 150 .

[0204] Step S1404, the physical base address calculation unit 150 receives the virtual address, physical address, page table size, and page table compression attributes sent back by the address management unit 140, and determines the second shift number (corresponding to the number of address adjustment bits in the above embodiment) according to the page table size and page table compression attributes corresponding to the physical address.

[0205] In an embodiment of the present application, the physical base address calculation unit 150 performs page table size offset calculation according to the page table size, performs page table compression offset calculation according to the page table compression attribute, accumulates the offset results obtained by the page table size offset calculation and the page table compression offset calculation, and obtains the second shift number.

[0206] Step S1405 : The physical base address calculation unit 150 determines a second shift address of the virtual address (corresponding to the second virtual address in the above embodiment) according to the second shift number, and replaces the first shift address recorded in the tag cache 160 with the second shift address.

[0207] Here, the second shift address is used to determine the physical address corresponding to the address translation command including the second shift address. Therefore, the second shift address and the first shift address are both virtual base addresses, wherein the first shift address is the current virtual base address; after the second shift address is stored in the tag cache, it becomes the historical virtual base address.

[0208] It should be noted that the address translation device 100 includes a queue 180, and both hit and miss virtual addresses are transmitted to the queue, waiting to be translated into physical addresses by the physical address adaptive calculation unit 190. Accordingly, in the process of the physical address adaptive calculation unit 190 obtaining the virtual address in the queue and translating it, for the hit virtual address, the physical address adaptive calculation unit 190 translates the physical address according to the virtual address, the aforementioned first virtual address and the physical base address, and outputs the physical address. For the miss virtual address, the physical address adaptive calculation unit 190 directly outputs the physical address returned by the address management unit as the translated physical address.

[0209] It can be understood that the physical address adaptive calculation unit 190 can output the translated physical address to the access source that transmits the virtual address to the address translation device, and the embodiment of the present application does not impose any specific limitation on this.

[0210] Step S1406: The physical base address calculation unit 150 subtracts the virtual address from the second shift address to obtain an offset address, and then aligns the offset address with the physical address to obtain a physical base address.

[0211] Here, the physical base address is stored in the data cache 170 , and the physical base address is used to determine the physical address corresponding to the address translation command including the second shift address.

[0212] like Fig.17 As shown, Fig.15 The operation block diagram of the physical base address calculation unit of the address translation device shown in FIG. Fig.17 In the embodiment, the physical base address calculation unit 150 receives the virtual address, the physical address, and the page table compression attribute and the page table size corresponding to the physical address sent back by the address management unit 140. The physical base address calculation unit 150 performs page table compression offset calculation according to the page table compression attribute corresponding to the physical address, and performs page table size offset calculation according to the page table size corresponding to the physical address, and accumulates the results of the page table compression offset calculation and the page table size offset calculation, and uses the accumulated result as the second shift number. The physical base address calculation unit 150 calculates the virtual address offset according to the second shift number to obtain the second shift address, and subtracts the virtual address from the second shift address to obtain the offset address. The physical base address calculation unit 150 aligns the received physical address with the obtained offset address to obtain the physical base address, and outputs the physical base address to the data cache storage.

[0213] Step S1408, the physical address adaptive calculation unit 190 obtains the virtual address in the queue 180, and in the case of a virtual address hit, subtracts the virtual address from the corresponding virtual base address to obtain an offset address; adds the obtained offset address and the physical base address, and uses the sum as the translated physical address; in the case of a virtual address miss, uses the physical address sent back by the address management unit 140 as the translated physical address.

[0214] Here, the translated physical address is transmitted to the access source which sent the virtual address to the address translation device.

[0215] In some embodiments, when the compression attribute is not 0, that is, when the virtual base address is compressed, a virtual base address may correspond to multiple physical addresses. Correspondingly, when the virtual address of the queue is obtained and translated, a physical address is arbitrated from the corresponding multiple physical addresses, and the physical address is output to the access source. It can be understood that the arbitration of the above multiple physical addresses to obtain a physical address can be arbitrated according to a certain address priority or in other ways, and this application does not make specific restrictions on this.

[0216] like Fig.18 As shown, Fig.18 The operation block diagram of the physical address adaptive calculation unit of the address translation device is shown. Fig.18 In the process, the physical address adaptive calculation unit 190 obtains the virtual address in the queue 180, and performs virtual address offset calculation based on the virtual address and the first shift address obtained by conversion to obtain the offset address. Accordingly, the data cache 170 transmits the physical base address corresponding to the first shift address to the physical address adaptive calculation unit 190, and the physical address adaptive calculation unit 190 accumulates the obtained offset address and the received physical address, uses the accumulated result as the translated physical address, and outputs the physical address to the access source.

[0217] In an embodiment of the present application, a page table adaptive adjustment unit 110, a virtual address adjustment unit 120, a physical base address calculation unit 150 and a physical address adaptive calculation unit 190 are provided in the address translation device, and the page table adaptive adjustment unit 110 flexibly adjusts the first shift number according to the page table size and the page table compression attribute of the page table. Accordingly, the virtual address adjustment unit 120 converts the virtual address according to the first shift number to obtain a first shift address, and the number of address bits of the first shift address must be less than or equal to the number of address bits of the virtual address. Accordingly, the cache hit check unit 130 performs a hit check in the tag cache according to the first shift address. In addition, because the number of address bits of the virtual base address in the tag cache is the same as the number of address bits of the first shift address, it is also less than or equal to the number of address bits of the virtual address. Therefore, compared with the technical solution of performing a hit check based on the virtual address in the related art: the virtual address hits only when all the address bits of the virtual address are the same as all the address bits of the virtual base address in the tag cache. In the embodiment of the present application, the virtual address hits as long as all the address bits of the first shift address are the same as all the address bits of the virtual base address in the tag cache. It can be seen that in the embodiment of the present application, the number of address bits required to be judged for the hit check is less than or equal to that in the related art, thereby improving the hit rate of the virtual address, reducing the number of times the address translation device accesses the address management unit due to a virtual address miss, thereby reducing the delay in translating the virtual address into a physical address, and being able to quickly respond to the address translation command request of the virtual address of the access source, effectively improving the efficiency of translating the virtual address into a physical address, and improving the performance of the address translation device.

[0218] In the embodiment of the present application, the influence of the page table compression attribute on the physical address is taken into account, the first shift number and the second shift number are determined, and the address bits of the virtual base address are reduced, thereby improving the hit rate of converting the virtual address to the virtual base address for hit checking. It should be noted that the higher the compression degree represented by the page table compression attribute, that is, the more physical addresses corresponding to a physical base address, then the first shift number and the second shift number obtained according to the page table compression attribute are also larger, and accordingly, the address bits of the virtual base address obtained according to the first shift number and the second shift number are also fewer, thereby making the hit rate of converting the virtual address to the virtual base address for hit checking higher. In addition, in the embodiment of the present application, in the physical address and the corresponding virtual address, the offset address of the physical address relative to the physical base address and the offset address of the virtual address relative to the virtual base address are the same, and the translation between the virtual address and the physical address is realized, which has the advantages of simple translation process and high feasibility.

[0219] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0220] The embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The storage medium can be transient or non-transient.

[0221] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0222] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.

[0223] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.

[0224] Fig.19 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Fig.19 As shown, the hardware entity of the computer device 1900 includes: a processor 1901 and a memory 1902, wherein the memory 1902 stores a computer program that can be run on the processor 1901, and the processor 1901 implements the steps in the method of any of the above embodiments when executing the program.

[0225] The memory 1902 stores computer programs that can be run on the processor. The memory 1902 is configured to store instructions and applications executable by the processor 1901. It can also cache data to be processed or processed by the processor 1901 and various modules in the computer device 1900 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0226] When the processor 1901 executes the program, the steps of any of the above virtual address translation methods are implemented. The processor 1901 generally controls the overall operation of the computer device 1900.

[0227] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the virtual address translation method of any of the above embodiments.

[0228] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0229] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application are not specifically limited.

[0230] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0231] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.

[0232] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0233] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0234] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0235] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: mobile storage devices, read-only memory (ROM), disks or optical disks, etc. Various media that can store program codes.

[0236] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the virtual address translation method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0237] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A virtual address translation method, characterized in that: Applied to an address translation device, the virtual address translation method comprises: receiving an address translation command carrying an original virtual address, and converting the original virtual address based on the address adjustment bit number to obtain a first virtual address; Performing a hit check on the first virtual address to obtain a hit check result; When the hit check result indicates that the first virtual address hits, a first physical address corresponding to the first virtual address is obtained, and a target physical address corresponding to the original virtual address is determined based on the original virtual address, the first virtual address and the first physical address.

2. The virtual address translation method according to claim 1, characterized in that: The virtual address translation method further includes: Determine at least one page table parameter of the page table; wherein the page table parameter is used to characterize the size of the storage space represented by the page table; Determine the number of sub-address adjustment bits corresponding to each of the page table parameters; The address adjustment bit number is determined based on the number of each of the sub-address adjustment bits.

3. The virtual address translation method according to claim 2, characterized in that: The at least one page table parameter includes a page table size, and determining the number of sub-address adjustment bits corresponding to each of the page table parameters includes: Obtaining a multiple of the page table size relative to a standard value of the page table size; The multiple is converted into an exponential power with a base number as the base, and an exponent in the exponential power is determined to be the number of sub-address adjustment bits corresponding to the page table size.

4. The virtual address translation method according to claim 2, characterized in that: The at least one page table parameter includes a compression parameter, and determining the number of sub-address adjustment bits corresponding to each of the page table parameters includes: The compression parameter is converted into an exponential power with a base number as the base, and an exponent in the exponential power is determined to be the number of sub-address adjustment bits corresponding to the compression parameter.

5. The virtual address translation method according to claim 1, characterized in that: The determining, based on the original virtual address, the first virtual address and the first physical address, a target physical address corresponding to the original virtual address includes: determining an offset address based on the original virtual address and the first virtual address; The target physical address is determined based on the offset address and the first physical address.

6. The virtual address translation method according to claim 5, characterized in that: The determining of the offset address based on the original virtual address and the first virtual address comprises: The original virtual address and the first virtual address are aligned, and the obtained alignment result is used as the offset address.

7. The virtual address translation method according to any one of claims 1 to 6, characterized in that: The virtual address translation method further comprises: In a case where the hit check result indicates that the first virtual address is not hit, determining a corresponding data physical address based on the original virtual address; Based on the address adjustment bit number, converting the original virtual address to obtain a second virtual address, and storing the second virtual address in a tag cache; determining a second physical address based on the original virtual address, the second virtual address, and the data physical address; The second physical address is stored in a data cache, and an address correspondence between the second virtual address and the second physical address is stored in a tag cache, wherein the second physical address is used to determine a target physical address corresponding to an address translation command including the second virtual address.

8. The virtual address translation method according to any one of claims 1 to 6, characterized in that: The device comprises a tag cache and a data cache; the tag cache is used to store the address correspondence between the historical virtual address and the historical physical address, and the data cache comprises the historical physical address; When the hit check result indicates that the first virtual address is hit, obtaining a first physical address corresponding to the first virtual address includes: When the hit check result indicates that there is a historical virtual address corresponding to the first virtual address in the tag cache, based on the address correspondence between the historical virtual address and the historical physical address, the historical physical address is obtained from the data cache and used as the first physical address.

9. An address translation device, characterized in that: The address translation device comprises an address adjustment unit, a hit check unit and a physical address calculation unit, wherein: The address adjustment unit is used to receive an address translation command carrying an original virtual address, and convert the original virtual address based on the address adjustment bit number to obtain a first virtual address; The hit check unit is used to perform a hit check on the first virtual address to obtain a hit check result; The physical address calculation unit is used to obtain the first physical address corresponding to the first virtual address when the hit check result indicates that the first virtual address hits, and determine the target physical address corresponding to the original virtual address based on the original virtual address, the first virtual address and the first physical address.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the virtual address translation method according to any one of claims 1 to 8 are implemented.

11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the virtual address translation method according to any one of claims 1 to 8 are implemented.

12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps in the virtual address translation method according to any one of claims 1 to 8 are implemented.