Level-2 market decoding circuit verification stimulus generation method and verification platform based on UVM

By defining STEP transactions and FAST message classes in UVM, incentives that comply with Level-2 market specifications are generated, which solves the problem that existing technology cannot effectively verify the Level-2 market decoding circuit, and achieves efficient verification platform construction and simplified verification. process.

CN113986637BActive Publication Date: 2024-09-24BEIJING TECH & BUSINESS UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111370597.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2024-09-24
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

The existing UVM verification platform cannot effectively cover the verification scenarios of Level-2 market decoding circuits. The traditional random incentive generation method requires a huge workload and is difficult to cover all possible field combinations, reducing verification efficiency and reliability.

Method used

By defining STEP transactions and FAST message classes in UVM, and using existing bitmap sequences and randomization fields to generate incentives that comply with Level-2 market specifications, the generator can generate random incentives in a variety of message types and field combinations, simplifying reference Model implementation and driver process.

Benefits of technology

It realizes the rapid construction of a verification platform for Level-2 market decoding circuits, simplifies the verification process, improves verification efficiency and reliability, covers more field combinations, and reduces development difficulty and cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986637B
    Figure CN113986637B
Patent Text Reader

Abstract

The present invention relates to a method for generating a verification stimulus for a Level-2 market decoding circuit based on UVM. The method includes the steps of generating a stimulus, randomizing, and combining STEP structure messages. The method for generating a verification stimulus for a Level-2 market decoding circuit based on UVM provided by the present invention can generate a verification stimulus that complies with the Level-2 market definition specification, and can assist verification personnel in quickly building a verification platform for a Level-2 market decoding circuit. This stimulus generation method can generate a transaction containing an expected output, which simplifies the implementation process of a reference model. The reference model only needs to locate the part of the message body in the STEP transaction and take it out, which can be used as the expected output of a scoreboard. At the same time, this stimulus generation method can simplify the process of a driver driving a transaction into a pin-level signal, and the first byte sequence can be directly driven by the driver to the input end of the circuit to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a UVM-based Level-2 market decoding circuit verification stimulus generation method and a verification platform, belonging to the technical field of digital circuits. Background Art

[0002] Level-2 is a market product launched by the Shanghai Stock Exchange. Its market data is transmitted by a financial information exchange protocol that uses compression coding. The components are STEP header, FAST message data, and STEP tail. STEP (Securities Trading Exchange Protocol) is the securities trading data exchange protocol part, and FAST (FIXAdapted for Streaming) data is the compression coding part, which contains the real market information. The STEP protocol part in the market data is organized in the format of "field = value". FAST data only contains "values", and its "fields" are stripped from the transmitted market information and exist in the form of message templates, which are known to both the sender and the receiver. Another feature of FAST data is that the "value" of each "field" in the message template is not transmitted in full. According to the needs of the actual market data, the "value" of the redundant "field" will be discarded.

[0003] In real-time trading, the speed of the market system directly determines the customer's transaction rate and the amount of profit. At present, some securities companies have begun to develop market decoding circuits that can be applied to Level-2. The main function of this market decoding circuit is to decode Level-2 market data, extract FAST data, and decode the "values" corresponding to each "field" of the current market according to the message template, so as to restore the complete market information. Level-2 market data has the characteristics of complex data structure and flexible and diverse information transmission. The digital circuits that can decode Level-2 market are often large-scale and complex in function. In addition, the development of securities business requires the designed digital circuits to have ultra-high reliability and stability. Therefore, UVM (Universal Verification Methodology) is usually used to verify the designed market hardware circuits.

[0004] Among the existing technical solutions, CN112486835A provides a UVM verification platform and method for securities and futures counters. However, the invention content of this technical solution only focuses on the verification of futures counters based on FPGA, and its input stimulus cannot randomly generate FAST data transmitted by the STEP protocol, so this technical solution cannot cover the verification scenario of Level-2 market conditions.

