CN113961405B - State switching instruction verification method and device, electronic equipment and storage medium - Google Patents

State switching instruction verification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113961405B
CN113961405B CN202111159823.5A CN202111159823A CN113961405B CN 113961405 B CN113961405 B CN 113961405B CN 202111159823 A CN202111159823 A CN 202111159823A CN 113961405 B CN113961405 B CN 113961405B
Authority
CN
China
Prior art keywords
state
switching
switched
array
switching 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
CN202111159823.5A
Other languages
Chinese (zh)
Other versions
CN113961405A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111159823.5A priority Critical patent/CN113961405B/en
Publication of CN113961405A publication Critical patent/CN113961405A/en
Application granted granted Critical
Publication of CN113961405B publication Critical patent/CN113961405B/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/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested

Abstract

The disclosure provides a state switching instruction verification method, a state switching instruction verification device, electronic equipment and a storage medium, and relates to the field of artificial intelligence such as artificial intelligence chips and cloud computing, wherein the method comprises the following steps: for any type of state switching instruction, the following processing is executed on each switching object in the tested equipment in parallel: aiming at the state switching instructions which are sent to the switching objects and belong to any type, the state required to be switched by the state switching instructions is compared with the corresponding switched state, the switched state is the state after the switching objects are switched, and if the states are not consistent, error reporting processing is carried out. By applying the scheme disclosed by the disclosure, the verification efficiency can be improved.

Description

