Verification environment building method, verification method, device, electronic equipment and medium
By creating N instances using the first and second variables in the configuration file and using a mapping function to map the communication link group, the problem of the inability to flexibly verify any N ports of a multi-port controller in the existing technology is solved, and flexible verification of any port is achieved.
Patent Information
- Application Number
- CN202611424921.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-27
AI Technical Summary
The existing verification environment cannot flexibly verify any N ports in a multi-port controller, especially it cannot support verification scenarios of non-contiguous ports, and can only verify the first port.
N instances are created using the first and second variables in the configuration file, including the top-level instance and child instances. A mapping function is used to map each instance to a communication link group, establishing a flexible verification environment that supports verification of any N ports.
It enables flexible verification of any port of a multi-port controller, supports non-contiguous port scenarios, and improves the flexibility and coverage of the verification environment.
Smart Images

Figure CN123185113A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of equipment verification, and more specifically, to a verification environment setup method, verification method, apparatus, electronic device, and medium. Background Technology
[0002] The complexity of multi-port architecture increases exponentially in terms of topology networking, link management, and transaction scheduling. Its verification technology has also been upgraded from single-link functional compliance verification to multi-dimensional, high-concurrency, and full-scenario system-level verification.
[0003] However, due to limitations in existing verification environments, if verification of a multi-port controller with X ports is required, the verification environment typically only supports continuous use of the first X ports, and cannot verify scenarios where only a subset of the ports in the multi-port controller is used. If only one port of the multi-port controller with X ports is to be verified, only the first port of the multi-port controller can be verified. Summary of the Invention
[0004] This application provides a method for setting up a verification environment, a verification method, an apparatus, an electronic device, and a medium to enable flexible verification of multi-port controllers.
[0005] In a first aspect, this application provides a method for setting up a verification environment, comprising: obtaining a first variable and a second variable from a configuration file; wherein the first variable is used to indicate the port for which an instance needs to be created, and the second variable includes a communication link group corresponding to each port; creating N instances based on the first variable; N is a positive integer, and the N instances include a top-level instance, and the remaining N-1 instances are sub-instances under the top-level instance; passing the second variable to a mapping function, so that the mapping function, according to the second variable, realizes the mapping between each instance and the corresponding communication link group, and each communication link group corresponds to a port, thereby completing the setup of the verification environment; so that when using the verification environment to verify a multi-port architecture, each instance in the verification environment is connected to the port corresponding to the corresponding communication link group through the corresponding communication link group, thereby realizing the verification of the ports in the multi-port architecture.
[0006] In this embodiment, a first variable and a second variable are pre-configured. The first variable indicates the number of instances created, and the second variable indicates the communication link group mapped to each instance. Since the mapping and creation of instances can be controlled by the first and second variables, the ports of the multi-port controller can be flexibly verified by configuring the first and second variables. Verification can also be performed on any N ports of the multi-port controller without needing to verify according to the port order.
[0007] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the first variable is an array comprising M bytes, where each byte is used to indicate whether a corresponding port needs to be instantiated.
[0008] In this embodiment, an array of M bytes is used as the first variable, with each byte corresponding to a port of the multi-port controller. Therefore, the port in the multi-port controller where the corresponding instance needs to be created can be determined using the first variable.
[0009] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, based on the first variable, N instances are created, including: counting the number of bytes in the first variable that represent the need to create instances, and obtaining the value of N; creating N instances; wherein the N instances include one top-level instance, and the remaining N-1 instances are sub-instances under the top-level instance.
[0010] In this embodiment of the application, by counting the number of bytes in the first variable that represent the number of instances to be created, N can be quickly and accurately determined, and then the corresponding number of instances can be created.
[0011] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, creating N instances includes: if N is an integer greater than 1, then creating one top-level instance and creating N-1 sub-instances under the top-level instance.
[0012] In this embodiment, to verify any port, a corresponding instance needs to be created. Therefore, this solution may require creating multiple instances. One instance is designated as the top-level instance, and the remaining instances are designated as sub-instances under the top-level instance, thus enabling the creation of multiple instances.
[0013] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the method further includes: if N is 1, creating the top-level instance.
[0014] Secondly, this application provides a multi-port controller verification method, comprising: building a verification environment based on the method described in the first aspect and / or in combination with any possible implementation of the first aspect; verifying a target multi-port controller through the built verification environment to obtain a verification result.
[0015] In this embodiment, in the verification environment built using the aforementioned verification environment construction method, each port of the target multi-port controller that needs to be verified corresponds to an instance, and this instance is mapped to the communication link group of the corresponding port in the target multi-port controller. Therefore, the verification environment can be used to verify ports with corresponding instances. Thus, the ports of the multi-port controller can be flexibly verified by configuring the first and second variables.
[0016] Thirdly, this application provides a verification environment setup apparatus, comprising: an acquisition module, configured to acquire a first variable and a second variable from a configuration file; wherein the first variable is used to indicate the port for which an instance needs to be created, and the second variable includes a communication link group corresponding to each port; a processing module, configured to create N instances based on the first variable; N is a positive integer, and the N instances include a top-level instance, with the remaining N-1 instances being sub-instances under the top-level instance; the second variable is passed to a mapping function, such that the mapping function maps each instance to its corresponding communication link group based on the second variable, with each communication link group corresponding to a port, thereby completing the setup of the verification environment; so that when using the verification environment to verify a multi-port architecture, each instance in the verification environment is connected to the port corresponding to the corresponding communication link group through the corresponding communication link group, thereby verifying the ports in the multi-port architecture.
[0017] Fourthly, this application provides a multi-port controller verification device, comprising: a verification environment building module and a verification module. The verification environment building module is used to build a verification environment based on the method described in the first aspect and / or in combination with any possible implementation of the first aspect. The verification module is used to verify a target multi-port controller through the built verification environment and obtain a verification result. Each instance in the verification environment corresponds to a port in the target multi-port controller. Each instance is connected to the port corresponding to that instance through a corresponding communication link group.
[0018] Fifthly, this application provides an electronic device, comprising: a memory and a processor, the memory and the processor being connected; the memory being used to store a program; the processor being used to invoke the program stored in the memory to execute the method described in the first aspect and / or in combination with any possible implementation of the first aspect, or to execute the method described in the second aspect.
[0019] In a sixth aspect, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, performs the method described in the first aspect and / or in combination with any possible implementation of the first aspect, or performs the method described in the second aspect. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments 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.
[0021] Figure 1 This is a flowchart illustrating the first verification environment setup method according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the data flow for creating N instances, as shown in an embodiment of this application. Figure 3 This is a flowchart illustrating a second method for setting up a verification environment, as shown in an embodiment of this application. Figure 4 This is a schematic diagram illustrating a verification environment according to an embodiment of this application; Figure 5 This is a flowchart illustrating a multi-port controller verification method according to an embodiment of this application; Figure 6 This is a schematic diagram illustrating a verification process performed through an established verification environment, as shown in an embodiment of this application. Figure 7 This is a structural block diagram illustrating a verification environment setup device according to an embodiment of this application; Figure 8 This is a structural block diagram of a multi-port controller verification device shown in an embodiment of this application; Figure 9 This is a structural block diagram of an electronic device shown in an embodiment of this application. Detailed Implementation
[0022] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0023] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., in the description of this application are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, 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.
[0024] The technical solution of this application will now be described in detail with reference to the accompanying drawings.
[0025] Currently, if you need to use N ports of a multi-port controller, only the first N ports of the multi-port controller need to be operational; the remaining ports will not work. Therefore, the existing verification environment only supports scenarios where the first N ports are used consecutively. If you need to verify a single port of the multi-port controller, you can only verify the first port of the multi-port controller.
[0026] To enable flexible verification of ports on a multi-port controller, this application provides a method for setting up a verification environment.
[0027] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for setting up a verification environment, as shown in an embodiment of this application. The following will be combined with... Figure 1 The specific steps for setting up the verification environment are explained.
[0028] S110: Retrieve the first and second variables from the configuration file.
[0029] The first variable indicates the port where the instance needs to be created, and the second variable includes the communication link group corresponding to each port.
[0030] The configuration file can be a global text file in cfg format, which defines a first variable and a second variable. This configuration file also serves as the configuration file for building the entire verification environment. The specific implementation of the verification environment configuration file is well known to those skilled in the art and will not be elaborated upon here for the sake of brevity.
[0031] The configuration file can also be implemented in other ways, as long as it can define the first and second variables, and is not limited to the methods exemplified here.
[0032] In one implementation, the first variable can be a set of M sub-variables, each sub-variable corresponding to a port of the multi-port controller. Each sub-variable is used to indicate whether an instance needs to be created for the corresponding port.
[0033] Each sub-variable can include a unique identifier for a port of the multi-port controller. In this case, each sub-variable includes a first component of the unique identifier and a second component indicating whether an instance needs to be created. When this type of implementation's sub-variable is obtained, the corresponding port is determined based on the first component, and whether the port needs to be instantiated is determined based on the second component.
[0034] The unique identifier can be any identifier that can uniquely correspond to a port in the multi-port controller, such as the number of each port in the multi-port controller. The implementation of the unique identifier is not limited to the example given here.
[0035] For example, a sub-variable can be represented as "AAA-BBB", where AAA is the unique identifier of the port and BBB indicates whether an instance needs to be created.
[0036] If "BBB" is set to "111", it indicates that an instance needs to be created. If "BBB" is set to "000", it indicates that an instance does not need to be created.
[0037] The four sub-variables are "000-111", "001-000", "010-000", and "011-111". Therefore, it can be determined that ports 000 and 011 require corresponding instances to be created, while ports 001 and 010 do not.
[0038] The examples provided are for illustrative purposes only and should not be construed as limiting the scope of this application.
[0039] Alternatively, each sub-variable can include only the component indicating whether an instance is created. In this case, the positions of the sub-variables corresponding to multiple ports in the first variable are fixed; therefore, the port corresponding to each sub-variable can be determined by the position of the sub-variable in the first variable.
[0040] For example, if the sub-variable is "111", it indicates that an instance needs to be created. If the sub-variable is "000", it indicates that no instance needs to be created. Furthermore, the four independent variables included in the first variable correspond to port 1, port 2, port 3, and port 4 from beginning to end.
[0041] The first variable is a set of "111", "000", "000", and "111". Therefore, the sub-variables corresponding to ports 1 and 4 are both "111", and thus, instances of ports 1 and 4 need to be created. However, the sub-variables corresponding to ports 2 and 3 are both "000", so instances of ports 2 and 3 do not need to be created.
[0042] The examples provided are for illustrative purposes only and should not be construed as limiting the scope of this application.
[0043] Optionally, the first variable can also be an array of M bytes, where each byte indicates whether an instance needs to be created for the corresponding port.
[0044] M represents the number of ports on the multi-port controller.
[0045] In this case, the positions of the bytes corresponding to the multiple ports in the array of M bytes included in the first variable are fixed. Therefore, the port corresponding to each byte can be determined by the position of each byte in the array.
[0046] For ease of understanding, let's take M=4 as an example, where the first byte corresponds to port 1, the second byte to port 2, the third byte to port 3, and the fourth byte to port 4. A byte of 0 indicates that no instance needs to be created, while a byte of 1 indicates that an instance needs to be created.
[0047] If the first variable is "1001", then the first byte of the array is 1, indicating that port 1 needs to create a corresponding instance. The second byte is 0, indicating that port 2 does not need to create a corresponding instance. The third byte is 0, indicating that port 3 does not need to create a corresponding instance. The fourth byte is 1, indicating that port 4 needs to create a corresponding instance.
[0048] The examples provided are for illustrative purposes only and should not be construed as limiting the scope of this application.
[0049] S120: Create N instances based on the first variable.
[0050] N is a positive integer. Among the N instances, there is one top-level instance and the remaining N-1 instances are child instances of the top-level instance.
[0051] In one implementation, creating N instances can be done by first counting the number of bytes in the first variable that represent the number of instances to be created, thus obtaining the value of N. Then, N instances are created. By counting the number of bytes in the first variable that represent the number of instances to be created, N can be quickly and accurately determined, and thus the corresponding number of instances can be created.
[0052] Optionally, during the creation of N instances, it is also possible to first determine whether N is greater than 1.
[0053] If N is an integer greater than 1, then create one top-level instance and create N-1 child instances under the top-level instance.
[0054] If N is 1, then create 1 top-level instance.
[0055] To verify any port, a corresponding instance needs to be created. Therefore, this solution may require creating multiple instances. One instance is designated as the top-level instance, while the others are sub-instances under the top-level instance, thus enabling the creation of multiple instances.
[0056] In this context, the top-level instance and its child instances are instances of the same origin, meaning they are both instances of the same class. During creation, for each of the N instances, a sequence (a dynamic object used to generate, control, and send test stimulus transactions) is initiated to instantiate the class instance, resulting in a single instance. The specific methods for instantiating class instances are well-known to those skilled in the art and will not be elaborated upon here for brevity.
[0057] To better understand the specific logic of creating N instances, the following will combine... Figure 2 Please provide an explanation.
[0058] like Figure 2 As shown, by retrieving the first variable and class instance from cfg (configuration file), and analyzing the first variable, we obtain the number N of instances to be created, and the ID of the port for each instance. The class instance is then instantiated N times to obtain N instances, each corresponding to a port ID.
[0059] S130: Pass the second variable to the mapping function so that the mapping function can map each instance to the corresponding communication link group based on the second variable, with each communication link group corresponding to a port.
[0060] Optionally, the communication link group can be a serial communication link group or a parallel communication link group.
[0061] In one implementation, the second variable may include M sets of link data, each set of link data including a communication link group of one port in the multi-port controller.
[0062] Optionally, each set of link data may also include a unique identifier for the port corresponding to that set of link data.
[0063] In this scenario, after passing the second variable to the mapping function, the function determines the port corresponding to each set of link data based on the unique identifier in each set of link data within the second variable. It also determines the communication link group corresponding to each port based on each set of link data. Finally, it maps each instance to the communication link group of its corresponding port.
[0064] Alternatively, the positions of the link data corresponding to multiple ports in the second variable can be fixed. Therefore, the port corresponding to each group of link data can be determined by the position of the link data in the second variable.
[0065] For example, it could be the starting position of the link data corresponding to port 1 in the second variable, while the subsequent link data in the second variable are port 2, port 3, port 4, etc. This example is only for ease of understanding.
[0066] The specific methods and principles by which the mapping function implements the mapping of each instance to the corresponding communication link group are well known to those skilled in the art, and will not be elaborated here for the sake of brevity.
[0067] For example, one way to implement the second variable is to define variables int get_lane_start[7:0] and int port_width[7:0].
[0068] Among them, get_lane_start[7:0] is used to indicate the starting point of the physical lane used by each port.
[0069] port_width[7:0] is used to indicate the number of physical lanes used for each port.
[0070] if(portactive[i] == 1'b1) / / Enter the loop only if the first variable, portactive, is valid; get_lane_start[i] = cfg.portoffset[i]; / / Get the starting lane position for each port; In each test environment, an interface is obtained to connect to the DUT (Design Under Test, such as the target multi-port controller). The implementation principle is as follows: interface dut_if logic tx_data[15:0] / / DUT transmit direction data interface logic rx_data[15:0] / / DUT receive direction data interface endinterface interface vip_if logic tx_data[7:0] / / data interface in the transmit direction in env (test environment) logic rx_data[7:0] / / data interface in the receive direction in env endinterface dut_if dut_if_tmp; / / declare DUT interface vip_if dut_if_tmp[7:0]; / / declare env interface if(portactive[i] == 1’b1) begin for(int j = 0; j <= port_width[i]; j++) begin / / width corresponding to each instance dut_if_tmp.rx_data[get_lane_start[i] + j] <= vip_if_tmp[i].tx_data[j]; / / connect DUT and env interfaces vip_if_tmp[i].rx_data[j] <= dut_if_tmp.tx_data[get_lane_start[i] + j]; / / connect DUT and env interfaces end The above logic is as follows: when the first variable represents an instance corresponding to a port that needs to be created, each physical lane (data transmission channel) corresponding to the instance is connected to the physical lane of the design under test (DUT) respectively. The physical lane for transmitting data corresponding to the instance is connected to the physical lane for receiving data of the DUT, and the physical lane for receiving data corresponding to the instance is connected to the physical lane for transmitting data of the DUT.
[0071] The examples herein are only for ease of understanding and should not be construed as limitations on the present application.
[0072] To facilitate understanding of the verification environment construction method described above, the following description will be made in conjunction with Figure 3 for explanation.
[0073] As shown in Figure 3 , first write the verification components required for the verification environment. The verification components may include a driver, a monitor, a scoreboard, a reference model, and the like.
[0074] Then create a global configuration file cfg, and define a first variable and a second variable in cfg. The first variable indicates whether a corresponding instance needs to be established for each port; the second variable indicates the physical lane (serial communication link) corresponding to each port.
[0075] Then, based on the first variable, determine the number N of instances that need to be created. Create N instances of the same origin, each instance used to start the corresponding port. Where N is an integer greater than 1, first create 1 top-level instance, and then create N-1 child instances in the top-level instance.
[0076] Finally, the second variable is passed to the mapping function so that the mapping function can map each instance to the corresponding serial communication link based on the second variable, thus completing the construction of the verification environment.
[0077] Figure 3 The specific implementation methods and principles of each step shown have been clearly described above, and will not be repeated here for the sake of brevity.
[0078] To facilitate understanding of the relationships between the top-level instance, sub-instances, and mapping functions mentioned above, the following will combine... Figure 4 Please provide an explanation.
[0079] like Figure 4 As shown, cfg is the configuration file for building the entire verification environment. In addition to the regular configuration data, it also needs to include portactive (the first variable) and portoffset (the second variable). Portactive is a 1-bit array (corresponding to the 8-port controller), and portoffset is an array of int types.
[0080] primary_test is the top-level instance, which exists as uvm_test_top for the entire verification environment. Its main function is to extract common configurations to build the verification environment framework.
[0081] `secondary_test` is a sub-instance of the same origin as `primary_test`. Its main function is to initiate specific sequences for specific ports. The creation of this sub-instance depends on `portactive` (the first variable) in the `cfg` (configuration file). If `portactive` is 1, the corresponding `secondary_test` will be created; if `portactive` is 0, it will not be created. The instance corresponding to one of the ports is the top-level instance.
[0082] Mapping is a mapping function that obtains a second variable from cfg to map each instance (top-level instance and child instances) to the corresponding port's communication link group (phy).
[0083] Based on the same technical concept, this application also provides a multi-port controller verification method, such as... Figure 5 As shown.
[0084] S210: Build a verification environment based on the verification environment building method.
[0085] The specific structure of the verification environment built using the verification environment setup method has been clearly described above, and will not be repeated here for the sake of brevity.
[0086] S220: Based on the established verification environment, the target multi-port controller is verified, and the verification results are obtained.
[0087] The specific methods for verifying multi-port controllers based on the verification environment are well known to those skilled in the art, and will not be elaborated here for the sake of brevity.
[0088] In one implementation, such as Figure 6 As shown, based on the established verification environment, the target multi-port controller is verified. The verification result can be obtained as follows: After the verification environment is set up, it is connected to the multi-port controller via an interface. Then, environment variables are configured in the top-level instance of the verification environment to create and instantiate the components within the configuration environment. Next, a sequence (a dynamic object used to generate, control, and send test stimulus transactions) is started to generate corresponding stimuli to drive the target multi-port controller. Finally, the verification of the target multi-port controller is completed through scoreboard comparison.
[0089] Among these, environmental variables can be the first variable or the second variable mentioned above. Alternatively, environmental variables can also include all other variables related to environmental factors.
[0090] Based on the same technical concept, this application also provides a verification environment construction device. For example... Figure 7 As shown, the verification environment setup device 100 includes an acquisition module 110 and a processing module 120.
[0091] The acquisition module 110 is used to acquire a first variable and a second variable from the configuration file; wherein the first variable is used to indicate the port where the instance needs to be created, and the second variable includes the communication link group corresponding to each port.
[0092] The processing module 120 is used to create N instances based on the first variable, where N is a positive integer; and to pass the second variable to a mapping function so that the mapping function maps each instance to a corresponding communication link group according to the second variable, with each communication link group corresponding to a port, thereby completing the construction of the verification environment; so that when the verification environment is used to verify the multi-port architecture, each instance in the verification environment is connected to the port corresponding to the corresponding communication link group through the corresponding communication link group, thereby verifying the ports in the multi-port architecture.
[0093] In one implementation, the first variable is an array of M bytes, where each byte indicates whether an instance needs to be created for a corresponding port.
[0094] The processing module 120 is specifically used to count the number of bytes in the first variable that represent the need to create instances, and obtain the value of N; create N instances; wherein the N instances include a top-level instance, and the remaining N-1 instances are sub-instances under the top-level instance.
[0095] The processing module 120 is specifically used to create one top-level instance if N is an integer greater than 1, and to create N-1 sub-instances under the top-level instance.
[0096] The processing module 120 is specifically used to create the top-level instance if N is 1.
[0097] The verification environment setup device 100 provided in this application embodiment has the same implementation principle and technical effect as the aforementioned verification environment setup method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned verification environment setup method embodiment.
[0098] Based on the same technical concept, this application also provides a multi-port controller verification device, such as... Figure 8 As shown. The multi-port controller verification device 200 includes a verification environment setup module 210 and a verification module 220.
[0099] The verification environment setup module 210 is used to set up a verification environment based on the aforementioned verification environment setup method.
[0100] The verification module 220 is used to verify the target multi-port controller based on the established verification environment and obtain the verification result; wherein, each instance in the verification environment corresponds to a port in the target multi-port controller; each instance is connected to the port corresponding to the instance through a corresponding communication link group.
[0101] The multi-port controller verification device 200 provided in this application embodiment has the same implementation principle and technical effect as the aforementioned multi-port controller verification method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned multi-port controller verification method embodiment.
[0102] Please see Figure 9 This is an electronic device 300 provided in an embodiment of this application. The electronic device 300 includes: a processor 310 and a memory 320.
[0103] The memory 320 and processor 310 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 320 is used to store computer programs, such as those containing... Figure 7 The software functional modules shown are the verification environment setup device 100; or the software that stores... Figure 8 The software functional module shown is the multi-port controller verification device 200. The verification environment setup device 100 / multi-port controller verification device 200 includes at least one software functional module that can be stored in the memory 320 in the form of software or firmware, or embedded in the operating system (OS) of the electronic device 300.
[0104] The processor 310 is used to execute executable modules stored in the memory 320, such as software function modules or computer programs included in the verification environment setup device 100. At this time, the processor 310 is used to obtain a first variable and a second variable from a configuration file; wherein the first variable indicates the port for which an instance needs to be created, and the second variable includes a communication link group corresponding to each port; based on the first variable, N instances are created; N is a positive integer; the second variable is passed to a mapping function so that the mapping function, according to the second variable, maps each instance to its corresponding communication link group, with each communication link group corresponding to a port, thus completing the setup of the verification environment; so that when using the verification environment to verify a multi-port architecture, each instance in the verification environment is connected to the port corresponding to that communication link group through the corresponding communication link group, thereby verifying the ports in the multi-port architecture.
[0105] The processor 310 is used to execute executable modules stored in the memory 320, such as software function modules or computer programs included in the multi-port controller verification device 100. At this time, the processor 310 is used to build a verification environment based on the verification environment building method; based on the built verification environment, it verifies the target multi-port controller and obtains a verification result; wherein each instance in the verification environment corresponds to a port in the target multi-port controller; each instance is connected to the port corresponding to that instance through a corresponding communication link group.
[0106] The memory 320 can be, 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.
[0107] Processor 310 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be a DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. 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 processor 310 can be any conventional processor.
[0108] Among them, the aforementioned electronic devices 300 include, but are not limited to, personal computers, servers, etc.
[0109] This application also provides a computer-readable storage medium (hereinafter referred to as the storage medium) storing a computer program. When the computer program is run by a computer, such as the electronic device 300 described above, it executes the verification environment setup method or the multi-port controller verification method described above. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory, random access memory, magnetic disk, or optical disk.
[0110] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for setting up a verification environment, characterized in that, include: Obtain the first and second variables from the configuration file; wherein the first variable is used to indicate the port where the instance needs to be created, and the second variable includes the communication link group corresponding to each port; Based on the first variable, create N instances; N is a positive integer. The second variable is passed to the mapping function so that the mapping function maps each instance to the corresponding communication link group based on the second variable. Each communication link group corresponds to a port, thus completing the construction of the verification environment. This allows each instance in the verification environment to connect to the port corresponding to the corresponding communication link group when verifying the multi-port architecture, thereby verifying the ports in the multi-port architecture.
2. The method according to claim 1, characterized in that, The first variable is an array of M bytes, where each byte indicates whether an instance needs to be created for a corresponding port.
3. The method according to claim 2, characterized in that, Based on the first variable, create N instances, including: The value of N is obtained by counting the number of bytes in the first variable that represent the number of instances that need to be created; Create N instances; among the N instances, there is one top-level instance, and the remaining N-1 instances are child instances under the top-level instance.
4. The method according to claim 3, characterized in that, Create N instances of the above, including: If N is an integer greater than 1, then create one top-level instance and create N-1 child instances under the top-level instance.
5. The method according to claim 3, characterized in that, The method further includes: If N is 1, create the top-level instance.
6. A multi-port controller verification method, characterized in that, include: A verification environment is built based on the method described in any one of claims 1-5; Based on the established verification environment, the target multi-port controller is verified to obtain verification results; wherein, each instance in the verification environment corresponds to a port in the target multi-port controller; each instance is connected to the port corresponding to the instance through a corresponding communication link group.
7. A verification environment setup device, characterized in that, include: The acquisition module is used to obtain a first variable and a second variable from the configuration file; wherein, the first variable is used to indicate the port where the instance needs to be created, and the second variable includes the communication link group corresponding to each port; The processing module is used to create N instances based on the first variable; N is a positive integer, and the N instances include a top-level instance and the remaining N-1 instances are sub-instances of the top-level instance; the second variable is passed to the mapping function so that the mapping function can map each instance to the corresponding communication link group according to the second variable, and each communication link group corresponds to a port.
8. A multi-port controller verification device, characterized in that, include: A verification environment setup module is used to set up a verification environment based on the method described in any one of claims 1-5; The verification module is used to verify the target multi-port controller based on the established verification environment and obtain the verification result; wherein, each instance in the verification environment corresponds to a port in the target multi-port controller; each instance is connected to the port corresponding to the instance through a corresponding communication link group.
9. An electronic device, characterized in that, include: A memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to execute the method as described in any one of claims 1-5, or to execute the method as described in claim 6.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a computer, performs the method as described in any one of claims 1-5, or performs the method as described in claim 6.