[0005] To verify the Level-2 market decoding circuit using UVM, we should not only pay attention to how to generate random stimuli in a constrained manner for each "field", but also pay attention to the various combinations of "fields" in the FAST data part. If a transaction is defined for each combination of "fields", then multiple transactions are required for the same message type to cover all combinations of FAST "fields". Different message types also have different message templates. The traditional random stimulus generation method mentioned above will require a huge workload, reducing the overall verification efficiency. There is also a risk of missing individual "field" combinations, reducing verification reliability. At the same time, most of the existing verification schemes directly generate a stimulus to be decoded based on the functional description of the design requirements. In order to obtain the expected output, the implementation details of the reference model need to be consistent with the circuit to be tested, which will increase the difficulty and cycle of the verification platform development to a certain extent. Summary of the invention

[0006] The technical problem to be solved by the present invention is: to overcome the disadvantages of the above-mentioned technology and provide a method for generating a verification stimulus for a Level-2 market decoding circuit based on UVM; and on this basis, to provide a Level-2 market decoding circuit verification platform which can reduce the development difficulty and development cycle.

[0007] In order to solve the above technical problems, the first technical solution proposed by the present invention is: A method for generating a verification stimulus for a Level-2 market decoding circuit based on UVM, comprising the following steps:

[0008] (1) uvm_test starts a verification case and uses uvm_do to make the sequence generator start generating a STEP transaction; the STEP transaction selects and instantiates a FAST message class; the FAST message class contains fields that correspond to the existence bitmap sequence and the sequence of the existence bitmap sequence;

[0009] (2) The FAST message class randomizes the existence bitmap sequence and fields; the existence bitmap sequence is pushed into the second byte queue; the corresponding fields marked as valid in the existence bitmap sequence are pushed into the second byte queue;

[0010] (3) The STEP transaction generates a message header and pushes it into the first byte queue;

[0011] (4) The STEP transaction takes out the second byte queue in the FAST message class and pushes it into the first byte queue;

[0012] (5) The STEP transaction generates a message tail and pushes it into the first byte queue.

[0013] A further improvement of the above scheme is that the STEP transaction inherits from the uvm_sequence_item base class, and internally generates a message header and a message footer that conform to the STEP protocol using string type definitions, ensuring that they are in ASCII encoding when pushed into the byte queue.

[0014] The above scheme is further improved in that: a random type existence bitmap sequence and a specific FAST message template are defined in the FAST message class; the FAST message template is composed of various field variables corresponding to the template, and each field variable is of a random type; each field variable in the FAST message template has constraints that comply with exchange specifications.

[0015] A further improvement of the above scheme is that the STEP transaction and the FAST message class have the function of writing the currently generated message data to a local file; the written message data is in the state before being pushed into the byte queue.

[0016] In order to solve the above technical problems, the second technical solution proposed by the present invention is: a UVM-based Level-2 market decoding circuit verification platform, including: uvm_test, a sequence generator and an environment component;

[0017] The uvm_test is responsible for configuring different verification cases and opening the sequence generator of the corresponding verification cases; and using this as the root node to instantiate each component of the verification platform according to the uvm tree hierarchy;

[0018] The sequence generator generates corresponding random stimulus, i.e., STEP transaction, according to the verification case configured by uvm_test;

[0019] The environment components include an input agent, an output agent, a reference model, and a scoreboard;

[0020] The input agent is instantiated in the environment component, including a sequence initiator and a driver;

[0021] The sequence initiator is responsible for passing the STEP transaction generated by the sequence generator to the driver;

[0022] The driver receives the STEP transaction transmitted by the sequence initiator, and transmits the message data contained in the STEP transaction to the input port of the circuit under test and the reference model through the interface layer;

[0023] The output agent is instantiated in an environment component, including a monitor;

[0024] The monitor receives the pin-level signal output by the circuit under test through the interface layer, converts it into a transaction, and sends it to the scoreboard as an actual output;

[0025] The reference model extracts FAST message data from the STEP transaction generated by the sequence generator and sends it to the scoreboard as expected output;