State switching instruction verification method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for verifying a state switching instruction in the fields of artificial intelligence chips and cloud computing, an electronic device, and a storage medium.
Background
A chip system, such as a voice chip, has a large number of state switching instructions, such as a reset state switching instruction, a clock frequency switching state switching instruction, and the like.
At present, aiming at the verification of the state switching instruction, all signal lines need to be analyzed and compared in sequence in a verification platform, and the efficiency is low.
Disclosure of Invention
The disclosure provides a state switching instruction verification method and device, electronic equipment and a storage medium.
A method for verifying a state switching instruction comprises the following steps:
for any type of state switching instruction, the following processing is executed on each switching object in the tested equipment in parallel:
aiming at the state switching instructions which are sent to the switching objects and belong to any type, comparing the state required to be switched by the state switching instructions with the corresponding switched state, wherein the switched state is the state switched by the switching objects, and if the states are not consistent, performing error reporting processing.
A state switching instruction validation apparatus comprising: the device comprises a first processing module and a second processing module;
the first processing module is configured to, for any type of state switching instruction, execute the following processing in parallel on each switching object in the device under test: aiming at the state switching instruction which is sent to the switching object and belongs to any type, comparing the state required to be switched by the state switching instruction with the corresponding switched state, wherein the switched state is the state after the switching object is switched;
and the second processing module is used for carrying out error reporting processing when the state required to be switched is inconsistent with the corresponding switched state.
An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as described above.
A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.
A computer program product comprising computer programs/instructions which, when executed by a processor, implement a method as described above.
One embodiment in the above disclosure has the following advantages or benefits: for any type of state switching instructions, all switching objects in the tested equipment can be verified in parallel, and all switching objects can be processed in parallel in the same mode, so that the verification efficiency is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a first embodiment of a method for verifying a state switch instruction according to the present disclosure;
FIG. 2 is a flowchart of a second embodiment of a method for verifying a state switch instruction according to the present disclosure;
FIG. 3 is a schematic diagram illustrating an exemplary configuration of a state switch instruction verification apparatus 300 according to the present disclosure;
FIG. 4 shows a schematic block diagram of an electronic device 400 that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In addition, it should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Fig. 1 is a flowchart illustrating a method for verifying a status switch instruction according to a first embodiment of the disclosure. As shown in fig. 1, the following detailed implementation is included.
In step 101, for any type of state switching instruction, the processing shown in step 102 is executed in parallel for each switching object in the Device Under Test (DUT).
In step 102, comparing the state to which the state switching instruction is required to be switched with the corresponding switched state, which is the state after the switching of the switching object, for the state switching instruction belonging to any one of the classes and sent to the switching object, and if the states are not consistent, performing error reporting processing.
It can be seen that, in the scheme of the method embodiment, for any type of state switching instruction, all switching objects in the device under test can be verified in parallel, that is, all switching objects can be processed in parallel in the same manner, so that the verification efficiency is improved.
For different types of state switching instructions, such as a reset type state switching instruction, a clock frequency switching type state switching instruction, and the like, the different types of state switching instructions can be processed respectively according to the method disclosed by the disclosure.
Taking a reset type state switching instruction as an example, the switching objects in the device to be tested may be signal lines, that is, independently controlled reset signal lines in the system, the specific number is determined according to the actual situation, and the processing shown in step 102 may be executed in parallel for each switching object, that is, for any state switching instruction belonging to the reset type and sent to the switching object, the state to which the state switching instruction is required to be switched is compared with the corresponding switched state, and if the state switching instruction is not consistent, an error reporting process may be performed.
In an embodiment of the present disclosure, for any state switching instruction sent to the switching object, the state required to be switched may be compared with the current state of the switching object, if the state is consistent, the processing for the state switching instruction may be ended, and if the state is inconsistent, the state required to be switched may be further compared with the corresponding state after switching.
If the state required to be switched is consistent with the current state of the switching object, the current state is the state required to be switched, so that the processing aiming at the state switching instruction can be directly finished, further, the subsequent processing flow can be omitted, and the resource and time consumption and the like are reduced.
In an embodiment of the present disclosure, for each type of state switching instruction, an expected current state array may also be respectively constructed, where the number of elements is equal to the number of switching objects, and each element corresponds to a different switching object, and is respectively used to record the state of the corresponding switching object; accordingly, the state of the switching object recorded in the expected current state array can be acquired as the current state of the switching object, and in addition, if the state required to be switched is not consistent with the current state of the switching object, the state of the switching object recorded in the expected current state array can be updated by using the state required to be switched.
In an embodiment of the present disclosure, for each type of state switching instruction, an expected switched state array and an actual switched state array may be further separately constructed, where the number of elements in each array is equal to the number of switching objects, and each element in the same array corresponds to a different switching object, and the elements in each array are respectively a queue, and accordingly, if the state required to be switched is not consistent with the current state of the switching object, the state required to be switched may be added to the queue corresponding to the switching object in the expected switched state array, and in addition, the state change of the switching object may be collected, and the state after each change is added to the queue corresponding to the switching object in the actual switched state array, and further, the switched state corresponding to each state required to be switched may be separately determined according to the queue corresponding to the switching object in the expected switched state array and the queue corresponding to the switching object in the actual switched state array.
That is, preferably, for each type of state switching instruction, three arrays may be constructed, respectively, an expected current state array, an expected post-switching state array, and an actual post-switching state array.
The expected switched state array is used for storing the state required to be switched by the state switching instruction, the expected value is compared with the corresponding state in the actual switched state array, the number of elements in the expected switched state array is equal to the number of switching objects, each element corresponds to different switching objects, and the elements in each array are a queue.
The actual switched state array is used for storing the switched state of the switched object, wherein the number of elements is equal to the number of the switched objects, each element corresponds to different switched objects, and the elements in each array are a queue respectively.
The expected current state array is used for storing the expected current state of the switching object, wherein the number of elements is equal to the number of the switching objects, and each element corresponds to different switching objects respectively and is used for recording the state of the corresponding switching object respectively.
In the initial state, each queue in the expected switched state array and the actual switched state array is empty, and the initial value of each element in the expected current state array can be the power-on initialization state of each switching object in the tested device.
For any state switching instruction sent to the switching object, the state of the switching object recorded in the current state array is expected to be acquired first and used as the current state of the switching object, then the state required to be switched by the state switching instruction is compared with the current state of the switching object, if the state is consistent, the processing of the state switching instruction can be finished directly, if the state is inconsistent, the state of the switching object recorded in the current state array is expected to be updated by using the state required to be switched, namely, the recorded state of the switching object can be updated to the state required to be switched, and the state required to be switched can be added to the queue corresponding to the switching object in the state array after expected to be switched, namely, the state required to be switched is added to the tail of the queue.
By means of the arrays, the required different states can be conveniently and accurately recorded, so that a good foundation is laid for subsequent processing, in the expected switched state array and the actual switched state array, the states corresponding to the same switching object are stored in a queue mode, and the states stored firstly can be prevented from being covered when the states are not processed.
As described above, for any state switching instruction issued to the switching target, the state to which the state switching instruction is required to be switched may be compared with the corresponding switched state. In an embodiment of the present disclosure, the post-switching state corresponding to each state required to be switched may be determined according to the queue corresponding to the switching object in the state array after the expected switching and the queue corresponding to the switching object in the state array after the actual switching.
In an embodiment of the present disclosure, when both queues corresponding to the switch object are not empty, two states at the same position (for example, both states are at the first position in the queue, etc.) in the two queues may be taken out as one state pair, and a first state in the state pair may be taken out as a post-switch state corresponding to a second state in the state pair, where the first state is taken out from a queue corresponding to the switch object in an actual post-switch state array, and the second state is taken out from a queue corresponding to the switch object in an expected post-switch state array.
For example, assuming that a certain switching object corresponds to queue 1 in the state array after expected switching and queue 2 in the state array after actual switching, when both queue 1 and queue 2 are not empty, it is assumed that queue 1 includes two states required to be switched, which are state a and state B, respectively, queue 2 includes one state after switching, which is state a, state a and state B correspond to different state switching instructions, respectively, it is assumed that state a is the state after switching of the switching object after the state switching instruction corresponding to state a is executed, and because of processing delay and the like, the state switching instruction corresponding to state B has not been executed yet at this time, accordingly, queue 2 includes only state a but not switched state B after the state switching object corresponding to state B is executed, because both queue 1 and queue 2 are not empty, two states at the same position in both queues can be taken out as one state pair, that is, a state pair composed of state a and state a can be taken out, and state a switched state a corresponding to state a can be taken out, and it is assumed that state B is further added to be taken out as a state pair composed of state B, and state B can be taken out as a state B after switching state B.
The two states in the state pair taken out each time can be compared, if the two states are not consistent, the situation that the state switching instruction is not consistent with the state switching execution situation is shown, and correspondingly, error reporting processing can be carried out.
It can be seen that, by adopting the above processing manner, as long as the two queues corresponding to the switching object are both non-empty, the taking out and comparing of the state pairs can be performed without waiting until all the state switching instructions are processed, thereby improving the processing efficiency and the like.
In an embodiment of the present disclosure, when all the state switching instructions that need to be sent to the switching object are processed, if an error is not reported, it may be determined that the state switching instruction for the switching object passes verification.
If 50 state switching instructions need to be sent to a certain switching object, and the 50 state switching instructions can belong to the same class, when the 50 state switching instructions are processed, if no error is reported, it can be determined that the type of state switching instruction for the switching object passes verification, and the state switching instructions for other classes can be processed in the same way. The sending sequence of the state switching instructions can be determined according to actual needs.
Assuming that no error occurs when all 50 state switching instructions are processed for the switching object, it is determined that the state switching instruction for the switching object passes verification.
In an embodiment of the present disclosure, when all state switching instructions that need to be issued to the switching object are processed completely, if the queue corresponding to the switching object in the state array after actual switching is not empty and the queue corresponding to the switching object in the state array after expected switching is empty, it may be determined that an error that the state switching is performed without a corresponding state switching instruction occurs.
For example, for a certain switching object, 4 (for example only, actually may be much larger than this) state switching instructions are sequentially issued thereto, and accordingly, it is desirable that 4 states required to be switched are stored in the queue corresponding to the switching object in the post-switching state array, which are respectively a state a, a state B, a state C, and a state D, respectively, but 5 post-switching states are stored in the queue corresponding to the switching object in the post-actual-switching state array, which are respectively a state a, a state B, a state C, a state X, and a state D, where the state a is a state after state switching according to the state switching instruction corresponding to the state a, the state B is a state after state switching according to the state switching instruction corresponding to the state B, and the state C is a state after state switching according to the state switching instruction corresponding to the state C, the state D is a state after state switching is performed according to a state switching instruction corresponding to the state D, and the state X is state switching which is not known to be caused by any reason, so that 4 state pairs including the state a, the state B, the state C, the state D and the state X can be sequentially taken out, wherein error reporting processing can be performed on the state pair formed by the state D and the state X.
In an embodiment of the present disclosure, when all state switching instructions that need to be sent to the switching object are processed, if it is expected that the queue corresponding to the switching object in the state array after switching is not empty and the queue corresponding to the switching object in the state array after actual switching is empty, it may be determined that an error that the corresponding state switching is not performed according to the state switching instruction occurs.
For example, for a certain switching object, 4 state switching instructions are sequentially issued to the certain switching object, and accordingly, it is desired that 4 states requiring switching are stored in the queue corresponding to the switching object in the post-switching state array, namely, a state a, a state B, a state c and a state D, but 3 post-switching states are stored in the queue corresponding to the switching object in the post-actual-switching state array, namely, a state a after state switching according to the state switching instruction corresponding to the state a, a state B after state switching according to the state switching instruction corresponding to the state B, and a state D after state switching according to the state switching instruction corresponding to the state D, so that 3 state pairs of the state a and the state a, the state B and the state B, and the state c and the state D can be sequentially fetched, and an error processing can be performed for the state pair composed of the state c and the state D, and it is also desired that the state D in the post-switching state array is not switched to be an error according to the state c corresponding to the state switching object, and it is not determined that the state D is an error processing is not performed for the state c corresponding to the state c in the post-switching object.
Through the processing, when all the state switching instructions which need to be sent to the switching object are processed, whether the expected switched state array and the actual switched state array are empty or not can be checked to determine the error types, so that the verification results are enriched, more available information is provided for verification personnel, and the like.
With the above introduction in mind, fig. 2 is a flowchart illustrating a second embodiment of a method for verifying a status switch instruction according to the present disclosure. As shown in fig. 2, the following detailed implementation is included.
In step 201, for any type of state switching instruction, an expected switched state array, an actual switched state array, and an expected current state array are respectively constructed, the number of elements in each array is equal to the number of switching objects in the device under test, each element in the same array corresponds to different switching objects, and the elements in the expected switched state array and the actual switched state array are respectively a queue.
And in the initial state, each queue in the expected switched state array and the actual switched state array is empty, and the initial value of each element in the expected current state array can be the power-on initialization state of each switching object in the tested equipment.
In step 202, the processing is performed in parallel as shown in steps 203 to 209 for each switching target in the device under test.
In step 203, the state of the switching object recorded in the expected current state array is obtained as the current state of the switching object for any state switching instruction belonging to the class currently sent to the switching object.
In step 204, it is determined whether the state to which the state switching command is requested to be switched is consistent with the current state of the switching object, if so, step 203 is executed, otherwise, step 205 is executed.
If the state required to be switched is consistent with the current state of the switching object, step 203 can be executed, and the next bar state switching instruction can be processed continuously.
In step 205, the state of the switching object recorded in the expected current state array is updated with the state required to be switched to, and the state required to be switched to is added to the queue corresponding to the switching object in the state array after the expected switching is performed, and then step 203 and step 207 may be performed.
Except that the state of the switching object recorded in the expected current state array needs to be updated and the state required to be switched is added into the queue corresponding to the switching object in the state array after the expected switching, the state switching instruction can be executed, and then step 203 can be executed, that is, the next bar state switching instruction can be continuously processed, and step 207 can be executed when the condition is met.
In step 206, the state change of the switching object is collected, the state after each change is added to the queue corresponding to the switching object in the state array after actual switching, and then step 207 may be executed.
In step 207, when both queues corresponding to the switch object are non-empty, two states at the same position in the two queues are taken out as a state pair, and a first state in the state pair is taken out from the queue corresponding to the switch object in the actual switched state array as a switched state corresponding to a second state in the state pair, where the first state is taken out from the queue corresponding to the switch object in the expected switched state array, and the second state is taken out from the queue corresponding to the switch object in the expected switched state array.
In step 208, the two states in each extracted state pair are compared, and if they are not the same, an error is reported.
If they are consistent, no processing is required.
In step 209, when all the state switching commands that need to be issued to the switching target are processed, if no error is reported, it is determined that the state switching command for the switching target passes verification.
Further, when all the state switching instructions that need to be issued to the switching object are processed completely, if the queue corresponding to the switching object in the state array after actual switching is not empty and the queue corresponding to the switching object in the state array after expected switching is empty, it is determined that an error that the state switching is performed without the corresponding state switching instruction occurs.
When all the state switching instructions which need to be sent to the switching object are processed completely, if the queue corresponding to the switching object in the state array after the expected switching is not empty and the queue corresponding to the switching object in the state array after the actual switching is empty, the error that the corresponding state switching is not carried out according to the state switching instructions can be determined.
It is noted that while for simplicity of explanation, the foregoing method embodiments are described as a series of acts, those skilled in the art will appreciate that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required for the disclosure. In addition, for parts which are not described in detail in a certain embodiment, reference may be made to relevant descriptions in other embodiments.
In summary, by adopting the scheme of the embodiment of the method disclosed by the present disclosure, centralized management, flow execution, batch operation, etc. of the state switching instructions can be realized, the situation of sending the same instruction for multiple times can be supported, various project requirements can be met, and the method has general applicability, and in addition, flexible capacity expansion can be realized, for example, if the number of the state switching instructions of the same kind needs to be increased, only the dimension of each array needs to be increased, and if the type of the state switching instructions needs to be increased, only the corresponding array needs to be increased, which is very flexible and convenient.
The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.
Fig. 3 is a schematic diagram illustrating a configuration of a state switching instruction verification apparatus 300 according to an embodiment of the present disclosure. As shown in fig. 3, includes: a first processing module 301 and a second processing module 302.
A first processing module 301, configured to execute the following processing for each switching object in the device under test in parallel for any type of state switching instruction: and aiming at the state switching instruction which is sent to the switching object and belongs to any one of the classes, comparing the state which is required to be switched by the state switching instruction with the corresponding switched state, wherein the switched state is the state after the switching object is switched.
The second processing module 302 is configured to perform error reporting processing when the state required to be switched is inconsistent with the corresponding switched state.
In the scheme of the embodiment of the device, for any type of state switching instructions, all switching objects in the tested equipment can be verified in parallel, that is, all switching objects can be processed in parallel in the same way, so that the verification efficiency is improved.
In an embodiment of the disclosure, for any state switching instruction sent to the switching object, the first processing module 301 may further compare the state required to be switched with the current state of the switching object, if the state required to be switched is consistent with the current state of the switching object, the processing for the state switching instruction may be ended, and if the state required to be switched is not consistent with the current state of the switching object, the state required to be switched may be further compared with the corresponding state after switching.
If the state required to be switched is consistent with the current state of the switching object, the current state is the state required to be switched, and therefore the processing aiming at the state switching instruction can be directly finished.
In an embodiment of the present disclosure, for each type of state switching instruction, the first processing module 301 may further respectively construct an expected current state array, where the number of elements is equal to the number of switching objects, and each element corresponds to a different switching object and is respectively used to record the state of the corresponding switching object; accordingly, the state of the switching object recorded in the expected current state array can be acquired as the current state of the switching object, and in addition, if the state required to be switched is not consistent with the current state of the switching object, the state of the switching object recorded in the expected current state array can be updated by using the state required to be switched.
In an embodiment of the disclosure, for each type of state switching instruction, the first processing module 301 may further respectively construct an expected switched state array and an actual switched state array, where the number of elements in each array is equal to the number of switching objects, each element in the same array corresponds to a different switching object, and the elements in each array are respectively a queue, and accordingly, if the state required to be switched is not consistent with the current state of the switching object, the state required to be switched may be added to the queue corresponding to the switching object in the expected switched state array, and in addition, the state change of the switching object may be collected, and the state after each change is added to the queue corresponding to the switching object in the actual switched state array, and further, the switched state corresponding to each state required to be switched may be determined according to the queue corresponding to the switching object in the expected switched state array and the queue corresponding to the switching object in the actual switched state array.
That is, preferably, for each type of state switching instruction, three arrays may be constructed, respectively, an expected current state array, an expected post-switching state array, and an actual post-switching state array.
The expected switched state array is used for storing the state required to be switched by the state switching instruction, the expected value is compared with the corresponding state in the actual switched state array, the number of elements in the expected switched state array is equal to the number of switching objects, each element corresponds to different switching objects, and the elements in each array are a queue.
The actual switched state array is used for storing the switched state of the switched object, wherein the number of elements is equal to the number of the switched objects, each element corresponds to different switched objects, and the elements in each array are a queue respectively.
The expected current state array is used for storing the expected current state of the switching object, wherein the number of elements is equal to the number of the switching objects, and each element corresponds to different switching objects respectively and is used for recording the state of the corresponding switching object respectively.
In the initial state, each queue in the expected switched state array and the actual switched state array is empty, and the initial value of each element in the expected current state array can be the power-on initialization state of each switching object in the tested device.
For any state switching instruction sent to the switching object, the state of the switching object recorded in the expected current state array can be firstly acquired as the current state of the switching object, then the state required to be switched by the state switching instruction can be compared with the current state of the switching object, if the state is consistent, the processing for the state switching instruction can be directly finished, if the state is not consistent, the state of the switching object recorded in the expected current state array can be updated by using the state required to be switched, namely, the recorded state of the switching object can be updated to the state required to be switched, the state required to be switched can be added into the queue corresponding to the switching object in the expected switched state array, namely, the state required to be switched is added to the tail of the queue, in addition, the state change of the switching object can be acquired in real time, the state after each time is added into the queue corresponding to the switching object in the actual switched state array, namely, when the state of the switching object is changed each time, the state after each time is changed, the state after the change can be added into the queue corresponding to the switching object in the actual switched state array, and the state after the switching object is executed, for example, the switching may be caused by other switching reasons, and the switching error.
In an embodiment of the present disclosure, the first processing module 301 may respectively determine the post-switching state corresponding to each state that requires switching according to the queue corresponding to the switching object in the state array after expected switching and the queue corresponding to the switching object in the state array after actual switching.
In an embodiment of the present disclosure, the first processing module 301 may take out two states at the same position in the two queues as one state pair when both the two queues corresponding to the switching object are non-empty, and may take a first state in the state pair as a post-switching state corresponding to a second state in the state pair, where the first state is a state taken out from a queue corresponding to the switching object in the actual post-switching state array, and the second state is a state taken out from a queue corresponding to the switching object in the expected post-switching state array.
The first processing module 301 may compare two states in the state pair taken out each time, and if the two states are not consistent, it indicates that the state switching instruction does not conform to the state switching execution condition, and accordingly, the second processing module 302 may perform error reporting processing.
In an embodiment of the disclosure, the second processing module 302 may determine that the state switching instruction for the switching object passes verification if no error is reported when all the state switching instructions that need to be sent to the switching object are processed.
In an embodiment of the disclosure, when all the state switching instructions that need to be sent to the switching object are processed, if the queue corresponding to the switching object in the state array after actual switching is not empty and the queue corresponding to the switching object in the state array after expected switching is empty, the second processing module 302 may determine that an error that the state switching is performed without a corresponding state switching instruction occurs.
In an embodiment of the disclosure, when all state switching instructions that need to be sent to the switching object are processed, if it is expected that the queue corresponding to the switching object in the state array after switching is not empty and the queue corresponding to the switching object in the state array after actual switching is empty, the second processing module 302 may determine that an error that the corresponding state switching is not performed according to the state switching instruction occurs.
The specific working flow of the embodiment of the apparatus shown in fig. 3 can refer to the related description of the foregoing method embodiments.
In a word, by adopting the scheme of the embodiment of the device disclosed by the disclosure, centralized management, flow execution, batch operation and the like of the state switching instructions can be realized, the condition of sending the same instruction for multiple times is supported, various project requirements can be met, the universal applicability is realized, in addition, flexible capacity expansion can be realized, for example, if the number of the state switching instructions of the same type needs to be increased, only the dimensionality of each array needs to be increased, if the type of the state switching instructions needs to be increased, only the corresponding array needs to be increased, and the device is very flexible and convenient.
The scheme disclosed by the disclosure can be applied to the field of artificial intelligence, in particular to the fields of artificial intelligence chips, cloud computing and the like. Artificial intelligence is a subject for studying a computer to simulate some thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning and the like) of a human, and has a hardware technology and a software technology, the artificial intelligence hardware technology generally comprises technologies such as a sensor, a special artificial intelligence chip, cloud computing, distributed storage, big data processing and the like, and the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge graph technology and the like.
In addition, in the technical scheme of the disclosure, the processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the related users all accord with the regulations of related laws and regulations, and do not violate the customs of public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 4 shows a schematic block diagram of an electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the device 400 comprises a computing unit 401, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 401 performs the various methods and processes described above, such as the methods described in this disclosure. For example, in some embodiments, the methods described in this disclosure may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When loaded into RAM 403 and executed by computing unit 401, may perform one or more steps of the methods described in the present disclosure. Alternatively, in other embodiments, the computing unit 401 may be configured by any other suitable means (e.g., by means of firmware) to perform the methods described by the present disclosure.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server combining a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (14)

