Methods, apparatus, equipment and storage media for verifying address information
By employing the AND gate computation method in the high-speed serial computer extended bus standard, the process of verifying the physical functional devices mapped to service requests is simplified, computational complexity is reduced, computational resources are saved, and efficiency is improved.
Patent Information
- Application Number
- CN202310945769.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-07-28
AI Technical Summary
In the high-speed serial computer extended bus standard, verifying the physical functional device mapped to the service request requires a large amount of computing resources. The existing technology compares the request address with the base address information of the physical functional device using an adder, which results in high computational complexity.
The AND gate calculation method is adopted. By obtaining the base address information and value of the expansion device, an AND operation is performed to obtain the second value. When the second value is the same as the base address information, a service request is sent to the expansion device, which simplifies the calculation process.
This reduces the computational complexity of the verification process, saves computational resources, avoids the complexity of adder calculations, and improves computational efficiency.
Smart Images

Figure CN119441098B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of bus transmission technology, and in particular to a method, apparatus, device and storage medium for verifying address information. Background Technology
[0002] The high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCI-Express / PCIE) provides high-speed serial point-to-point dual-channel high-bandwidth transmission.
[0003] In related technologies, the Data Processing Unit (DPU) is connected to multiple Physical Function (PF) devices via PCIe. An adder compares the request address of a service request with the information in the base address register of the PF device to determine the PF device mapped to the service request.
[0004] How to save computing resources when verifying the PF device mapped to the business request is an urgent problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for verifying address information, the technical solution of which is as follows:
[0006] According to one aspect of this application, a method for verifying address information is provided, the method being performed by an electronic device, the electronic device having a bus connection established with at least two expansion devices, the method comprising:
[0007] Obtain the request address of the service request, which is used to indicate the service processing method of the first extended device;
[0008] Obtain the base address information of the first expansion device and the first value corresponding to the first expansion device. The base address information is used to indicate the starting storage location of the base address register of the first expansion device. The high-order bits of the first value are the first value, and the low-order bits of the first value are the second value. The number of binary bits of the high-order bits is greater than or equal to the maximum number of binary bits of the address length information of the first expansion device, and the number of binary bits of the low-order bits is less than the maximum number of binary bits of the address length information.
[0009] A second value is obtained by performing an AND gate operation based on the first value and the requested address;
[0010] In response to the second value being the same as the base address information, the service request is sent to the first extension device corresponding to the base address information.
[0011] According to another aspect of this application, an address information verification device is provided, the device being used in an electronic device, the electronic device having a bus connection established with at least two expansion devices, the device comprising:
[0012] The acquisition module is used to acquire the request address of the service request, which is used to indicate the service processing method of the first extended device;
[0013] The acquisition module is further configured to acquire the base address information of the first expansion device and the first value corresponding to the first expansion device. The base address information is used to indicate the starting storage location of the base address register of the first expansion device. The high-order bits of the first value are a first value, and the low-order bits of the first value are a second value. The number of binary bits of the high-order bits is greater than or equal to the maximum number of binary bits of the address length information of the first expansion device, and the number of binary bits of the low-order bits is less than the maximum number of binary bits of the address length information.
[0014] The processing module is used to perform an AND gate calculation based on the first value and the request address to obtain a second value;
[0015] The sending module is configured to send the service request to the first extended device corresponding to the base address information in response to the second value being the same as the base address information.
[0016] In an optional design of this application, the acquisition module is further configured to:
[0017] Obtain the address length information of the first expansion device, wherein the address length information is used to indicate the address space size of the base address register of the first expansion device;
[0018] The first value is obtained by performing binary bit operations based on the address length information.
[0019] In an optional design of this application, the acquisition module is further configured to:
[0020] The difference between the address length information and the third value is determined as the mask information, and the mask information is used to determine the binary bits with a binary number of less than the maximum binary number of the address length information as the first value;
[0021] The first value is obtained by inverting the mask information.
[0022] In an optional design of this application, the sending module is further configured to:
[0023] The equality comparator is invoked to compare the second value with the base address information;
[0024] If the second value is equal to the base address information, the service request is sent to the first extension device corresponding to the base address information.
[0025] In an optional design of this application, the processing module is further configured to:
[0026] The AND gate circuit is invoked to calculate the first value and the requested address to obtain the second value.
[0027] In an optional design of this application, the acquisition module is further configured to:
[0028] Obtain the address tables of the at least two extended devices stored in the electronic device, wherein the address tables are used to indicate the base address register information of the at least two extended devices that have established a bus connection with the electronic device;
[0029] The base address information and the first value are obtained based on the address table.
[0030] In an optional design of this application, the acquisition module is further configured to:
[0031] Obtain the application address space of the at least two extended devices, wherein the application address space is used to indicate the number of binary difference bits between the base address registers of the at least two extended devices;
[0032] Obtain the first sub-information from the base address register of any one of the at least two expansion devices, and obtain at least two second sub-information corresponding to the base address registers of the at least two expansion devices;
[0033] Based on the first sub-information and the at least two second sub-information, the address tables of the at least two extended devices are constructed;
[0034] The first sub-information is the number of binary bits in the base address register that are greater than or equal to the target number of bits, and the second sub-information is the number of binary bits in the base address register that are less than the target number of bits. The target number of bits is determined based on the application address space.
[0035] In an optional design of this application, the processing module is further configured to:
[0036] The fourth value is determined by multiplying the number of binary bits corresponding to the application address space with n, where n is greater than 1;
[0037] The target number of digits is determined based on the fourth value, wherein the target number of digits is greater than or equal to the fourth value.
[0038] In an optional design of this application, the processing module is further configured to:
[0039] The hash algorithm is called to process the data of the request address to obtain the request hash value corresponding to the business request;
[0040] Obtain the hash tables corresponding to the at least two extended devices, and find the target hash value that is the same as the requested hash value in the hash tables, wherein the target hash value has an association with the first extended device.
[0041] In an optional design of this application, the hash table includes a first sub-table and a second sub-table;
[0042] The processing module is also used for:
[0043] Based on the first sub-table, the first sub-hash value is found in the request hash value, where the first sub-hash value is a partial binary bit of the request hash value;
[0044] In the event of a conflict when searching for the first sub-hash value in the first sub-table, the target hash value that is the same as the second sub-hash value in the request hash value is obtained based on the search in the second sub-table. The second sub-hash value is a portion of the binary bits of the request hash value, and the binary bit information corresponding to the first sub-hash value and the second sub-hash value in the request hash value is different.
[0045] According to another aspect of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the address information verification method as described above.
[0046] According to another aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the address information verification method described above.
[0047] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor reads from the computer-readable storage medium and executes the computer instructions to implement the address information verification method described above.
[0048] The beneficial effects of the technical solution provided in this application include at least the following:
[0049] The second value is obtained by AND gate calculation. If the second value and the base address information are the same, a service request is sent to the first extension device. This reduces the complexity of comparing the request address and the base address information and avoids the comparison of the size relationship between the request address and the base address information and the limit address information of the first extension device by adding an adder in related technologies. The adder calculation is simplified to AND gate calculation, saving computing resources. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a schematic diagram of a computer system provided in an exemplary embodiment of this application;
[0052] Figure 2 This is a schematic diagram of a computer system provided in an exemplary embodiment of this application;
[0053] Figure 3 This is a schematic diagram of an address information verification method provided in an exemplary embodiment of this application;
[0054] Figure 4 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0055] Figure 5 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0056] Figure 6 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0057] Figure 7 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0058] Figure 8 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0059] Figure 9 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0060] Figure 10 This is a schematic diagram of base address register routing provided in an exemplary embodiment of this application;
[0061] Figure 11 This is a schematic diagram of a base address register routing table provided in an exemplary embodiment of this application;
[0062] Figure 12 This is a flowchart of an address information verification method provided in an exemplary embodiment of this application;
[0063] Figure 13 This is a structural block diagram of an address information verification device provided in an exemplary embodiment of this application;
[0064] Figure 14 This is a structural block diagram of a server provided in an exemplary embodiment of this application.
[0065] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0067] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0068] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0069] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the request address and other information involved in this application were obtained with full authorization.
[0070] It should be understood that although the terms first, second, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, a first parameter may also be referred to as a second parameter without departing from the scope of this disclosure, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0071] Figure 1 A schematic diagram of a computer system provided in one embodiment of this application is shown. This computer system can implement a system architecture for an address information verification method. The computer system may include an electronic device 100 and at least two expansion devices. In this embodiment, a first expansion device 110 and a second expansion device 120 are used as examples. It is understood that in different embodiments, more expansion devices may be included, such as hundreds or thousands of expansion devices, and this application does not impose any limitations on this.
[0072] Electronic device 100 is an electronic device with data computing, processing and / or storage capabilities. It can be a terminal or a server, or a processing core in a terminal or server, such as an independent physical server, a server cluster or distributed system consisting of multiple physical servers, a mobile phone, a tablet computer, a PC (Personal Computer), or a processing core in the above devices, such as a data processing unit (DPU).
[0073] The first expansion device 110 and the second expansion device 120 can be the same device or different devices. This application does not limit the type of expansion device used to establish a bus connection with the electronic device 100. The expansion device can be at least one of a network interface card (NIC), a host bus adapter (HBA), an application-specific integrated circuit (ASIC), and a graphics processing unit (GPU).
[0074] The bus connection between electronic device 100 and at least two expansion devices can be based on the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCI-Express / PCIE), or it can be established through other bus connection methods; for example, including but not limited to any one of Peripheral Component Interconnect (PCI) and Accelerated Graphics Port (AGP), this application does not limit the bus connection method.
[0075] Next, we will introduce how to establish a bus connection between electronic devices and expansion devices based on PCIe.
[0076] Figure 2 A schematic diagram of a computer system provided in one embodiment of this application is shown. This computer system can implement a system architecture for an address information verification method. The computer system is described using an example of a PCIe bus connection between an electronic device and an expansion device, where the expansion device is a System On a Chip (SOC).
[0077] The electronic device includes a first subsystem 210 and a second subsystem 220;
[0078] Specifically, the first subsystem 210 includes a first central processing unit 212, a root complex 214, and a first memory 216. The root complex 214 also includes multiple root ports (RPs). In this embodiment, the root complex 214 includes a first root port 214a and a second root port 214b.
[0079] The second subsystem 220 includes a User Datagram Protocol Server (UPS) 222, a Data Path 224, a Control Path 226, and a Block / Network / User 228. The Data Path 224 includes a first PCIe route (pcie_rout) 224a, and the Control Path 226 includes a second PCIe route (pcie_rout) 226a. A bus connection is established between the second PCIe route 226a and the System-on-Chip (SoC) 112. The SoC 112 includes a second Central Processing Unit (CPU) 232, a second memory 234, and a Processing Unit 236. The Processing Unit 236 parses and processes Transaction Layer Packets (TLPs) sent from the second PCIe route 226a to the SoC 112. For example, the Processing Unit is an Integrated Management Unit (IMU).
[0080] Figure 3 A schematic diagram of an address information verification method provided in an exemplary embodiment of this application is provided.
[0081] In this embodiment, a service request indicating the service processing mode of the first extension device 320 is carried in the transaction layer packets (TLP) 300. The transaction layer packets 300 correspond to a request address 302, which is used to indicate the address information of the transaction layer packets 300; for example, the request address 302 is the same as the base address register (BAR) of the first extension device 320, which is 32-bit or 64-bit information.
[0082] The hash algorithm is invoked to process the data at request address 302, resulting in a request hash value 304 corresponding to the business request. At least two hash tables 310 corresponding to the extended devices are retrieved, and a target hash value 312 identical to the request hash value 304 is found in the hash table 310. The target hash value 312 has an association with the first extended device 320. For example, the hash table 310 may include multiple sub-tables, and the hash algorithm may include a Cyclic Redundancy Check (CRC) algorithm.
[0083] Based on the base address register information of the first expansion device 320, the address length information 322 and base address information 324 corresponding to the first expansion device 320 are obtained; wherein, the address length information 322 and base address information 324 are obtained by performing binary bitwise operations on the base address register information. The base address information is used to indicate the starting storage location of the base address register of the first expansion device, and the address length information is used to indicate the address space size of the base address register of the first expansion device.
[0084] The difference between the address length information 322 and the third value 333 is determined as the mask information 322a. The mask information 322a is used to determine the binary bits that are less than the address length information as the first value (e.g., the first value is 1). The NOT gate circuit 330a is called to invert the mask information 322a to obtain the first value 331. The binary bits in the first value that are greater than or equal to the address length information of the first extended device are the first value (e.g., the first value is 1), and the binary bits that are less than the address length information are the second value (e.g., the second value is 0).
[0085] The AND gate 330b is invoked to calculate the first value 331 and the request address 302 to obtain the second value 332. The equality comparator constructed by the XOR gate 330c is invoked to compare the second value and the base address information to obtain the comparison result 340. If the second value and the base address information are equal, for example, if the comparison result 340 is 0, a service request is sent to the first extension device corresponding to the base address information.
[0086] The following examples will illustrate the method for verifying address information.
[0087] Figure 4 A flowchart illustrating an exemplary embodiment of this application's address information verification method is shown. This method can be performed by an electronic device. The method includes:
[0088] Step 510: Obtain the request address of the business request;
[0089] For example, the service request is used to indicate the service processing method of the first extended device; for example, the service processing method includes, but is not limited to, calling the first extended device to acquire, edit, or store data information at least one of these methods. This embodiment does not limit the service processing method. For example, the request address of the service request is used to indicate the destination address of the service request. In one example, the service request is carried in a Transaction Layer Packets (TLP), and the request address of the service request is the address field of the TLP (also known as TLP_ADDR).
[0090] For example, a bus connection is established between the electronic device and at least two expansion devices. As described above, this application does not limit the manner in which the bus connection is established between the electronic device and at least two expansion devices.
[0091] Step 520: Obtain the base address information of the first expansion device and the first value corresponding to the first expansion device;
[0092] For example, the base address information is used to indicate the starting storage location of the base address register of the first extended device, also known as ADDR_BASE. For example, the first extended device corresponds to one or more base address registers.
[0093] For example, the first value is a binary representation of a value. In one example, the number of bits in the first value is the same as the number of bits in the base address information, such as 32 or 64 bits. The high-order bits of the first value represent a first value, and the low-order bits represent a second value; in one example, the first value is 1, and the second value is 0. The number of binary bits in the high-order bits is greater than or equal to the maximum number of binary bits in the address length information of the first extended device, and the number of binary bits in the low-order bits is less than the maximum number of binary bits in the address length information. For example, the address length information is used to indicate the address space size of the base address register of the first extended device.
[0094] Step 530: Perform an AND gate calculation based on the first value and the request address to obtain the second value;
[0095] For example, the AND gate calculation between the first value and the requested address can be implemented using logic circuitry or a binary AND gate algorithm; this application does not impose any limitations on this. Correspondingly, the second value is a binary representation of the value.
[0096] Step 540: In response to the fact that the second value and the base address information are the same, send a service request to the first extended device corresponding to the base address information;
[0097] For example, the fact that the second value and the base address information are the same can be obtained based on logic circuit judgment or through a numerical comparison algorithm; this application does not impose any restrictions on this. For example, the service request can be carried in a data packet and sent to the first extension device; for example, the service request can be carried in a transaction layer data packet.
[0098] In summary, the method provided in this embodiment obtains a second value through AND gate calculation. When the second value and the base address information are the same, a service request is sent to the first extension device. This reduces the complexity of comparing the request address and the base address information, avoids the comparison of the size relationship between the request address and the base address information and the restriction address information of the first extension device through an adder in related technologies, simplifies the adder calculation to an AND gate calculation, and saves computing resources.
[0099] Figure 5 A flowchart illustrating an exemplary embodiment of this application's address information verification method is shown. This method can be executed by an electronic device. That is, in Figure 4 In the illustrated embodiment, step 520 can be implemented as steps 521, 522, and 524:
[0100] Step 521: Obtain the base address information of the first expansion device;
[0101] For example, the base address information is used to indicate the starting storage location of the base address register of the first extended device. For example, the address space of the base address register is a space with the base address information as the starting storage location and the address length information as the address space size.
[0102] Step 522: Obtain the address length information of the first expansion device;
[0103] For example, the address length information is used to indicate the address space size of the base address register of the first extended device; in one example, the address space size of the base address register is 4KB, and correspondingly, the maximum number of binary bits in the address length information is the twelfth bit (Bit12), which has a value of 1, while bits 0 through eleven (Bit11) all have values of 0, i.e., the address length information is: 10000000000000. Accordingly, in the first value, the higher-order bits with a binary number greater than or equal to Bit12 have a value of 1, and the lower-order bits with a binary number less than Bit12 have a value of 0.
[0104] Step 524: Perform binary bitwise operations based on the address length information to obtain the first value;
[0105] For example, the first value is obtained through binary bitwise operations, which include, but are not limited to, at least one of AND, OR, XOR, NOT, left shift, and right shift. It is understood that binary bitwise operations can be implemented through logic circuits or through binary algorithms. Binary bitwise operations can be performed on multiple binary bits in parallel, or they can be performed on a subset of binary bits based on address length information; this application does not impose any limitations on this.
[0106] In an alternative implementation, step 524 in this embodiment can be implemented as the following sub-steps:
[0107] Sub-step 24a: Determine the difference between the address length information and the third value as the mask information;
[0108] For example, the mask information is a numerical value represented in binary. In one example, the number of bits in the mask information is the same as the number of bits in the base address information. The mask information is used to determine the first value of the bits whose binary number of bits is less than the maximum binary number of bits in the address length information. For example, as mentioned above, the address space size of the base address register is 4KB, and correspondingly, the maximum binary number of bits in the address length information is the twelfth bit (Bit12). The mask information is used to determine the first value of the bits whose binary number of bits is less than Bit12, that is, the zeroth bit (Bit0) to the eleventh bit (Bit11) are determined as the first value, and further, the first value is 1.
[0109] It should be noted that this application does not limit the address space size of the base address register; in one example, the address space size of the base address register, i.e., the address length information, is not less than 4KB, but this application does not exclude the possibility that the address length information is less than 4KB. Furthermore, this application does not limit the address length information of multiple extended devices connected to the electronic device; the address length information of different extended devices can be the same or different.
[0110] Sub-step 24b: Invert the mask information to obtain the first value;
[0111] In one example, the inversion of the mask information is implemented using a NOT gate circuit; it is understood that the first value can also be obtained through binary bitwise operations or binary inversion algorithms, and this embodiment does not limit this.
[0112] In summary, the method provided in this embodiment determines a first value by performing binary bitwise operations on the address length information of the first expansion device, effectively utilizing the address length information. Furthermore, the complexity of processing the address length information is reduced by using inversion calculations during the determination of the first value. A second value is obtained through AND gate calculations. If the second value and the base address information are the same, a service request is sent to the first expansion device. This reduces the complexity of comparing the request address and the base address information, avoiding the comparison of the request address with the base address information and the limiting address information of the first expansion device using adders in related technologies. The adder calculation is simplified to an AND gate calculation, saving computational resources.
[0113] Figure 6A flowchart illustrating an exemplary embodiment of this application's address information verification method is shown. This method can be executed by an electronic device. That is, in Figure 4 In the illustrated embodiment, step 530 can be implemented as step 532, and step 540 can be implemented as steps 542 and 544:
[0114] Step 532: Use an AND gate to calculate the first value and the requested address to obtain the second value;
[0115] For example, the AND gate circuit calculates the first value and the request address based on the logic circuit, and the second value is the base address information of the base address register corresponding to the transmission destination address of the service request extracted from the request address.
[0116] It should be noted that step 532 in this embodiment can be combined with steps 510, 520 and 540 above to form a new embodiment and be implemented independently. This application does not limit this.
[0117] Step 542: Call the equality comparator to compare the second value and the base address information;
[0118] For example, calling the equality comparator to compare the second value and the base address information is based on the logic circuit's comparison calculation of the second value and the base address information. In one example, the equality comparator can be constructed based on an XOR gate circuit or an NAND gate circuit; this application does not limit the implementation method of the equality comparator.
[0119] Step 544: If the second value and the base address information are equal, send a service request to the first extended device corresponding to the base address information;
[0120] For example, when the second value and the base address information are equal, the base address information of the base address register corresponding to the transmission destination address of the service request extracted from the request address is the same as the base address information corresponding to the first extended device, and the transmission destination address of the service request corresponds to the first extended device.
[0121] It should be noted that steps 542 and 544 in this embodiment can be the same as... Figure 4 Steps 510 to 530 can be combined into new embodiments and implemented separately; this application does not impose any limitations on this.
[0122] In summary, the method provided in this embodiment calculates the second value by calling an AND gate circuit. If the second value and the base address information are the same when compared by an equality comparator, a service request is sent to the first extension device. This reduces the complexity of comparing the request address and the base address information, avoids the comparison of the size relationship between the request address and the base address information and the limit address information of the first extension device by an adder in related technologies, and simplifies the adder calculation to an AND gate calculation, thus saving computing resources.
[0123] Next, we will introduce the equal sign comparator, AND gate circuit, etc. mentioned above through a specific example.
[0124] In one example, the destination address indicated by the requested address corresponds to the base address register in the first extended device, and the requested address needs to be verified during the verification process.
[0125] In related technologies, the base address information (BAR_BASE) and address length information (BAR_SIZE) of the base address register need to be summed to calculate the limit address information (LIMIT_BAR_ADDR) of the base address register; the limit address information is used to indicate the end storage location of the base address register. Understandably, the above summation process requires calling an adder.
[0126] Furthermore, it is necessary to compare the request address with the base address information and the restriction address information. If the request address is greater than or equal to the base address information and less than or equal to the restriction address information (also known as ADDR_BASE <= TLP_ADDR <= LIMIT_BAR_ADDR), a service request is sent to the first extended device corresponding to the base address information. Understandably, the above comparison process requires the use of adders. Understandably, in related technologies, verifying the request address requires the use of three adder circuits.
[0127] In the technical solution provided in this application, when the address length information of the base address registers of different expansion devices is the same, the address length information is preset or determined by a table lookup. When the address length information of the base address registers of different expansion devices is different, the address length information corresponding to the first expansion device is obtained by looking up a table.
[0128] The address length information and the interpolation of 1 are used to determine the mask information. The mask information is then inverted to obtain the first value. The first value has the same number of bits as the base address information, such as 64 bits. For example, when the address length information is 4KB, bits 0 to 11 of the first value are all 0, and bits 12 to 63 are all 1. An AND gate is used to calculate the first value and the request address to obtain the second value. The second value is the base address information of the base address register corresponding to the transmission destination address of the service request extracted from the request address.
[0129] The equals sign comparator is invoked to compare the second value and the base address information; if the second value and the base address information are equal, a service request is sent to the first extended device corresponding to the base address information.
[0130] As can be seen, in this embodiment, only AND gate circuits and equal sign comparators are called, which reduces the complexity of comparing the request address and base address information. It avoids the comparison of the size relationship between the request address and the base address information and the limit address information of the first extended device through adders in related technologies, and simplifies the adder calculation to AND gate calculation, thus saving computing resources.
[0131] Figure 7 A flowchart illustrating an exemplary embodiment of this application's address information verification method is shown. This method can be executed by an electronic device. That is, in Figure 4 Based on the illustrated embodiment, step 515 is also included:
[0132] Step 515: Obtain the address tables of at least two extended devices stored in the electronic device;
[0133] For example, the electronic device stores an address table, which is used to indicate the base address register information of at least two extended devices that have established a bus connection with the electronic device; in this embodiment, the base address information and the first value in step 520 are obtained based on the address table.
[0134] In one example, the base address register information of at least two extended devices in the address table can have a one-to-one correspondence with the hash value, and this embodiment does not impose any restrictions on this.
[0135] For example, the address table may include multiple storage sections, and the base address register information of the first expansion device is obtained by concatenating the information from these multiple storage sections. By including multiple storage sections in the address table, duplicate parts of the base address register information of the expansion device can be stored only once, thereby saving storage space for the address table in the electronic device.
[0136] In summary, the method provided in this embodiment can quickly obtain the base address information and the first value of the first expansion device by storing address tables of at least two expansion devices in the electronic device; obtain the second value through AND gate calculation; and send a service request to the first expansion device when the second value and the base address information are the same. This reduces the complexity of comparing the request address and the base address information, avoids the comparison of the size relationship between the request address and the base address information and the limit address information of the first expansion device through an adder in related technologies, and simplifies the adder calculation to the AND gate calculation, thus saving computing resources.
[0137] Next, we will introduce the address table in more detail.
[0138] Figure 8 A flowchart illustrating an exemplary embodiment of this application's address information verification method is shown. This method can be executed by an electronic device. That is, in Figure 7 In the illustrated embodiment, step 515 can be implemented as follows:
[0139] Step 515a: Obtain the application address space of at least two extended devices;
[0140] For example, the application address space is used to indicate the number of bits of binary difference between the base address registers of at least two extended devices; in one example, the application address space is obtained by comparing the base address register information of at least two extended devices, and the application address space is used to indicate the highest number of bits where the base address register information differs between at least two extended devices. In another example, the address allocation of the extended devices is based on consecutive positions, but this does not exclude the possibility of address adjustments between some extended devices with intervals; the application address space is used to indicate the pre-set size of the space for address allocation of at least two extended devices. In one example, 16MB (i.e., 2) is pre-set. 20 *2 4 The address space is used to assign addresses to at least two extended devices; correspondingly, the binary difference bits indicated by the application address space are 24 bits.
[0141] Step 515b: Obtain the first sub-information from the base address register of any one of the at least two extended devices, and obtain at least two second sub-information corresponding to the base address registers of the at least two extended devices;
[0142] For example, the first and second sub-information are portions of the information in the base address register. Specifically, the first sub-information consists of binary bits in the base address register that are greater than or equal to the target number of bits, and the second sub-information consists of binary bits in the base address register that are less than the target number of bits. The target number of bits is determined based on the application address space. In one example, the target number of bits can be the sum of the number of binary bits indicated by the application address space and the maximum number of binary bits in the address length information of the first extended device. Taking the example above, where the binary difference bit length indicated by the application address space is 24 bits and the address space size of the base address register is 4KB, the target number of bits is 12 + 24 = 36 bits.
[0143] It should be noted that the first sub-information corresponds to the base address register of any one of the at least two expansion devices. The number of second sub-information items is the same as the number of base address registers in the at least two expansion devices.
[0144] In one alternative implementation, determining the target number of bits includes the following two steps prior to this step:
[0145] • The product of the number of binary bits corresponding to the application address space and n is used to determine the fourth value;
[0146] • Determine the target number of digits based on the fourth value;
[0147] For example, n is greater than 1; in a preferred example, n is an integer, such as n = 2. For example, the target number of digits is greater than or equal to the fourth value. In an optional implementation, the target number of digits can be a homogeneous power of 2, a multiple of 2, or a multiple of 8. It is understood that the target number of digits can also be other values besides those mentioned above, and this embodiment does not limit this.
[0148] For example, the target number of bits is determined based on the sum of the maximum number of binary bits of the fourth value and the address length information of the first extended device. Taking the example above, where the binary difference bits of the address space indicator are 24 bits, the address space size of the base address register is 4KB, and n is 2, the maximum sum of the maximum number of binary bits of the fourth value and the address length information of the first extended device is 24 * 2 = 48 bits. If the target number of bits is greater than the fourth value and is a homogeneous power of 2, the target number of bits is 64 bits. For example, the target number of bits is the smallest homogeneous power of 2 that is greater than or equal to the fourth value.
[0149] It should be noted that the fourth value is greater than the number of bits corresponding to the application address space. This fourth value is a safety margin set for address fine-tuning between some extended devices, where there are gaps. The target number of bits is a homogeneous power of 2 to facilitate the alignment of the second storage part in the address table.
[0150] Step 515c: Based on the first sub-information and at least two second sub-information, construct address tables for at least two extended devices;
[0151] For example, the first sub-information is used as the first storage part of the address table, and multiple second sub-informations corresponding one-to-one with the base address register are used as the second storage part of the address table to construct the address table. It can be seen that only one first sub-information is stored in the address table, saving the space occupied by identical storage information in the address table.
[0152] In summary, the method provided in this embodiment constructs an address table using first sub-information and at least two second sub-information, effectively reducing the storage space occupied by the address table. By storing address tables of at least two extension devices in the electronic device, the base address information and first value of the first extension device can be quickly obtained. The second value is obtained through AND gate calculation. If the second value and the base address information are the same, a service request is sent to the first extension device. This reduces the complexity of comparing the request address and the base address information, avoids the comparison of the request address with the base address information and the limitation address information of the first extension device using an adder in related technologies, simplifies the adder calculation to an AND gate calculation, and saves computing resources.
[0153] Next, we will further introduce the address table stored in the electronic device mentioned above through a specific example.
[0154] In one example, the storage space of the expansion devices connected to the electronic device is typically allocated contiguously. Specifically, the addresses of the base address registers of the expansion devices are relatively contiguous, and the base address registers can be fine-tuned according to business needs, meaning there are gaps between adjacent base address registers. Understandably, due to the address allocation method of the base address registers, the base address information of the base address registers of different expansion devices will have the same parts.
[0155] For example, the application address space is used to indicate the number of bits of binary difference between the base address registers of at least two extended devices. In one example, the application address space indicates 6 bits;
[0156] Furthermore, the fourth value is the application address space * 2 = 12 bits, and the target number of bits is a homogeneous power of 2 greater than the fourth value. In one example, the address table does not store the position information indicated by the address length information. That is, taking a base address register address space size of 4KB as an example, the least significant bit of the PCIe address that needs to be stored in the address table is the twelfth bit (Bit12); taking a base address register address space size of 8KB as an example, the least significant bit of the PCIe address that needs to be stored in the address table is the thirteenth bit (Bit13). In this embodiment, taking an address space size indicated by the address length information of 4KB as an example, the target number of bits is a homogeneous power of 2 greater than 12 + 12 = 24 bits. For example, the target number of bits is 32 bits. It can be seen that in this embodiment, the information from the twelfth bit to the thirty-second bit stored in the address table corresponds one-to-one with the base address register, and information higher than the thirty-second bit only needs to be stored once in the address table. With 2k additional devices, the address space saved by building the address table is (64-32)*(2048-1) = 32kbit - 32bit. This reduces the storage resources required for the electronic device to store the address table.
[0157] In summary, the method provided in this embodiment constructs an address table using first sub-information and at least two second sub-information, effectively reducing the storage space occupied by the address table. By storing address tables of at least two extension devices in the electronic device, the base address information and first value of the first extension device can be quickly obtained. The second value is obtained through AND gate calculation. If the second value and the base address information are the same, a service request is sent to the first extension device. This reduces the complexity of comparing the request address and the base address information, avoids the comparison of the request address with the base address information and the limitation address information of the first extension device using an adder in related technologies, simplifies the adder calculation to an AND gate calculation, and saves computing resources.
[0158] Figure 9 A flowchart illustrating an exemplary embodiment of this application's address information verification method is shown. This method can be executed by an electronic device. That is, in Figure 4 Based on the illustrated embodiment, steps 513 and 514 are also included:
[0159] Step 513: Use a hash algorithm to process the data in the request address to obtain the request hash value corresponding to the business request;
[0160] For example, the number of bits in the request hash value obtained after hashing is shorter than the number of bits in the request address. There is a correspondence between the request hash value and the extended device corresponding to the transmission destination address indicated by the request address. For example, the hash algorithm can process all the information in the request address, or it can process only some of the information; this embodiment does not impose any limitations on this.
[0161] For example, hash algorithms include, but are not limited to, at least one of the following: Cyclic redundancy check (CRC) algorithm, MD5 message-digest algorithm (MD5), and Secure Hash Algorithm (SHA).
[0162] Step 514: Obtain the hash tables corresponding to at least two extended devices, and find the target hash value that is the same as the requested hash value in the hash tables;
[0163] For example, a hash table is used to record the hash values of at least two expansion devices; further, there is a one-to-one correspondence between the hash values and the base address registers of the expansion devices. For example, the hash table is typically stored by the electronic device, but it is not excluded that it is stored in the expansion device or other devices. For example, a target hash value with the same requested hash value is obtained by searching in the hash table. This embodiment does not limit the method of searching for the target hash value in the hash table; it can be obtained by searching character by character, or by sequential search, hash search, or binary tree search at least one of these methods. For example, there is an association between the target hash value and the first expansion device; further, there is a corresponding association between the target hash value and one of the base address registers in the first expansion device.
[0164] In summary, the method provided in this embodiment reduces the time required to determine the first expansion device among multiple expansion devices by looking up the target hash value in the hash table; it obtains the second value through AND gate calculation, and sends a service request to the first expansion device when the second value and the base address information are the same, reducing the complexity of comparing the request address and the base address information. This avoids the comparison of the request address with the base address information and the restriction address information of the first expansion device through an adder in related technologies, simplifying the adder calculation to an AND gate calculation and saving computing resources.
[0165] Next, we will further explain step 514 from the above text.
[0166] In one alternative implementation, step 514 can be implemented as the following two sub-steps:
[0167] Sub-step 14a: Find the first sub-hash value in the request hash value based on the first sub-table;
[0168] For example, the first sub-hash value is a portion of the binary bits of the requested hash value; in one example, the first sub-hash value is bits 0 through 11 of the requested hash value.
[0169] Sub-step 14b: If a collision occurs when searching for the first sub-hash value in the first sub-table, find the target hash value that is the same as the second sub-hash value in the requested hash value based on the second sub-table;
[0170] For example, the second sub-hash value is a portion of the binary bits of the request hash value, and the binary bit information corresponding to the first and second sub-hash values in the request hash value is different; in one example, the first sub-hash value is the first bit (Bit1) to the twelfth bit (Bit12) in the request hash value. It should be noted that, in this embodiment, the initial value of the algorithm that calls the hash algorithm to process the data of the request address can be pre-configured. By configuring different initial values, the dispersion of the hash algorithm can be adjusted to reduce the collision rate.
[0171] In summary, the method provided in this embodiment reduces the time required to determine the first expansion device among multiple expansion devices by searching for the target hash value in the hash table. The multiple sub-tables in the hash table effectively reduce the probability of hash collisions, ensuring the hashing behavior between different expansion devices. By obtaining the second value through AND gate calculation, and if the second value matches the base address information, a service request is sent to the first expansion device. This reduces the complexity of comparing the request address and the base address information, avoiding the comparison of the request address with the base address and restriction address information of the first expansion device using an adder in related technologies. The adder calculation is simplified to an AND gate calculation, saving computational resources.
[0172] Figure 10 A schematic diagram of base address register routing provided in an exemplary embodiment of this application is shown.
[0173] Base address register routing (bar_rout) 610 includes routing tables for base address registers in the extended device. Taking a first extended device with two base address registers as an example, it includes a bar0 routing table (bar0_table_rout) 611 and a bar2 routing table (bar2_table_rout) 612. In this embodiment, the base address register is a 64-bit BAR, but it is possible that in other embodiments the base address register is a 32-bit BAR. After obtaining a memory request message, the bar0 routing table 611, bar2 routing table 612, and the synchronous mapping host port routing (host_pn_rout) 613 and on-chip system port routing (soc_pn_rout) 614 are searched in parallel. For example, the memory request mapping has at most one base address register. After aggregating the mapping results in routing hint (rout_hit_rist) 615, the memory request is written to the routing buffer (rout_fifo) 616. If the storage of escape hash table (Hash Table level 2) 617 is not zero, the hash value of the memory request message will be determined based on the records in escape hash table 617. For example, the collision rate can be reduced by adjusting the configuration and algorithm to avoid the storage of escape hash table 617 being non-zero.
[0174] Figure 11 This illustration shows a schematic diagram of a base address register routing table provided in an exemplary embodiment of this application. The base address register routing table in this embodiment, namely the barN routing table 610a, can be... Figure 10 The routing table 611 (bar0) or 612 (bar2) is used. For example, an AND gate is performed on the first value 621 and the request address 622. The AND gate result and the initial value 623 are then processed using the CRC algorithm. The request hash value corresponding to the request address 622 is stored in the CRC register (CRCO_REG) 625. The CRC register 625 also stores the port number 624a and the PCIe mode 624b. The first value 621 is obtained by inverting the mask information and is denoted as ~barn_mask. For an explanation of the mask information, please refer to sub-step 24a above. The first value 621 is the initial input value for the CRC algorithm and is denoted as crc_init_value. The 0th to Mth bits (crco[M:0]) of the requested hash value are searched in the first sub-hash table (Hash Table level 0) 626a, and the 1st to M+1th bits (crco[M+1:1]) of the requested hash value are searched in the second sub-hash table (Hash Table level 1) 626b.
[0175] For example, a D-flip-Flop (DFF) 627 is invoked to process the first part of the request address 622 (denoted as tlp_addr[high_width-1:low_width]), and the calculation result is ANDed with the lookup results in the first sub-hash table 626a and the second sub-hash table 626b respectively. The second part of the request address 622 (denoted as tlp_addr[63:high_width]) is directly compared with the base address information 628, and an ANDed operation is performed. For example, the slots in the first sub-hash table 626a and the second sub-hash table 626b record address information and the function number (function_num) and valid value (valid) of the extended device. By comparing the first part and the second part of the request address 622 respectively, the function number (function_num) corresponding to the request address 622 is obtained.
[0176] Figure 12 A flowchart illustrating an exemplary embodiment of the present application provides a method for verifying address information. This method can be performed by an electronic device and an extension device. Exemplarily, the first subsystem in the electronic device is a host device, the second subsystem is an application layer device, the extension device is a system-on-a-chip (SoC), the second memory in the SoC is a System-on-Chip (SOC) memory, and the processing unit is a comprehensive management unit (SMJ).
[0177] Step 702: The host device sends a configuration TLP to the application layer device;
[0178] For example, host device 1, after power-on reset and removal, initiates either the Basic Input / Output System (BIOS) or the Operating System (OS) enumeration and driver loading. For example, firstly, the BIOS performs hardware initialization and boots the operating system. The operating system enumerates and identifies the computer's hardware devices and loads the corresponding device drivers to ensure that the hardware can be used and controlled normally by the operating system.
[0179] Step 704: The application layer device sends a configuration TLP to the SOC memory;
[0180] For example, the application layer device forwards the received configuration TLP (CFGTLP) to the SOC memory.
[0181] Step 706: The SOC memory sends a configuration TLP to the integrated management unit;
[0182] For example, the SOC memory forwards the received configuration TLP to the integration management unit. For example, the hardware writes the configuration TLP to the SOC memory, and the integration management unit reads, writes, and parses the configuration TLP according to the pointer state.
[0183] Step 708: The integrated management unit sends register configuration to the application layer device;
[0184] For example, the integrated management unit configures information to the hardware device based on the configuration results loaded by enumeration / driver; for example, the register configuration includes the basic configuration of the routing table.
[0185] Step 710: The integrated management unit sends a response message to the application layer device;
[0186] For example, the response message includes a CPL / CPLD message, which is a completion message from the integrated management unit.
[0187] Step 712: The application layer device sends a response message to the host device;
[0188] For example, the application layer device forwards a response message to the host device.
[0189] Step 714: The host device sends the storage TLP to the application layer device;
[0190] For example, the host device accesses the device space through the storage TLP (Memory TLP).
[0191] Step 716: The application layer device sends a storage TLP to the SOC memory;
[0192] For example, the application layer device forwards the received storage TLP to the SOC memory. When the storage TLP passes through the hardware, it needs to look up the routing table to determine the destination device. If it is mapped to the on-chip device of the application layer device, it is routed to the on-chip module. If it involves control and management, it will be routed to the SOC memory. The integrated management unit will parse and process it. If the routing result does not find the corresponding device, it will be processed according to the protocol and an error will be reported.
[0193] Step 718: The SOC memory sends a storage TLP to the integrated management unit;
[0194] For example, the SOC memory forwards the received storage TLP to the integrated management unit.
[0195] Step 720: The integrated management unit sends register or table configurations to the application layer devices;
[0196] The integrated management unit sends registers or table configurations to application layer devices.
[0197] Step 722: The integrated management unit sends a response message to the application layer device;
[0198] For example, the response message includes a CPL / CPLD message, which is a completion message from the integrated management unit.
[0199] Step 724: The application layer device sends a response message to the host device;
[0200] For example, the application layer device forwards a response message (cpid tlp for memory readrequest) to the host device.
[0201] Those skilled in the art will understand that the above embodiments can be implemented independently, or the above embodiments can be freely combined to create new embodiments to implement the address information verification method of this application.
[0202] Figure 13 This illustration shows a structural block diagram of an address information verification device provided in an exemplary embodiment of this application. The device is used in an electronic device that establishes a bus connection with at least two expansion devices. The device includes:
[0203] The acquisition module 810 is used to acquire the request address of the service request, wherein the service request is used to indicate the service processing method of the first extended device;
[0204] The acquisition module 810 is further configured to acquire the base address information of the first expansion device and the first value corresponding to the first expansion device. The base address information is used to indicate the starting storage location of the base address register of the first expansion device. The high-order bits of the first value are a first value, and the low-order bits of the first value are a second value. The number of binary bits of the high-order bits is greater than or equal to the maximum number of binary bits of the address length information of the first expansion device, and the number of binary bits of the low-order bits is less than the maximum number of binary bits of the address length information.
[0205] Processing module 820 is used to perform an AND gate calculation based on the first value and the request address to obtain a second value;
[0206] The sending module 830 is configured to send the service request to the first extended device corresponding to the base address information in response to the second value being the same as the base address information.
[0207] In an optional implementation of the embodiment, the acquisition module 810 is further configured to:
[0208] Obtain the address length information of the first expansion device, wherein the address length information is used to indicate the address space size of the base address register of the first expansion device;
[0209] The first value is obtained by performing binary bit operations based on the address length information.
[0210] In an optional implementation of the embodiment, the acquisition module 810 is further configured to:
[0211] The difference between the address length information and the third value is determined as the mask information, and the mask information is used to determine the binary bits with a binary number of less than the maximum binary number of the address length information as the first value;
[0212] The first value is obtained by inverting the mask information.
[0213] In an optional implementation of the embodiment, the sending module 830 is further configured to:
[0214] The equality comparator is invoked to compare the second value with the base address information;
[0215] If the second value is equal to the base address information, the service request is sent to the first extension device corresponding to the base address information.
[0216] In an optional implementation of the embodiment, the processing module 820 is further configured to:
[0217] The AND gate circuit is invoked to calculate the first value and the requested address to obtain the second value.
[0218] In an optional implementation of the embodiment, the acquisition module 810 is further configured to:
[0219] Obtain the address tables of the at least two extended devices stored in the electronic device, wherein the address tables are used to indicate the base address register information of the at least two extended devices that have established a bus connection with the electronic device;
[0220] The base address information and the first value are obtained based on the address table.
[0221] In an optional implementation of the embodiment, the acquisition module 810 is further configured to:
[0222] Obtain the application address space of the at least two extended devices, wherein the application address space is used to indicate the number of binary difference bits between the base address registers of the at least two extended devices;
[0223] Obtain the first sub-information from the base address register of any one of the at least two expansion devices, and obtain at least two second sub-information corresponding to the base address registers of the at least two expansion devices;
[0224] Based on the first sub-information and the at least two second sub-information, the address tables of the at least two extended devices are constructed;
[0225] The first sub-information is the number of binary bits in the base address register that are greater than or equal to the target number of bits, and the second sub-information is the number of binary bits in the base address register that are less than the target number of bits. The target number of bits is determined based on the application address space.
[0226] In an optional implementation of the embodiment, the processing module 820 is further configured to:
[0227] The fourth value is determined by multiplying the number of binary bits corresponding to the application address space with n, where n is greater than 1;
[0228] The target number of digits is determined based on the fourth value, wherein the target number of digits is greater than or equal to the fourth value.
[0229] In an optional implementation of the embodiment, the processing module 820 is further configured to:
[0230] The hash algorithm is called to process the data of the request address to obtain the request hash value corresponding to the business request;
[0231] Obtain the hash tables corresponding to the at least two extended devices, and find the target hash value that is the same as the requested hash value in the hash tables, wherein the target hash value has an association with the first extended device.
[0232] In one optional implementation of the embodiment, the hash table includes a first sub-table and a second sub-table;
[0233] The processing module 820 is further configured to:
[0234] Based on the first sub-table, the first sub-hash value is found in the request hash value, where the first sub-hash value is a partial binary bit of the request hash value;
[0235] In the event of a conflict when searching for the first sub-hash value in the first sub-table, the target hash value that is the same as the second sub-hash value in the request hash value is obtained based on the search in the second sub-table. The second sub-hash value is a portion of the binary bits of the request hash value, and the binary bit information corresponding to the first sub-hash value and the second sub-hash value in the request hash value is different.
[0236] It should be noted that the device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0237] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments of the relevant method; the technical effects achieved by each module performing its operation are the same as the technical effects in the embodiments of the relevant method, and will not be elaborated here.
[0238] This application also provides a computer device, comprising: a processor and a memory, wherein the memory stores a computer program; the processor is configured to execute the computer program in the memory to implement the address information verification method provided in the above-described method embodiments. Optionally, the computer device is a server. For example, Figure 14 This is a structural block diagram of a server provided in an exemplary embodiment of this application. Typically, the server 2300 includes a processor 2301 and a memory 2302.
[0239] Processor 2301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2301 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 2301 may also include a main processor and a coprocessor. The main processor, also known as a central processing unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2301 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 2301 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0240] The memory 2302 may include one or more computer-readable storage media, which may be non-transitory. The memory 2302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2302 is used to store at least one instruction, which is executed by the processor 2301 to implement the address information verification method provided in the method embodiments of this application.
[0241] In some embodiments, the server 2300 may optionally include an input interface 2303 and an output interface 2304. The processor 2301, memory 2302, and input interfaces 2303 and 2304 can be connected via a bus or signal lines. Various peripheral devices can be connected to the input interfaces 2303 and 2304 via a bus, signal lines, or a circuit board. The input interfaces 2303 and 2304 can be used to connect at least one input / output (I / O) related peripheral device to the processor 2301 and memory 2302. In some embodiments, the processor 2301, memory 2302, and input interfaces 2303 and 2304 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2301, memory 2302, and input interfaces 2303 and 2304 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.
[0242] Those skilled in the art will understand that the structure shown above does not constitute a limitation on server 2300, and may include more or fewer components than shown, or combine certain components, or employ different component arrangements.
[0243] In an exemplary embodiment, a chip is also provided, the chip including programmable logic circuitry and / or program instructions, which, when the chip is run on a computer device, are used to implement the address information verification method described above.
[0244] In an exemplary embodiment, a computer program product is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the address information verification method provided in the above-described method embodiments.
[0245] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores a computer program that is loaded and executed by a processor to implement the address information verification method provided in the above-described method embodiments.
[0246] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0247] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0248] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for verifying address information, characterized in that, The method is performed by an electronic device, which establishes a bus connection with at least two expansion devices, and the method includes: Obtain the request address of the service request, which is used to indicate the service processing method of the first extended device; Obtain the base address information of the first expansion device and the first value corresponding to the first expansion device. The base address information is used to indicate the starting storage location of the base address register of the first expansion device. The high-order bits of the first value are the first value, and the low-order bits of the first value are the second value. The number of binary bits of the high-order bits is greater than or equal to the maximum number of binary bits of the address length information of the first expansion device, and the number of binary bits of the low-order bits is less than the maximum number of binary bits of the address length information. A second value is obtained by performing an AND gate operation based on the first value and the requested address; In response to the second value being the same as the base address information, the service request is sent to the first extension device corresponding to the base address information.
2. The method according to claim 1, characterized in that, The step of obtaining the first value corresponding to the first extended device includes: Obtain the address length information of the first expansion device, wherein the address length information is used to indicate the address space size of the base address register of the first expansion device; The first value is obtained by performing binary bit operations based on the address length information.
3. The method according to claim 2, characterized in that, The step of performing binary bitwise operations based on the address length information to obtain the first value includes: The difference between the address length information and the third value is determined as the mask information, and the mask information is used to determine the binary bits with a binary number of less than the maximum binary number of the address length information as the first value; The first value is obtained by inverting the mask information.
4. The method according to any one of claims 1 to 3, characterized in that, The step of responding to the second value being the same as the base address information by sending the service request to the first extended device corresponding to the base address information includes: The equality comparator is invoked to compare the second value with the base address information; If the second value is equal to the base address information, the service request is sent to the first extension device corresponding to the base address information.
5. The method according to any one of claims 1 to 3, characterized in that, The step of performing an AND gate calculation based on the first value and the request address to obtain the second value includes: The AND gate circuit is invoked to calculate the first value and the requested address to obtain the second value.
6. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain the address tables of the at least two extended devices stored in the electronic device, wherein the address tables are used to indicate the base address register information of the at least two extended devices that have established a bus connection with the electronic device; The base address information and the first value are obtained based on the address table.
7. The method according to claim 6, characterized in that, The step of obtaining the address tables of the at least two extended devices stored in the electronic device includes: Obtain the application address space of the at least two extended devices, wherein the application address space is used to indicate the number of binary difference bits between the base address registers of the at least two extended devices; Obtain the first sub-information from the base address register of any one of the at least two expansion devices, and obtain at least two second sub-information corresponding to the base address registers of the at least two expansion devices; Based on the first sub-information and the at least two second sub-information, the address tables of the at least two extended devices are constructed; The first sub-information is the number of binary bits in the base address register that are greater than or equal to the target number of bits, and the second sub-information is the number of binary bits in the base address register that are less than the target number of bits. The target number of bits is determined based on the application address space.
8. The method according to claim 7, characterized in that, The method further includes: The fourth value is determined by multiplying the number of binary bits corresponding to the application address space with n, where n is greater than 1; The target number of digits is determined based on the fourth value, wherein the target number of digits is greater than or equal to the fourth value.
9. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The hash algorithm is invoked to process the data of the request address to obtain the request hash value corresponding to the business request; Obtain the hash tables corresponding to the at least two extended devices, and find the target hash value that is the same as the requested hash value in the hash tables, wherein the target hash value has an association with the first extended device.
10. The method according to claim 9, characterized in that, The hash table includes a first sub-table and a second sub-table; The step of finding the target hash value that is the same as the requested hash value in the hash table includes: Based on the first sub-table, the first sub-hash value is found in the request hash value, where the first sub-hash value is a partial binary bit of the request hash value; In the event of a conflict when searching for the first sub-hash value in the first sub-table, the target hash value that is the same as the second sub-hash value in the request hash value is obtained based on the search in the second sub-table. The second sub-hash value is a portion of the binary bits of the request hash value, and the binary bit information corresponding to the first sub-hash value and the second sub-hash value in the request hash value is different.
11. A device for verifying address information, characterized in that, The device is used in an electronic device, the electronic device having a bus connection with at least two expansion devices, the device comprising: The acquisition module is used to acquire the request address of the service request, which is used to indicate the service processing method of the first extended device; The acquisition module is further configured to acquire the base address information of the first expansion device and the first value corresponding to the first expansion device. The base address information is used to indicate the starting storage location of the base address register of the first expansion device. The high-order bits of the first value are a first value, and the low-order bits of the first value are a second value. The number of binary bits of the high-order bits is greater than or equal to the maximum number of binary bits of the address length information of the first expansion device, and the number of binary bits of the low-order bits is less than the maximum number of binary bits of the address length information. The processing module is used to perform an AND gate calculation based on the first value and the request address to obtain a second value; The sending module is configured to send the service request to the first extended device corresponding to the base address information in response to the second value being the same as the base address information.
12. A computer device, characterized in that, The computer device includes: a processor and a memory, wherein the memory stores at least one program; the processor is configured to execute the at least one program in the memory to implement the address information verification method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The readable storage medium stores executable instructions, which are loaded and executed by a processor to implement the address information verification method as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium. The processor reads and executes the computer instructions from the computer-readable storage medium to implement the address information verification method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for PCIE address mapping detection
CN103731317A
Message processing method and device, electronic equipment and computer readable storage medium
CN116015613A