[0026] The scoreboard compares the expected output with the actual output to see if they are consistent. If they are consistent, it is determined that the function of the circuit under test meets the design requirements. Otherwise, it is determined that the function of the circuit under test does not meet the design requirements and the verification process is interrupted.

[0027] The interface layer connects the input port and output port of the circuit under test with the verification platform; and is defined according to the input and output ports required by the design of the circuit under test.

[0028] A further improvement of the above scheme is that: the driver takes out the byte queue in the STEP transaction, converts it into a pin-level signal and sends it to the input port of the circuit to be tested through the interface layer; the reference model receives the STEP transaction transmitted by the driver through uvm_tlm_analysis_fifo, and takes out the various parts of the FAST message data and combines them into the expected output through the field information in the transaction.

[0029] The above solution is further improved in that: the field information of the STEP protocol and the FAST message template in the Level-2 market is retained in the STEP transaction; with the help of the field information, the FAST message data as the message body in the STEP transaction can be directly used as the expected output.

[0030] The UVM-based Level-2 market decoding circuit verification stimulus generation method provided by the present invention can generate verification stimuli that conform to the Level-2 market definition specification, and can assist verification personnel in quickly building a verification platform for the Level-2 market decoding circuit. This stimulus generation method can generate a transaction containing an expected output, simplifying the implementation process of the reference model. The reference model only needs to locate the part of the message body in the STEP transaction and take it out to serve as the expected output of the scoreboard. At the same time, this stimulus generation method can simplify the process of the driver driving the transaction into a pin-level signal, and the first byte sequence can be directly driven by the driver to the input end of the circuit to be tested. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The present invention will be further described below in conjunction with the accompanying drawings.

[0032] Figure 1 : Schematic diagram of the FAST message class definition structure.

[0033] Figure 2 : Schematic diagram of STEP transaction definition structure.

[0034] Figure 3:Flowchart of the UVM-based Level-2 market decoding hardware circuit verification stimulus generation method.

[0035] Figure 4 : Schematic diagram of the verification platform structure. DETAILED DESCRIPTION Example

[0036] The UVM-based Level-2 market decoding circuit verification incentive generation method of this embodiment is as follows: Figure 3 As shown, the following steps are included:

[0037] S1: uvm_test starts a verification case and uses uvm_do to make the sequence generator start generating stimulus, which is a STEP transaction. The STEP transaction selects to instantiate a FAST message class.

[0038] S2: FAST message class randomizes the existence bitmap sequence 101 and the FAST message template 102; the existence bitmap sequence 101 is pushed into the byte queue 103; according to the randomized existence bitmap sequence, it is determined which field in the FAST message template is pushed into the byte queue 103;

[0039] S3: The STEP header template 205 generates a message header and pushes the message header into the byte queue 204;

[0040] S4: Instantiate FAST message 203 and push byte queue 103 into byte queue 204 as the message body;

[0041] S5: The STEP tail template 206 generates a message tail and pushes the message tail into the byte queue 204.

[0042] Among them, the FAST message class definition structure is as follows Figure 1 As shown. The FAST message class includes a bitmap sequence 101, a FAST message template 102, a byte queue 103, and a FAST data write module 104. Among them, the length of the bitmap sequence 101 is consistent with the number of fields in the FAST message template 102, and the sequence corresponds to the field one by one. The bitmap sequence 101 is used to indicate whether the corresponding field in the FAST message template 102 is pressed into the byte queue, and whether it is written to the local file by the FAST data write module 104, and its content is divided into two states: valid and invalid. Each field in the FAST message template 102 is a random value, and each field has constraints that comply with the exchange specifications.