1. A method for verifying a state switching instruction comprises the following steps:
for any type of state switching instruction, the following processing is executed on each switching object in the tested equipment in parallel:
aiming at the state switching instruction which is sent to the switching object and belongs to any type, comparing the state which is required to be switched by the state switching instruction with the corresponding switched state, wherein the switched state is the state after the switching object is switched, and if the state is not consistent, carrying out error reporting processing; the state switching instruction comprises a reset state switching instruction, and the switching object comprises a signal line;
further comprising: aiming at any type of state switching instruction, an expected switched state array and an actual switched state array are constructed, the number of elements in each array is equal to the number of the switching objects, each element in the same array corresponds to different switching objects respectively, and the elements in each array are a queue respectively;
if the state required to be switched is not consistent with the current state of the switching object, adding the state required to be switched into a queue corresponding to the switching object in the state array after expected switching; collecting state changes of the switching object, and respectively adding the state after each change into a queue corresponding to the switching object in the actual switched state array;
determining the switched state corresponding to each state required to be switched according to the queue corresponding to the switching object in the state array after expected switching and the queue corresponding to the switching object in the state array after actual switching in the following modes: and when both the queues corresponding to the switching object are non-empty, taking out two states at the same position in the two queues as a state pair, and taking a first state in the state pair as the switched state corresponding to a second state in the state pair, wherein the first state is taken out from the queue corresponding to the switching object in the actual switched state array, and the second state is taken out from the queue corresponding to the switching object in the expected switched state array.
2. The method of claim 1, further comprising:
and comparing the state required to be switched with the current state of the switching object, if the state required to be switched is consistent with the current state of the switching object, ending the processing aiming at the state switching instruction, and if the state required to be switched is inconsistent with the current state of the switching object, comparing the state required to be switched with the corresponding switched state.
3. The method of claim 2, further comprising:
aiming at any type of state switching instruction, constructing an expected current state array, wherein the number of elements is equal to the number of switching objects, and each element corresponds to different switching objects and is used for recording the state of the corresponding switching object;
acquiring the state of the switching object recorded in the expected current state array as the current state of the switching object;
and if the state required to be switched to is not consistent with the current state of the switching object, updating the state of the switching object recorded in the expected current state array by using the state required to be switched to.
4. The method of any of claims 1~3, further comprising:
and when all the state switching instructions which need to be sent to the switching object are processed, if no error is reported, determining that the state switching instructions aiming at the switching object pass the verification.
5. The method of claim 1, further comprising:
when all the state switching instructions which need to be sent to the switching object are processed, if the queue corresponding to the switching object in the actual switched state array is not empty and the queue corresponding to the switching object in the expected switched state array is empty, determining that an error that the corresponding state switching instruction does not exist but the state switching is performed occurs.
6. The method of claim 1 or 5, further comprising:
when all state switching instructions which need to be sent to the switching object are processed, if the queue corresponding to the switching object in the state array after the expected switching is not empty and the queue corresponding to the switching object in the state array after the actual switching is empty, determining that an error of not performing corresponding state switching according to the state switching instructions occurs.
7. A state switching instruction validation apparatus comprising: the device comprises a first processing module and a second processing module;
the first processing module is configured to, for any type of state switching instruction, execute the following processing in parallel on each switching object in the device under test: aiming at the state switching instruction which is sent to the switching object and belongs to any type, comparing the state which is required to be switched by the state switching instruction with the corresponding switched state, wherein the switched state is the state after the switching object is switched; the state switching instruction comprises a reset state switching instruction, and the switching object comprises a signal line;
the second processing module is configured to perform error reporting processing when the state required to be switched is inconsistent with the corresponding switched state;
the first processing module is further configured to construct an expected switched state array and an actual switched state array for the state switching instruction of any type, where the number of elements in each array is equal to the number of the switching objects, the elements in the same array correspond to different switching objects, and the elements in each array are a queue; if the state required to be switched is not consistent with the current state of the switching object, adding the state required to be switched into a queue corresponding to the switching object in the state array after expected switching; collecting state changes of the switching object, and respectively adding the state after each change into a queue corresponding to the switching object in the state array after actual switching; determining the switched state corresponding to each state required to be switched according to the queue corresponding to the switching object in the state array after expected switching and the queue corresponding to the switching object in the state array after actual switching in the following modes: and when both the queues corresponding to the switching object are non-empty, taking out two states at the same position in the two queues as a state pair, and taking a first state in the state pair as the switched state corresponding to a second state in the state pair, wherein the first state is taken out from the queue corresponding to the switching object in the actual switched state array, and the second state is taken out from the queue corresponding to the switching object in the expected switched state array.
8. The apparatus of claim 7, wherein,
the first processing module is further configured to compare the state to which the switching request is to be switched with the current state of the switching object, if the state to which the switching request is to be switched is consistent with the current state of the switching object, the processing for the state switching instruction is ended, and if the state to which the switching request is to be switched is not consistent with the current state of the switching object, the state to which the switching request is to be switched is compared with the corresponding switched state.
9. The apparatus of claim 8, wherein,
the first processing module is further configured to construct an expected current state array for the state switching instruction of any type, where the number of elements is equal to the number of the switching objects, and each element corresponds to a different switching object and is used to record the state of the corresponding switching object; acquiring the state of the switching object recorded in the expected current state array as the current state of the switching object; and if the state required to be switched to is not consistent with the current state of the switching object, updating the state of the switching object recorded in the expected current state array by using the state required to be switched to.
10. The apparatus of any one of claims 7~9,
the second processing module is further configured to, when all the state switching instructions that need to be sent to the switching object are processed completely, determine that the state switching instruction for the switching object passes verification if an error is not reported.
11. The apparatus of claim 7, wherein,
the second processing module is further configured to, when all state switching instructions that need to be sent to the switching object are processed, determine that an error occurs in which a corresponding state switching instruction does not exist but state switching is performed if the queue corresponding to the switching object in the state array after actual switching is not empty and the queue corresponding to the switching object in the state array after expected switching is empty.
12. The apparatus of claim 7 or 11,
the second processing module is further configured to, when all state switching instructions that need to be issued to the switching object are processed completely, determine that an error that a corresponding state switching is not performed according to a state switching instruction occurs if a queue corresponding to the switching object in the state array after expected switching is not empty and a queue corresponding to the switching object in the state array after actual switching is empty.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-6.
CN202111159823.5A 2021-09-30 2021-09-30 State switching instruction verification method and device, electronic equipment and storage medium Active CN113961405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111159823.5A CN113961405B (en) 2021-09-30 2021-09-30 State switching instruction verification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111159823.5A CN113961405B (en) 2021-09-30 2021-09-30 State switching instruction verification method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113961405A CN113961405A (en) 2022-01-21
CN113961405B true CN113961405B (en) 2022-10-28

Family

ID=79462866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111159823.5A Active CN113961405B (en) 2021-09-30 2021-09-30 State switching instruction verification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113961405B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756960A (en) * 2003-03-31 2006-04-05 爱德万测试株式会社 Test device and test method
CN101147206A (en) * 2005-12-08 2008-03-19 爱德万测试株式会社 Test device and test method
KR101266601B1 (en) * 2012-12-21 2013-05-22 오세경 Apparatus and method for testing a flash memory card or embedded memory card
CN109059198A (en) * 2018-07-23 2018-12-21 珠海格力电器股份有限公司 Equipment automatic engineering adjustment method, device, system and computer equipment
CN112703409A (en) * 2019-01-22 2021-04-23 爱德万测试公司 Automatic test equipment for testing one or more devices under test, method for automatically testing one or more devices under test, and computer program using buffer memory

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012099035A (en) * 2010-11-05 2012-05-24 Fujitsu Ltd Operation verification method for processor, operation verification device for processor and operation verification program for processor
US9336100B2 (en) * 2013-12-27 2016-05-10 International Business Machines Corporation Efficient debugging of memory miscompare failures in post-silicon validation
CN111858207B (en) * 2020-06-30 2022-03-22 浪潮(北京)电子信息产业有限公司 SoC chip verification test system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756960A (en) * 2003-03-31 2006-04-05 爱德万测试株式会社 Test device and test method
CN101147206A (en) * 2005-12-08 2008-03-19 爱德万测试株式会社 Test device and test method
KR101266601B1 (en) * 2012-12-21 2013-05-22 오세경 Apparatus and method for testing a flash memory card or embedded memory card
CN109059198A (en) * 2018-07-23 2018-12-21 珠海格力电器股份有限公司 Equipment automatic engineering adjustment method, device, system and computer equipment
CN112703409A (en) * 2019-01-22 2021-04-23 爱德万测试公司 Automatic test equipment for testing one or more devices under test, method for automatically testing one or more devices under test, and computer program using buffer memory

