Method for generating Ethernet protocol MAC (Media Access Control) frame in specified format

By defining class, function and sequence in the System Verilog language, generating Ethernet protocol MAC frames in the specified format, solving the complex problem of multiple MAC frame formats, improving the efficiency of verification environment construction and application flexibility.

CN119766896APending Publication Date: 2025-04-04XIDIAN UNIV +1
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202411916536.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

During the chip verification process, multiple different forms of MAC frame packaging formats make it difficult to build a verification environment and affect verification efficiency.

Method used

Through the System Verilog language, class, function and sequence are defined to generate Ethernet protocol MAC frames in a specified format, integrating multiple MAC frame formats and encapsulating the conversion process, realizing the function of quickly generating and converting MAC frames.

Benefits of technology

It significantly improves the efficiency of building test cases and building verification environments, reduces the cost of testers to learn a variety of MAC frame formats, enhances application flexibility and practicality, and has high reusability and practical value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766896A_ABST
    Figure CN119766896A_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating an Ethernet protocol MAC (Media Access Control) frame in a specified format, which belongs to the technical field of chip verification and comprises the following steps of: defining parameters, function and sequence required by a tester through class on the basis of a System Verilog language; and calling the sequence or the function so as to generate an Ethernet protocol MAC frame in a specified format according to the MAC frame type and the MAC frame parameter in the parameters. According to the method and the device, various MAC frame formats are integrated, and the conversion process is packaged, so that the function of quickly generating and converting the MAC frames can be realized, the problem of complex processing of various MAC frame formats in the prior art is effectively solved, and the efficiency of constructing test cases and establishing a verification environment is remarkably improved; in addition, the cost required by a tester to learn various MAC frame formats is reduced, the application flexibility and practicability in different scenes are enhanced, and the method has very high reusability and practical value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of chip verification, and in particular relates to a method for generating an Ethernet protocol MAC frame in a specified format. Background Art

[0002] In the chip-related field, the delivery time in the chip design process is crucial, so it is necessary to ensure that the chips can be delivered on time, with quality and quantity. In the context of the global chip shortage, the on-time delivery of chips is of great significance to major chip manufacturers. In the chip design process, the efficiency of the verification stage is the key factor in determining whether the chip can be delivered on schedule.

[0003] In the chip verification process, the efficiency of setting up the verification environment and the convenience and reusability of the verification environment have a huge impact on the verification work. With the development of chip verification technology, there are already a variety of VIPs (verification IPs) for common protocols such as Ethernet protocols. For example, Cadence and Synopsys have their own independent VIPs, which also have different forms of MAC frame encapsulation formats. Since the call instructions and transmission parameter formats of different MAC frame encapsulation formats are not exactly the same, this brings many difficulties to the construction of the verification environment. Summary of the invention

[0004] In order to solve the above problems existing in the prior art, the present invention provides a method for generating an Ethernet protocol MAC frame of a specified format. The technical problem to be solved by the present invention is achieved by the following technical solutions:

[0005] The present invention provides a method for generating an Ethernet protocol MAC frame in a specified format, comprising:

[0006] Based on System Verilog language, define the parameters, functions, and sequences required by testers through classes;

[0007] Call this sequence or function to generate an Ethernet protocol MAC frame of a specified format according to the MAC frame type and MAC frame parameters in the parameters.

[0008] In one embodiment of the present invention, the MAC frame type and the MAC frame parameters input by the tester both have initial default values ​​and randomization constraints.

[0009] In one embodiment of the present invention, the MAC frame parameters include at least: a source MAC address, a destination MAC address, a value of a MAC frame length field, and a data field of the MAC frame;

[0010] The randomization constraints include:

[0011] The field length of the source MAC address and the destination MAC address complies with the Ethernet protocol and is 6 bytes.

[0012] The value of the MAC frame length field complies with the Ethernet protocol and is a maximum of 1500 bytes.

[0013] The data field of the MAC frame complies with the Ethernet protocol, with a maximum of 1500 bytes and a minimum of 46 bytes.

[0014] In one embodiment of the present invention, if the tester does not specify the MAC frame type and the MAC frame parameters in the required parameters, the MAC frame type and the MAC frame parameters are randomly generated under the condition that the randomization constraints are met.

[0015] In one embodiment of the present invention, before the step of calling the sequence or function to generate an Ethernet protocol MAC frame of a specified format according to the MAC frame type and MAC frame parameters in the parameters, the step includes:

[0016] The MAC frame type supported by the current verification environment is determined by macro definition.

[0017] In one embodiment of the present invention, if the MAC frame type required by the tester is not a MAC frame type supported by the current verification environment, an error is reported.

[0018] In one embodiment of the present invention, the macro is defined as SYNOPSYS, indicating that the verification IP environment of synopsys is used in the current verification environment, and related functions are all in the enabled state.