[0043] The internal definition structure of STEP transaction is as follows Figure 2As shown. A STEP transaction inherits from the uvm_sequence_item base class, including several defined FAST message classes, selection instantiation 201, weight control 202, instantiated FAST message 203, byte queue 204, STEP header template 205, and STEP tail template 206. Among them, the selection instantiation 201 will instantiate the FAST message class of the specified proportion according to the weight control 202. Each instantiation operation only selects one FAST message class for instantiation, and exists in the STEP transaction as an instantiated FAST message class 203. The byte queue 204 consists of three parts, namely, a message header, a message body, and a message tail. The data generated by the STEP header template 205 is first pressed into the byte queue 204 as a message header, and then the byte queue 103 in the instantiated FAST message 203 is pressed into the byte queue 204 as a message body, and finally the data generated by the STEP tail template 205 is pressed into the byte queue 204 as a message tail.

[0044] Specifically, the post_randomize function in the STEP transaction completes the process of pushing the message header, message body and message tail into the byte queue 204, and the execution process is triggered by uvm_do in uvm_test. The STEP transaction generates the message header and message tail in accordance with the STEP protocol with string type definition, ensuring that they are in ASCII encoding when pushed into the byte queue.

[0045] The verification platform of this embodiment, such as Figure 4 As shown, the internal components include: uvm_test401, sequence generator 402 and environment component 403. Among them, the environment component 403 includes: input agent 404, reference model 405, scoreboard 406, output agent 407. The input agent 404 includes a sequence initiator 408 and a driver 409. The output agent 407 includes a monitor 410. uvm_test401 and the circuit under test 411 are implemented in the top-level file.

[0046] The sequence generator 402 is connected to the sequence initiator 408. The sequence initiator 408 is connected to the driver 409. The driver 409 is connected to the input of the circuit under test 411 through the interface layer, and is connected to the reference model 405 in another way. The output of the reference model 405 is connected to the scoreboard 406. The output of the circuit under test 411 is connected to the monitor 410 through the interface layer. The output of the monitor 410 is connected to the scoreboard 406.

[0047] uvm_test 401 configures different verification cases for environment component 403. Sequence generator 402 generates stimulus of corresponding message type according to the configured verification cases.

[0048] The STEP transaction generated by the sequence generator 402 is sent to the driver 409 via the sequence initiator 408. The driver 409 takes out the byte queue 204 in the STEP transaction, processes it into a pin-level signal, and sends it to the circuit under test 411 through the interface layer. At the same time, the driver 409 copies the STEP transaction and sends it to the reference model 405. The reference model 405 extracts the FAST message part from the STEP transaction as the expected output and sends it to the scoreboard 406. The monitor 410 collects the output of the circuit under test 411 and sends it to the scoreboard 406 as the actual output. The scoreboard 406 compares the expected output with the actual output to determine whether the function of the circuit under test is correct.

[0049] The communication mode between the driver 409 and the reference model 405 , the reference model 405 and the scoreboard 406 , and the monitor 410 and the scoreboard 406 is transaction-level communication, and they are connected through uvm_tlm_analysis_fifo.

[0050] The STEP transaction and FAST message classes have the function of writing the currently generated message data to a local file; the written message data is the state before being pushed into the byte queue, that is, it is presented in plain text. It can be used as a reference for manual interpretation.

[0051] Specifically, when the circuit to be tested 411 is verified using the verification platform, the sequence generator 402 will cyclically generate multiple random excitations, i.e., multiple STEP transactions. The weight control 202 will cause each STEP transaction generated to instantiate different FAST message classes, i.e., generate Level-2 market data of different message types, thereby realizing the verification of different message types. The FAST message class instantiated in the STEP transaction will press the random value of the valid field into the byte queue 103 according to the indication of the randomized existence bitmap sequence 101, and become the message body part of the byte queue 204. When the same FAST message class is instantiated multiple times, each message class will randomly generate a different existence bitmap sequence 101, and the type and number of valid fields will also change accordingly, thereby realizing the verification of different field combinations under the same message type. Therefore, it is only necessary to increase the number of cycles of the sequence generator 402 to generate random excitations, so as to gradually cover the verification scenarios of market data of different message types and market data of different field combinations of the same message.

[0052] The present invention is not limited to the above embodiments. Any technical solution formed by equivalent replacement falls within the protection scope required by the present invention.

Claims

