CN114610557B - Method and device for testing equipment driving unit - Google Patents
Method and device for testing equipment driving unit Download PDFInfo
- Publication number
- CN114610557B CN114610557B CN202210508847.5A CN202210508847A CN114610557B CN 114610557 B CN114610557 B CN 114610557B CN 202210508847 A CN202210508847 A CN 202210508847A CN 114610557 B CN114610557 B CN 114610557B
- Authority
- CN
- China
- Prior art keywords
- register
- read
- write
- driving unit
- preset
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0208—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
- G05B23/0213—Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Automation & Control Theory (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to the field of electronic information, and particularly discloses a method and a device for testing a device driving unit. The method comprises the following steps: acquiring a register read-write instruction triggered by a device driving unit in response to a received input parameter; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers; remapping the read-write instruction of the register to the virtual register according to the address remapping mode; the virtual register is realized through a memory and is used for simulating a preset register; and acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the device driving unit according to the matching result.
Description
Technical Field
The embodiment of the invention relates to the field of electronic information, in particular to a method and a device for testing a device driving unit.
Background
Currently, many hardware devices need to be able to operate normally after installation of a device driving unit. If the device driving unit is abnormal, the hardware device cannot be normally used. For this reason, it is necessary to test the device driving unit in advance to avoid the use of the hardware device being affected by the problem of the device driving unit.
In the related art, in order to test the device driving unit, the device driving unit needs to be installed on the hardware device first, and the device driving unit is operated, so that the device driving unit performs read-write operation on a hardware register in the hardware device in an operation process, and obtains an operation result of the hardware device. And judging whether the hardware equipment normally operates according to the operation result of the hardware equipment, so as to detect whether the equipment driving unit normally operates.
However, the inventor finds that the mode has at least the following defects in the process of implementing the invention: the device driving unit needs to be installed on the hardware device, and a test environment including the hardware device needs to be built, resulting in high test cost. Moreover, whether the operation condition is normal or not needs to be judged manually according to the operation result of the hardware equipment, and the judgment mode is complicated and low-efficiency.
Disclosure of Invention
In view of the above, the present invention has been made to provide a test method and apparatus for a device driving unit that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a method of testing a device driving unit, the method comprising:
acquiring a register read-write instruction triggered by a device driving unit in response to a received input parameter; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers;
remapping the read-write instruction of the register to the virtual register according to the address remapping mode; the virtual register is realized through a memory and is used for simulating a preset register;
and acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the device driving unit according to the matching result.
According to still another aspect of the present invention, there is provided a test apparatus of a device driving unit, the apparatus including:
the acquisition module is suitable for acquiring a register read-write instruction triggered by the device driving unit in response to the received input parameters; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers;
the remapping module is suitable for remapping the read-write instruction of the register to the virtual register according to the address remapping mode; the virtual register is realized through a memory and is used for simulating a preset register;
and the test module is suitable for acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the equipment driving unit according to the matching result.
According to still another aspect of the present invention, there is provided an electronic apparatus including: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the method.
According to yet another aspect of the embodiments of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to execute the method as described above.
In the method and the device for testing the device driving unit, the preset register in the hardware device is simulated through the memory, so that the testing process of the device driving unit is realized through the virtual register. The test mode can realize the test process by directly utilizing the local memory without hardware equipment, thereby simplifying the test environment and reducing the test cost. Moreover, the read-write operation result of the virtual register is matched with the standard read-write result corresponding to the input parameter, so that the comparison efficiency of the test result can be improved, and the problem that manual judgment causes complexity and error easily is solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a method for testing a device driving unit according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing a structure of a test system in the related art;
fig. 3 is a flowchart illustrating a method for testing a device driving unit according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram illustrating a testing apparatus of a device driving unit according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to yet another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flowchart illustrating a method for testing a device driver unit according to an embodiment of the present invention. As shown in fig. 1, the method includes:
s110: acquiring a register read-write instruction triggered by a device driving unit in response to a received input parameter; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers.
The device driving unit includes various driving units for driving the hardware device, and may be implemented by, for example, driving software, a driving program, and the like. The hardware device to be driven is provided with a preset register, and the register is a hardware register and is positioned inside the hardware device.
In the working process of the device driving unit, read-write operation needs to be performed on a preset register inside the hardware device. For example, when the device driving unit receives an input parameter, a corresponding register read-write instruction is triggered according to a parameter value of the input parameter, so as to implement a read-write process on a preset register.
S120: remapping the read-write instruction of the register to the virtual register according to the address remapping mode; the virtual register is realized through a memory and is used for simulating a preset register.
In this embodiment, in order to simplify the test environment, a virtual register is set in the memory in advance, so that the virtual register simulates a preset register in the hardware device, thereby implementing the test process without the hardware device.
The register read-write instruction is remapped to the virtual register in an address remapping mode, so that the read-write instruction triggered by the device driving unit aiming at the preset register in the hardware device is redirected to the virtual register in the memory, and the effect of simulating the preset register in the hardware device by the virtual register is achieved.
S130: and acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the device driving unit according to the matching result.
The virtual register responds to the register read-write instruction and generates a read-write operation result. And reading a read-write operation result generated by the virtual register, and matching the read-write operation result with a standard read-write result corresponding to the input parameter, so as to determine a test result of the device driving unit according to the matching result.
The standard read-write result corresponding to the input parameter is determined in advance through calculation and the like, and the standard read-write result refers to: and under the condition that the equipment driving unit works normally, responding to the input parameters, and performing read-write operation on the register to generate a result. If the read-write operation result is matched with the standard read-write result, the test result is normal; if the read-write operation result is not matched with the standard read-write result, the test result is abnormal.
In the method for testing the device driving unit provided by the embodiment of the invention, hardware equipment is not needed, and the testing process can be realized by directly utilizing the local memory, so that the testing environment is simplified, and the testing cost is reduced. Moreover, the read-write operation result of the virtual register is matched with the standard read-write result corresponding to the input parameter, so that the comparison efficiency of the test result can be improved, and the problem that manual judgment causes complexity and error easily is solved.
For the sake of understanding, a detailed description will be given below by taking a specific embodiment as an example.
Fig. 2 is a schematic diagram showing a structure of a test system in the related art. As shown in fig. 2, the test system includes: a device driving unit 21, a hardware device 22. Wherein the hardware device 22 further comprises: a first preset register 221, a second preset register 222, and a hardware circuit 223. Among them, the device driving unit 21 is used to drive the hardware circuit 223 in the hardware device 22. In addition, during the operation of the device driving unit, the first preset register 221 and the second preset register 222 need to be read and written.
In case of input parameter determination, data is written into the first preset register 221 and/or the second preset register 222 by the device driving unit, so as to drive the hardware circuit to generate a corresponding output result according to the data content. For example, when a hardware circuit has a plurality of operating states, the correspondence between different values of the register and the various operating states of the hardware circuit is set in advance. Accordingly, based on the correspondence, the circuit operation result corresponding to the data content in the register can be determined.
In the test system shown in fig. 2, after the hardware circuit reads the register value and displays the circuit operation result corresponding to the register value, it is determined whether the circuit operation state is normal by obtaining the circuit operation result, and it is further determined whether the device driving unit is normal. The circuit operation result can also be a software operation result, observable objects such as currently output circuit waveforms, logs, nixie tubes, display screens and the like need to be recorded for judgment, the purpose of automatically judging the result cannot be achieved in some scenes, and whether the result is correct or not needs to be determined by means of manual observation and recording and the like.
It can be seen that the system shown in fig. 2 has at least the following drawbacks and disadvantages: because hardware equipment is required to participate in the test process, more equipment is required for testing, and the environment is complex to build; moreover, the test process result of a single case needs to be observed and recorded, and the test period is longer under the condition of more cases; moreover, the test result needs to be judged manually, and an unaided factor exists.
In order to solve the above problem, fig. 3 is a flowchart illustrating a method for testing a device driving unit according to another embodiment of the present invention. In the embodiment shown in fig. 3, the hardware device is omitted, and the test of the device driving unit can be completed directly in the local of the test device. As shown in fig. 3, the method includes:
s300: and configuring a virtual register corresponding to the preset register in the memory of the test equipment according to the register configuration information of the preset register contained in the hardware equipment.
The method comprises the steps of obtaining register configuration information of a preset register, applying for a continuous memory space matched with the register configuration information, configuring the continuous memory space into a virtual register corresponding to the preset register, and storing a mapping relation between the virtual register and the preset register so as to realize address remapping processing in the subsequent steps. The number of the preset registers may be one or more. In this embodiment, the preset register includes: at least two first registers, respectively, a virtual register comprising: at least two second registers corresponding to the respective first registers.
The register configuration information of the preset register comprises at least one of the following: the identification of each first register, the numerical value of each first register, the bit width of each first register, the physical address information of each first register, and the attribute description information of each first register. The identifier of the first register may be information such as a name or an ID of the first register. The value of the first register is typically a value in the form of 0, 1. The bit width of the first register is also called the length of the first register, and is used for indicating the number of bytes occupied by the first register. The physical address information of the first register includes: the first register has specific information such as a start bit and an end bit of a physical address (also called a byte address) in the hardware device. The attribute description information of the first register is used to describe information such as a function and a structure of the first register. In short, the present invention does not limit the specific meaning of the register configuration information.
The register configuration information can be stored in a register list form, wherein the configuration information is fixed except that the value of the register is variable, the format of the register list is not changed for fixed hardware design, and the register list can exist in the test equipment in a template form, so that the test equipment can directly and quickly create the virtual register in the memory according to the register configuration information stored in the register list.
The virtual register in the memory comprises a plurality of second registers, so when a continuous memory space matched with the register configuration information is applied and the continuous memory space is configured as the virtual register corresponding to the preset register, the address interval of the continuous memory space and the address range of each second register are determined specifically according to the bit width of each first register, so that the plurality of second registers are configured in the continuous memory space.
S310: the input parameters are sent to the device driving unit.
The execution subject of the method is test software running on the test equipment. In addition, the device driving unit can be device driving software, correspondingly, the testing software and the device driving software are both configured on the same testing device, and hardware devices driven by the device driving software do not need to be configured additionally, so that a testing result can be directly generated locally on the testing device, and the testing cost is reduced. In other words, the main execution body of the method is a test device (for example, test software installed on the test device) independent of the hardware device, and the device driver unit runs in the test device.
In this embodiment, the standard read/write result corresponding to the input parameter is configured in advance. When the input parameters are multiple groups, the standard read-write results corresponding to the input parameters of each group can be configured respectively. Correspondingly, all the input parameters are sequentially sent to the equipment driving unit, and judgment is carried out according to the matching relation between the read-write operation result corresponding to each input parameter and the standard read-write result. For example, when the device driving unit has a plurality of test cases, input parameters corresponding to the respective test cases and standard read-write results corresponding to the input parameters are configured, respectively. By means of sequentially sending a plurality of input parameters to the equipment driving unit, sequential testing of a plurality of test cases is achieved, and testing efficiency is greatly improved.
S320: and the acquisition equipment driving unit responds to the register read-write instruction triggered by the received input parameters.
In the working process of the device driving unit, read-write operation needs to be performed on a preset register inside the hardware device. For example, when the device driving unit receives an input parameter, a corresponding register read-write instruction is triggered according to a parameter value of the input parameter, so as to implement a read-write process on a preset register.
In this embodiment, in order to perform a test without relying on the hardware device, a read-write interface needs to be set in the test software, and the read-write interface can be implemented by a read-write function, so that the read-write interface intercepts a register read-write instruction triggered by the device driving unit in response to the received input parameter, and redirects the register read-write instruction in a subsequent step.
S330: and remapping the read-write instruction of the register to the virtual register according to the address remapping mode.
And sending the register read-write instruction to the virtual register in an address remapping mode according to the mapping relation. For example, under the condition that the virtual register comprises a plurality of second registers, the register identifier contained in the register read-write instruction is analyzed and obtained, and the second registers corresponding to the register identifier are determined; and sending the register read-write instruction to a second register in an address remapping mode according to the mapping relation.
In one implementation, the memory absolute address can be translated for access in a manner consistent with the address space encoding of the hardware register (i.e., the default register). For example, the first address of the memory region corresponding to the virtual register can be pointed to by a manner similar to a data pointer in C language. In addition, in the case that the virtual register includes a plurality of second registers, the data pointer is specifically an array pointer, and each element in the array pointer is used for pointing to a corresponding second register. Correspondingly, the read-write interface can transfer the register read-write instruction triggered by the device driving software to the virtual register realized by the memory in a data pointer mode.
S340: and acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the device driving unit according to the matching result.
The virtual register responds to the register read-write instruction and generates a read-write operation result. And reading a read-write operation result generated by the virtual register, and matching the read-write operation result with a standard read-write result corresponding to the input parameter, so as to determine a test result of the device driving unit according to the matching result. If the read-write operation result is successfully matched with the standard read-write result corresponding to the input parameter, determining that the equipment driving unit is in a normal state; and if the read-write operation result is not matched with the standard read-write result corresponding to the input parameter, determining that the equipment driving unit is in an abnormal state.
The reading and writing operation result can be presented in a mode of reading and writing the result list through the register, the standard reading and writing result can be presented in a mode of presetting the result list through the register, the result list is preset through the pre-stored register, and judgment is carried out in a mode of comparing whether the read and writing result list of the register is matched with the result list of the register or not. For example, for a single test case, it corresponds to two register lists: one is a preset correct result (i.e. register preset result list); the other is the result of the device driver software running (i.e. the register read-write result list), which is generated by filling the value stored in the virtual register set after the software running into the register value field in the register read-write result list. During comparison, only the register value fields in the register preset result list and the register read-write result list need to be compared. If the register value fields are the same, the register value fields are successful; if the register value fields are different, then failure occurs. Wherein the register value field is used to store the value of the register.
In conclusion, the testing method is realized by adopting software, the automation degree is high, and the judgment result is objective and does not depend on human judgment. The method can solve the problems that the testing device is complex, a single test case needs a complex recording process, results need manual judgment and the like in the prior art, and effectively overcomes the defects of low efficiency, high complexity, long testing period and the like. The plurality of second registers form a virtual register set, and a result can be obtained directly in a software input and output mode without hardware equipment. The test result clearly indicates pass or fail, and the comparison difference result can be displayed when the test result fails, so that the abnormity reason judgment can be conveniently carried out by comparing the difference result, and the implementation mode is simple and clear. The method can be completely separated from hardware equipment and circuits, the result of whether the driving software is qualified is completely given by logic test, and the test case can be repeatedly used. The method can solve the problems of low efficiency, complex test environment, inaccuracy caused by dependence on artificial observation of results and the like in the conventional method. The software testing process is automatically realized, the result is clear, and the tracking and the correction are convenient.
Fig. 4 is a schematic structural diagram illustrating a testing apparatus of a device driving unit according to another embodiment of the present invention, including:
an obtaining module 41, adapted to obtain a register read-write instruction triggered by the device driving unit in response to the received input parameter; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers;
a remapping module 42 adapted to remap the register read-write instruction to the virtual register according to the address remapping; the virtual register is realized through a memory and is used for simulating a preset register;
the test module 43 is adapted to obtain a read-write operation result of the virtual register in response to the register read-write instruction, match the read-write operation result with a standard read-write result corresponding to the input parameter, and determine a test result of the device driving unit according to the matching result.
Optionally, the obtaining module is further adapted to:
acquiring register configuration information of a preset register, applying for a continuous memory space matched with the register configuration information, configuring the continuous memory space into a virtual register corresponding to the preset register, and storing a mapping relation between the virtual register and the preset register;
and, remapping the register read-write instructions to the virtual registers according to the address remapping manner includes: and sending the register read-write instruction to the virtual register in an address remapping mode according to the mapping relation.
Optionally, the preset register includes: a plurality of first registers; and the virtual register includes: a plurality of second registers corresponding to the respective first registers;
and, the register configuration information of the preset register includes at least one of: the method comprises the following steps of identifying each first register, bit width of each first register, physical address information of each first register and attribute description information of each first register;
the acquisition module is specifically adapted to: and determining an address interval of the continuous memory space and an address range of each second register according to the bit width of each first register so as to configure a plurality of second registers in the continuous memory space.
Optionally, the remapping module is specifically adapted to:
analyzing and acquiring a register identifier contained in the register read-write instruction, and determining a second register corresponding to the register identifier;
and sending the register read-write instruction to a second register in an address remapping mode according to the mapping relation.
Optionally, the obtaining module is further adapted to:
transmitting the input parameters to a device driving unit; wherein, the standard reading and writing result corresponding to the input parameter is configured in advance.
Optionally, the test module is specifically adapted to:
if the read-write operation result is successfully matched with the standard read-write result corresponding to the input parameter, determining that the equipment driving unit is in a normal state;
and if the read-write operation result is not matched with the standard read-write result corresponding to the input parameter, determining that the equipment driving unit is in an abnormal state.
The specific structure and the working principle of each module may refer to the description of the corresponding part of the method embodiment, and are not described herein again.
Yet another embodiment of the present application provides a non-volatile computer storage medium, where the computer storage medium stores at least one executable instruction, and the computer executable instruction may execute the object loading method in the virtual scene in any of the above method embodiments. The executable instructions may be specifically configured to cause a processor to perform respective operations corresponding to the above-described method embodiments.
Fig. 5 is a schematic structural diagram of an electronic device according to another embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 5, the electronic device may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein:
the processor 502, communication interface 504, and memory 506 communicate with each other via a communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically execute relevant steps in the above-described test method embodiment of the device driver unit.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The one or more processors included in the electronic device may be the same type of processor, such as one or more CPUs. Or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically configured to enable the processor 502 to execute corresponding operations in the above-described test method embodiment of the device driver unit.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may also be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an apparatus according to an embodiment of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Claims (9)
1. A method of testing a device driver unit, the method comprising:
intercepting a register read-write instruction triggered by the device driving unit responding to the received input parameters through a read-write interface; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers; the preset register is a hardware register located inside the hardware equipment;
remapping the read-write instruction of the register to a virtual register according to an address remapping mode; the virtual register is realized through a memory and is used for simulating the preset register;
acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the equipment driving unit according to the matching result; before the intercepting device driving unit responds to the register read-write instruction triggered by the received input parameter, the method further comprises the following steps:
acquiring register configuration information of the preset register, applying for a continuous memory space matched with the register configuration information, configuring the continuous memory space into a virtual register corresponding to the preset register, and storing a mapping relation between the virtual register and the preset register; the register configuration information of the preset register comprises at least one of the following: the method comprises the steps of identifying the first registers, the numerical values of the first registers, the bit width of the first registers, the physical address information of the first registers and the attribute description information of the first registers; and the execution subject of the method is a test device independent of the hardware device, and the device driving unit runs in the test device.
2. The method of claim 1, wherein the preset register comprises: a plurality of first registers; and the virtual register comprises: a plurality of second registers corresponding to the respective first registers;
and the register configuration information of the preset register includes at least one of: the method comprises the following steps of identifying each first register, bit width of each first register, physical address information of each first register and attribute description information of each first register;
applying for a continuous memory space matched with the register configuration information, wherein configuring the continuous memory space into a virtual register corresponding to the preset register comprises: and determining an address interval of the continuous memory space and an address range of each second register according to the bit width of each first register so as to configure a plurality of second registers in the continuous memory space.
3. The method of claim 2, wherein remapping the register read and write instructions to virtual registers according to an address remapping manner comprises:
analyzing and acquiring a register identifier contained in the register read-write instruction, and determining a second register corresponding to the register identifier;
and sending the register read-write instruction to the second register in an address remapping mode according to the mapping relation.
4. A method according to any of claims 1-3, wherein the device driver unit comprises device driver software.
5. The method according to any one of claims 1 to 3, wherein before the intercepting device driving unit responds to the register read-write instruction triggered by the received input parameter, the method further comprises:
transmitting the input parameter to a device driving unit; and pre-configuring a standard reading and writing result corresponding to the input parameter.
6. The method according to any of claims 1-3, wherein said determining a test result of said device driver unit based on the matching result comprises:
if the read-write operation result is successfully matched with the standard read-write result corresponding to the input parameter, determining that the equipment driving unit is in a normal state;
and if the read-write operation result is not matched with the standard read-write result corresponding to the input parameter, determining that the equipment driving unit is in an abnormal state.
7. An apparatus for testing a device driving unit, the apparatus comprising:
the acquisition module is suitable for intercepting a register read-write instruction triggered by the equipment driving unit responding to the received input parameters through the read-write interface; the device driving unit is used for driving hardware devices comprising preset registers, and the register read-write instruction is used for executing read-write operation aiming at the preset registers; the preset register is a hardware register located inside the hardware equipment;
the remapping module is suitable for remapping the read-write instruction of the register to the virtual register according to an address remapping mode; the virtual register is realized through a memory and is used for simulating the preset register;
the test module is suitable for acquiring a read-write operation result of the virtual register responding to the register read-write instruction, matching the read-write operation result with a standard read-write result corresponding to the input parameter, and determining a test result of the equipment driving unit according to the matching result;
wherein the acquisition module is further adapted to: acquiring register configuration information of the preset register, applying for a continuous memory space matched with the register configuration information, configuring the continuous memory space into a virtual register corresponding to the preset register, and storing a mapping relation between the virtual register and the preset register; the register configuration information of the preset register comprises at least one of the following: the method comprises the steps that identification of each first register, numerical values of each first register, bit width of each first register, physical address information of each first register and attribute description information of each first register are obtained; and the test device is independent of the hardware equipment, and the equipment driving unit runs in the test device.
8. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is for storing at least one executable instruction that causes the processor to perform the method of any one of claims 1-6.
9. A computer storage medium having stored therein at least one executable instruction that causes a processor to perform the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210508847.5A CN114610557B (en) | 2022-05-11 | 2022-05-11 | Method and device for testing equipment driving unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210508847.5A CN114610557B (en) | 2022-05-11 | 2022-05-11 | Method and device for testing equipment driving unit |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114610557A CN114610557A (en) | 2022-06-10 |
CN114610557B true CN114610557B (en) | 2022-08-26 |
Family
ID=81870432
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210508847.5A Active CN114610557B (en) | 2022-05-11 | 2022-05-11 | Method and device for testing equipment driving unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114610557B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116360853B (en) * | 2022-12-30 | 2023-12-12 | 中科驭数(北京)科技有限公司 | Register mapping method, device, equipment and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1274890A (en) * | 1999-05-24 | 2000-11-29 | 英业达股份有限公司 | Test method of great-capacity floppy disk drive for notebook computer |
KR20020033224A (en) * | 2000-10-30 | 2002-05-06 | 구자홍 | Method for software pre-test using device emulator |
CN1553202A (en) * | 2003-05-30 | 2004-12-08 | 上海华园微电子技术有限公司 | Testing circuit and testing method for liquid-crystal displaying driver |
CN107329892A (en) * | 2017-06-07 | 2017-11-07 | 珠海市杰理科技股份有限公司 | Drive method of testing, device, storage medium and its computer equipment |
CN111159005A (en) * | 2018-11-07 | 2020-05-15 | 珠海全志科技股份有限公司 | Method and system for testing memory management function |
CN114461478A (en) * | 2020-11-09 | 2022-05-10 | 华为技术有限公司 | Simulator, drive test method, electronic device, and computer-readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4843554B2 (en) * | 2007-05-11 | 2011-12-21 | 株式会社東芝 | Interface board, simulator, synchronization method, synchronization program |
CN102194064B (en) * | 2010-03-12 | 2013-07-10 | 中国长城计算机深圳股份有限公司 | I/O (Input/Output) monitoring method |
CN109917277B (en) * | 2019-05-16 | 2019-08-23 | 上海燧原智能科技有限公司 | Virtual measuring method, device, equipment and storage medium |
-
2022
- 2022-05-11 CN CN202210508847.5A patent/CN114610557B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1274890A (en) * | 1999-05-24 | 2000-11-29 | 英业达股份有限公司 | Test method of great-capacity floppy disk drive for notebook computer |
KR20020033224A (en) * | 2000-10-30 | 2002-05-06 | 구자홍 | Method for software pre-test using device emulator |
CN1553202A (en) * | 2003-05-30 | 2004-12-08 | 上海华园微电子技术有限公司 | Testing circuit and testing method for liquid-crystal displaying driver |
CN107329892A (en) * | 2017-06-07 | 2017-11-07 | 珠海市杰理科技股份有限公司 | Drive method of testing, device, storage medium and its computer equipment |
CN111159005A (en) * | 2018-11-07 | 2020-05-15 | 珠海全志科技股份有限公司 | Method and system for testing memory management function |
CN114461478A (en) * | 2020-11-09 | 2022-05-10 | 华为技术有限公司 | Simulator, drive test method, electronic device, and computer-readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114610557A (en) | 2022-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107357558B (en) | Method and device for constructing codes | |
US8752023B2 (en) | System, method and program product for executing a debugger | |
KR101456976B1 (en) | Memory test device and testing method for memory | |
CN116627861B (en) | Data processing method and system based on expander, electronic equipment and storage medium | |
CN114610557B (en) | Method and device for testing equipment driving unit | |
CN109936716A (en) | A kind of realization method and system of display driving | |
CN112463633B (en) | Method, device, equipment and medium for checking address decoding of on-chip memory | |
CN111295658B (en) | Simulation device, simulation method, and computer-readable storage medium | |
US20130124925A1 (en) | Method and apparatus for checking a main memory of a processor | |
US5504862A (en) | Logic verification method | |
CN114443375A (en) | Test method and device, electronic device and computer readable storage medium | |
CN113742198B (en) | Test method, test device, electronic equipment and storage medium | |
CN102411527A (en) | Detecting method for image-processing chip, developing plate and detecting system | |
CN108170463B (en) | Factory setting method and device for android device | |
JP2000222243A (en) | Device and method for debugging | |
CN118672908A (en) | Vehicle flashing test method, system and equipment | |
JP2007264698A (en) | Rom inspection system and rom inspection method | |
JPH02252043A (en) | External transfer circuit inspecting system | |
CN117407299A (en) | Model test method and system | |
CN116303058A (en) | Test environment checking method, system, electronic equipment and medium | |
CN115794518A (en) | SPI bus debugging method and system | |
CN118567981A (en) | Automatic testing method of embedded operating system and related products | |
CN114816289A (en) | Screen initialization method of electronic equipment and related device thereof | |
JP3098746B1 (en) | One-rotation data processing method and apparatus | |
CN112905396A (en) | Information display method, device and equipment and storage 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 |