[0019] In one embodiment of the present invention, the related functions include:

[0020] According to the MAC frame type and MAC frame parameters required by the tester, the first specified data is generated, and the first specified data is input into the sequence of the sending frame encapsulated by the verification IP, so that the verification IP sends out an Ethernet protocol MAC frame of the specified format.

[0021] In one embodiment of the present invention, the related functions further include:

[0022] According to the MAC frame type and MAC frame parameters required by the tester, the Ethernet protocol MAC frame of other formats monitored by the verification IPmonitor is converted into the Ethernet protocol MAC frame format of the specified format and the second specified data by calling the conversion frame function, and then saved.

[0023] In one embodiment of the present invention, it is encapsulated in a package so as to be directly imported when reused.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] The present invention provides a method for generating an Ethernet protocol MAC frame of a specified format, which integrates a variety of MAC frame formats and encapsulates the conversion process, can realize the function of quickly generating and converting MAC frames, effectively solves the problem of complex processing of a variety of MAC frame formats in the prior art, and significantly improves the efficiency of constructing test cases and setting up a verification environment.

[0026] In addition, the above method also reduces the cost required for testers to learn multiple MAC frame formats, enhances the application flexibility and practicality in different scenarios, and has high reusability and practical value.

[0027] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 The invention is a flowchart of a method for generating an Ethernet protocol MAC frame in a specified format provided by an embodiment of the invention. DETAILED DESCRIPTION

[0029] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0030] Figure 1 FIG. 1 is a flow chart of a method for generating a MAC frame of an Ethernet protocol in a specified format provided by an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a method for generating an Ethernet protocol MAC frame in a specified format, comprising:

[0031] S1. Based on System Verilog language, define the parameters, functions, and sequences required by testers through classes;

[0032] S2. Call the sequence or function to generate an Ethernet protocol MAC frame of a specified format according to the MAC frame type and MAC frame parameters in the parameters.

[0033] In this embodiment, the MAC frame type and MAC frame parameters input by the tester both have initial default values ​​and randomization constraints.

[0034] Optionally, the MAC frame parameters include at least: a source MAC address, a destination MAC address, a value of a MAC frame length field, and a data field of the MAC frame;

[0035] Randomization constraints include:

[0036] The field length of the source MAC address and the destination MAC address complies with the Ethernet protocol and is 6 bytes.

[0037] The value of the MAC frame length field complies with the Ethernet protocol and is a maximum of 1500 bytes.

[0038] The data field of the MAC frame complies with the Ethernet protocol, with a maximum of 1500 bytes and a minimum of 46 bytes;

[0039] If the tester does not specify the MAC frame type and MAC frame parameters in the required parameters, the MAC frame type and MAC frame parameters are randomly generated under the condition that the randomization constraints are met.

[0040] It should be noted that before the step of calling the sequence to generate an Ethernet protocol MAC frame of a specified format according to the MAC frame type and MAC frame parameters in the parameters, the following steps are included:

[0041] The MAC frame type supported by the current verification environment is determined by macro definition. If the MAC frame type required by the tester is not the MAC frame type supported by the current verification environment, an error is reported.

[0042] Exemplarily, the macro is defined as SYNOPSYS, which means that the verification IP environment of synopsys is used in the current verification environment, and related functions are all in the turned-on state. The related functions include: sending Ethernet protocol MAC frames in a specified format and converting the monitored MAC frames into Ethernet protocol MAC frames in a specified format. In step S2, when the function of sending the Ethernet protocol MAC frame in a specified format is implemented, sequence is called, and when the function of converting into the Ethernet protocol MAC frame in a specified format is implemented, function is called.

[0043] Specifically, on the one hand, the relevant functions include: generating first specified data according to the MAC frame type and MAC frame parameters required by the tester, and inputting the first specified data into the sequence of the sending frame encapsulated by the verification IP, so that the verification IP sends out an Ethernet protocol MAC frame of the specified format.

[0044] When using the function of sending Ethernet protocol MAC frames in a specified format, the sequence is sent to the specified component by specifying the sequencer corresponding to the VIP in the current test environment, the amount of data to be carried by the MAC frame is confirmed by specifying the value of the MAC frame length field, and the destination address of this transmission is confirmed by specifying the destination MAC address.

[0045] In the above process, it is necessary to confirm the specific path of the sequencer in the current test environment. When there are multiple sequencers in the current test environment, when using the function of sending Ethernet protocol MAC frames in a specified format, it is necessary to ensure that the specified sequencer is correct, otherwise it will not be sent successfully.

[0046] In addition, when using encapsulated sequences, multiple constraints that conform to the Ethernet protocol can be passed to generate the required MAC frames. If the passed constraints do not meet the protocol requirements, the transmission will fail due to constraint conflicts.

[0047] On the other hand, related functions also include:

