Process generation and execution method suitable for semiconductor device parameter testing
By generating the abstract syntax tree of device testing and converting it into host language code, the problems of low parameter testing efficiency and weak error checking capabilities of semiconductor devices in the prior art are solved, and efficient and reliable testing process execution is achieved.
Patent Information
- Application Number
- CN202411053736.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-02
AI Technical Summary
The existing semiconductor device parameter testing methods are inefficient, the script languages that interpret and execute do not meet the timing requirements, and the syntax and logic error checking capabilities are weak, making it difficult to meet the requirements for semiconductor device parameter testing.
The process generation and execution method is adopted, and the device test abstract syntax tree is generated by obtaining the device test target flowchart, converting it into the process logic code text of the host language, and generating dynamic link library files through compilation and linking to perform device parameter testing.
It improves the efficiency and reliability of semiconductor device parameter testing, meets the needs of semiconductor device parameter testing, and realizes efficient test process execution and error detection.
Smart Images

Figure CN118567932B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a process generation execution method, in particular to a process generation execution method suitable for semiconductor device parameter testing. Background Art
[0002] In the field of parameter testing of semiconductor devices, in response to complex and changing test requirements, people often use scripted testing functions, that is, writing the test content into functional test scripts, such as Lua scripts, Python scripts, etc., and using the script execution engine to execute the functional test scripts to complete the test of a certain function.
[0003] During testing, a series of functional tests can be completed by arranging the functional test scripts in a certain order. The advantage of this is that the test logic can be changed by simply modifying or adding scripts, which has strong compatibility and improves the convenience of testing and debugging. The disadvantage is that script execution is often interpreted and inefficient. For parameter scenarios of semiconductor devices with high timing requirements, this execution method cannot meet the test requirements.
[0004] In addition, when receiving a large amount of data from instruments or frequently switching between the host language and the embedded script language, the efficiency of the test method based on the functional test script is extremely low. In addition, the script language has a weak ability to check script errors before execution, such as syntax errors, logical errors, etc. Therefore, the existing semiconductor test execution method is difficult to meet the parameter test requirements of semiconductor devices. Summary of the invention
[0005] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a process generation and execution method suitable for semiconductor device parameter testing, which can effectively meet the needs of semiconductor device parameter testing and improve test efficiency and reliability.
[0006] According to the technical solution provided by the present invention, a process generation and execution method suitable for semiconductor device parameter testing, the process generation and execution method comprises:
[0007] Acquire a device test target flow chart for semiconductor device parameter testing, wherein the device test target flow chart includes a process node group having a plurality of process nodes and a directed connection line group having a plurality of directed connection lines,
[0008] In the device test target flow chart, based on the process nodes in the process node group, at least one start node, one end node and a plurality of test content nodes are formed;
[0009] The directed connection lines in the directed connection line group adapt and connect the process nodes in the process node group to form a test flow direction of the device test target flow chart based on the connection pointing state of the directed connection lines;
[0010] Based on the test flow of the device test target flow chart, a corresponding device test abstract syntax tree is generated, wherein in the generated device test abstract syntax tree, the start node of the device test target flow chart is used as the root node of the device test abstract syntax tree;
[0011] Based on the above-mentioned device test abstract syntax tree, generate a process logic code text based on the host language, wherein the process logic code text includes the test flow of the device test target flow chart;
[0012] Parameter testing of semiconductor devices is performed based on process logic code text, and parameter testing results are generated after performing the parameter testing. When performing the parameter testing of semiconductor devices, a target interface and target test parameters for parameter testing are configured so as to call the target interface and target test parameters during the parameter testing of the semiconductor devices.
[0013] The test content node includes an operation object node for controlling the test flow or a function module node as a parameter test logic code carrier, wherein:
[0014] The operation object nodes include If operation nodes, While operation nodes, End operation nodes, Break operation nodes, For operation nodes and / or Code operation nodes, wherein:
[0015] The If operation node is a conditional branch operation node in the device test target flow chart;
[0016] The While operation node is paired with the End operation node to form a loop structure in the device test target flow chart.
[0017] The Break operation node is an exit operation node of the loop structure in the device test target flow chart;
[0018] The For operation node is the For loop start node in the device test target flow chart;
[0019] The Code operation node is a host language code block in the device test target flow chart;
[0020] The function module node at least includes parameter test logic code and target test parameters required to execute the parameter test logic code.
[0021] When generating a device test abstract syntax tree, include:
[0022] Based on the test flow, the process nodes in the device test target flow chart are traversed in a top-down recursive descent manner, where:
[0023] The start node is configured as the root node of the device test abstract syntax tree and a corresponding parent node, and the corresponding process node is searched along the arrow of the directed connection line, and the first process node searched is used as the right subtree root node of the parent node;
[0024] For each process node determined by the search, when the process node is a test content node, based on the type of the test content node, determine the distribution position state of the corresponding tree node on the device test abstract syntax tree in a recursive descent traversal manner until the search finds an end node;
[0025] Based on the end node found by the search, a tree end node is configured on the device test abstract syntax tree.
[0026] When the current process node is a test content node, and the type of the test content node is an operation object node, then:
[0027] If the current process node is an If operation node, the target process node B pointed to by the directed connection line on the left side of the current process node is used as the root node of the left subtree of the current node, and the target process node C pointed to by the directed connection line on the right side of the current process node is used as the root node of the right subtree of the current node. When there are two directed connections pointing to process node E at the same time, and the target process node B is closest to the target process node C and process node E, the recursive traversal of the left subtree and right subtree of the current process node is terminated;
[0028] If the current process node is a While operation node or a For operation node, search for the End operation node closest to the current process node, and use the process nodes on the line between the current node and the corresponding End operation node as the right subtree of the current process node;
[0029] If the current process node is a Break node, a Code operation node, or an End operation node, the current process node is used as the root node of the corresponding subtree, and the process nodes are recursively traversed along the test flow;
[0030] When the current process node is a test content node and the type of the test content node is a function module node, the current process node is used as the root node of the corresponding subtree, and the process nodes are recursively traversed along the test flow.
[0031] The host language includes C# language, wherein:
[0032] When the host language is C#, the process logic code text is generated, including:
[0033] Construct a process execution text Flow class, wherein the process execution text Flow class includes a FunctionStart statement and a FunctionEnd statement, and the FunctionStart statement is located above the FunctionEnd statement,
[0034] In the process execution text Flow class, an Execute function is defined above the FunctionStart statement, and the defined Execute function includes a FlowStart statement and a FlowEnd statement, wherein the FlowStart statement is located above the FlowEnd statement;
[0035] Starting from the root node of the device test abstract syntax tree, traverse the tree nodes of the device test abstract syntax tree, and according to the type of the process node corresponding to the tree node on the device test abstract syntax tree, add the corresponding logic code text in the process execution text Flow class until traversing to the tree end node on the device test abstract syntax tree;
[0036] After traversing to the tree end node on the device test abstract syntax tree, the traversal end flag is output, and the FunctionStart statement and the FunctionEnd statement in the process execution text Flow class are deleted to generate the process logic code text.
[0037] When the process node corresponding to the tree node is a function module node, the method of adding the corresponding logic code text in the process execution text Flow class includes:
[0038] When the function module node corresponding to the tree node is D, a function call statement f_D() is generated, where D is the number of the function module node;
[0039] In the process execution text Flow class, add the text of the function call statement f_D(), wherein the text of the function call statement f_D() is added on the previous line of the FunctionEnd statement, and the text of the function call statement f_D() includes the f_DStart statement and the f_DEnd statement, wherein the f_DStart statement is located above the f_DEnd statement;
[0040] Obtain module node parameters and node logic code fragments of function module node D, and generate parameter type text adapted to the module node parameter type;
[0041] Add the parameter type text generated above to the line above the f_DStart statement in the function call statement f_D() text, and add the node logic code snippet to the line below the f_DStart statement in the function call statement f_D() text.
[0042] Configure a test result manager DataManager for querying the test result value of the management parameter, use the test result manager DataManager to configure the module node parameter of the function module node D to be in a callable state, and generate a module node parameter call execution text, where,
[0043] The module node parameter callable execution text is added to the line above the f_DEnd statement in the function call statement f_D() text;
[0044] The test result manager DataManager uses a dictionary structure of key-value pairs to store and manage the corresponding module node parameters in the function module node D.
[0045] When the process node corresponding to the tree node is an operation object node, the method of adding the corresponding logic code text in the process execution text Flow class includes:
[0046] If the operation object node is a While operation node, traverse the right subtree of the current While operation node and output the text of the While operation node, wherein the text of the While operation node is while(@Condition1){right subtree output text}, @Condition1 is a conditional expression obtained from the text of the While operation node;
[0047] If the operation object node is a For operation node, recursively traverse the right subtree of the For operation node and output the For operation node text, wherein the For operation node text is for(@Condition2){right subtree output text}, and @Condition2 is a conditional expression obtained from the text of the For operation node;
[0048] If the operation object node is an If operation node, recursively traverse the left subtree and right subtree of the If operation node, and output the If operation node text, wherein the If operation node text is if(@Condition3){left subtree output text}else{right subtree output text}, @Condition3 is a conditional expression obtained from the text of the If operation node; when there is no process node in the right subtree, else{right subtree output text} is omitted;
[0049] If the operation object node is a Break operation node, the Break operation node text is output, wherein the Break operation node text is break;
[0050] If the operation object node is an End operation node, the End operation node text is output, where the End operation node text is "}";
[0051] If the operation object node is a Code operation node, the Code operation node text is output, wherein the Code operation node text includes the host language code block in the Code operation node;
[0052] When there are multiple operation object nodes, the operation node texts corresponding to all the operation object nodes are concatenated in the recursive order of the operation object nodes to form an operation node concatenation text;
[0053] Add the above operation node concatenation text to the line above the FlowEnd statement in the Execute function.
[0054] When performing parametric testing of semiconductor devices based on process logic code text, including:
[0055] Compile and link the process logic code text of the host language to generate a dynamic link library file;
[0056] The generated dynamic link library file is loaded, and the address of the Execute function in the dynamic link library file is addressed and executed to perform parameter testing of the semiconductor device.
[0057] configuring a test parameter manager and an interface adapter, wherein when performing parameter testing of a semiconductor device, the interface adapter and the test parameter manager are loaded based on a host language;
[0058] utilizing the loaded interface adapter to interact with an external interface unit when performing semiconductor device parameter testing;
[0059] Using the loaded test parameter manager, target test parameters required for executing parameter tests of semiconductor devices are loaded.
[0060] The advantages of the present invention are as follows: based on the test flow of the device test target flowchart, a corresponding device test abstract syntax tree is generated; based on the above-mentioned device test abstract syntax tree, a process logic code text based on the host language is generated; based on the process logic code text, parameter testing of semiconductor devices is performed; and after performing the parameter testing, parameter testing results are generated, thereby effectively meeting the needs for parameter testing of semiconductor devices and improving test efficiency and reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for executing process generation of the present invention.
[0062] Figure 2 This is a schematic diagram of a first embodiment of a device test target flow chart of the present invention.
[0063] Figure 3 It is a schematic diagram of a second embodiment of the device test target flow chart of the present invention.
[0064] Figure 4 It is a schematic diagram of a third embodiment of the device test target flow chart of the present invention.
[0065] Figure 5 It is a schematic diagram of a fourth embodiment of the device test target flow chart of the present invention.
[0066] Figure 6 It is a schematic diagram of a first embodiment of the device testing abstract syntax tree of the present invention.
[0067] Figure 7 A schematic diagram of a second embodiment of the device testing abstract syntax tree of the present invention.
[0068] Figure 8 A schematic diagram of a third embodiment of the device testing an abstract syntax tree of the present invention.
[0069] Fig. 9 A schematic diagram of a fourth embodiment of the device testing abstract syntax tree of the present invention.
[0070] Fig.10 It is a schematic diagram of a fifth embodiment of the device testing abstract syntax tree of the present invention. DETAILED DESCRIPTION
[0071] The present invention will be further described below in conjunction with specific drawings and embodiments.
[0072] In order to effectively meet the needs of semiconductor device parameter testing and improve test efficiency and reliability, the present invention provides a process generation and execution method suitable for semiconductor device parameter testing. Specifically, the process generation and execution method includes:
[0073] Acquire a device test target flow chart for semiconductor device parameter testing, wherein the device test target flow chart includes a process node group having a plurality of process nodes and a directed connection line group having a plurality of directed connection lines,
[0074] In the device test target flow chart, based on the process nodes in the process node group, at least one start node, one end node and a plurality of test content nodes are formed;
[0075] The directed connection lines in the directed connection line group adapt and connect the process nodes in the process node group to form a test flow direction of the device test target flow chart based on the connection pointing state of the directed connection lines;
[0076] Based on the test flow of the device test target flow chart, a corresponding device test abstract syntax tree is generated, wherein in the generated device test abstract syntax tree, the start node of the device test target flow chart is used as the root node of the device test abstract syntax tree;
[0077] Based on the above-mentioned device test abstract syntax tree, generate a process logic code text based on the host language, wherein the process logic code text includes the test flow of the device test target flow chart;
[0078] Parameter testing of semiconductor devices is performed based on process logic code text, and parameter testing results are generated after performing the parameter testing. When performing the parameter testing of semiconductor devices, a target interface and target test parameters for parameter testing are configured so as to call the target interface and target test parameters during the parameter testing of the semiconductor devices.
[0079] Figure 1 A flowchart of an embodiment of the process generation and execution of the present invention is shown in the figure. It can be seen from the figure that when the process generation and execution are performed, it is necessary to first obtain the device test target flowchart, that is, the execution of the process generation of the present invention needs to rely on the device test target flowchart. It can be understood that the device test target flowchart can be produced according to the parameter test requirements of the semiconductor device. The semiconductor device can be a common MOSFET device, IGBT device or other type of device. The parameters for testing the semiconductor device can be target test parameters for tests such as DC characteristic testing, AC characteristic testing, aging parameter testing, and power cycle testing. Therefore, according to the type of semiconductor device and the requirements of semiconductor device parameter testing, the device test target flowchart can be produced using existing commonly used tools. Figure 2~Figure 5 An embodiment of a flow chart for making a device test target is shown in FIG.
[0080] Depend on Figure 2~Figure 5 As can be seen from the device test target flow chart in the figure, the device test target flow Figure 1 Generally, it includes a process node group and a directed connection line group, wherein the process node group includes a plurality of process nodes, and the directed connection line group includes a plurality of directed connection lines. By using the process nodes in the process node group, at least one start node, one end node and a plurality of test content nodes can be formed. The start node represents the beginning of the device test target flow chart, that is, the beginning of the semiconductor device parameter test, and the end node represents the end of the device test target flow chart, that is, the completion of the semiconductor device parameter test. Figure 2 In the example, the start box is the start node, and the end box is the end node. The test content node is generally located between the start node and the end node, such as Figure 2 The boxes corresponding to Test 1 to Test 5 are 5 test content nodes. During specific implementation, the number of test content nodes in the device test target flow chart is related to the parameter test requirements.
[0081] A directed connection line is a connection line with an arrow pointing to it. After the process nodes are adapted and connected through the directed connection line, the device test target flow chart is a directed graph. The connection direction of the directed connection line is the process direction of the semiconductor device parameter test. Generally, the connection direction of the directed connection line is at least from the start node to the end node. The connection direction between the start node and the end node is related to the type of the test content node. It can be understood that the test flow direction of the device test target flow chart is the flow direction / direction from the start node to the end node so as to complete the test according to the preset test requirements.
[0082] Figure 2 In the semiconductor device target flow chart shown, the start node-test 1-test 2-test 3-test 4-test 5-end node are connected in sequence using directed connecting lines. At this time, the test flow direction is from the start node to test 1, and after test 1 is executed, it points to test 2, and after test 2 is executed, it points to test 3, until it points to the end node. For other device test target flow charts, the connection pointing state of the directed connecting lines and the corresponding test flow direction can be referred to the description here, and no examples are given here.
[0083] In one embodiment of the present invention, the test content node includes an operation object node for controlling the test flow or a function module node as a parameter test logic code carrier, wherein:
[0084] The operation object nodes include If operation nodes, While operation nodes, End operation nodes, Break operation nodes, For operation nodes and / or Code operation nodes, wherein:
[0085] The If operation node is a conditional branch operation node in the device test target flow chart;
[0086] The While operation node is paired with the End operation node to form a loop structure in the device test target flow chart.
[0087] The Break operation node is an exit operation node of the loop structure in the device test target flow chart;
[0088] The For operation node is the For loop start node in the device test target flow chart;
[0089] The Code operation node is a host language code block in the device test target flow chart;
[0090] The function module node at least includes parameter test logic code and target test parameters required to execute the parameter test logic code.
[0091] In specific implementation, the test content node can be an operation object node or a function module node. The type of the test content node is related to the demand for semiconductor device parameter testing. Generally, a device test target flow chart is used to perform parameter testing of semiconductor devices, and the device test target flow chart can include both operation object nodes and function module nodes. Of course, according to the demand for semiconductor device parameter testing, there can only be operation object nodes or function module nodes in the device test target flow chart, where the operation object node can be used to control the test flow, and the function module node can be used as a parameter test logic code carrier. The role of the operation object node or the function module node in the device test target flow chart is specifically described below.
[0092] The operation object nodes include If operation nodes, While operation nodes, End operation nodes, Break operation nodes, For operation nodes and / or Code operation nodes. In specific implementation, when there are operation object nodes in the device test target flow chart, the operation object node may be one or more of If operation nodes, While operation nodes, End operation nodes, Break operation nodes, For operation nodes or Code operation nodes, which is specifically related to the requirements of controlling the test popularity.
[0093] Specifically, the If operation node is a conditional branch operation node in the device test target flow chart. Generally, the left branch of the If operation node is used as a selection branch for a true condition. At this time, the right branch of the If operation node should be used as a selection branch for a false condition. The selection condition code is filled in the If operation node, where the condition code can be a code snippet that conforms to the host language logic. Figure 3 An embodiment of a device test target flow chart including an If operation node is shown in FIG. Figure 3 In the figure, the diamond box where if a= =b is located is the If operation node, and the parameters a and b can be the target parameters of the semiconductor device test. The directed connection line on the left side of the If operation node forms the left branch, and the directed connection line on the right side of the If operation node forms the right branch. The true condition is the condition that satisfies the condition code in the If operation node, and the false condition is the condition that does not satisfy the selection condition code in the If operation node. For example, if the selection condition code in the If operation node is a==b, when the parameter a is equal to the parameter b, the true condition is met, otherwise it can be judged as a false condition. Figure 3 In the example, when the true condition is reached, the Break operation node is executed, and when the false condition is reached, test 2 is executed.
[0094] The While operation node is a conditional judgment operation node. Generally, the While operation node and the End operation node appear in pairs to form a loop structure in the device test target flow chart, wherein any operation object node and / or function module node between the While operation node and the End operation node will be executed in a loop. The selection condition code is filled in the While operation node. The condition code is a logical host language fragment. When the condition is true, all process nodes between the End operation node will be executed in a loop. Figure 3 2 shows an embodiment in which a device test target flow chart includes a While operation node and an End operation node. In the figure, the box where While is located is the While operation node, and the box where End is located is the End operation node.
[0095] Figure 3 In the example, the selection condition code of the While operation node is c==d, where c and d can be target parameters for semiconductor device testing, that is, a judgment is made in the While operation node whether the parameters c and d are equal. If the judgment is not established, the loop structure between the While operation node and the End operation node is not executed. Figure 3 In the example, it is the end node after executing the End operation node; when the judgment is established, test 1 is executed first. After test 1 is executed, the If operation node will be executed according to the test flow. From the above description, it can be seen that when executing the If operation node, the condition selection is required. If the true condition of the If operation node is reached, it points to the Break operation node, and then the loop result will be jumped out; if the false condition is reached, test 2 is selected to be executed. After executing test 2, the judgment of the While operation node will continue, and the above process will be repeated until the loop ends. It can be seen that the Break operation node is the exit operation node of the loop structure in the device test target flow chart.
[0096] The For operation node is the For loop start node in the device test target flow chart; generally, when the For operation node is executed, the For loop will be entered. Specifically, the For loop will perform iterative operations, such as performing accumulation operations or corresponding iterative operations during interface calls.
[0097] The Code operation node is a host language code block in the device test target flow chart; Figure 4 An embodiment having a Code operation node in a device test target flow chart is shown in the figure. When the Code operation node is executed, a judgment is performed on whether n is 1. When the judgment is true (at this time, n is 1), Alert("OK") is executed. When the judgment is false (at this time, n≠1), Alert("NG") is executed, wherein Alert is an interface function for outputting a warning text to a user interface.
[0098] The function module node includes at least a parameter test logic code and a target test parameter required to execute the parameter test logic code. Figure 2 In the example, test 1 to test 5 are function module nodes. Figure 3 Test 1~Test 2 in are also function module nodes; of course, Figure 5 The process nodes corresponding to B, C, E, and F are also function module nodes. Figure 2~Figure 3 The red test and test 2 may be the same functional module nodes or different functional module nodes. The figure is only used to illustrate the situation of the semiconductor device target flow chart and is not used as a basis for limiting the semiconductor device target flow chart of the present invention.
[0099] Generally, the function module node also includes a function number, a function name and a display title, such as Test 1 to Test 5 are the corresponding display titles. The target test parameters of the function module node generally include function module input parameters, function module output parameters, function module calculation input parameters and function module calculation output parameters, wherein the function module calculation input parameters can be calculated based on the function module input parameters, and the function module calculation output parameters can be calculated based on the function module input parameters, the function module output parameters and the function module calculation input parameters. Generally, the function module input parameters can be used as conditional parameters for parameter testing of semiconductor devices.
[0100] From the above description, it can be seen that according to the requirements of semiconductor device parameter testing, a corresponding device test target flowchart can be produced or obtained; when producing a device test target flowchart, a corresponding directed graph can be generated according to the above description and the requirements of semiconductor device parameter testing; the specific method of producing a device test target flowchart will not be repeated here.
[0101] In one embodiment of the present invention, when generating a device test abstract syntax tree, the method includes:
[0102] Based on the test flow, the process nodes in the device test target flow chart are traversed in a top-down recursive descent manner, where:
[0103] The start node is configured as the root node of the device test abstract syntax tree and a corresponding parent node, and the corresponding process node is searched along the arrow of the directed connection line, and the first process node searched is used as the right subtree root node of the parent node;
[0104] For each process node determined by the search, when the process node is a test content node, based on the type of the test content node, determine the distribution position state of the corresponding tree node on the device test abstract syntax tree in a recursive descent traversal manner until the search finds an end node;
[0105] Based on the end node found by the search, a tree end node is configured on the device test abstract syntax tree.
[0106] Depend on Figure 1 It can be seen that after obtaining the device test target flow chart, it is necessary to generate a device test abstract syntax tree based on the device test target flow chart, wherein the device test abstract syntax tree is the abstract syntax tree (AST) in the usual sense. The abstract syntax tree is an abstract representation of the syntax structure of the source code. It expresses the syntax structure of the programming language in a tree form. Each node on the tree represents a structure in the source code, and the nodes on the abstract syntax tree are tree nodes.
[0107] In one embodiment of the present invention, when generating a device test abstract syntax tree, based on the test flow of the device test target flowchart, the process nodes are traversed in a top-down recursive descent manner. All process nodes on the device test target flowchart can be traversed in a recursive descent manner to determine the distribution position state of each process node corresponding to the tree node formed, wherein the distribution position state of the tree node formed specifically refers to the position and connection state of the tree node on the device test abstract syntax tree.
[0108] From the above description, it can be seen that the test flow direction of the device test target flowchart is at least the direction from the start node to the end node; generally, the start node is located at the top of the device test target flowchart, and the end node is located at the bottom of the device test target flowchart. From this, it can be seen that according to the top-down recursive descent method, specifically the start node is used as the starting point and the end node is used as the end point, that is, when traversing the process nodes, the first process node is the start node, and the last process node should be the end node.
[0109] In specific implementation, when traversing the start node, the start node is used as the root node of the device test abstract syntax tree and a corresponding parent node, that is, the start node forms the root node of the device test abstract syntax tree and the parent node of the subsequent corresponding tree nodes. After the start node is used as the root node, it is necessary to search for the corresponding process node along the arrow of the directed connection line. At this time, the first process node obtained by the search is used as the right subtree root node of the parent node; Figure 2 In the semiconductor device target flow chart, the start node is used as the root node of the device test abstract syntax tree and the corresponding parent node, and test 1 is used as the right subtree root node of the parent node; Figure 3 In the illustrated embodiment, the start node serves as the root node of the device test abstract syntax tree, and the While operation node serves as the parent node and the right child tree node. Figure 4 In the example, the start node is the root node of the device test abstract syntax tree, and the Code operation node is the right child tree node of the parent node. Figure 5In the example, the start node is used as the root node of the device test abstract syntax tree, and the If operation node is used as the right child tree node of the parent node.
[0110] For the process nodes determined by the subsequent search, in one embodiment of the present invention, for each process node determined by the search, when the process node is a test content node, based on the type of the test content node, the distribution position status of the corresponding tree node on the device test abstract syntax tree is determined in accordance with a recursive descent traversal method until the search finds the end node; based on the end node of the search, a tree end node is configured on the device test abstract syntax tree; the process nodes determined by the subsequent search here are the start node and other process nodes other than the first process node.
[0111] The following specifically explains the process node as a test content node, and based on the type of the test content node, the method and process of specifically determining the corresponding tree node on the abstract syntax tree of the device at this time.
[0112] In one embodiment of the present invention, when the current process node is a test content node, and the type of the test content node is an operation object node, then:
[0113] If the current process node is an If operation node, the target process node B pointed to by the directed connection line on the left side of the current process node is used as the root node of the left subtree of the current node, and the target process node C pointed to by the directed connection line on the right side of the current process node is used as the root node of the right subtree of the current node. When there are two directed connections pointing to process node E at the same time, and the target process node B is closest to the target process node C and process node E, the recursive traversal of the left subtree and right subtree of the current process node is terminated;
[0114] If the current process node is a While operation node or a For operation node, search for the End operation node closest to the current process node, and use the process nodes on the line between the current node and the corresponding End operation node as the right subtree of the current process node;
[0115] If the current process node is a Break node, a Code operation node, or an End operation node, the current process node is used as the root node of the corresponding subtree, and the process nodes are recursively traversed along the test flow;
[0116] When the current process node is a test content node and the type of the test content node is a function module node, the current process node is used as the root node of the corresponding subtree, and the process nodes are recursively traversed along the test flow.
[0117] Figure 3In the example, starting from the start node, the second process node is the While operation node. At this time, the process node corresponding to the While operation node is used as the right subtree root node of the device test abstract syntax tree, and the right subtree root node is connected to the parent node formed by the start node; thereafter, the process node on the line from the While operation node to the End operation node is used as the right subtree of the current process node, such as Figure 3 The process node where Test 1 is located, the If operation node, the Break node, and the process node where Test 2 is located are all used as the right subtree of the While operation node.
[0118] The process node after the While operation node, such as the process node next to the While operation node, is used as the current process node. At this time, taking the current process node as process node A as an example, the specific process of generating the device test abstract syntax tree is described. Figure 3 In the example, after the While operation node is the process node where Test 1 is located, the process node where Test 1 is located is used as a tree node of the right subtree, and the tree node of the right subtree formed by the process node where Test 1 is located is connected to the root node of the right subtree formed by the While operation node. Thereafter, along the test flow, the process node where Test 1 is located is connected to the If operation node, that is, the If operation node is formed to form the above-mentioned process node A. At this time, process node A is used as a tree node of the right subtree, and the right subtree node is connected to the tree node of the right subtree formed by Test 1, that is, the tree node formed by the process node where Test 1 is located is used as the parent node of the If operation node.
[0119] Figure 3 In the embodiment of the device test target flow chart, the box where If a==b is located is the If operation node. When the If operation node forms the current process node, the process node A is obtained. At the same time, Figure 3 In the example, the target process node B is the Break node, and the target process node C is test 2; since both the target process node B and the target process node C point to the End operation node, the End operation node is the process node E.
[0120] After process node A is used as a tree node of the right subtree, target process node B is used as the left subtree root node of the current tree node, and the target process node C pointed to is used as the right subtree root node of the current tree node, that is, the tree node of the right subtree where process node A is located is used as the parent node of the corresponding tree nodes of target process node B and target process node C. At this time, the tree node positions of target process node B and target process node C on the device test abstract syntax tree are configured. Since target process node B and target process node C point to process node E at the same time, process node E forms a convergence node.
[0121] After the convergence node is determined, it is necessary to determine the distances between the target process node B, the target process node C and the process node E. Specifically, each time an If operation node is traversed, the position of the current If operation node in the device test target flow chart (the number of traversed steps, the step number) is recorded. Each time a convergence node is passed, the row number of the current convergence node is recorded. Therefore, the determined distance specifically refers to the difference between the value of the If operation node position and the value of the convergence node position.
[0122] Specifically, the distances between the target process node B, the target process node C and the convergence node are determined, mainly to avoid the situation where the convergence node is incorrectly identified when there are multiple If operation nodes in the generated device test abstract syntax tree. Fig.10 An embodiment in which two If operation nodes exist in a device test abstract syntax tree is shown. In the figure, the positions of the two If operation nodes in the device test abstract syntax tree are respectively position 1 and position 2, and the two convergence nodes are the process node where test 7 is located, and the end node, wherein the end node corresponds to the convergence node of the If operation node at position 1, and the process node where test 7 is located is the convergence node of the If operation node at position 2.
[0123] Depend on Fig.10 It can be seen that the distance between the process node where test 7 is located and the If operation node corresponding to position 2 is smaller than the distance between the end node and the If operation node corresponding to position 2, and also smaller than the distance between the If operation node corresponding to position 1 and the process node where test 7 is located. Therefore, the convergence node corresponding to the If operation node corresponding to position 2 should be the process node where test 7 is located.
[0124] When the If operation node and the aggregation node are other situations, you can refer to Fig.10 As well as the above explanations, no further examples will be given here.
[0125] When the target process node B is closest to the target process node C and process node E, the recursive traversal of the left subtree and the right subtree of the current process node is terminated. Figure 3 In the example, process node E is the End operation node. At this time, the recursive traversal of the corresponding left subtree and right subtree when the current process node A is the parent node is terminated, and the tree node formed by process node E is used as the parent node of the end node.
[0126] Figure 5 In the device test target flow chart, the If operation node is a flow node adjacent to the start node. When the start node serves as the root node of the device test abstract syntax tree, the If operation node forms the right subtree root node of the parent node, and the right subtree root node is connected to the root node formed by the start node.
[0127] Figure 5In the If operation node, the two branches are connected to the target process node B and the target process node C respectively. The target process node B and the target process node C both point to the process node E. Figure 5 The process node E in the device forms a convergence node. The position status of the target process node B, the target process node C, and the process node E in the device abstract syntax tree can be referred to above. Figure 3 Description. Figure 5 In the example, process node E is followed by process node F. At this time, the tree node formed by process node E serves as the parent node of the tree node formed by process node F, and the tree node formed by process node F serves as the parent node of the end node.
[0128] Figure 4 In the example, after the start node, there is the Code operation node. At this time, when the start node is the root node of the device test abstract syntax tree, the Code operation node is the right subtree root node of the parent node, and the right subtree root node is connected to the root node formed by the start node. The tree node formed by the Code operation node is the parent node of the tree node formed by the end node.
[0129] When the device test target flow chart is other implementation situations, the corresponding device test abstract syntax tree can be generated by referring to the above description. The specific situations of generating the device test abstract syntax tree will not be listed one by one here.
[0130] Figure 2 In the device test target flow chart shown, when test 1 to test 5 are function module nodes and are executed in sequence, when generating the device test abstract syntax tree, the tree node formed by test 1 is used as the parent node of the tree node formed by test 2, the tree node formed by test 2 is used as the parent node of the tree node formed by test 3, the tree node formed by test 3 is used as the parent node of the tree node formed by test 4, and the parent node formed by test 4 is used as the parent node of the tree node formed by test 5. The tree node formed by test 5 is used as the parent node of the tree node formed by the end node. It can be seen from this that Figure 2 In the figure, the function module nodes corresponding to test 1 to test 5 are all used as the root nodes of the corresponding subtrees.
[0131] In one embodiment of the present invention, the host language includes C# language, wherein:
[0132] When the host language is C#, the process logic code text is generated, including:
[0133] Construct a process execution text Flow class, wherein the process execution text Flow class includes a FunctionStart statement and a FunctionEnd statement, and the FunctionStart statement is located above the FunctionEnd statement,
[0134] In the process execution text Flow class, an Execute function is defined above the FunctionStart statement, and the defined Execute function includes a FlowStart statement and a FlowEnd statement, wherein the FlowStart statement is located above the FlowEnd statement;
[0135] Starting from the root node of the device test abstract syntax tree, traverse the tree nodes of the device test abstract syntax tree, and according to the type of the process node corresponding to the tree node on the device test abstract syntax tree, add the corresponding logic code text in the process execution text Flow class until traversing to the tree end node on the device test abstract syntax tree;
[0136] After traversing to the tree end node on the device test abstract syntax tree, the traversal end flag is output, and the FunctionStart statement and the FunctionEnd statement in the process execution text Flow class are deleted to generate the process logic code text.
[0137] Specifically, the host language generally refers to a programming language or environment that allows other programming languages or components to be run or implemented within it. For example, C#, C++, Java, etc. can all be used as host languages. Since they allow developers to build and run other codes or components (such as scripting language codes such as Lua and Python) on them, in one embodiment of the present invention, C# is selected as the host language. The case where the host language is selected as other programming languages can be referred to the description here.
[0138] After using C# as the host language, when generating process logic code text, you first need to build a process execution text Flow class. The constructed process execution text Flow class generally includes FunctionStart statement and FunctionEnd statement. After building the process execution text Flow class, you also need to define the Execute function in the process execution text Flow class. After defining the Execute function in the process execution text Flow class, the corresponding text can be as follows:
[0139] public static class Flow
[0140] {
[0141] public void Execute()
[0142] {
[0143] FlowStart:
[0144] FlowEnd:
[0145] }
[0146] FunctionStart:
[0147] FunctionEnd:
[0148] }
[0149] Among them, public static class Flow is the definition statement for defining the process execution text Flow class, and public void Execute() is the statement for defining the Execute function.
[0150] After defining the above-mentioned process execution text Flow class, it is necessary to generate the corresponding process logic code text according to the device test abstract syntax tree. Specifically, starting from the root node of the device test abstract syntax tree, traverse the tree nodes of the device test abstract syntax tree, and according to the type of process nodes corresponding to the tree nodes on the device test abstract syntax tree, add the corresponding logic code text in the process execution text Flow class until traversing to the tree end node on the device test abstract syntax tree; the following specifically describes the method and process of adding the corresponding logic code text in the execution text Flow class according to the type of process nodes corresponding to the tree nodes.
[0151] It should be noted that after traversing to the tree end node on the device test abstract syntax tree, the traversal end mark is output, and the FunctionStart statement and the FunctionEnd statement in the process execution text Flow class are deleted to generate the process logic code text; specifically, the output traversal end compilation can be: output a blank line of text \r\n; after outputting the traversal end mark, return to the process execution text Flow, delete the FunctionStart statement and the FunctionEnd statement, and then the process logic code text can be generated.
[0152] In one embodiment of the present invention, when the process node corresponding to the tree node is a function module node, the method of adding the corresponding logic code text in the process execution text Flow class includes:
[0153] When the function module node corresponding to the tree node is D, a function call statement f_D() is generated, where D is the number of the function module node;
[0154] In the process execution text Flow class, add the text of the function call statement f_D(), wherein the text of the function call statement f_D() is added on the previous line of the FunctionEnd statement, and the text of the function call statement f_D() includes the f_DStart statement and the f_DEnd statement, wherein the f_DStart statement is located above the f_DEnd statement;
[0155] Obtain module node parameters and node logic code fragments of function module node D, and generate parameter type text adapted to the module node parameter type;
[0156] Add the parameter type text generated above to the line above the f_DStart statement in the function call statement f_D() text, and add the node logic code snippet to the line below the f_DStart statement in the function call statement f_D() text.
[0157] It can be seen from the above description that the function module node at least includes the parameter test logic code and the target test parameters required to execute the parameter test logic code; therefore, when the process node corresponding to the tree node is a function module node, it is necessary to add the parameter test logic code and the corresponding target test parameters to the process execution text Flow class. Therefore, the module node parameters at least include the corresponding target test parameters. The situation of the target test parameters can be referred to the above description; the specific method of adding logic code text is explained below.
[0158] Take the function module node numbered D as an example. At this time, the function module node corresponding to the tree node is the function module node D, and a function call statement f_D() is generated. Specifically, the text of the function call statement f_D() includes an f_DStart statement and an f_DEnd statement. For the text of the function call statement f_D(), a feasible embodiment is:
[0159] private void f_D()
[0160] {
[0161] f_DStart:
[0162] f_DEnd:
[0163] }
[0164] Among them, private void f_D() is the statement that defines the function call f_D().
[0165] In order to facilitate parameter management, in one embodiment of the present invention, a test parameter manager can be configured, and the test parameter manager can at least be responsible for querying and managing the function module input parameters, function module output parameters, function module calculation input parameters, and function module calculation output parameters, that is, at least responsible for querying and managing the module node parameters of the function module nodes, wherein the management includes but is not limited to operations such as deletion and modification; that is, the module node parameters can be function module input parameters, function module output parameters, function module calculation input parameters, and function module calculation output parameters. The following example illustrates the situation of module node parameters.
[0166] For the function module node D, the module node parameters may include two function module input parameters, wherein the two function module input parameters are: parameter in_param1 is of double type, parameter in_param2 is of int type, and an output parameter out_param is of double type, that is, the parameters in_param1 and in_param2 can be used as function module input parameters, and the output parameter out_param can be used as function module output parameter or function module calculation output parameter; then based on the module node parameters, a parameter type text can be generated, and an embodiment of generating the parameter type text can be:
[0167] double in_param1= 1.1;
[0168] int in_param2 = 10;
[0169] double out_param=0;
[0170] It should be noted that 1.1 is the value set by the user for the parameter param1 of the function test module D when editing the process parameters, and 10 is the value set by the user for the parameter param2 of the function test module D when editing the process parameters; out_param=0 is the initial value assigned to the output parameter. When other set values and output parameter initial values are used, please refer to the instructions here, and no further instructions will be listed here.
[0171] As can be seen from the above description, the function module node includes parameter test logic code, so the obtained node logic code fragment can be a part of the parameter test logic code, or the entire parameter test logic code. Generally, the node logic code fragment should be selected as the entire parameter test logic code. The node logic code fragment can be: out_param = in_param1 + in_param2.
[0172] In specific implementation, the parameter type text generated above is added to the previous line of the f_DStart statement in the function call statement f_D() text, and the node logic code fragment is added to the next line of the f_DStart statement in the function call statement f_D() text; based on the above description, an embodiment of the added text can be obtained as follows:
[0173] public static class Flow
[0174] {
[0175] public void Execute()
[0176] {
[0177] FlowStart:
[0178] FlowEnd:
[0179] }
[0180] FunctionStart:
[0181] private void f_D()
[0182] {
[0183] double in_param1= 1.1;
[0184] int in_param2 = 10;
[0185] double out_param = 0;
[0186] f_DStart:
[0187] out_param = in_param1 + in_param2;
[0188] f_DEnd:
[0189] }
[0190] FunctionEnd:
[0191] }
[0192] In one embodiment of the present invention, a test result manager DataManager is configured for querying the test result value of the management parameter, and the module node parameter of the function module node D is configured to be in a callable state by using the test result manager DataManager, and a module node parameter call execution text is generated, wherein:
[0193] The module node parameter callable execution text is added to the line above the f_DEnd statement in the function call statement f_D() text;
[0194] The test result manager DataManager uses a dictionary structure of key-value pairs to store and manage the corresponding module node parameters in the function module node D.
[0195] Specifically, for each functional module node, since the result of the output parameter needs to be used externally, the value of the input parameter and the result of the output parameter need to be saved through the cache in the test result manager. For the functional module node D, the generated module node parameter call execution text can be:
[0196] DataManager.SetData("D","in_param1",in_param1);
[0197] DataManager.SetData("D","in_param2",in_param2);
[0198] DataManager.SetData("D","out_param",out_param);
[0199] The "D" mentioned above specifically refers to the function module node D. For DataManager.SetData("D","in_param1",in_param1), the first in_param1 refers to the parameter name, that is, "in_param1" represents the parameter name; the second in_param1 is the parameter value corresponding to the parameter name; the first one is the in_param1 characters close to "D".
[0200] Specifically, the module node parameter callable execution text is added to the line above the f_DEnd statement in the function call statement f_D() text, then:
[0201] The generated process logic code text is as follows:
[0202] public static class Flow
[0203] {
[0204] public void Execute()
[0205] {
[0206] FlowStart:
[0207] FlowEnd:
[0208] }
[0209] FunctionStart:
[0210] private void f_D()
[0211] {
[0212] double in_param1= 1.1;
[0213] int in_param2 = 10;
[0214] double out_param=0;
[0215] f_DStart:
[0216] out_param = in_param1 + in_param2;
[0217] DataManager.SetData("D","in_param1",in_param1);
[0218] DataManager.SetData("D","in_param2",in_param2);
[0219] DataManager.SetData("D","out_param",out_param);
[0220] f_DEnd:
[0221] }
[0222] FunctionEnd:
[0223] }
[0224] In specific implementation, DataManager is a test result manager, which provides a dictionary structure, that is, a "key-value" pair structure, which is used to store function module name D. parameter name (key), parameter value (value). In this way, external function modules (such as display, file storage) can obtain the value of out_param from the test result manager DataManager through the GetData("D","out_param") statement.
[0225] In addition, the test parameter manager also provides a built-in parameter library for storing the parameters to be tested and the input, output and calculation parameter information related thereto, so as to manage the corresponding parameter information required when constructing the device test target flow chart. The type of parameter information managed can refer to the above description; thus, the test parameter manager can be used to store and load the test flow chart, the test function module and the input and output parameters of the test function module. In specific implementation, according to the user's choice, the device test target flow chart, the function module nodes in the device test target flow chart and their related input and output parameters are stored or loaded for use in generating the test flow logic code.
[0226] In one embodiment of the present invention, the display primitives in the device test target flow chart are in the form of a node set and stored in the xml format. Specifically, the primitives correspond to the process nodes in the device test target flow chart, such as the If primitive, which is the process node corresponding to the If operation node, including the position, size, name and number of the If operation node, etc. The primitives are stored in the xml node format, and the entire device test target flow chart forms an xml node set, wherein the size of the If operation node specifically refers to the length and width of the If operation node in the device test target flow chart. In addition, the logic code expressed by the device test target flow chart is stored as a code snippet with the host language as the programming language, and the module node parameters of the functional module node are stored in a table form.
[0227] The above shows a function module node D, and an embodiment of adding the module node parameters and node logic code snippets of the function module node D to the process execution text Flow class. When there are multiple function module nodes, the multiple function module nodes have a logical order association in the device test target flow chart. For example, when there are function module node D and function module node G at the same time, based on the test flow direction, the corresponding module node parameters and node logic code snippets of the function module nodes are added one by one to the process execution text Flow class.
[0228] It can be seen from the above description that when the tree node corresponding to the function module node G is traversed immediately after the function module node D, the function call statement f_G() can be generated by referring to the above description, wherein G is the number of the function module node; in addition, in the process execution text Flow class, the text of the function call statement f_G() is added, wherein the text of the function call statement f_G() is added on the previous line of the FunctionEnd statement, and the text of the function call statement f_G() includes an f_GStart statement and an f_GEnd statement, and the f_GStart statement is located above the f_GEnd statement; specifically, the text of the function call statement f_G(), the text of the function call statement f_G() is added to the process execution text Flow class, and the subsequent method of adding the module node parameters and the node logic code snippets to the process execution text Flow class one by one, can be referred to the above description and will not be repeated here.
[0229] In addition, the node logic code snippets within the above-mentioned functional module nodes can also complete the text construction by traversing the input and output parameter loops, so as to be added to the process execution text Flow class. The specific method of adding the node logic code snippets to the process execution text Flow class can be selected according to needs, and will not be listed here one by one.
[0230] In one embodiment of the present invention, when the process node corresponding to the tree node is an operation object node, the method of adding the corresponding logic code text in the process execution text Flow class includes:
[0231] If the operation object node is a While operation node, traverse the right subtree of the current While operation node and output the text of the While operation node, wherein the text of the While operation node is while(@Condition1){right subtree output text}, @Condition1 is a conditional expression obtained from the text of the While operation node;
[0232] If the operation object node is a For operation node, recursively traverse the right subtree of the For operation node and output the For operation node text, wherein the For operation node text is for(@Condition2){right subtree output text}, and @Condition2 is a conditional expression obtained from the text of the For operation node;
[0233] If the operation object node is an If operation node, recursively traverse the left subtree and right subtree of the If operation node, and output the If operation node text, wherein the If operation node text is if(@Condition3){left subtree output text}else{right subtree output text}, @Condition3 is to obtain the conditional expression from the text of the If operation node, when the right subtree text is empty, that is, the right subtree is empty and has no nodes, else{right subtree output text} can be omitted;
[0234] If the operation object node is a Break operation node, the Break operation node text is output, wherein the Break operation node text is break;
[0235] If the operation object node is an End operation node, the End operation node text is output, where the End operation node text is "}";
[0236] If the operation object node is a Code operation node, the Code operation node text is output, wherein the Code operation node text includes the host language code block in the Code operation node;
[0237] When there are multiple operation object nodes, the operation node texts corresponding to all the operation object nodes are concatenated in the recursive order of the operation object nodes to form an operation node concatenation text;
[0238] Add the above operation node concatenation text to the line above the FlowEnd statement in the Execute function.
[0239] Figure 6~Figure 10 shows an embodiment of a device test abstract syntax tree, Figure 6 Neutralization Figure 7 In the device test abstract syntax tree shown in , the corresponding tree nodes all include While operation nodes, Figure 6 In the example, the nodes between the While operation node and the End operation node are all the right subtrees of the current While operation node. Therefore, traversing the right subtree of the current While operation node specifically refers to traversing Figure 6 The tree node where B is located, the If operation node, and the Break operation node, Figure 6 @Condition1 in the code is DataManger.Getdata("B", "out_param")==0, and the output text of the right subtree is the text corresponding to the tree node where B is located, the If operation node, and the Break operation node.
[0240] Figure 7In the illustrated embodiment, the nodes between the While operation node and the End operation node are both right subtrees of the current While operation node. Therefore, traversing the right subtree of the current While operation node specifically refers to traversing Figure 7 In the tree node where test 1 is located and the tree node corresponding to test 2, the output text of the right subtree is: f_test1(); and f_test2();, where f_test1(); is located on the previous line of f_test2();. When the tree node corresponding to test 1 is a function module node, f_test1(); and f_test2(); are function call statements of the host language.
[0241] Figure 8 An embodiment of a device test abstract syntax tree including a For operation node is shown in FIG. Figure 8 In the example, the For operation node and the End operation node are both the right subtrees of the current For operation node. Therefore, when traversing the right subtree of the recursive For operation node, it specifically refers to traversing Figure 8 The tree node formed by test 1 and the tree node formed by test 2, at this time, the output text of the right subtree is: f_test1(); and f_test2();, where, based on Figure 8 In the tree node corresponding to test 1 and the tree node corresponding to test 2, f_test1(); is located in the previous line of f_test2();.
[0242] Figure 6 , Fig. 9 and Fig.10 An embodiment of a device test abstract syntax tree including an If operation node is shown in FIG. 1 . The following describes a method for adding a logic code text when the operation object node is an If operation node in conjunction with the accompanying drawings.
[0243] Figure 6 , the right subtree of the first If operation node is empty, therefore, else{right subtree output text} can be omitted; @Condition3 should be: DataManger.Getdata("A", "out_param")==0, the tree nodes of the left subtree corresponding to the first If operation node are: While operation node, tree node corresponding to B, second If operation node, Break node and End operation node, therefore, the left subtree output text should be composed of the text corresponding to While operation node, tree node corresponding to B, second If operation node, Break node and End operation node.
[0244] For the second If operation node, the corresponding right subtree is empty, so else{right subtree output text} can be omitted; @Condition3 should be: DataManger.Getdata("B", "out_param")==1. The left subtree corresponding to the second If operation node is a Break node, then the corresponding left subtree output text is formed based on the Break node.
[0245] The first If operation node mentioned above specifically refers to the tree node where the parent node is A, and the second If operation node refers to the tree node where the parent node is B.
[0246] In specific implementation, when the process node corresponding to the tree node is an operation object node, it is necessary to point to the corresponding add operation according to the type of the operation object node. After adding the operation node concatenation text to the Execute function, the corresponding text is obtained. Figure 6 In the illustrated embodiment, an embodiment of the corresponding text may be:
[0247] public static class Flow
[0248] {
[0249] public void Execute()
[0250] {
[0251] FlowStart:
[0252] f_A();
[0253] if(DataManager.GetData("A","out_param")== 0)
[0254] {
[0255] While(DataManager.GetData("A","out_param")== 0)
[0256] {
[0257] f_B();
[0258] if(DataManager.GetData("B","out_param")== 1)
[0259] {
[0260] break;
[0261] }
[0262] }
[0263] }
[0264] FlowEnd:
[0265] }
[0266] private void f_A()
[0267] {
[0268] double in_param1= 1.1;
[0269] int in_param2= 10;
[0270] double out_param=0;
[0271] f_AStart:
[0272] out_param = in_param1 + in_param2;
[0273] DataManager.SetData("A","in_param1",in_param1);
[0274] DataManager.SetData("A","in_param2",in_param2);
[0275] DataManager.SetData("A","out_param",out_param);
[0276] f_AEnd:
[0277] }
[0278] private void f_B()
[0279] {
[0280] double in_param1= 1.1;
[0281] int in_param2= 10;
[0282] double out_param=0;
[0283] f_BStart:
[0284] out_param = in_param1 + in_param2;
[0285] DataManager.SetData("B","in_param1",in_param1);
[0286] DataManager.SetData("B","in_param2",in_param2);
[0287] DataManager.SetData("B","out_param",out_param);
[0288] f_BEnd:
[0289] }
[0290] }
[0291] Fig. 9 The abstract syntax tree for device testing is shown in FIG. 1 , including an If operation node. The left subtree of the If operation node includes the tree node where test 1 is located and the tree node where test 2 is located. The right subtree of the If operation node includes the tree node where test 3 is located and the tree node where test 4 is located. Therefore, the text of the If operation node can be:
[0292] if(@Condition3)
[0293] {
[0294] f_test1();
[0295] f_test1();
[0296] }
[0297] else
[0298] {
[0299] f_test3();
[0300] f_test4();
[0301] }
[0302] Fig.10 The device test abstract syntax tree shown in the figure also includes two If operation nodes. The right subtree of the first If operation node includes the tree node corresponding to test 3 and the tree node corresponding to test 4. The left subtree of the first If operation node includes the tree node corresponding to test 1, the tree node corresponding to test 2, and the second If operation node. For the second If operation node, the right subtree includes the tree node corresponding to test 6, the left subtree includes the tree node corresponding to test 5, and the tree node corresponding to test 7 serves as the sink node of the second If operation node, and the sink node of the first If operation node is the end node.
[0303] Fig.10 For the text of the two If operation nodes, please refer to the above instructions and will not be repeated here.
[0304] From the above description, it can be seen that the process logic code text includes the test process of the device test target flow chart. Therefore, when the process logic code text is executed, the process and purpose of executing the parameter test of the semiconductor device according to the device test target flow chart can be realized, and the parameter test of the semiconductor device can be effectively realized.
[0305] In one embodiment of the present invention, a test parameter manager and an interface adapter are configured, wherein when performing parameter testing of a semiconductor device, the interface adapter and the test parameter manager are loaded based on a host language;
[0306] utilizing the loaded interface adapter to interact with an external interface unit when performing semiconductor device parameter testing;
[0307] Using the loaded test parameter manager, target test parameters required for executing parameter tests of semiconductor devices are loaded.
[0308] The code snippets in the functional test nodes often need to read and write the hardware for testing semiconductor devices or display information and store data. Therefore, it is necessary to provide pre-defined interfaces for these functions for calling and using in the functional test module. However, the implementation of these interfaces often varies according to the needs of the actual test system. Therefore, it is necessary to make corresponding adapters according to the actual situation of the system to implement specific interfaces, which are mainly used for packaging, decoding, logic control (conditional transfer, loop, branch selection, expression calculation) and input and output of communication instructions with instruments.
[0309] As can be seen from the above description, when performing parameter testing on semiconductor devices, it is necessary to interact with an external interface unit, which may be an instrument or a display interface, etc. The interface unit may be selected as required to meet the requirements for parameter testing of semiconductor devices. For the test parameter manager, please refer to the above description.
[0310] Generally, when the host language adopts C#, the interface adapter and the test parameter manager will be in different component libraries. Therefore, in order to ensure the smooth execution of the test, it is necessary to introduce an external resource library by artificially specifying the loading or pre-loading of a common function library, wherein the external resource refers to a callable external interface, such as a device, a disk, a port, etc. In one embodiment of the present invention, the C# language is used as the host and the scripting language. Therefore, the external function library can be specified to be loaded by the using keyword, and the library file can be loaded by identifying the using assembly loading method. At this time, the loading and calling of the interface adapter and the test parameter manager can be realized. For example, in the operation of the external interface, IO operation can be used to perform read and write operations. It can be stored in a specific memory, or it can be directly displayed on a user interface, etc. The present invention is not limited to any classification storage method.
[0311] In one embodiment of the present invention, when performing parameter testing of a semiconductor device based on a process logic code text, the method includes:
[0312] Compile and link the process logic code text of the host language to generate a dynamic link library file;
[0313] The generated dynamic link library file is loaded, and the address of the Execute function in the dynamic link library file is addressed and executed to perform parameter testing of the semiconductor device.
[0314] In the specific implementation, after generating the process logic code text, firstly, the host language programming tool chain is used to compile and link the host language process logic code text generated by the test process interpreter to generate a dynamic link library file; secondly, the generated dynamic link library file is loaded, and the Execute function address therein is addressed and executed, thereby realizing the execution of the test process, wherein the method and process of addressing and executing the Execute function are consistent with the prior art, and the specific method is based on the ability to execute the test process.
[0315] The present invention adopts C# language as the host language. Since C# language has its own online compilation function, it can save the work of installing the compilation and linking tool chain on the client. When performing the compilation-linking process, it belongs to the process of online generation and execution. Personnel in the technical field know that, different from the interpretation and execution of the script language and the method of publishing the dynamic link library file to the client program package after compilation and linking, the method of generating the dynamic link library file of the present invention has higher execution efficiency and can be changed immediately with the change of the process or the change of the parameters of the functional test module in the process, and the efficiency of obtaining the change effect is higher. At the same time, because there is a compilation-linking process, the syntax errors and logic errors of the test process can be detected in real time, and the operating user is notified in the form of a notification message.
[0316] In addition, the test parameter manager and the test result manager can be used to store the input parameter values and test results of the functional module test parameters, respectively; the test results in the test result manager are read for presentation or presented in the form of a data report, which facilitates the query and management of the semiconductor device parameter test results.
Claims
1. A process generation and execution method suitable for semiconductor device parameter testing, characterized in that: The process generation execution method comprises: Acquire a device test target flow chart for semiconductor device parameter testing, wherein the device test target flow chart includes a process node group having a plurality of process nodes and a directed connection line group having a plurality of directed connection lines, In the device test target flow chart, based on the process nodes in the process node group, at least one start node, one end node and a plurality of test content nodes are formed; The directed connection lines in the directed connection line group adapt and connect the process nodes in the process node group to form a test flow direction of the device test target flow chart based on the connection pointing state of the directed connection lines; Based on the test flow of the device test target flow chart, a corresponding device test abstract syntax tree is generated, wherein in the generated device test abstract syntax tree, the start node of the device test target flow chart is used as the root node of the device test abstract syntax tree; Based on the above-mentioned device test abstract syntax tree, generate a process logic code text based on the host language, wherein the process logic code text includes the test flow of the device test target flow chart; Execute parameter test of semiconductor device based on process logic code text, and generate parameter test result after executing parameter test, wherein, when executing parameter test of semiconductor device, configure target interface and target test parameter for parameter test, so as to call target interface and target test parameter in the process of executing parameter test of semiconductor device; The test content node includes an operation object node for controlling the test flow and a function module node as a parameter test logic code carrier, wherein: The operation object nodes include If operation nodes, While operation nodes, End operation nodes, Break operation nodes, For operation nodes and / or Code operation nodes, wherein: The If operation node is a conditional branch operation node in the device test target flow chart; The While operation node is paired with the End operation node to form a loop structure in the device test target flow chart. The Break operation node is an exit operation node of the loop structure in the device test target flow chart; The For operation node is the For loop start node in the device test target flow chart; The Code operation node is a host language code block in the device test target flow chart; The function module node includes at least a parameter test logic code and target test parameters required to execute the parameter test logic code; When generating a device test abstract syntax tree, include: Based on the test flow, the process nodes in the device test target flow chart are traversed in a top-down recursive descent manner, where: The start node is configured as the root node of the device test abstract syntax tree and a corresponding parent node, and the corresponding process node is searched along the arrow of the directed connection line, and the first process node searched is used as the right subtree root node of the parent node; For each process node determined by the search, when the process node is a test content node, based on the type of the test content node, determine the distribution position state of the corresponding tree node on the device test abstract syntax tree in a recursive descent traversal manner until the search finds an end node; Based on the end node found by the search, a tree end node is configured on the device test abstract syntax tree; When the current process node is a test content node and the type of the test content node is an operation object node, then: If the current process node is an If operation node, the target process node B pointed to by the directed connection line on the left side of the current process node is used as the root node of the left subtree of the current node, and the target process node C pointed to by the directed connection line on the right side of the current process node is used as the root node of the right subtree of the current node. When there are two directed connections pointing to process node E at the same time, and the target process node B is closest to the target process node C and process node E, the recursive traversal of the left subtree and right subtree of the current process node is terminated; If the current process node is a While operation node or a For operation node, search for the End operation node closest to the current process node, and use the process nodes on the line between the current node and the corresponding End operation node as the right subtree of the current process node; If the current process node is a Break node, a Code operation node, or an End operation node, the current process node is used as the root node of the corresponding subtree, and the process nodes are recursively traversed along the test flow direction; When the current process node is a test content node and the type of the test content node is a function module node, the current process node is used as the root node of the corresponding subtree, and the process nodes are recursively traversed along the test flow.
2. The process generation and execution method suitable for semiconductor device parameter testing according to claim 1, characterized in that: When performing parametric testing of semiconductor devices based on process logic code text, including: Compile and link the process logic code text of the host language to generate a dynamic link library file; The generated dynamic link library file is loaded, and the address of the Execute function in the dynamic link library file is addressed and executed to perform parameter testing of the semiconductor device.
3. The process generation and execution method suitable for semiconductor device parameter testing according to claim 1, characterized in that: configuring a test parameter manager and an interface adapter, wherein when performing parameter testing of a semiconductor device, the interface adapter and the test parameter manager are loaded based on a host language; utilizing the loaded interface adapter to interact with an external interface unit when performing semiconductor device parameter testing; Using the loaded test parameter manager, target test parameters required for executing parameter tests of semiconductor devices are loaded.
