Command line parameter passing method, verification platform, electronic device and storage medium
Patent Information
- Application Number
- CN202611093124.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-27
AI Technical Summary
[0005]一方面,在大规模集成电路中,不同模块可能定义了相同的参数,使用现有命令行传参进行修改时,可能出现对无需修改的模块也一并进行修改了的情况下,导致冲突的情况出现
[0018]一实施例中,所述第一预设结构支持配置多种类型的传参信息,所述传参信息的类型包括以下至少一种:变量赋值;变量队列赋值;变量数值上限赋值;变量数值下限赋值;指定任务嵌入,所述指定任务嵌入用于在所述待控制对象的当前任务队列中嵌入该待控制对象所支持执行的新任务;自定义任务嵌入,所述自定义任务嵌入用于在所述待控制对象的当前任务队列中嵌入新任务。
Smart Images

Figure CN122987791A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of chip simulation and verification, and specifically provides a command-line parameter passing method, a verification platform, an electronic device, and a storage medium. Background Technology
[0002] During chip verification, parameters and configuration information, including verification environment, model, and verification components, are determined during the compilation stage and cannot usually be directly modified during simulation verification. If it is necessary to modify parameters or configuration information, verification usually needs to be paused for modification, and then recompiled and the simulation restarted after modification, which takes a long time overall.
[0003] Currently, there are several ways to modify parameters and configuration information using command-line arguments. Command-line arguments can pass parameters to verification components or modules during simulation verification, allowing modification of their configuration information based on the passed parameters. For example, Verilog (a hardware description language) has built-in functions $test$plusargs and $value$plusargs, which are used to pass strings or numbers respectively, to modify parameters and configuration information during simulation verification without recompiling, effectively improving verification efficiency.
[0004] However, currently, command-line parameters are usually passed globally to achieve unified modification of the entire system.
[0005] On the one hand, in large-scale integrated circuits, different modules may define the same parameters. When modifying them using existing command-line parameters, it is possible that modules that do not need to be modified will also be modified, leading to conflicts.
[0006] On the other hand, during the verification process, a single verification component may be instantiated into multiple instances for verification. Each instantiated verification component originates from the original verification component and has the same defined parameters. The existing command-line parameter passing method cannot modify one of the multiple instantiated verification components. Summary of the Invention
[0007] In view of this, this application aims to provide a command-line parameter passing method, a verification platform, an electronic device, and a storage medium. This method can make specific adjustments to the parameters or configuration information of each module in the verification component, realize global or local control, and can also embed specific tasks to meet the parameter passing and scenario requirements in complex verification scenarios.
[0008] In a first aspect, embodiments of this application provide a command-line parameter passing method applied to a target verification component in a verification platform, wherein the target verification component has a command-line parameter passing interface; the command-line parameter passing method includes: receiving a command-line parameter passing instruction of a first preset structure based on the command-line parameter passing interface; the first preset structure includes the name of the object to be controlled in the target verification component and parameter information; the parameter information is used to configure the object to be controlled; parsing the command-line parameter passing instruction to obtain a parsing result; the parsing result includes the name of the object to be controlled and the parameter information; and reorganizing the parsing result according to a second preset structure to obtain a target instruction executable by the target verification component.
[0009] In this embodiment, a character structure for command-line parameter passing instructions is defined, which is also known as a first preset structure. Besides configuring parameter information, this first preset structure can also specify the name of the object to be controlled in the target verification component. Therefore, after parsing the command-line parameter passing instructions of the first preset structure, the object to be adjusted can be determined. This allows for targeted adjustments to the object to be controlled, avoiding adjustments to other modules or instantiated modules, thus enabling localized control via command-line parameters. This method effectively enhances the functionality of command-line parameters, enabling them to meet the needs of targeted module adjustments in complex verification scenarios of large-scale integrated circuits. It reduces the need to stop the verification environment, modify the environment, and recompile due to modifications to certain modules, thereby reducing time wastage and improving verification efficiency.
[0010] In one embodiment, the first preset structure further includes the command-line parameter passing interface name of the target verification component; before parsing the command-line parameter passing instruction to obtain the parsing result of the command-line parameter passing instruction, the method further includes: calling a first function to determine that the command-line parameter passing instruction includes the name of the command-line parameter passing interface.
[0011] In this embodiment, a command-line parameter passing interface is configured within the target verification component, enabling the target verification component to receive command-line parameter passing instructions. Furthermore, the name of the command-line parameter passing interface is configured in the command-line parameter passing instructions, and the name of the command-line parameter passing interface is confirmed upon receiving the command-line parameter passing instructions. This verifies the command-line parameter passing instructions, preventing the target verification component from incorrectly executing command-line parameter passing instructions from other components, ensuring the correctness of the command-line parameters, and thus ensuring the correctness of the parameter configuration of the verification component, thereby ensuring that the verification is performed correctly.
[0012] In one embodiment, the object to be controlled is any adjustable module or instantiated module in the target verification component; the name of the object to be controlled in the first preset structure is the class name of the module or the class instantiation name of the instantiated module.
[0013] In this embodiment, different modules have different class names, and multiple instantiated modules instantiated from the same module will also have different class instantiation names. Therefore, by using class to distinguish different objects to be controlled, not only can different modules be adjusted in a targeted manner, but also different instantiated modules instantiated from the same module can be adjusted in a targeted manner, adapting to the local control requirements of some modules or instantiated modules in more scenarios.
[0014] In one embodiment, parsing the command-line parameter instruction to obtain the parsing result includes: calling a second function to parse the command-line parameter instruction to obtain the name of the object to be controlled and the parameter information; reorganizing the parameter information into an intermediate variable with a third preset structure; the parsing result includes the name of the object to be controlled and / or the intermediate variable; and reorganizing the parsing result according to the second preset structure to obtain the target instruction executable by the target verification component includes: reorganizing the intermediate variable and the name of the object to be controlled according to the second preset structure to obtain the target instruction.
[0015] Because the first preset structure used by the command line parameter instruction is a redefined character structure, it cannot be directly used by existing modules. Therefore, in this embodiment, a corresponding parsing method is also provided. This method can parse the information in the command line parameter instruction of the first preset structure, extract it and reassemble it to obtain an executable target instruction. Thus, even if the command line parameter instruction is a redefined character structure, it can be correctly parsed and executed, and the first preset structure can be configured to jointly complete the local control of the module components.
[0016] In one embodiment, the first preset structure supports configuring multiple types of parameter information; the second function predefines parsing sub-functions corresponding to different types of parameter information; the step of calling the second function to read the name of the object to be controlled and the parameter information in the command line parameter instruction includes: determining the target type corresponding to the parameter information in the command line parameter instruction; and obtaining the parameter information from the command line parameter instruction based on the parsing sub-function corresponding to the target type.
[0017] In this embodiment of the application, different variable assignment methods are also provided for different types of parameter information, that is, different parsing sub-functions corresponding to different types, so as to realize the parsing of different types of parameter information. Thus, the command line parameter passing method can support the configuration and parsing of multiple types of parameter information to meet the needs of modifying different parameters or configuration information in complex scenarios.
[0018] In one embodiment, the first preset structure supports configuring multiple types of parameter information, and the types of parameter information include at least one of the following: variable assignment; variable queue assignment; variable value upper limit assignment; variable value lower limit assignment; specified task embedding, wherein the specified task embedding is used to embed a new task supported by the controlled object into the current task queue of the controlled object; and custom task embedding, wherein the custom task embedding is used to embed a new task into the current task queue of the controlled object.
[0019] In this embodiment, command-line parameter passing can not only pass parameters to variables but also to variable queues, satisfying the need for adjusting more parameters and configuration information. Furthermore, this command-line parameter passing method also supports passing in tasks, and is not limited to the specified tasks supported by the module itself. It can also support tasks defined by engineers. This method allows adding new tasks during verification without stopping the simulation or recompiling, expanding the scope of command-line parameter passing support and reducing time wasted due to modifying the verification environment and recompiling in more scenarios, thus improving verification efficiency in a wider range of situations.
[0020] In one embodiment, the step of calling the second function to read the name of the object to be controlled and the parameter information in the command-line parameter instruction includes: calling a first preset macro based on the second function; and parsing the command-line parameter instruction based on the first preset macro to obtain the name of the object to be controlled and the parameter information.
[0021] In this embodiment of the application, command line parsing is performed by calling a preset macro to call variable assignment method, which can simplify the parsing process and help improve code conciseness.
[0022] In one embodiment, the step of reorganizing the transmitted parameter information into an intermediate variable of a third preset structure includes: traversing the transmitted parameter information and splitting the strings in the transmitted parameter information based on a delimiter; traversing the strings and extracting actions, variable names, and variable values from the strings; and reorganizing the command line transmitted parameter instruction, the transmitted parameter information, the actions, the variable names, and the variable values into an intermediate variable of the third preset structure.
[0023] In this embodiment of the application, the intermediate variable of the third preset structure includes complete information of each stage after the command line parameter instruction is received, that is, the command line parameter instruction at the time of reception. The parameter information is extracted from the command line parameter instruction, and the action, variable name, variable value, etc. are extracted from the parameter information. This can ensure that the intermediate variable can completely record the information of the command line parameter instruction and ensure the integrity of the subsequent reorganization into the target instruction.
[0024] In one embodiment, before recombining the parsing result according to the second preset structure, the method further includes: determining that the parsing result includes the name of the object to be controlled.
[0025] In this embodiment of the application, after parsing the command line parameter instruction and before reorganizing the parsing result, it is confirmed again that the parsing result includes the name of the object to be controlled. This reduces the occurrence of some abnormal situations, such as the loss of some information due to format errors or character errors that may occur during input. By ensuring that the parsing result includes the name of the object to be controlled, execution of abnormal situations is avoided, thereby improving the accuracy and reliability of the execution of the command line parameter instruction.
[0026] In one embodiment, the parameter information includes variables; before receiving the command-line parameter instruction with a first preset structure based on the command-line parameter transmission interface, the method further includes: registering different types of variables based on a preset variable registration method; the preset variable registration method includes the registration methods corresponding to each of the different types of variables; wherein, before parsing the command-line parameter instruction, the method further includes: determining that the variables in the parameter information are registered.
[0027] Because the first preset structure may include different types of parameter information, some of the variables in the parameter information are not general variables, such as variables defined by engineers. If the variable is not registered, the variable may not be correctly parsed and executed. Therefore, in this embodiment, a complete variable registration method is also defined, and different variables are registered using their respective registration methods, so that the target verification component can support the parsing and execution of different types of variables and meet the verification requirements.
[0028] In one embodiment, registering different types of variables based on a preset variable registration method includes: calling a second preset macro to register different types of variables based on the preset variable registration method.
[0029] In this embodiment, using macros to register variables helps to automate variable registration, reduce the workload of engineers, lower the learning curve for users, and improve code conciseness, thereby improving variable registration efficiency and simulation verification efficiency.
[0030] In one embodiment, the different types of variables include at least one of the following: integers; integer queues; enumeration variables; enumeration queues.
[0031] In this embodiment, not only is command-line parameter passing supported for integers, but also the registration and command-line parameter passing of variables of types such as integer queues, enumerations, and enumeration queues are supported, which meets the needs of modifying multiple types of parameters and configuration information in complex verification scenarios.
[0032] Secondly, this application provides a verification platform, comprising: at least one target verification component; the target verification component having a command-line parameter passing interface and a parsing module; the command-line parameter passing interface being used to receive command-line parameter passing instructions of a first preset structure; the first preset structure being used for the name and parameter information of the object to be controlled in the target verification component; the parameter information configuring the object to be controlled; the parsing module being used to parse the command-line parameter passing instructions to obtain a parsing result; the parsing result including the name of the object to be controlled and the parameter information; the parsing module being further used to reorganize the parsing result according to a second preset structure to obtain a target instruction executable by the target verification component.
[0033] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores computer-readable instructions, which, when executed by the processor, cause the processor to be configured as a verification platform and to perform the command-line parameter passing method as described in any of the first aspects.
[0034] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, which, when run on a computer, causes the computer to execute the command-line parameter passing method as described in any of the first aspects. Attached Figure Description
[0035] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 A flowchart of a command-line parameter passing method is provided in this application embodiment; Figure 2 A schematic diagram of an intermediate variable provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating command-line parameter passing according to an embodiment of this application; Figure 4 A schematic diagram of an electronic device 500 is also provided as an embodiment of this application.
[0037] Icons: Electronic device 500; Processor 510; Memory 520. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0039] First, this application provides a command-line parameter passing method, which can be applied to the target verification component in the verification platform.
[0040] In the simulation and verification of integrated circuits, a verification platform is used to simulate and verify the code and software functions of the integrated circuit. The verification platform constructs a verification environment, abstracting the hardware functions of the integrated circuit into software code, and then simulates the behavior of the hardware through the software code to achieve the simulation and verification of the integrated circuit. In the embodiments of this application, the verification platform is used to simulate and verify the code of the integrated circuit functions, including but not limited to the circuit functions and the interactions between various modules. This verification platform is a software platform, and correspondingly, the verification components in the verification platform mentioned in the embodiments of this application are also program module components.
[0041] The verification components of the verification platform include, but are not limited to, environment configuration components, delay model components, register configuration components, stimulus sequences, etc., without any restrictions.
[0042] In the embodiments of this application, the target verification component is a verification component with a command-line parameter passing interface and a parsing module. The command-line parameter passing interface is used to receive command-line parameter passing instructions, and the parsing module is used to parse and execute the command-line parameter passing instructions. In the embodiments of this application, the target verification component implements the command-line parameter passing method provided in this application through the command-line parameter passing interface and the parsing module.
[0043] Next, the command-line parameter passing method provided in this application will be elaborated. Please refer to [link / reference]. Figure 1 , Figure 1 A flowchart illustrating a command-line parameter passing method provided in an embodiment of this application is shown. The command-line parameter passing method includes: S110, receives command-line parameter passing instructions with a first preset structure based on the command-line parameter passing interface.
[0044] Unlike existing command-line parameter passing methods, this application redefines the character structure of command-line parameter passing instructions. In this application's embodiments, this redefined character structure can be referred to as the first preset structure.
[0045] In the embodiments of this application, the first preset structure includes the name of the object to be controlled and the parameter information in the target verification component, wherein the parameter information is used to configure the object to be controlled.
[0046] Therefore, in addition to the parameter information, the command-line parameter passing instructions of the first preset structure also specify the name of the object to be controlled in the target verification component. Thus, after parsing the command-line parameter passing instructions of the first preset structure, the object to be adjusted can be clearly identified, and then precise adjustments can be made to the object to be controlled. Unlike the existing global control command-line parameter passing method, this method realizes local control based on command-line parameters.
[0047] In the embodiments of this application, the object to be controlled is any module or instantiated module in the target verification component that supports adjustment; the name of the object to be controlled in the first preset structure is the class name of the module or the class instantiation name of the instantiated module.
[0048] Instantiation is a common practice in simulation verification, allowing multiple identical modules to be configured for simulation verification. Since different instantiated modules have the same class name, in the embodiments of this application, a corresponding instantiation name needs to be configured for each instantiated module to achieve targeted control over the instantiated modules.
[0049] In some embodiments of this application, the first preset structure may further include the name of the command line parameter passing interface of the target verification component, so that after receiving the command line parameter passing instruction, it can be determined whether the name of the command line parameter passing interface in the command line parameter passing instruction matches the name of the command line parameter passing interface of the target verification component, thereby determining whether the command line parameter passing instruction has been correctly transmitted, and thus ensuring the correctness of subsequent parsing and execution.
[0050] For example, in some examples of this application, the first preset structure can be represented as: A="BC=D", where A is the name of the command line parameter passing interface of the target verification component, B is the name of the object to be controlled, and C=D is the parameter passing information.
[0051] In the embodiments of this application, the first preset structure can support the configuration of various types of parameter information to correspond to different operations that adjust the parameters or configuration information.
[0052] For example, the types of parameter information include at least one of the following: variable assignment, variable queue assignment, variable value upper limit assignment, variable value lower limit assignment, specified task embedding, and custom task embedding.
[0053] Task embedding is used to add new tasks to the current task queue of the target verification component or its modules. Specifying task embedding is used to embed new tasks supported by the object to be controlled into the current task queue of the object to be controlled; these are the object's built-in tasks. Examples of specified task embeddings include, but are not limited to, READ, WRITE, POLL, UPDATE, and PRINT. Custom task embedding is used to embed new input tasks into the current task queue of the object to be controlled. These input tasks can be tasks defined by engineers and may differ depending on the verification scenario; they will not be discussed further here.
[0054] Accordingly, a corresponding character structure is provided for each type of parameter information. That is, the first preset structure includes the character structure corresponding to each type of parameter information. The character structure corresponding to each type of parameter information includes the name of the command line parameter interface, the name of the object to be controlled, and the parameter information.
[0055] For example, corresponding to the six types of parameter information mentioned above, the corresponding character structure can be represented as follows: Variable assignment: A="BC=D"; Variable queue assignment: A = "B.C__CQ={E,F}"; Variable value upper limit setting: A="B.C__CH=D"; Variable value lower limit setting: A="B.C__CL=D"; Specify task embedding: A = "B.__TASK(XX,YY…)"; Custom task embedding: A = "B.TASK(XX,YY…)".
[0056] Where A is the name of the command-line parameter passing interface of the target verification component, B is the name of the object to be controlled, C is a variable, D is the specific value to be assigned, CQ represents a queue, {E,F} represents the elements in the queue, and C__CH and C__CL are the upper and lower bounds of the variable, respectively. TASK represents a task, and (XX,YY…) is the specific content of the task. Specified tasks and custom tasks are distinguished by different symbols; B.__TASK represents a specified task, and B.TASK represents a custom task. In this embodiment, B can be the class name of the module to be adjusted, or B can be the class instantiation name of the instantiated module.
[0057] In the above embodiments, A, B, and C are merely symbols for ease of understanding. In reality, they can be other symbols or strings. The specific names can be defined by engineers according to the verification scenario. They are only examples here and are not intended to be limiting.
[0058] In the embodiments of this application, the parameter information can be a task embedding or a variable, where the variable can be an integer, a queue, an enumeration, a character, etc. The task embedded in the task is an operation that the verification component itself can perform or an operation that has been defined in the parameter information. Variables need to be registered before they can be correctly parsed. Therefore, in the embodiments of this application, it is also necessary to register the variables.
[0059] In the embodiments of this application, the variables mentioned above can also support multiple types. For example, in some embodiments of the application, different types of variables include at least one of the following: integers; integer queues; enumerations; enumeration queues.
[0060] Due to the different character structures and the fact that more variable types are supported for parameter passing, some variables are types that cannot be passed as parameters using existing command-line parameters. Therefore, for two reasons, it is not possible to register them using the existing variable registration method.
[0061] Building upon this, embodiments of this application further provide various corresponding variable registration methods for different types of variables. Accordingly, in embodiments of this application, different types of variables can also be registered based on preset variable registration methods before receiving command-line parameter instructions with a first preset structure via the command-line parameter passing interface. These preset variable registration methods include registration methods corresponding to each type of variable.
[0062] For example, the preset variable registration method may include: `def_var_int(bit [31:0], default, m_int, min,max) `def_var_int_queue(bit [31:0], m_int_q, min,max) `def_var_enum(type, m_enum) `def_var_enum_queue(type, m_enum_q) Here, `def_var` indicates variable registration, `int` represents integer, `enum` represents enumeration, and `queue` represents queue (abbreviated as q). The content within parentheses represents the specific definition of the variable. For example, integers and integer queues can include bit width (bit), name (m_int), maximum value (max), and minimum value (min), while enumerations and enumeration queues can include type (type) and name (m_enum). `m_int_q` represents an integer queue, and `default` is the default value.
[0063] In the embodiments of this application, the above-mentioned preset variable registration method can be a macro call. Therefore, in some embodiments of this application, registering different types of variables based on the preset variable registration method may include: calling a second preset macro to register different types of variables based on the preset variable registration method.
[0064] For example, taking `def_var_int(bit [31:0], default, m_int, min,max)` as an example, this second preset macro can perform the following configuration process: / / Default value bits [31:0] m_int = default; / / Minimum value bits [31:0] m_int_cl = min; / / Maximum bit value [31:0] m_int_ch = max; / / Value retrieval queue bit [31:0] m_int_ch_cq[$]; / / Non-value queue bits [31:0] m_int_ch_eq[$]; / / Constrain c_m_int_cons{ / / If the value queue is greater than 0, then m_int takes a value from the value queue; m_int_ch_cq .size()>0 ->m_intinside m_int_ch_cq; / / If the non-value queue is greater than 0, then m_int is not in the non-value queue; m_int_ch_eq .size()>0 ->!(m_intinside m_int_ch_eq); / / The variable is greater than or equal to the minimum value m_int>= m_int_cl; / / Variables less than or equal to the maximum value m_int>= m_int_ch;} In this example, the second preset macro can limit various constraints on integer variables, such as setting default values, maximum values, minimum values, value queues, non-value queues, and value retrieval methods, to complete the registration of integer variables.
[0065] In the embodiments of this application, if no constraints are set when registering variables, the second preset macro can be registered under random conditions.
[0066] Other types of variables can also be registered by configuring corresponding second preset macros. The above is just an example and will not be explained in detail here.
[0067] In this embodiment, not only is command-line parameter passing for integers supported, but also the registration and command-line parameter passing for variables of types such as integer queues, enumerations, and enumeration queues, meeting the needs of modifying multiple types of parameters and configuration information in complex verification scenarios. Furthermore, using macros to register variables helps to automate variable registration, reducing the workload for engineers, lowering the learning curve for users, and improving code conciseness, thereby increasing variable registration efficiency and simulation verification efficiency.
[0068] S120 parses the command-line parameter instructions and obtains the parsing results.
[0069] In this embodiment, the command line parameter passing instructions can be parsed to extract the name and parameter information of the object to be controlled in the target verification component of the command line parameter passing instructions, thereby achieving local control of the object to be controlled without changing other objects.
[0070] In the embodiments of this application, because the character structure of the command line parameter passing instructions has been redefined, the corresponding parsing method also needs to be redefined in order to parse the command line parameter passing instructions of the first preset structure.
[0071] In the embodiments of this application, the parsing method includes the following: In some embodiments of this application, before parsing the command-line parameter passing instructions, a first function may be called to determine the name of the command-line parameter passing interface, including the command-line parameter passing instructions.
[0072] That is, in this embodiment, the name of the command line parameter passing interface in the scan command line parameter passing instruction matches the name of the command line parameter passing interface defined by the target verification component. If they match, the subsequent parsing process continues. If they do not match, the parsing of the command line parameter passing instruction ends to avoid erroneous execution.
[0073] In the embodiments of this application, the first function can be the Init_field_by_cmd_line(+AAA=) function, which is a secondary encapsulated parameter initialization function. Here, AAA represents the name of the command line parameter passing interface of the target verification component. If the command line parameter passing instruction includes the string +AAA, it is determined that the command line parameter passing instruction includes the name of the command line parameter passing interface of the target verification component, and then the subsequent parsing process can be executed.
[0074] In one embodiment, parsing the command-line parameter instruction to obtain the parsing result may include: calling a second function to parse the command-line parameter instruction to obtain the name of the object to be controlled and the parameter information; and reorganizing the parameter information into intermediate variables of a third preset structure, wherein the parsing result includes the name of the object to be controlled and / or the intermediate variables.
[0075] In the embodiments of this application, the second function can be the `get_cmd_line_by_plusargs` function. The `get_cmd_line_by_plusargs` function is a commonly used function for parsing simulation command-line parameters. It is used to read the parameter `plusargs` from the simulation startup command and read the externally passed configuration value into internal code variables. In the embodiments of this application, the `get_cmd_line_by_plusargs` function can be used to parse different strings of command-line parameter instructions to obtain the name and parameter information of the object to be controlled from the command-line parameter instructions.
[0076] In the embodiments of this application, the first preset structure can be configured with various types of parameter information, and the parsing methods corresponding to different types of parameter information are different. Therefore, in the embodiments of this application, different assignment methods for parameter information can be predefined, and the parameter information can be parsed through different function calls corresponding to the assignment methods.
[0077] For example, in some embodiments, the second function predefines parsing sub-functions corresponding to different types of parameter information. Accordingly, calling the second function to read the name and parameter information of the object to be controlled in the command line parameter instruction may include: determining the target type corresponding to the parameter information in the command line parameter instruction; and obtaining the parameter information from the command line parameter instruction based on the parsing sub-function corresponding to the target type.
[0078] For example, in this embodiment, the second function may include the set_value_by_filed_name function, which includes: `get_from_cmd_line_begin; `get_value_from_cmd_line_int(bit [31:0], m_inta, INTA); `get_value_from_cmd_line_int_queue(bit [31:0], m_inta_q, INTA_Q); `get_value_from_cmd_line_enum(type_e, m_type, TYPE); `get_value_from_cmd_line_enum_queue(type_e, m_type, TYPE); `get_from_cmd_line_end.
[0079] Here, begin indicates the start of the function, end indicates the end of the function, and the other entries include the parsing sub-functions corresponding to integer int, integer queue int_queue, enumeration enum, and enumeration queue enum_queue.
[0080] The aforementioned parsing sub-functions can be used to parse command-line parameter instructions using the corresponding assignment methods, obtaining parameter information such as variable names and values. The rules for obtaining parameter information in the assignment methods correspond to the rules of the first preset structure; that is, the assignment methods are configured based on the first preset structure. This will not be elaborated upon further here.
[0081] In the embodiments of this application, after determining the name of the object to be controlled, the name of the object to be controlled can be stored for subsequent use. The name of the object to be controlled is a class name or an instantiated class name. Each module has a unique corresponding class name, and the class instantiation module is obtained by instantiating the module. Therefore, there can be multiple instantiation names of the class.
[0082] In the embodiments of this application, the do_parser function can be called to reorganize the passed parameter information into intermediate variables of a third preset structure. The do_parser function is a parsing or execution function. The parsing function module in the simulation verification platform mainly splits, converts the format and verifies the legality of external input commands, parameters and messages, and writes the parsing results into the corresponding configuration unit. As the underlying core unit for parameter processing, it connects external input and platform internal logic, realizes automated parameter configuration, and improves the flexibility and stability of the verification platform. The specific functions can be referred to in the prior art, and will not be elaborated here.
[0083] In the embodiments of this application, the do_parser function is used to parse the parameter information to determine the variable name and variable value of the variable in the parameter information, and assemble them into a third preset structure.
[0084] In the embodiments of this application, the do_parser function is called to implement the following process of reorganizing the parameter information into intermediate variables of a third preset structure: traversing the parameter information and splitting the strings in the parameter information based on the delimiter; traversing the strings and extracting the action, variable name and variable value from the strings; and reorganizing the command line parameter instruction, parameter information, action, variable name and variable value into intermediate variables of the third preset structure.
[0085] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram of an intermediate variable provided in an embodiment of this application. The intermediate variable with the third preset structure may include: m_usr_msg, m_raw_stream, m_action, m_paths, and m_raw_var_strs. Specifically, m_usr_msg stores the original parameters passed from the command line, i.e., the command line parameter passing instructions; m_raw_stream stores subsequent parameters from the parameter passing interface, i.e., parameter passing information; m_action stores the action parsed from the original parameters, such as configuration values, configuration queues, custom tasks, etc.; m_paths parses the m_raw_stream parameters, extracts variable names from them, and stores them; m_raw_var_strs parses the m_raw_stream parameters, splits them into variable values, and stores them, such as storage addresses, data, etc.
[0086] like Figure 2 As shown, the intermediate variable includes the following: m_raw_stream stores the command-line parameter instructions as [mc_phy_static_user_ctrl]plugargs_name +MC PHY USER_CTRL_SETTING= (IdX_1): MC PHY USER CTRL.PHY RXENSEL=0x01; m_raw_stream stores the parameter information as MC PHY USER CTRL.PHY RXEN SEL=0x01SET; m_action stores the action as SET_VALUE; m_paths stores the strings MC_PHY_USER_CTRL and PHY_RXEN_SEL; m_raw_var_stream stores the character value 0x01.
[0087] In the example above, the stored MC PHY USER CTRL.PHY RXEN SEL=0x01SET is split into MC PHY USER CTRL, PHY RXEN SEL, 0x01, and SET. Here, SET represents the action, MC PHY USER CTRL and PHY RXEN SEL are two different variables, and 0x01 is the variable value.
[0088] Similar to task embedding, the action of task embedding is stored in m_action, the task representing the task is stored in m_paths, and the specific task is stored in m_raw_var_stream.
[0089] In embodiments of this application, the second function described above can also be a function that calls a macro to perform the above-mentioned parsing action through the macro. In this embodiment, calling the second function to read the name of the object to be controlled and the parameter information in the command-line parameter instruction may include: calling a first preset macro based on the second function; and parsing the command-line parameter instruction based on the first preset macro to obtain the name of the object to be controlled and the parameter information.
[0090] S130, the parsing results are reorganized according to the second preset structure to obtain the target instructions that the target verification component can execute.
[0091] The second preset structure is a data structure that the target verification component can use and execute. For details, please refer to existing technologies, which will not be elaborated here.
[0092] In this embodiment of the application, the names of intermediate variables and objects to be controlled can be reorganized according to the second preset structure to obtain the target instruction.
[0093] In the embodiments of this application, the command line parameter passing instructions of the first preset structure cannot be passed by the target verification component. Therefore, after parsing out the parameter information and the name of the object to be controlled in the command line parameter passing instructions, they are reorganized according to the second preset structure, so that the target verification component can control the module or instantiated module according to the requirements of the command line parameter passing instructions, and realize targeted adjustment and control.
[0094] In some embodiments of this application, before reorganizing the parsing result according to the second preset structure, the method may further include: determining that the parsing result includes the name of the object to be controlled.
[0095] In this embodiment of the application, after parsing the command line parameter instruction, errors may occur during the transmission or parsing process. Therefore, before reorganizing the parsing result, it is confirmed again that the parsing result includes the name of the object to be controlled, so as to reduce the occurrence of some abnormal situations. For example, the format error or character error may occur when passing the data, resulting in the loss of some information. By confirming that the parsing result includes the name of the object to be controlled, execution of abnormal situations is avoided, thereby improving the accuracy and reliability of the execution of the command line parameter instruction.
[0096] In some embodiments of this application, after extracting the action, variable name, and variable value from the string, the variable name and the name of the object to be controlled can be configured in the m_paths item. The parsing result can be determined by judging whether m_paths includes the name of the object to be controlled.
[0097] In this embodiment, the parsing module for executing the command-line parameter passing method can be built based on a UVM object. UVM is a commonly used verification method, and a parsing module built based on UVM can be used in most verification environments. This enables the parsing module to be reused in multiple scenarios and can be adjusted and extended according to actual scenario requirements without recreating the parsing module. Therefore, building a parsing module based on a UVM object helps improve the versatility, reusability, and scalability of the parsing module.
[0098] In the embodiments of this application, a set of character structures (i.e., the first preset structure), variable assignment methods, and variable registration methods are redefined, so that the entire set of methods can be standardized and reused in different projects and scenarios, thereby improving the maintainability and reusability of the code.
[0099] To facilitate understanding, an example is provided here; please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of command line parameter passing provided in an embodiment of this application.
[0100] In this example, the target verification module includes module A and instantiated modules a1 and a0. a1 and a0 are instantiated modules generated from module A. The command-line parameter passing interface of module A is represented as +A SET=, and the command-line parameter passing interfaces of instantiated modules a0 and a1 are denoted as +AO SET= and +A1 SET=, respectively.
[0101] The command-line parameter passing instructions received by the parameter passing interface of the target verification component include: "+A SET='AC=3'", "+A0SET='a0.b=0'", and "+A1 SET='a1.b_q={0,1,2}". Here, "+A SET='AC=3'" indicates that module A, based on the parameter passing interface "+A SET=", assigns the value 3 to the variable c of the module with class name A. "+A0 SET='a0.b=0'" indicates that, based on the parameter passing interface "+A0 SET=", assigns the value 3 to the variable b of the module with instantiated class name a0. "+A1 SET='a1.b_q={0,1,2}'" indicates that module A1, based on the parameter passing interface "+A1 SET=", assigns the value {0,1,2} to the variable b_q of the module with class name a1.
[0102] Next, the parsing module of the target verification component parses each command-line parameter instruction, such as calling the second function to obtain the parsing result.
[0103] Next, determine whether the parsing result includes the class name (A) or the class instance name (a0, a1). If it does, the parsing result can be reorganized into an intermediate variable to distinguish between numerical copying, queues, or task embedding.
[0104] Finally, the structures are reorganized according to the second preset structure, resulting in a0: b=0, c=3; a1: b_.q={0,1,2}.c=3. In this example, module A is assigned the value c=3, meaning that all instantiated modules of module A need to assign the variable c the value 3. Instantiated module a0 sets the variable b to 0, and instantiated module a1 sets the variable b_.q to {0,1,2}.
[0105] In this embodiment, a character structure for command-line parameter passing instructions is defined, which is also known as a first preset structure. Besides configuring parameter information, this first preset structure can also specify the name of the object to be controlled in the target verification component. Therefore, after parsing the command-line parameter passing instructions of the first preset structure, the object to be adjusted can be determined. This allows for targeted adjustments to the object to be controlled, avoiding adjustments to other modules or instantiated modules, thus enabling localized control via command-line parameters. This method effectively enhances the functionality of command-line parameters, enabling them to meet the needs of targeted module adjustments in complex verification scenarios of large-scale integrated circuits. It reduces the need to stop the verification environment, modify the environment, and recompile due to modifications to certain modules, thereby reducing time wastage and improving verification efficiency.
[0106] Based on the unified inventive concept, embodiments of this application also provide a verification platform, which includes multiple verification components, wherein the multiple verification components include at least one target verification component. The verification components include, but are not limited to, environment components, latency model components, stimulus components, and memory management components of the verification platform, etc., which will not be elaborated here, but can be referred to in the prior art for details.
[0107] In the embodiments of this application, the target verification component has a command-line parameter passing interface and a parsing module.
[0108] The command-line parameter passing interface is used to receive command-line parameter passing instructions of a first preset structure; the first preset structure is used for the name and parameter information of the object to be controlled in the target verification component; the parameter information configures the object to be controlled.
[0109] The parsing module is used to parse command-line parameter instructions and obtain parsing results; the parsing results include the name of the object to be controlled and the parameter information.
[0110] The parsing module is also used to reorganize the parsing results according to the second preset structure to obtain the target instructions that the target verification component can execute.
[0111] In one embodiment, the first preset structure further includes the name of the command-line parameter passing interface of the target verification component; the parsing module is used to call a first function to determine that the command-line parameter passing instruction includes the name of the command-line parameter passing interface before parsing the command-line parameter passing instruction and obtaining the parsing result of the command-line parameter passing instruction.
[0112] In one embodiment, the object to be controlled is any module or instantiated module in the target verification component that supports adjustment; the name of the object to be controlled in the first preset structure is the class name of the module or the class instantiation name of the instantiated module.
[0113] In one embodiment, the parsing module is used to call a second function to parse the command line parameter instruction to obtain the name of the object to be controlled and the parameter information; the parameter information is reorganized into an intermediate variable with a third preset structure; the parsing result includes the name of the object to be controlled and / or the intermediate variable, and the parsing module is used to reorganize the intermediate variable and the name of the object to be controlled according to the second preset structure to obtain the target instruction.
[0114] In one embodiment, the first preset structure supports configuring multiple types of parameter information; the second function predefines parsing sub-functions corresponding to different types of parameter information, and the parsing module is used to determine the target type corresponding to the parameter information in the command line parameter instruction; and obtains the parameter information from the command line parameter instruction based on the parsing sub-function corresponding to the target type.
[0115] In one embodiment, the first preset structure supports configuring multiple types of parameter information, the types of which include at least one of the following: variable assignment; variable queue assignment; variable value upper limit assignment; variable value lower limit assignment; specified task embedding, wherein the specified task embedding is used to embed a new task supported by the object to be controlled into the current task queue of the object to be controlled; and custom task embedding, wherein the custom task embedding is used to embed a new input task into the current task queue of the object to be controlled.
[0116] In one embodiment, the parsing module is used to call a first preset macro based on the second function; and to parse the command line parameter instruction based on the first preset macro to obtain the name of the object to be controlled and the parameter information.
[0117] In one embodiment, the parsing module is used to traverse the parameter information, split the string in the parameter information based on the delimiter; traverse the string, extract the action, variable name and variable value from the string; and reorganize the command line parameter instruction, the parameter information, the action, the variable name and the variable value into the intermediate variable of the third preset structure.
[0118] In one embodiment, the parsing module is used to determine that the parsing result includes the name of the object to be controlled before reorganizing the parsing result according to the second preset structure.
[0119] In one embodiment, the parameter information includes variables, and the parsing module is used to register different types of variables based on a preset variable registration method; the preset variable registration method includes the registration method corresponding to each of the different types of variables, and before parsing the command line parameter instruction, determining that the variables in the parameter information are registered.
[0120] In one embodiment, the different types of variables include at least one of the following: integers; integer queues; enumerations; enumeration queues.
[0121] Based on the same inventive concept, this application also provides an electronic device, please refer to... Figure 4 , Figure 4 This application also provides a schematic diagram of an electronic device 500, which can serve as the execution subject of the aforementioned delayed output method, including: a processor 510 and a memory 520, the processor 510 and the memory 520 being communicatively connected.
[0122] The electronic device 500 can be configured as a verification platform, and the memory 520 stores computer-readable instructions that can be executed by the processor 510, so that the processor 510 can execute the command line parameter passing method in the aforementioned embodiment.
[0123] The processor 510 and memory 520 are connected, but are not limited to, via a communication bus.
[0124] Processor 510 can be an integrated circuit chip with signal processing capabilities. Processor 510 can be a general-purpose processor, including a CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be a digital signal processor, application-specific integrated circuit, off-the-shelf programmable gate array, or other programmable logic device or transistor logic device, or discrete hardware component. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.
[0125] The memory 520 may include, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.
[0126] It is understood that the electronic device 500 may also include more general modules required by itself, which will not be described one by one in the embodiments of this application.
[0127] Based on the same inventive concept, embodiments of this application also provide a readable storage medium on which a program is stored. When the computer program runs on a processor, it causes the processor to execute the command-line parameter passing method provided in the above embodiments.
[0128] The readable storage medium can be any available medium that the processor can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs (digital video discs)), or semiconductor media (e.g., SSDs (solid state disks)).
[0129] If the method is implemented as a software functional module and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0130] In the embodiments provided in this application, it should be understood that the disclosed methods and apparatus can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. The functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0131] The above embodiments can be freely combined without conflict, and the resulting embodiments are covered within the protection scope of this application.
[0132] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0133] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A command-line parameter passing method, characterized in that, A target verification component applied in a verification platform, the target verification component having a command-line parameter passing interface; the command-line parameter passing method includes: The command-line parameter passing interface receives a command-line parameter passing instruction with a first preset structure; the first preset structure includes the name and parameter information of the object to be controlled in the target verification component; the parameter information is used to configure the object to be controlled. The command-line parameter instruction is parsed to obtain a parsing result; the parsing result includes the name of the object to be controlled and the parameter information. The parsing results are reorganized according to the second preset structure to obtain the target instructions that the target verification component can execute.
2. The command-line parameter passing method according to claim 1, characterized in that, The first preset structure also includes the name of the command-line parameter passing interface of the target verification component; Before parsing the command-line parameter instruction to obtain the parsing result, the method further includes: The first function is called to determine the name of the command-line parameter passing instruction, including the command-line parameter passing interface.
3. The command-line parameter passing method according to claim 1, characterized in that, The object to be controlled is any module or instantiated module in the target verification component that supports adjustment; the name of the object to be controlled in the first preset structure is the class name of the module or the class instantiation name of the instantiated module.
4. The command-line parameter passing method according to claim 2, characterized in that, The parsing of the command-line parameter instruction to obtain the parsing result includes: The second function is called to parse the command-line parameter instruction to obtain the name of the object to be controlled and the parameter information. The parameter information is reorganized into intermediate variables with a third preset structure; the parsing result includes the name of the object to be controlled and / or the intermediate variables; The step of reorganizing the parsing results according to the second preset structure to obtain the target instructions executable by the target verification component includes: The intermediate variables and the names of the objects to be controlled are reorganized according to the second preset structure to obtain the target instruction.
5. The command-line parameter passing method according to claim 4, characterized in that, The first preset structure supports the configuration of multiple types of parameter information; the second function predefines parsing sub-functions corresponding to different types of parameter information. The step of calling the second function to read the name of the object to be controlled and the parameter information in the command-line parameter instruction includes: Determine the target type corresponding to the parameter information in the command-line parameter passing instruction; The parameter information is obtained from the command-line parameter passing instructions based on the parsing sub-function corresponding to the target type.
6. The command-line parameter passing method according to claim 5, characterized in that, The first preset structure supports configuring multiple types of parameter information, and the types of parameter information include at least one of the following: Variable assignment; Assigning values to the variable queue; Assigning a value to the upper limit of a variable's numerical value; Assigning a lower limit value to a variable; Specify task embedding, wherein the specified task embedding is used to embed a new task that the object to be controlled supports executing into the current task queue of the object to be controlled; Custom task embedding, which is used to embed a new task into the current task queue of the object to be controlled.
7. The command-line parameter passing method according to claim 4, characterized in that, The step of calling the second function to read the name of the object to be controlled and the parameter information in the command-line parameter instruction includes: The first preset macro is called based on the second function; Based on the first preset macro, the command line parameter passing instruction is parsed to obtain the name of the object to be controlled and the parameter information.
8. The command-line parameter passing method according to claim 4, characterized in that, The intermediate variable that reorganizes the transmitted parameter information into a third preset structure includes: Iterate through the passed parameter information and split the strings in the passed parameter information based on the delimiter; Iterate through the string and extract the action, variable name, and variable value from it. The command line parameter instruction, the parameter information, the action, the variable name, and the variable value are reorganized into an intermediate variable of the third preset structure.
9. The command-line parameter passing method according to claim 4, characterized in that, Before reorganizing the parsing result according to the second preset structure, the method further includes: The parsing result is determined to include the name of the object to be controlled.
10. The command-line parameter passing method according to any one of claims 1-9, characterized in that, The parameter information includes variables; Before receiving the command-line parameter instruction with the first preset structure based on the command-line parameter passing interface, the method further includes: registering different types of variables based on a preset variable registration method; the preset variable registration method includes the registration method corresponding to each of the different types of variables; Before parsing the command-line parameter instruction, the method further includes: determining that the variables in the parameter information are registered.
11. The command-line parameter passing method according to claim 10, characterized in that, The registration of different types of variables based on a preset variable registration method includes: The second preset macro is invoked to register different types of variables based on the preset variable registration method.
12. The command-line parameter passing method according to claim 10, characterized in that, The different types of variables include at least one of the following: integers; integer queues; enumerations; enumeration queues.
13. A verification platform, characterized in that, include: At least one target verification component; The target verification component has a command-line parameter passing interface and a parsing module; The command-line parameter passing interface is used to receive command-line parameter passing instructions with a first preset structure. The first preset structure is used for the name and parameter information of the object to be controlled in the target verification component; the parameter information configures the object to be controlled. The parsing module is used to parse the command-line parameter instructions to obtain the parsing result; the parsing result includes the name of the object to be controlled and the parameter information; The parsing module is also used to reorganize the parsing results according to the second preset structure to obtain the target instructions that the target verification component can execute.
14. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores computer-readable instructions that, when executed by the processor, cause the processor to be configured as a verification platform and to perform the command-line parameter passing method as described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The readable storage medium stores a computer program that, when run on a computer, causes the computer to execute the command-line parameter passing method as described in any one of claims 1-12.