[0048] According to the MAC frame type and MAC frame parameters required by the tester, the Ethernet protocol MAC frame of other formats monitored by the verification IPmonitor is converted into the Ethernet protocol MAC frame format of the specified format and the second specified data by calling the conversion frame function, and then saved.

[0049] In the scoreboard, the encapsulated function is called to use the function of converting to the Ethernet protocol MAC frame of the specified format. The corresponding function is selected according to the MAC frame type detected by the monitor, and the monitored MAC frame instance is passed to the function. The function stores the converted second specified data in the defined transaction as output.

[0050] It should be noted that in this embodiment, the MAC frames received by the DUT obtained from the environment are stored in the form of pure data, and the stored MAC frames are also converted into defined transactions when implementing the comparison logic, thereby realizing efficient data comparison function. Transactions can also be used to send self-implemented Ethernet protocol MAC frames, but testers need to design corresponding driver logic and supporting verification environment.

[0051] Optionally, the method for generating the Ethernet protocol MAC frame in the specified format is encapsulated in a package so as to be directly imported during multiplexing.

[0052] Still taking the macro definition SYNOPSYS as an example, in this embodiment, the System Verilog language and UVM verification methodology can be used to build a verification environment, integrate Synopsys Ethernet (Ethernet) VIP in the verification environment and import the package encapsulated by the method for generating the Ethernet protocol MAC frame in the above specified format.

[0053] It can be seen from the above embodiments that the beneficial effects of the present invention are:

[0054] The present invention provides a method for generating an Ethernet protocol MAC frame of a specified format, which integrates a variety of MAC frame formats and encapsulates the conversion process, can realize the function of quickly generating and converting MAC frames, effectively solves the problem of complex processing of a variety of MAC frame formats in the prior art, and significantly improves the efficiency of constructing test cases and setting up a verification environment.

[0055] In addition, the above method also reduces the cost required for testers to learn multiple MAC frame formats, enhances the application flexibility and practicality in different scenarios, and has high reusability and practical value.

[0056] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0057] The description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.

[0058] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A method for generating an Ethernet protocol MAC frame of a specified format, characterized in that: include: Based on System Verilog language, define the parameters, functions, and sequences required by testers through classes; Call this sequence or function to generate an Ethernet protocol MAC frame of a specified format according to the MAC frame type and MAC frame parameters in the parameters.

2. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 1, characterized in that: The MAC frame type and the MAC frame parameters input by the tester both have initial default values ​​and randomization constraints.

3. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 2, characterized in that: The MAC frame parameters include at least: a source MAC address, a destination MAC address, a value of a MAC frame length field, and a data field of a MAC frame; The randomization constraints include: The field length of the source MAC address and the destination MAC address complies with the Ethernet protocol and is 6 bytes. The value of the MAC frame length field complies with the Ethernet protocol and is a maximum of 1500 bytes. The data field of the MAC frame complies with the Ethernet protocol, with a maximum of 1500 bytes and a minimum of 46 bytes.

4. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 3, characterized in that: If the tester does not specify the MAC frame type and the MAC frame parameters in the required parameters, the MAC frame type and the MAC frame parameters are randomly generated under the condition that the randomization constraints are met.

5. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 2, characterized in that: Before calling the sequence or function to generate an Ethernet protocol MAC frame of a specified format according to the MAC frame type and MAC frame parameters in the parameters, the step includes: The MAC frame type supported by the current verification environment is determined by macro definition.

6. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 5, characterized in that: If the MAC frame type required by the tester is not the MAC frame type supported by the current verification environment, an error is reported.

7. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 5, characterized in that: The macro is defined as SYNOPSYS, which means that the verification IP of synopsys is used to build the environment in the current verification environment, and related functions are all in the enabled state.

8. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 7, characterized in that: The related functions include: According to the MAC frame type and MAC frame parameters required by the tester, the first specified data is generated, and the first specified data is input into the sequence of the sending frame encapsulated by the verification IP, so that the verification IP sends out an Ethernet protocol MAC frame of the specified format.

9. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 8, characterized in that: The related functions also include: According to the MAC frame type and MAC frame parameters required by the tester, the Ethernet protocol MAC frame of other formats monitored by the verification IPmonitor is converted into the Ethernet protocol MAC frame format of the specified format and the second specified data by calling the conversion frame function, and then saved.

10. The method for generating an Ethernet protocol MAC frame of a specified format according to claim 1, characterized in that: It is encapsulated in a package so that it can be directly imported when reused.

Citation Information

Patent Citations

  • Low power consumption high speed network message detection method and device

    CN107733736A

  • Novel networking protocol method based on ubiquitous power Internet of Things

    CN110662226A

  • Data conversion method and device, and server

    CN110933146A

  • Test instruction set generation method and apparatus, and electronic device

    CN111506501A

  • FPGA-based Ethernet MACIP board-level verification structure and method

    CN113901754A