CN112631915B - Method, system, device and medium for PCIE device software simulation - Google Patents

Method, system, device and medium for PCIE device software simulation Download PDF

Info

Publication number
CN112631915B
CN112631915B CN202011551499.7A CN202011551499A CN112631915B CN 112631915 B CN112631915 B CN 112631915B CN 202011551499 A CN202011551499 A CN 202011551499A CN 112631915 B CN112631915 B CN 112631915B
Authority
CN
China
Prior art keywords
pcie
handle
protocol
file
image object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011551499.7A
Other languages
Chinese (zh)
Other versions
CN112631915A (en
Inventor
闫李明
杨熠晨
王优博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011551499.7A priority Critical patent/CN112631915B/en
Publication of CN112631915A publication Critical patent/CN112631915A/en
Application granted granted Critical
Publication of CN112631915B publication Critical patent/CN112631915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method, a system, equipment and a storage medium for PCIE equipment software simulation, wherein the method comprises the following steps: creating a driving assembly based on the unified extensible firmware interface specification, and taking the PCIE information structure body as a picture object of the driving assembly; installing a PCIE-related protocol on a handle of a driving assembly pointing to a picture object; compiling the driving component to generate an intermediate file, and loading the intermediate file into an internal memory to generate a picture file; and positioning the picture file to the corresponding picture object according to the protocol on the handle, and executing the operation of the corresponding PCIE equipment by utilizing the picture object. According to the invention, the drive assembly is established, and parameter configuration and protocol installation are carried out on the drive assembly so as to simulate the Image object formed by loading the PCIE equipment into the memory, so that a firmware developer can carry out equipment identification and subsequent verification analysis of other functions, and the efficiency of firmware development is greatly improved.

Description

Method, system, device and medium for PCIE device software simulation
Technical Field
The present invention relates to the field of simulation, and in particular, to a method, a system, a computer device, and a readable medium for PCIE device software simulation.
Background
In recent years, with the development of services such as big data and cloud computing, servers have been popularized in various industries. Firmware development is one of the post industries of the whole server industry, development efficiency directly influences development and operation and maintenance of a server, PCIE equipment adaptation is the most basic work in firmware development, a mainstream test method is that specific Riser and PCIE equipment are matched on a server mainboard for debugging, the test mode depends on various equipment and connection of corresponding Riser and SlimLine, the demand on the equipment is large, and if appropriate PCIE equipment or cables do not happen in hand, development efficiency is influenced.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, a system, a computer device, and a computer readable storage medium for software simulation of a PCIE device, where a driver component is established and parameter configuration and protocol installation are performed on the driver component, so as to simulate an Image object formed by loading a PCIE device into a memory, so that a firmware developer performs device identification and verification analysis of subsequent other functions, thereby greatly improving efficiency of firmware development.
Based on the above object, an aspect of the embodiments of the present invention provides a method for simulating PCIE device software, including the following steps: creating a driving assembly based on a unified extensible firmware interface specification, and taking a PCIE information structure body as a picture object of the driving assembly; installing a PCIE-related protocol on a handle of the drive assembly pointing to the picture object; compiling the driving component to generate an intermediate file, and loading the intermediate file into a memory to generate a picture file; and positioning the picture file to a corresponding picture object according to the protocol on the handle, and executing the operation of corresponding PCIE equipment by using the picture object.
In some embodiments, the taking the PCIE information structure as the picture object of the driving component includes: creating a corresponding controller object for each PCIE device for controlling the PCIE device.
In some embodiments, the installing the PCIE-related protocol on the handle to the picture object by the drive component includes: and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
In some embodiments, the installing the PCIE-related protocol on the handle to the picture object by the drive component includes: a first protocol for device access and a second protocol for obtaining a device path are installed on the handle.
In another aspect of the embodiments of the present invention, a PCIE device software simulation system is further provided, including: the device comprises a creation module, a storage module and a display module, wherein the creation module is configured to create a drive assembly based on a unified extensible firmware interface specification, and take a PCIE information structure body as a picture object of the drive assembly; the installation module is configured to install a PCIE-related protocol on a handle of the picture object pointed by the drive assembly; the loading module is configured to compile the driving component to generate an intermediate file, and load the intermediate file into an internal memory to generate a picture file; and the execution module is configured to position the picture file to a corresponding picture object according to the protocol on the handle, and execute the operation of the corresponding PCIE equipment by using the picture object.
In some embodiments, the creation module is configured to: creating a corresponding controller object for each PCIE device for controlling the PCIE device.
In some embodiments, the installation module is configured to: and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
In some embodiments, the installation module is configured to: a first protocol for device access and a second protocol for obtaining a device path are installed on the handle.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: by establishing the driving assembly, parameter configuration and protocol installation are carried out on the driving assembly, so that an Image object formed by loading PCIE equipment into a memory is simulated, equipment identification and subsequent verification and analysis of other functions are carried out by firmware developers, and the firmware development efficiency is greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic diagram of an embodiment of a method for simulating software of a PCIE device provided in the present invention;
fig. 2 is a schematic diagram of a hardware structure of an embodiment of a computer device for PCIE device software emulation provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are only used for convenience of expression and should not be construed as a limitation to the embodiments of the present invention, and no description is given in the following embodiments.
Based on the above purpose, a first aspect of the embodiments of the present invention provides an embodiment of a method for simulating PCIE device software. Fig. 1 is a schematic diagram illustrating an embodiment of a method for simulating PCIE device software provided in the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, creating a driving assembly based on the unified extensible firmware interface specification, and taking the PCIE information structure body as a picture object of the driving assembly;
s2, installing PCIE related protocols on handles of the drive components pointing to the picture objects;
s3, compiling the driving assembly to generate an intermediate file, and loading the intermediate file into the memory to generate a picture file; and
and S4, positioning the picture file to the corresponding picture object according to the protocol on the handle, and executing the operation of the corresponding PCIE equipment by using the picture object.
The embodiment of the invention provides a modularized PCIE (peripheral component Interface express) equipment software simulation method, which is characterized in that a DXE _ DRIVER (DRIVER component) which accords with a Unified Extensible Firmware Interface (UEFI) specification is added, a protocol (protocol) related to a PCIE is installed for the DXE _ DRIVER, and related parameters set by the DRIVER component are added, so that the UEFI can be simulated as a Controller object (a special Image object) generated in a memory by the PCIE equipment. The PCIE equipment of the entity does not need to be matched, and the corresponding PCIE equipment is simulated only through options, so that the efficiency of firmware development is improved, and the successful implementation of customer customization and project development is ensured.
And creating a driving assembly based on the unified extensible firmware interface specification, and taking the PCIE information structure body as a picture object of the driving assembly.
In some embodiments, the taking the PCIE information structure as the picture object of the driving component includes: creating a corresponding controller object for each PCIE device for controlling the PCIE device. And creating a standard DXE _ DRIVER, taking a PCIE information structure existing in the code as an Image object operated by a drive component, and carrying out initialization configuration on the parameters of the Image object.
And installing PCIE (peripheral component interface express) related protocols on handles which point to the picture objects by the driving components. Each DXE _ DRIVER has a HANDLE to the Image object, which is of the EFI _ HANDLE type, to which PCIE related protocol is installed using standard commands of UEFI.
In some embodiments, the installing the PCIE-related protocol on the handle to the picture object by the drive component includes: and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
In some embodiments, the installing the PCIE-related protocol on the handle to the picture object by the drive component includes: a first protocol for device access and a second protocol for obtaining a device path are installed on the handle. For example: the method comprises the steps of PciIoProtocol for equipment access and DevicePathProtocol for obtaining equipment paths, wherein the protocols are installed on a handle, and a PCIE Image which can be loaded in an internal memory is simulated.
And compiling the driving component to generate an intermediate file, and loading the intermediate file into the memory to generate a picture file. When the driver component is compiled, a efi file is generated, and the UEFI loads the file into the memory to generate an Image file.
And positioning the picture file to the corresponding picture object according to the protocol on the handle, and executing the operation of the corresponding PCIE equipment by using the picture object. PCIE related protocols exist in a HANDLE EFI _ HANDLE of the Image file, and when UEFI identifies and displays all PCIE equipment, the Image file can be positioned to an Image object through the HANDLE, and identification and subsequent related operations are carried out on the Image object. Parameters can be customized in the former PCIE equipment parameter configuration, so that the development, adaptation and other work can be more conveniently carried out.
After the UEFI scans the bus, a Controller object is established for each PCIE device to control the device and point to it through EFI _ HANDLE, and the UEFI installs a related protocol for the device to implement functions of identifying and accessing the device. And finally, a. EFI file is generated through a DXE _ DRIVER module added by UEFI specification, when UEFI loads the file into a memory, an Image object is also established for the file, the Image object is also an EFI _ portable object, and if a related protocol is installed for the file, UEFI also recognizes the file as a PCIE device and recognizes and accesses the PCIE device. This makes it possible to implement modular PCIE software emulation.
It should be particularly noted that, in each embodiment of the above PCIE device software simulation method, each step may be intersected, replaced, added, or deleted, and therefore, these methods for PCIE device software simulation, which are transformed by reasonable permutation and combination, should also belong to the protection scope of the present invention, and should not limit the protection scope of the present invention to the embodiments.
Based on the above object, a second aspect of the embodiment of the present invention provides a system for simulating PCIE device software, including: the device comprises a creation module, a storage module and a display module, wherein the creation module is configured to create a drive assembly based on a unified extensible firmware interface specification, and take a PCIE information structure body as a picture object of the drive assembly; the installation module is configured to install a PCIE-related protocol on a handle of the picture object pointed by the drive assembly; the loading module is configured to compile the driving component to generate an intermediate file, and load the intermediate file into an internal memory to generate a picture file; and the execution module is configured to position the picture file to a corresponding picture according to the protocol on the handle, and execute the operation of the corresponding PCIE equipment by using the picture.
In some embodiments, the creation module is configured to: creating a corresponding controller object for each PCIE device for controlling the PCIE device.
In some embodiments, the installation module is configured to: and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
In some embodiments, the installation module is configured to: a first protocol for device access and a second protocol for obtaining a device path are installed on the handle.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, creating a driving assembly based on the unified extensible firmware interface specification, and taking the PCIE information structure body as a picture object of the driving assembly; s2, installing PCIE related protocols on handles of the drive components pointing to the picture objects; s3, compiling the driving assembly to generate an intermediate file, and loading the intermediate file into the memory to generate a picture file; and S4, positioning the picture file to the corresponding picture according to the protocol on the handle, and executing the operation of the corresponding PCIE equipment by using the picture.
In some embodiments, the taking the PCIE information structure as the picture object of the driving component includes: creating a corresponding controller object for each PCIE device for controlling the PCIE device.
In some embodiments, the installing the PCIE-related protocol on the handle to the picture object by the drive component includes: and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
In some embodiments, the installing the PCIE-related protocol on the handle to the picture object by the drive component includes: a first protocol for device access and a second protocol for obtaining a device path are installed on the handle.
Fig. 2 is a schematic diagram of a hardware structure of an embodiment of the PCIE device software emulation computer device provided in the present invention.
Taking the apparatus shown in fig. 2 as an example, the apparatus includes a processor 301 and a memory 302, and may further include: an input device 303 and an output device 304.
The processor 301, the memory 302, the input device 303 and the output device 304 may be connected by a bus or other means, and fig. 2 illustrates the connection by a bus as an example.
The memory 302 is used as a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for simulating the software of the PCIE device in the embodiment of the present application. The processor 301 executes various functional applications and data processing of the server by running nonvolatile software programs, instructions and modules stored in the memory 302, that is, the method for implementing software emulation of PCIE devices according to the foregoing method embodiment is implemented.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the method of PCIE device software simulation, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 302 optionally includes memory located remotely from processor 301, which may be connected to a local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 303 may receive information such as a user name and a password that are input. The output means 304 may comprise a display device such as a display screen.
Program instructions/modules corresponding to one or more methods for PCIE device software emulation are stored in the memory 302, and when executed by the processor 301, perform the method for PCIE device software emulation in any of the above-described method embodiments.
Any embodiment of the computer device executing the method for PCIE device software simulation may achieve the same or similar effects as any corresponding method embodiment described above.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate, all or part of the processes in the methods of the foregoing embodiments may be implemented by instructing related hardware by a computer program, and the program of the method for simulating software of a PCIE device may be stored in a computer-readable storage medium, and when executed, the program may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for PCIE equipment software simulation is characterized by comprising the following steps:
creating a drive assembly based on a unified extensible firmware interface specification, and taking a PCIE information structure body as an Image object of the drive assembly;
installing a PCIE-related protocol on a handle of the drive component pointing to the Image object;
compiling the driving component to generate an intermediate file, and loading the intermediate file into a memory to generate an Image file; and
and positioning the Image file to a corresponding Image object according to the protocol on the handle, and executing the operation of the corresponding PCIE equipment by using the Image object.
2. The method according to claim 1, wherein the taking the PCIE information structure as the Image object of the driving component comprises:
and creating a corresponding controller object for each PCIE device to be used for controlling the PCIE device.
3. The method of claim 2, wherein installing the PCIE-related protocol onto a handle of the driver component to the Image object comprises:
and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
4. The method of claim 1, wherein installing the PCIE-related protocol onto a handle of the driver component to the Image object comprises:
a first protocol for device access and a second protocol for obtaining a device path are installed on the handle.
5. A system for PCIE device software emulation, comprising:
the device comprises a creation module, a storage module and a processing module, wherein the creation module is configured to create a drive assembly based on a unified extensible firmware interface specification, and take a PCIE information structure body as an Image object of the drive assembly;
the installation module is configured to install a PCIE-related protocol on a handle of the drive component pointing to the Image object;
the loading module is configured to compile the driving component to generate an intermediate file, and load the intermediate file into a memory to generate an Image file; and
and the execution module is configured to locate the Image file to a corresponding Image object according to the protocol on the handle, and execute the operation of the corresponding PCIE equipment by using the Image object.
6. The system of claim 5, wherein the creation module is configured to:
creating a corresponding controller object for each PCIE device for controlling the PCIE device.
7. The system of claim 6, wherein the installation module is configured to:
and installing PCIE (peripheral component interface express) related protocols on a handle of the drive assembly pointing to the controller object.
8. The system of claim 5, wherein the installation module is configured to:
a first protocol for device access and a second protocol for obtaining a device path are installed on the handle.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 4.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN202011551499.7A 2020-12-24 2020-12-24 Method, system, device and medium for PCIE device software simulation Active CN112631915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011551499.7A CN112631915B (en) 2020-12-24 2020-12-24 Method, system, device and medium for PCIE device software simulation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011551499.7A CN112631915B (en) 2020-12-24 2020-12-24 Method, system, device and medium for PCIE device software simulation

Publications (2)

Publication Number Publication Date
CN112631915A CN112631915A (en) 2021-04-09
CN112631915B true CN112631915B (en) 2022-05-13

Family

ID=75324500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011551499.7A Active CN112631915B (en) 2020-12-24 2020-12-24 Method, system, device and medium for PCIE device software simulation

Country Status (1)

Country Link
CN (1) CN112631915B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817115A (en) * 2022-05-20 2022-07-29 深圳市广和通无线通信软件有限公司 Serial port communication method and related device
CN117369906B (en) * 2023-12-07 2024-02-09 成都市楠菲微电子有限公司 Pcie verification platform, method and device, storage medium and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909399A (en) * 2015-12-22 2017-06-30 中电科技(北京)有限公司 A kind of UEFI firmware implementation methods based on server computer
CN110674067B (en) * 2019-09-23 2021-06-29 中国科学院微小卫星创新研究院 Configuration connection system and method for communication simulation between hardware
CN111045838B (en) * 2019-12-03 2023-03-31 中国航空无线电电子研究所 Distributed driving middleware based on remote procedure call protocol

Also Published As

Publication number Publication date
CN112631915A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
CN109976761B (en) Software development kit generation method and device and terminal equipment
CN112631915B (en) Method, system, device and medium for PCIE device software simulation
JP2017146966A (en) Method and system for extending function to package file
CN112148278A (en) Visual block chain intelligent contract framework and intelligent contract development and deployment method
CN108121650B (en) Method and device for testing page user interface
CN113268684A (en) Data processing method, device, terminal equipment and storage medium
CN111338925A (en) Applet test method, device and system, electronic equipment and storage medium
CN111880801A (en) Application program dynamic method and device and electronic equipment
US9952953B2 (en) Non-monotonic eventual convergence for desired state configuration
CN111552542B (en) Method for automatically constructing virtual machine mirror image
CN111930398A (en) Application program updating method, device, system, medium and equipment
CN111488275A (en) UI automation test method and device, storage medium and electronic equipment
CN111459506B (en) Deep learning platform cluster deployment method and device, medium and electronic equipment
CN117008934A (en) Method, device, equipment and medium for automatically making mirror image of information creation operating system
CN114201382A (en) Test case generation method and device, storage medium and electronic equipment
CN110825370B (en) Mobile terminal application development method, device and system
WO2004088508A2 (en) A method of creating software that is portable across different operating systems
US20220012036A1 (en) System and method for modularizing update environment in life cycle manager
CN114741294A (en) Page debugging method, device, equipment and storage medium
Anand Secure bootloader for connectivity mcu
CN111181953B (en) Method and device for supporting spice protocol through Roc virtualization
CN113961232A (en) Terminal, method and platform server for providing integrated development environment
CN114253615B (en) Method and device for setting bootstrap program, electronic equipment and storage medium
CN116991355B (en) Method, system and device for supporting LED driving chip by modifying and iterating script
CN116302847B (en) Dynamic acquisition method and device of abnormal information, computer equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant