Page table conversion method, page table converter, SOC and electronic equipment
Through the page table conversion method and converter, the problem of waste of storage resources caused by the differences in page table formats of different IP Core in SOC is solved, and the unified conversion of page table formats is realized, and the utilization rate and maintenance efficiency of storage resources are improved.
Patent Information
- Application Number
- CN202210174711.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-02-24
AI Technical Summary
In SOC, due to the differences in page table formats used by different IP Cores, it is necessary to save multiple different page tables in memory for each IP Core, which increases the consumption of storage resources.
Provide a page table conversion method and a page table converter. By receiving IP Core acquisition request, determine whether the target information belongs to a pre-configured shared page table, obtain and convert page table information, and convert it from a custom page table format to IP Core The page table format used is used to reduce multiple storage of page table formats in memory.
It effectively reduces the consumption of storage resources in SOC, improves the utilization rate of storage resources, and reduces the overhead of page table maintenance.
Smart Images

Figure CN116701249B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of page table conversion, and in particular to a page table conversion method, a page table converter, a SOC and an electronic device. Background Art
[0002] A SOC (System On Chip) using VM (Virtual Memory) may include multiple functional modules (IP Cores). Each IP Core has a corresponding page table (Page Table) and MMU (Memory Management Unit). Each IP Core can access the virtual address VA (Virtual Address) and convert the VA into a physical address PA (Physical Address) through the corresponding MMU. Finally, data is retrieved from the memory and returned to the IP Core to complete a data access. There may be a need for data interaction between the IP Cores in the same SOC. Therefore, there are page tables in different IP Cores that need to be synchronized. The logical mapping relationship of VA<->PA represented by these page tables that need to be synchronized is exactly the same.
[0003] Since the page table formats used by different IP Cores are different, under the traditional SOC architecture, a page table matching its page table format needs to be stored in the SOC memory for each IP Core. The IP Core loads its own page table from the memory when in use. Accordingly, multiple page tables with different page table formats but essentially the same logical mapping relationship need to be saved in the memory, which increases the consumption of storage resources. Summary of the invention
[0004] The purpose of the present disclosure is to provide a page table conversion method, a page table converter, a SOC and an electronic device, which can reduce the consumption of storage resources in the SOC and help improve the utilization rate of storage resources.
[0005] According to one aspect of the present disclosure, a page table conversion method is provided, which is applied to a page table converter connected to an IP Core, and the method includes: receiving a request for obtaining target information sent by the IP Core; determining whether the target information belongs to a shared page table pre-configured in a custom page table format; if so, obtaining page table information corresponding to the target information in the shared page table; according to a pre-configured page table conversion rule, converting the page table information from the custom page table format to a page table format used by the IP Core, and returning the converted page table to the IP Core; the shared page table is a page table that needs to be kept synchronized by multiple different IP Cores.
[0006] In a feasible implementation of the present disclosure, the acquisition request carries first information for characterizing the physical address where the target information is located, and a second information set for characterizing the physical address where the shared page table is stored is pre-configured in the page table converter; the judgment as to whether the target information belongs to a shared page table pre-configured in a custom page table format includes: judging whether the first information belongs to the second information set; and if so, characterizing that the target information belongs to the shared page table.
[0007] In a feasible implementation of the present disclosure, both the first information and the second information are physical addresses; or both the first information and the second information are identification bits used to represent physical addresses.
[0008] In a feasible implementation of the present disclosure, obtaining the page table information corresponding to the target information in the shared page table includes: routing the acquisition request to a memory for storing the shared page table through an on-chip bus network, and obtaining the page table information returned by the memory according to the acquisition request.
[0009] In a feasible implementation of the present disclosure, the bit width of the page table format used by the IP Core is N, the bit width of the custom page table format is M, N≠M and both are positive integers greater than 0, and before routing the acquisition request through an on-chip bus network to a memory for storing the shared page table, the method further includes: adjusting the data bits used to represent the target information in the acquisition request from the N bits to the M bits.
[0010] In a feasible implementation of the present disclosure, the converting of the page table information from the custom page table format to the page table format used by the IP Core includes: filtering a target field from various fields included in the page table information, the target field being a field included in the page table format used by the IP Core; adjusting the bit width of the target field to a target bit width, the target bit width being the bit width occupied by the target field in the page table format used by the IP Core; and adjusting the target field to a target position, the target position being the position of the target field in the page table format used by the IP Core.
[0011] In a feasible implementation of the present disclosure, the shared page table includes a multi-level page table, the page table information is a P-th level page table in the multi-level page table, and P is a positive integer greater than 0; the page table conversion rule includes page table conversion sub-rules corresponding to each level of page table; the converting of the page table information from the custom page table format to the page table format used by the IPCore includes: according to the page table conversion sub-rule corresponding to the P-th level page table, converting the page table information from the custom page table format to the page table format used by the IP Core.
[0012] In a feasible implementation of the present disclosure, the IP Core corresponds to the page table converter one by one; or, different IP Cores using the same page table format share the same page table converter; or, different IP Cores using different page table formats share the same page table converter.
[0013] According to another aspect of the present disclosure, a page table converter is further provided, the page table converter is used to connect to the IP Core, and the page table converter includes:
[0014] The address selector is configured to: receive an acquisition request for target information sent by the IP Core; when it is determined that the target information belongs to a shared page table configured in advance using a custom page table format, route the acquisition request to a memory for storing the shared page table through an on-chip bus network;
[0015] A data format converter is configured to perform a page table format conversion task: receiving page table information corresponding to the target information returned by the memory according to the acquisition request; and converting the page table information from the custom page table format into the page table format used by the IP Core, and returning it to the IP Core; the shared page table is a page table that multiple different IP Cores need to keep synchronized.
[0016] In a feasible implementation of the present disclosure, the acquisition request carries first information for characterizing the physical address where the target information is located; the address selector is configured to: determine whether the first information belongs to a pre-configured second information set for characterizing the physical address where the shared page table is stored; and if so, determine that the target information belongs to the shared page table.
[0017] In a feasible implementation of the present disclosure, both the first information and the second information are physical addresses; or both the first information and the second information are identification bits used to represent physical addresses.
[0018] In a feasible implementation of the present disclosure, the page table converter also includes a data size converter, which is configured to: when the bit width of the page table format used by the IP Core is N, the bit width of the custom page table format is M, N≠M and both are positive integers greater than 0, adjust the data bits used to represent the target information in the acquisition request from the N bits to the M bits.
[0019] In a feasible implementation of the present disclosure, the data format converter is configured to: filter a target field from various fields included in the page table information, wherein the target field is a field included in the page table format used by the IP Core; adjust the bit width of the target field to a target bit width, wherein the target bit width is the bit width occupied by the target field in the page table format used by the IP Core; and adjust the target field to a target position, wherein the target position is the position of the target field in the page table format used by the IP Core.
[0020] In a feasible implementation of the present disclosure, the shared page table includes a multi-level page table; the address selector is configured to: when determining that the target information belongs to the shared page table, mark the page table level where the target information is located in the shared page table;
[0021] The page table converter includes a page table tag memory configured to store a page table level of the target information;
[0022] The page table converter includes a data format converter corresponding to each level of page table included in the shared page table;
[0023] The page table converter includes a selector configured to: read the page table level of the target information stored in the page table tag memory, and select a data format converter corresponding to the page table level of the target information to perform the page table format conversion task.
[0024] According to another aspect of the present disclosure, it includes an on-chip bus network, a memory, multiple IP Cores that need to keep page tables synchronized, and a page table converter as described in any implementation method of the present disclosure, one of the IP Cores is connected to a corresponding page table converter, the IP Core and the page table converter are connected to the memory through the on-chip bus network, a shared page table that needs to be kept synchronized by the multiple IP Cores is configured in the memory, and the page table formats used by the multiple IP Cores are partially the same or completely different.
[0025] In a feasible implementation of the present disclosure, when the page table formats used by the multiple IP Cores are partially the same, the IP Cores using the same page table format among the multiple IP Cores are connected to the same page table converter, or are connected to different page table converters.
[0026] According to another aspect of the present disclosure, an electronic device is also provided, comprising the SOC described in any implementation manner of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a flow chart of a page table conversion method according to an embodiment of the present disclosure;
[0028] Figure 2 A schematic diagram of the structure of a page table converter according to an embodiment of the present disclosure;
[0029] Figure 3 It is a structural schematic diagram of a SOC in the prior art;
[0030] Figure 4 This is one of the structural schematic diagrams of a SOC according to an embodiment of the present disclosure;
[0031] Figure 5 This is the second structural diagram of the SOC according to an embodiment of the present disclosure;
[0032] Figure 6 This is the third structural diagram of the SOC according to an embodiment of the present disclosure.
[0033] Reference numerals: 400 - page table converter; 410 - address selector; 420 - data format converter; 430 - data size converter; 440 - page table tag memory; 450 - selector. DETAILED DESCRIPTION
[0034] Before introducing the embodiments of the present disclosure, it should be noted that:
[0035] Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be given sequential step numbers, the operation steps therein may be implemented in parallel, concurrently or simultaneously.
[0036] In the embodiments of the present disclosure, the terms "first", "second", etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used only to distinguish one feature from another.
[0037] The term “and / or” may be used in embodiments of the present disclosure. “And / or” includes any and all combinations of one or more of the associated features listed.
[0038] It should be understood that when describing the connection or communication relationship between two components, unless it is explicitly stated that the two components are directly connected or directly communicating, the connection or communication between the two components can be understood as direct connection or communication, or as indirect connection or communication through an intermediate component.
[0039] In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the exemplary embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0040] The following will introduce the page table conversion solution provided by the present disclosure.
[0041] In the prior art, multiple page tables need to be stored in the memory of the SOC. The page table formats of these multiple page tables are different, but the logical mapping relationship of VA-PA represented by them is essentially the same and needs to be kept synchronized. This method increases the consumption of storage resources in the memory.
[0042] In order to solve the above problems, an embodiment of the present disclosure provides a page table conversion method, which is applied to a page table converter connected to an IP Core, and the IP Core is located in a SOC. In addition, the SOC also includes other IP Cores that need to be identical and synchronized with part or all of the page tables of the IP Core. The same means that the logical mapping relationship of VA-PA represented by different page tables is the same. For the convenience of subsequent description, in some embodiments of the present disclosure, the IP Cores with such a relationship are referred to as multiple IP Cores with an associated relationship, and the page tables that need to be kept identical and synchronized by multiple IP Cores with an associated relationship are referred to as duplicate page tables.
[0043] Please refer to Figure 1 , the method may include:
[0044] S110: Receive a request for obtaining target information sent by the IP Core.
[0045] S120: Determine whether the target information belongs to a shared page table that is pre-configured using a custom page table format.
[0046] S130: If yes, obtain page table information corresponding to the target information in the shared page table.
[0047] S140: According to a pre-configured page table conversion rule, the page table information is converted from the custom page table format to a page table format used by the IP Core, and then returned to the IP Core.
[0048] In the embodiments of the present disclosure, the IP Core connected to the page table converter (for ease of description, it will be referred to as the target IP Core in some embodiments below) is one of a plurality of IP Cores that are associated with each other.
[0049] In addition, the shared page table involved in the embodiment of the present disclosure is pre-configured in the memory of the SOC using a unified custom page table format. When configuring the shared page table, the logical mapping relationship of VA-PA represented by the shared page table is configured to be equivalent to the logical mapping relationship of VA-PA represented by the duplicate page tables of multiple IP Cores with an associated relationship.
[0050] In some implementations, the content defined by the custom page table format includes: the number of page table levels, the directory format of each page table level, and the like.
[0051] The page table level is used to define the shared page table level. For example, when the page table level included in the custom page table format is 4, it means that the configured shared page table is a 4-level page table, and when the page table level included in the custom page table format is 1, it means that the configured shared page table is a single-level page table.
[0052] It is worth noting that in the embodiment of the present disclosure, the page table formats used by multiple associated IP Cores have the same page table levels, and the page table levels defined by the custom page table format need to be consistent with the page table levels used by multiple different IP Cores that have an associated relationship.
[0053] The directory format of each level of page table (the directory format of the highest level page table is PDE, the directory format of the lowest level page table is PTE, and the directory format of other levels of page tables is PCE) is used to define the fields that the shared page table needs to include in the page table of that level, including the common fields of the page table formats used by multiple IP Cores with an associated relationship in the page table of that level and the fields unique to each IPCore.
[0054] Assume that IP Core 1 and IP Core 2 are multiple IP Cores with an associated relationship, and the page table formats used by IP Core 1 and IP Core 2 are page table format 1 and page table format 2, respectively. The number of page table levels defined by page table format 1 and page table format 2 are both 4, and the directory format of the fourth-level page table defined by page table format 1 is shown in Table 1, and the directory format of the fourth-level page table defined by page table format 2 is shown in Table 2.
[0055] Table 1: Directory format of the fourth-level page table defined by page table format 1
[0056]
[0057]
[0058] Table 2: Directory format of the fourth-level page table defined by page table format 2
[0059]
[0060] As can be seen from Table 1 and Table 2 above, in the target format of the fourth-level page table defined by page table format 1 and page table format 2 respectively, there are common fields "Next-level table address", "0" and "1", and there are also fields "Attr1" unique to page table format 1 and "Attr2" unique to page table format 2. Then, in the target format of the fourth-level page table included in the custom page table format, it is necessary to define the fourth-level page table of the shared page table including the above common fields "Next-level table address", "0", "1" and the unique fields "Attr1" and "Attr2" of the above-mentioned respective page table formats. In this application scenario, the target format of the fourth-level page table included in the custom page table format can be shown in Table 3:
[0061] Table 3: Directory format of the fourth-level page table defined by the custom page table format
[0062] Bitmap 63-52 51-12 11-2 1 0 Bit field Attr1 Next-level table address Attr2 0 1
[0063] From the above examples, it can be seen that although the logical mapping relationship represented by the shared page table is the same as the logical mapping relationship represented by the duplicate page table of each IP Core, for a specific IP Core, the bit width occupied by the shared page table may be the same as or different from the bit width represented by the page table format it uses, and the attributes represented by each field may be the same or different.
[0064] The above-mentioned custom page table format can be stored in the memory of the SOC, so that the SOC automatically configures the shared page table according to the custom page table format each time it is powered on.
[0065] In addition, in the disclosed embodiment, a page table conversion rule corresponding to the target IP Core is pre-configured in the page table converter. The page table conversion rule records rule information for converting the custom page table format into the page table format used by the target IP Core, so that the page table converter can convert the shared page table presented in the custom page table format into a special page table presented in the page table format used by the target IP Core based on the page table conversion rule, so that the special page table can be parsed and used by the target IP Core.
[0066] After completing the above configuration, for the target IP Core among the multiple IP Cores that are associated, even if the page table format used by the target IP Core is different from the page table format of other IP Cores, there is no need to separately configure a duplicate page table that can be parsed by the target IP Core and presented in the page table format used by the target IP Core in the memory of the SOC. When the target IP Core needs to use the content represented by the duplicate page table, it can initiate a request to obtain the target information (partial or all of the shared page table) to the page table converter connected to it. After verifying that the target information belongs to the shared page table, the page table converter can obtain the page table information corresponding to the target information in the shared page table. Of course, the page table information at this time is presented in a custom page table format. Subsequently, the page table converter converts the page table information from the custom page table format to the page table format used by the target IP Core based on the page table conversion rules corresponding to the target IP Core and returns it to the target IP Core.
[0067] At this time, the page table information returned to the target IP Core is presented in the page table format used by the target IP Core. The target IP Core can parse it, so the target IP Core can successfully obtain the content represented by the duplicate page table.
[0068] Similarly, for other page tables in multiple IP Cores that are associated with each other, when there are corresponding page table converters, it is not necessary to separately save duplicate page tables presented in the page table format used by them in the SOC memory. The content of the duplicate page table can be obtained through the format conversion function of the corresponding page table converter.
[0069] That is to say, according to the page table conversion method provided in the present invention, there is no need to configure the duplicate page table into multiple duplicate page tables in different page table formats in the memory of the SOC. By configuring a shared page table in the memory and configuring corresponding page table converters for multiple IP Cores that are associated with each other, it is possible to avoid configuring multiple duplicate page tables in the memory of the SOC that have different page table formats but essentially represent the same logical mapping relationship, thereby reducing the storage resource consumption of the SOC memory and helping to improve the utilization of storage resources.
[0070] In some embodiments of the present disclosure, a page table conversion rule is configured in each page table converter.
[0071] Based on this, in some application scenarios, the IP Core with page table format conversion requirements and the table converter are connected one-to-one. Then the page table conversion rules configured in the page table converter corresponding to the IP Core are page table conversion rules used to convert the custom page table format into the page table format used by the corresponding IP Core.
[0072] Based on this, in other application scenarios, there may be different IP Cores in the SOC that use the same page table format (assuming that they are all in the first page table format). In this application scenario, in order to save hardware resources, there is a need for page table format conversion, and different IP Cores using the same page table format can share the same page table converter. Then the page table conversion rules configured in the page table converter connected to multiple different IP Cores are page table conversion rules for converting the custom page table format into the first page table format.
[0073] In other embodiments of the present disclosure, multiple page table conversion rules adapted to each IPCore are configured in the same page table converter as much as possible. There is a need for page table format conversion, and different IPCores using different page table formats can all be connected to the same page table converter. Then in this embodiment, when the IP Core initiates an acquisition request to the page table converter, the acquisition request needs to carry an identifier for representing the page table conversion rule required for this acquisition request, so that the subsequent page table converter can find the corresponding page table conversion rule based on the identifier of the page table conversion rule to convert the page table format.
[0074] The following will take the one-to-one connection between the IP Core with page table format conversion requirements and the page table converter as an example to introduce the implementation details of the page table conversion method provided by the present disclosure in detail. It can be understood that when the connection method between the page table converter and the IP Core with page table format conversion requirements is the above-mentioned other connection schemes, the specific implementation details corresponding to the above-mentioned embodiments can be adjusted accordingly, and will not be repeated here.
[0075] S110: Receive a request for obtaining target information sent by the IP Core.
[0076] In the embodiment of the present disclosure, when the target IP Core needs to obtain target information stored in the memory of the SOC, it can generate an acquisition request for the target information and send it to the page table converter connected thereto. The acquisition request carries first information for representing the physical address storing the target information.
[0077] S120: Determine whether the target information belongs to a shared page table that is pre-configured using a custom page table format.
[0078] As mentioned above, the acquisition request carries first information for representing the physical address where the target information is stored. In addition, in the embodiment of the present disclosure, a second information set for representing the physical address where the shared page table is stored is also pre-configured in the page table converter.
[0079] Among them, when the shared page table is a single-level page table, the second information set is a single second information used to represent the physical address where the single-level page table is located. When the shared page table is a multi-level page table, each level of the page table has corresponding second information, and the set composed of the second information of the page tables at each level is the second information set.
[0080] In some implementations, the first information and the second information may both be physical addresses; in other implementations, the first information and the second information may both be identification bits used to represent the physical address, such as an identification of the physical address.
[0081] When the page table converter receives the acquisition request, it may first determine whether the target information belongs to a pre-configured shared page table according to the first information and the second information set.
[0082] Optionally, when the page table converter determines that the first information belongs to the second information set, it can determine that the target information belongs to the shared page table, and the content requested by this acquisition request is part of or all of the shared page table. For example, when the shared page table is a single-level page table, the target information is all shared page tables, and when the shared page table is a multi-level page table, the target information is a certain level of the shared page table. In other words, each acquisition request initiated by the target IP Core for a multi-level page table is generally a first-level page table.
[0083] Of course, when the page table converter determines that the first information does not belong to the second information set, it can determine that the target information does not belong to the shared page table, and the content requested by this acquisition request is other information. As for the subsequent processing method of this situation, it is not within the scope of discussion of this disclosure.
[0084] S130: If yes, obtain page table information corresponding to the target information in the shared page table.
[0085] In the disclosed embodiment, the page table converter is connected to the memory included in the SOC through the on-chip bus network (Bus) included in the SOC. Based on this, when it is determined that the target information belongs to the shared page table, the page table converter can route the acquisition request to the memory of the SOC through the Bus, so that the page table information corresponding to the target information in the shared page table returned by the memory according to the acquisition request can be obtained later.
[0086] As mentioned above, for a specific IP Core, the bit width occupied by the shared page table may be the same as or different from the bit width represented by the page table format used by the IP Core.
[0087] Based on this, when the bit width represented by the page table format used by the target IP Core is equal to the bit width occupied by the shared page table, the page table converter does not need to adjust the data bits used to represent the target information in the acquisition request.
[0088] When the bit width N represented by the page table format used by the target IP Core is not equal to the bit width M occupied by the shared page table, in order to successfully identify the page table information retrieved from the memory, the page table converter can also adjust the data bits used to represent the target information in the acquisition request from N bits to M bits before routing the acquisition request to the memory.
[0089] For example, if the page table format used by the target IP Core represents a bit width of N = 32 bits, and the bit width of the shared page table is M = 64 bits, then the page table converter needs to adjust the data bits used to represent the target information in the acquisition request from 32 bits to 64 bits to adapt to the page table information with a bit width of 64 bits read from the memory.
[0090] Wherein, N and M are both positive integers greater than 0.
[0091] S140: According to a pre-configured page table conversion rule, the page table information is converted from the custom page table format to a page table format used by the IP Core, and then returned to the IP Core.
[0092] In some application scenarios of the present disclosure, there is a need for page table format conversion, that is, the IP Core whose page table format is different from the custom page table format will be connected to the page table converter. In this application scenario, the page table information obtained by the page table converter is presented in the custom page table format and cannot be successfully parsed and identified by the target IP Core. Based on this, the page table converter can call the page table conversion rules corresponding to the target IP Core configured in itself, convert the page table information from the custom page table format to the page table format used by the target IP Core, and then return it to the target IP Core.
[0093] The following will introduce the process of performing page table conversion by the page table converter.
[0094] As mentioned above, a page table conversion rule corresponding to the target IP Core is pre-configured in the page table converter. The page table conversion rule records rule information for converting a custom page table format into a page table format used by the target IP Core.
[0095] The rule information includes: the total number of bits required when converting the custom page table format into the page table format used by the target IP Core, which fields in the page table information need to be used as target fields, the target bit width that each target field should occupy, and the target position of each target field in the total number of bits. The target field is the field included in the page table format used by the target IP Core.
[0096] After such configuration, when the page table converter obtains the page table information presented in the custom page table format, it can filter the target field from the various fields included in the page table information; adjust the bit width of the target field to the target bit width (including adjusting from a large value to a small value and from a small value to a large value), and the target bit width is the bit width occupied by the target field in the page table format used by the target IPCore; adjust the target field to the target position, and the target position is the specific position of the target field in the page table format used by the target IPCore.
[0097] In addition, as mentioned above, in some application scenarios, the shared page table can be a multi-level page table. Since the conversion methods of different levels of page tables may be different when converting the page tables of each level of the shared page table into the page tables of the corresponding level of the page table format used by the target IP Core, therefore, in some embodiments, when the shared page table is a multi-level page table, the page table conversion rules configured in the page table converter also include corresponding page table conversion sub-rules corresponding to each level of the page table.
[0098] The page table conversion sub-rule records rule information for converting a P-th (P is a positive integer) level page table in a custom page table format into a P-th level page table in a page table format used by a target IP Core.
[0099] The rule information includes: the total number of bits required when converting the P-th level page table of the custom page table format into the P-th level page table of the page table format used by the target IP Core, which fields in the page table information need to be used as target fields, the target bit width that each target field should occupy, and the target position of each target field in the total number of bits. The target field is the field included in the page table format used by the target IP Core.
[0100] Accordingly, when the page table converter performs page table format conversion on the page table information, it converts the page table information from the custom page table format to the page table format used by the target IP Core according to the page table conversion sub-rule corresponding to the P-th level page table in the page table conversion rule.
[0101] Of course, in some application scenarios, the target IP Core may continuously send multiple acquisition requests to the page table converter to obtain different target information. In order to ensure that the page table information can be matched one-to-one with the acquisition request in the future without confusion, in some implementations, each acquisition request initiated by the target IP Core will carry a unique request identifier (such as ID or Tag), and each page table information fed back by the memory will also carry the request identifier of the acquisition request for it. After the page table converter returns the page table information to the target IP Core, the target IP Core will match the acquisition request with the same request identifier with the page table information one-to-one.
[0102] From the above content, it can be seen that for each IP Core among multiple IP Cores that are associated, there is no need to configure a dedicated duplicate page table for it in the SOC, that is, there is no need to configure multiple different page tables for representing the same logical mapping relationship. Instead, the repeated logical mapping relationship required by each IP Core is configured in the same shared page table, which can reduce the consumption of storage resources and help improve the utilization of storage resources. In addition, since the repeated logical mapping relationship required by each IP Core is configured in the same shared page table, when the repeated logical mapping relationship needs to be updated, only the shared page table needs to be updated, and it is no longer necessary to update the page table of each IP Core separately, which reduces the software maintenance overhead of the page table.
[0103] In addition, please refer to Figure 2 The embodiment of the present disclosure further provides a page table converter 400 for connecting with the IP Core. The page table converter 400 may include:
[0104] The address selector 410 is configured to: receive an acquisition request for target information sent by the IP Core; when it is determined that the target information belongs to a shared page table configured in advance with a custom page table format, route the acquisition request to a memory for storing the shared page table through an on-chip bus network;
[0105] The data format converter 420 is configured to perform a page table format conversion task: receiving the page table information corresponding to the target information returned by the memory according to the acquisition request; and converting the page table information from the custom page table format into the page table format used by the IP Core, and returning it to the IP Core; the shared page table is a page table that multiple different IP Cores need to keep synchronized.
[0106] In some application scenarios, the acquisition request initiated by the IP Core carries first information for characterizing the physical address where the target information is located; the address selector 410 is configured to: determine whether the first information belongs to a pre-configured second information set for characterizing the physical address where the shared page table is stored; if so, determine that the target information belongs to the shared page table.
[0107] In some application scenarios, the first information and the second information are both physical addresses; or the first information and the second information are both identification bits used to represent physical addresses.
[0108] In some application scenarios, the page table converter 400 also includes a data size converter 430, which is configured to: when the bit width of the page table format used by the IP Core is N, the bit width of the custom page table format is M, N≠M and both are positive integers greater than 0, adjust the data bits used to represent the target information in the acquisition request from the N bits to the M bits.
[0109] In some application scenarios, the data format converter 420 is configured to: filter a target field from various fields included in the page table information, where the target field is a field included in the page table format used by the IP Core; adjust the bit width of the target field to a target bit width, where the target bit width is the bit width occupied by the target field in the page table format used by the IP Core; adjust the target field to a target position, where the target position is the position of the target field in the page table format used by the IP Core.
[0110] The shared page table includes multiple levels of page tables; the page table converter 400 may also include a page table tag memory 440 and a selector 450. In addition, the data format converter 420 included in the page table converter 400 corresponds one-to-one to the page tables of each level included in the shared page table.
[0111] The address selector 410 is configured to: when determining that the target information belongs to the shared page table, mark the page table level where the target information is located in the shared page table.
[0112] The page table tag memory 440 is configured to store the page table level number of the target information.
[0113] The selector 450 is configured to read the page table level of the target information stored in the page table tag memory 440 and select the data format converter 420 corresponding to the page table level of the target information to perform the page table format conversion task.
[0114] Of course, for the specific implementation details of each component included in the above-mentioned page table converter 400 when executing the corresponding instructions, please refer to the corresponding content described in the above-mentioned method embodiment, which will not be repeated here.
[0115] In the prior art, multiple duplicate page tables corresponding to each IP Core need to be stored in the SOC to ensure that the IP Cores using different page table formats can interact with each other. Figure 3As shown, a GPU Page table corresponding to the GPU Core, a Micro Core Page table corresponding to the Micro Core, and a Video Core Page table corresponding to the Video Core are stored in the memory. The logical mapping relationship represented by the GPU Page table, Micro Core Page table, and Video Core Page table shown in the figure is the same.
[0116] Based on this, the embodiment of the present disclosure further provides a SOC, including an on-chip bus network Bus, a memory, a page table converter mentioned in any embodiment of the present disclosure, and a plurality of IP Cores that need to keep the page table synchronized, such as Figure 4 The GPU Core (Graphics Processing Unit Core), Video Core (video processor core), Micro Core (microprocessor core), etc. shown in the figure.
[0117] In the disclosed embodiment, one IP Core is connected to one page table converter correspondingly, and each IP Core and each page table converter is connected to the memory through an on-chip bus network.
[0118] Multiple IP Cores are configured in the memory with shared page tables that need to be synchronized, and the page table formats used by the multiple IP Cores are partially the same or completely different.
[0119] In the disclosed embodiment, the IP Core connected to the page table converter is the IP Core that has the page table format conversion requirement.
[0120] In some application scenarios, the page table converter and the IP Core that needs to convert the page table format can be Figure 4 The one-to-one connections shown.
[0121] In other application scenarios, there is a need for page table format conversion, and IP Cores using the same page table format can share the same page table converter, such as Figure 5 As shown in the figure, the page table format used by Micro Core and GPU Core is the same.
[0122] Of course, there may be an application scenario where the IP Core that needs to convert the page table format uses the same page table format as the previous one. Figure 6As shown, it is connected to the same page table converter. Of course, the page table converter includes multiple data format converters, so that the page table converter has the ability to convert the custom page table format into the page table format used by any IP Core connected to it.
[0123] From the above Figure 4-Figure 6 It can be seen that the SOC provided by the embodiment of the present disclosure only needs to save one shared page table to ensure the interaction between various IP Cores using different page table formats. Therefore, the consumption of storage resources in the SOC can be reduced, which is conducive to improving the utilization of storage resources.
[0124] In addition, the disclosed embodiment also provides an electronic device, which includes the above-mentioned SOC and other necessary components. In some usage scenarios, the product form of the electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, a game console, a workstation, a server, etc.
[0125] Based on the above virtual address management scheme, for each IP Core among multiple IP Cores that are associated with each other, there is no need to configure a dedicated duplicate page table for it in the SOC, that is, there is no need to configure multiple different page tables for representing the same logical mapping relationship. Instead, the repeated logical mapping relationship required by each IP Core is configured into the same shared page table, which can reduce the consumption of storage resources and help improve the utilization of storage resources. In addition, since the repeated logical mapping relationship required by each IP Core is configured into the same shared page table, when the repeated logical mapping relationship needs to be updated, only the shared page table needs to be updated, and there is no need to update the page table of each IP Core separately, which reduces the software maintenance overhead of the page table.
[0126] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.
[0127] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A page table conversion method, applied to a page table converter connected to an IP Core, the method comprising: Receiving a request for obtaining target information sent by the IP Core; Determining whether the target information belongs to a shared page table that is pre-configured using a custom page table format; If so, obtaining page table information corresponding to the target information in the shared page table; According to the pre-configured page table conversion rules, the page table information is converted from the custom page table format to the page table format used by the IP Core, and then returned to the IP Core; The shared page table is a page table that multiple different IP Cores need to keep synchronized; Carrying first information for representing the physical address where the target information is located in the acquisition request, and pre-configuring a second information set for representing the physical address where the shared page table is stored in the page table converter; The determining whether the target information belongs to a shared page table pre-configured in a custom page table format includes: determining whether the first information belongs to the second information set; if so, indicating that the target information belongs to the shared page table; The converting the page table information from the custom page table format to the page table format used by the IP Core includes: Filtering a target field from various fields included in the page table information, where the target field is a field included in the page table format used by the IP Core; Adjusting the bit width of the target field to a target bit width, where the target bit width is the bit width occupied by the target field in the page table format used by the IPCore; The target field is adjusted to a target position, where the target position is a position of the target field in a page table format used by the IP Core.
2. According to the method of claim 1, the first information and the second information are both physical addresses; or the first information and the second information are both identification bits used to represent physical addresses.
3. The method according to claim 1, wherein obtaining the page table information corresponding to the target information in the shared page table comprises: The acquisition request is routed to a memory for storing the shared page table through an on-chip bus network, and the page table information returned by the memory according to the acquisition request is acquired.
4. According to the method of claim 3, the bit width of the page table format used by the IP Core is N, the bit width of the custom page table format is M, N≠M and both are positive integers greater than 0, and before routing the acquisition request to the memory for storing the shared page table through the on-chip bus network, the method further includes: The data bits used to represent the target information in the acquisition request are adjusted from the N bits to the M bits.
5. According to the method of any one of claims 1 to 4, the shared page table includes a multi-level page table, the page table information is a P-th level page table in the multi-level page table, and P is a positive integer greater than 0; the page table conversion rule includes a page table conversion sub-rule corresponding to each level of the page table; the converting the page table information from the custom page table format to the page table format used by the IP Core comprises: The page table information is converted from the custom page table format to a page table format used by the IP Core according to a page table conversion sub-rule corresponding to the P-th level page table.
6. The method according to any one of claims 1 to 4, wherein the IP Core corresponds to the page table converter in a one-to-one manner; or Different IP Cores using the same page table format share the same page table converter; or, Different IP Cores using different page table formats share the same page table converter.
7. A page table converter, used to connect to an IP Core, the page table converter comprising: The address selector is configured to: receive an acquisition request for target information sent by the IP Core; when it is determined that the target information belongs to a shared page table configured in advance using a custom page table format, route the acquisition request to a memory for storing the shared page table through an on-chip bus network; A data format converter is configured to perform a page table format conversion task: receiving page table information corresponding to the target information returned by the memory according to the acquisition request; and converting the page table information from the custom page table format into the page table format used by the IP Core, and returning it to the IP Core; the shared page table is a page table that multiple different IP Cores need to keep synchronized; The acquisition request carries first information for representing the physical address where the target information is located; the address selector is configured to: determine whether the first information belongs to a pre-configured second information set for representing the physical address where the shared page table is stored; and if so, determine that the target information belongs to the shared page table; The data format converter is configured to: filter a target field from each field included in the page table information, wherein the target field is a field included in the page table format used by the IP Core; adjust the bit width of the target field to a target bit width, wherein the target bit width is a bit width occupied by the target field in the page table format used by the IP Core; The target field is adjusted to a target position, where the target position is a position of the target field in a page table format used by the IP Core.
8. The page table converter according to claim 7, wherein the first information and the second information are both physical addresses; or the first information and the second information are both identification bits used to represent physical addresses.
9. The page table converter according to claim 7 further comprises a data size converter, configured to: when the bit width of the page table format used by the IP Core is N, the bit width of the custom page table format is M, N≠M and both are positive integers greater than 0, adjust the data bits used to represent the target information in the acquisition request from the N bits to the M bits.
10. The page table converter according to any one of claims 7 to 9, wherein the shared page table comprises a multi-level page table; The address selector is configured to: when determining that the target information belongs to the shared page table, mark the page table level where the target information is located in the shared page table; The page table converter includes a page table tag memory configured to store a page table level of the target information; The page table converter includes a data format converter corresponding to each level of page table included in the shared page table; The page table converter includes a selector configured to: read the page table level of the target information stored in the page table tag memory, and select a data format converter corresponding to the page table level of the target information to perform the page table format conversion task.
11. A SOC, comprising an on-chip bus network, a memory, a plurality of IP Cores that need to keep page tables synchronized, and a page table converter as described in any one of claims 7 to 10, wherein one of the IP Cores is connected to one of the page table converters, the IP Cores and the page table converter are connected to the memory via the on-chip bus network, a shared page table that needs to be kept synchronized by the plurality of IP Cores is configured in the memory, and the page table formats used by the plurality of IP Cores are partially the same or completely different.
12. The SOC according to claim 11, when the page table formats used by the multiple IP Cores are partially the same, the IP Cores using the same page table format among the multiple IP Cores are connected to the same page table converter, or are connected to different page table converters.
13. An electronic device comprising the SOC according to claim 11 or 12.