Also Published As

Publication number Publication date
CN113961405A (en) 2022-01-21

Similar Documents

Publication Publication Date Title
CN115150471A (en) Data processing method, device, equipment, storage medium and program product
CN114924862A (en) Task processing method, device and medium implemented by integer programming solver
CN114417780A (en) State synchronization method and device, electronic equipment and storage medium
CN114816393A (en) Information generation method, device, equipment and storage medium
CN114743586B (en) Mirror image storage implementation method and device of storage model and storage medium
CN115879469B (en) Text data processing method, model training method, device and medium
CN114330221B (en) Score board implementation method, score board, electronic device and storage medium
CN113961405B (en) State switching instruction verification method and device, electronic equipment and storage medium
CN114881170A (en) Training method of neural network for conversation task and conversation task processing method
JP2022095895A (en) Traffic data prediction method, traffic data prediction device, electronic device, storage medium, computer program product, and computer program
CN113361574A (en) Training method and device of data processing model, electronic equipment and storage medium
CN113962191B (en) Sequence randomization method and device, electronic equipment and storage medium
CN114721895B (en) Verification method, platform, equipment and medium for design to be tested
CN114118356B (en) Neural network processor verification method and device, electronic equipment and storage medium
CN113867634B (en) Data reading method and device, electronic equipment and storage medium
CN114896114B (en) Score board implementation method and device, score board, electronic equipment and storage medium
CN114218069B (en) Regression testing method, regression testing device, electronic equipment and storage medium
CN113656268B (en) Performance test method and device for business service, electronic equipment and storage medium
CN115080120A (en) Verification method, device, equipment and medium of register
CN115357493A (en) Test method, test device, electronic equipment and storage medium
CN115757275A (en) Asset information management method and device, electronic equipment and storage medium
CN113641639A (en) Log reporting method and device, electronic equipment and storage medium
CN115686304A (en) Information acquisition method and device, electronic equipment and storage medium
CN113836021A (en) Test method, test device, electronic apparatus, and medium
CN115061886A (en) Performance data processing method, device, 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