1. A UVM-based Level-2 market decoding circuit verification stimulus generation method, characterized in that: The steps include: (1) uvm_test starts a verification case and uses uvm_do to make the sequence generator start generating a STEP transaction; the STEP transaction selects and instantiates a FAST message class; the FAST message class contains fields that correspond to the existence bitmap sequence and the sequence of the existence bitmap sequence; (2) The FAST message class randomizes the existence bitmap sequence and fields; the existence bitmap sequence is pushed into the second byte queue; the corresponding fields marked as valid in the existence bitmap sequence are pushed into the second byte queue; (3) The STEP transaction generates a message header and pushes it into the first byte queue; (4) The STEP transaction takes out the second byte queue in the FAST message class and pushes it into the first byte queue; (5) The STEP transaction generates a message tail and pushes it into the first byte queue.

2. The UVM-based Level-2 market decoding circuit verification incentive generation method according to claim 1, characterized in that: The STEP transaction inherits from the uvm_sequence_item base class, and internally generates a message header and a message tail that conform to the STEP protocol using string type definitions to ensure that they are in ASCII encoding when pushed into the byte queue; the first byte queue in the STEP transaction is used to store and pass the message header, message body and message tail to the driver.

3. The UVM-based Level-2 market decoding circuit verification incentive generation method according to claim 1, characterized in that: The FAST message class defines a random type existence bitmap sequence and a specific FAST message template; the FAST message template is composed of various field variables corresponding to the template, and each field variable is of a random type; each field variable in the FAST message template has constraints that comply with exchange specifications; the FAST message class will be instantiated in the STEP transaction to generate a randomized message body.

4. The UVM-based Level-2 market decoding circuit verification incentive generation method according to claim 1, characterized in that: The STEP transaction and FAST message classes have the function of writing the currently generated message data to a local file. The written message data is the state before being pushed into the byte queue, that is, it is presented in plain text and can be used as a reference for manual interpretation.

5. A verification platform for the UVM-based Level-2 market decoding circuit verification incentive generation method according to claim 1, characterized in that: include: uvm_test, sequencer and environment components; The uvm_test is responsible for configuring different verification cases and opening the sequence generator of the corresponding verification cases; and using this as the root node to instantiate each component of the verification platform according to the uvm tree hierarchy; The sequence generator generates corresponding random stimulus, i.e., STEP transaction, according to the verification case configured by uvm_test; The environment components include an input agent, an output agent, a reference model, and a scoreboard; The input agent is instantiated in the environment component, including a sequence initiator and a driver; The sequence initiator is responsible for passing the STEP transaction generated by the sequence generator to the driver; The driver receives the STEP transaction transmitted by the sequence initiator, and transmits the message data contained in the STEP transaction to the input port of the circuit under test and the reference model through the interface layer; The output agent is instantiated in an environment component, including a monitor; The monitor receives the pin-level signal output by the circuit under test through the interface layer, converts it into a transaction, and sends it to the scoreboard as an actual output; The reference model extracts FAST message data from the STEP transaction generated by the sequence generator and sends it to the scoreboard as expected output; The scoreboard compares the expected output with the actual output to see if they are consistent. If they are consistent, it is determined that the function of the circuit under test meets the design requirements. Otherwise, it is determined that the function of the circuit under test does not meet the design requirements and the verification process is interrupted; The interface layer connects the input port and output port of the circuit to be tested with the verification platform; Define the input and output ports according to the design requirements of the circuit to be tested.

6. The verification platform according to claim 5, characterized in that: The driver takes out the byte queue in the STEP transaction, converts it into a pin-level signal and sends it to the input port of the circuit to be tested through the interface layer; the reference model receives the STEP transaction transmitted by the driver through uvm_tlm_analysis_fifo, and takes out the various parts of the FAST message data and combines them into the expected output through the field information in the transaction.

7. The verification platform according to claim 5, characterized in that: The STEP transaction retains the field information of the STEP protocol and FAST message template in the Level-2 market. With the help of the field information, the FAST message data as the message body in the STEP transaction can be directly used as the expected output.