Chip function test optimization method and system based on FC protocol time sequence level modeling
Through the timing level modeling method based on the FC protocol, the port state machine and credit management model is constructed to monitor the DUT behavior in real time, which solves the problem that the verification IP in the existing technology cannot directly detect the chip internal protocol layer state machine and credit management, and improves Improve the accuracy and coverage of chip testing.
Patent Information
- Application Number
- CN202410759961.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-15
AI Technical Summary
Existing chip function verification IP cannot directly verify the behavior of the DUT's internal protocol state machine jumps, pipelines, and internal queues, resulting in insufficient verification granularity and inability to effectively detect the correctness of the chip's internal protocol layer.
The timing-level modeling method based on the FC protocol is used to build the port state machine model and credit management model. Through dynamic simulation and parallel assertion modeling, the DUT port state machine and credit management behavior are monitored in real time, and the System Verilog language is used for model verification. , improve the accuracy and coverage of verification.
It achieves accurate monitoring and verification of DUT protocol layer behavior, makes up for the limitations of verification IP, improves the accuracy and quality of chip testing, and shortens the development cycle.
Smart Images

Figure CN118779172A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip testing technology, and in particular to a chip function testing optimization method and system based on FC protocol timing level modeling. Background Art
[0002] The DUT (Design under Test) plays a very important role in chip testing, and usually refers to the functional units of the chip, such as memory, on-chip microcontroller, etc. After the design is completed, the functional units of the chip need to be tested to verify their correctness and stability. In chip testing, the DUT will be connected to the test equipment and undergo a series of tests, such as electrical parameter testing, logic function testing, failure mode testing, etc., to ensure the quality and reliability of the chip. With the continuous development of chip design, the methods for testing DUT are also evolving. Modern chip testing methods include both traditional external testing methods and advanced internal testing methods. For example, in the internal testing method, the test communicates with the DUT according to a fixed test procedure to detect the internal operating status of the chip, data transmission speed, and data transmission quality.
[0003] In the functional verification of dedicated chips, more and more verification IPs are used in the chip development process, greatly shortening the chip development time. Taking the Fibre Channel (FC) protocol verification IP as an example, the verification IP integrates the protocol layers such as the physical layer, data link layer and data transmission layer, which is convenient for the verifier to verify at the granularity of the FC protocol layer. The verification IP inputs stimulus to the DUT, and the verification IP checks whether the response returned by the DUT conforms to the protocol layer behavior to report errors, thereby accelerating the development of protocol functions. Since the existing verification IP is serially connected to the DUT design, the DUT protocol data is passed to the verification IP level by level through the protocol layer. In this way, the verification IP can verify the correctness of the protocol layer data verification, but the internal protocol verification of the DUT cannot be directly verified. For example, the verification IP cannot check the behavior of the DUT protocol layer state machine jump, pipeline, internal queue, etc., which requires the establishment of a model to monitor the DUT behavior in real time to make up for the limitations of the verification IP. Summary of the invention
[0004] To this end, the present invention provides a chip function test optimization method and system based on FC protocol timing level modeling, which makes up for the limitations of existing verification IP in chip function verification testing, monitors the behavior of internal components of the design under test through assertion modeling, verifies the protocol behavior data of the design under test DUT at the granularity of the timing level, and improves the accuracy and quality of the target chip test.
[0005] According to the design scheme provided by the present invention, on the one hand, a chip function test optimization method based on FC protocol timing level modeling is provided, comprising:
[0006] Constructing an FC port state machine model and an FC credit management model, and inserting the FC port state machine model and the FC credit management model into the DUT to be tested as probes, wherein the FC port state machine model is used to check whether the port state machine behavior of the DUT to be tested is correct through dynamic simulation, and the FC credit management model is used to check whether the credit management behavior of the DUT to be tested is correct through dynamic simulation;
[0007] On the verification simulation platform, establish a connection between the verification IP and the DUT to be tested, use the test sequence provided by the verification IP to test the correctness of the physical layer and link layer protocol data of the DUT to be tested, and trigger the probe during the test to monitor the transport layer port state machine and credit management behavior of the DUT to be tested in real time.
[0008] As a chip function test optimization method based on FC protocol timing level modeling of the present invention, further, an FC port state machine model is constructed, including:
[0009] Using a hardware description verification language to set the behavior content of a port state machine in the DUT under test, wherein the set behavior content of the port state machine includes an input event signal, an output event signal, and a port state machine;
[0010] The event signal and the actual state of the port state machine are used for modeling to bind the FC port state machine model with the port state machine in the DUT under test.
[0011] As a chip function test optimization method based on FC protocol timing level modeling of the present invention, further, modeling is performed using event signals and actual states of port state machines, including:
[0012] Use parallel assertions to model a common state transition model, and set an enumeration type for simulating the state of the state machine and a checker model for judging whether the state machine of the DUT port under test meets the expected state of the current trigger input;
[0013] A state machine state checker model and a coverage check model of the corresponding state checker are instantiated based on a common state transition model, a state machine enumeration type and a checker.
[0014] As a chip function test optimization method based on FC protocol timing level modeling of the present invention, further, an FC credit management model is constructed, including:
[0015] The credit management port of the DUT under test is modeled through parallel assertions, the credit management assertion model is bound to the credit management of the DUT under test, and the credit management assertion model is used to check the correctness of credit compensation recovery when the credit is reduced under abnormal scenarios. The credit management of the DUT under test uses data frames and R-RDY primitive signals between the sending end and the receiving end to dynamically manage the credit.
[0016] As a chip function test optimization method based on FC protocol timing level modeling of the present invention, further, the credit management port of the DUT under test is modeled by parallel assertion, including:
[0017] Constructing a lost credit period compensation count sequence;
[0018] Using the lost credit cycle compensation count sequence in the BB-SCs and BB-SCr primitive signals in conjunction with the counter to compensate for the lost credit recovery process and counting the credit loss recovery value based on the system clock cycle;
[0019] Instantiate the assertion model, use the assertion model to check whether the lost credit cycle compensation count sequence during credit recovery is correct, and collect assertion coverage to ensure the completeness of verification.
[0020] As a chip function test optimization method based on FC protocol timing level modeling of the present invention, further, the credit management port of the DUT under test is modeled by parallel assertion, and it also includes:
[0021] For each abnormal scenario, a corresponding lost credit periodic compensation count sequence and assertion model are constructed respectively, so as to monitor the credit management behavior under each abnormal scenario by using the corresponding lost credit periodic compensation count sequence and assertion model.
[0022] As a chip function test optimization method based on FC protocol timing level modeling of the present invention, further, the abnormal scenario includes a frame loss scenario and an R-RDY loss scenario caused by link bit errors.
[0023] On the other hand, the present invention also provides a chip function test optimization system based on FC protocol timing level modeling, comprising: a modeling module and a test module, wherein:
[0024] A modeling module, used for constructing an FC port state machine model and an FC credit management model, and inserting the FC port state machine model and the FC credit management model into the DUT to be tested as probes, wherein the FC port state machine model is used for checking whether the port state machine behavior of the DUT to be tested is correct through dynamic simulation, and the FC credit management model is used for checking whether the credit management behavior of the DUT to be tested is correct through dynamic simulation;
[0025] The test module establishes the connection relationship between the verification IP and the DUT under test on the verification simulation platform, uses the test sequence provided by the verification IP to test the correctness of the physical layer and link layer protocol data of the DUT under test, and triggers the probe during the test to monitor the transport layer port state machine and credit management behavior of the DUT under test in real time.
[0026] Beneficial effects of the present invention:
[0027] The present invention can use concurrent assertions in System Verilog language to model FC port state machine model and FC credit management model, so as to insert these models into the monitored module as probes. When the test stimulus sent by the verification IP acts on the DUT, the probe is used to monitor in real time whether the protocol behavior of the protocol layer is correct. At the same time, the cover attribute of the assertion can be used to enable the simulator to collect the coverage of the inspection object, improve the coverage collection effect of the target chip function verification, improve the test accuracy and instructions of the target chip, and have a good application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of the chip function test optimization process based on FC protocol timing level modeling in the embodiment;
[0029] Figure 2 This is a schematic diagram of the FC protocol timing level model architecture in the embodiment;
[0030] Figure 3 It is a schematic diagram of the port state machine model and the port state machine structure in the DUT in the embodiment;
[0031] Figure 4 This is a schematic diagram of the credit management function in the DUT in the embodiment;
[0032] Figure 5 It is a schematic diagram of the credit management model and DUT credit management in the embodiment;
[0033] Figure 6 This is an illustration of FC verifying IP replacing R_RDY and frame header in the embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present invention clearer and more understandable, the present invention is further described in detail below in conjunction with the accompanying drawings and technical solutions.
[0035] In view of the shortcomings of the Fibre Channel (FC) protocol verification IP in the existing chip function test, the embodiments of the present invention refer to Figure 1 As shown, a chip function test optimization method based on FC protocol timing level modeling is provided, comprising:
[0036] S101. Construct an FC port state machine model and an FC credit management model, and insert the FC port state machine model and the FC credit management model into the DUT to be tested as probes. The FC port state machine model is used to check whether the port state machine behavior of the DUT to be tested is correct through dynamic simulation, and the FC credit management model is used to check whether the credit management behavior of the DUT to be tested is correct through dynamic simulation.
[0037] The FC protocol layers in DUT are transport layer, link layer and physical layer. Figure 2 As shown, in the embodiment of this case, by constructing a credit management assertion model and a port state machine assertion model, during the dynamic simulation process, the port state machine assertion model and the credit management assertion model are used to check whether the port state machine and credit management behavior of the transport layer are correct, so as to make up for the defect that the FC verification IP cannot be directly checked.
[0038] Specifically, the FC port state machine model is constructed and can be designed to include:
[0039] Using a hardware description verification language to set the behavior content of a port state machine in the design under test (DUT), wherein the set behavior content of the port state machine includes an input event signal, an output event signal, and a port state machine;
[0040] The event signal and the actual state of the port state machine are used for modeling to bind the FC port state machine model with the port state machine in the design under test (DUT).
[0041] Among them, modeling using event signals and the actual state of the port state machine may include:
[0042] Use parallel assertions to model a common state transition model, and set an enumeration type for simulating the state of the state machine and a checker model for judging whether the state machine of the DUT port under test meets the expected state of the current trigger input;
[0043] A state machine state checker model and a coverage check model of the corresponding state checker are instantiated based on a common state transition model, a state machine enumeration type and a checker.
[0044] The FC port state machine is an important part of the transport layer. It is mainly responsible for indicating the current link status, controlling the online / offline status of the local node, and interacting with the endpoint through primitive sequences or primitive signals to implement Fibre Channel link initialization. As shown in Table 1, the port state machine will jump to the next state according to the current state under the influence of input events, and the corresponding primitive sequence needs to be issued in the current state.
[0045] Table 1 Port state machine
[0046]
[0047]
[0048] Figure 3 The port state machine of the DUT transport layer uses Verilog language to "translate" the behavior of the port state machine in Table 1. The content structure includes input event signals, output event signals and state machines. Figure 2 The port state machine model in Table 1 uses the assertion language to describe the behavior of the port state machine. The content structure includes the enumeration type state machine, the public assertion model state_transfer, and the instantiated assertion state machine. After the FC verification IP applies the stimulus, the instantiated assertion state machine model can check in real time whether the relationship between signals and the state of the state machine are correct during the entire simulation process.
[0049] Since the port state machine model is bound to the port state machine in the dut, the port state machine port signals (such as Figure 3 The event signal shown in ) and the actual state of the state machine in the DUT ( Figure 3 The model is modeled by the state machine state output by the DUT state machine module shown in FIG. 1 . Combined with Table 1 and FIG. 2 , the specific modeling process can be described as follows:
[0050] 1) Use system Verilog to define enumerated port status typedef enum{AC, LR1, LR2, LR3...OL3}
[0051] fc_port_state( Figure 3 The enumerated state machine shown in );
[0052] 2) Define the input event trigger signal signal_trigger equal to {lr, lrr...idle};
[0053] 3) Use system Verilog assertions to model the public state jump model state_transfer:
[0054] property state_transfer(cur_state, signal_trigger, next_state); / / Start of property block
[0055] fc_port_state expect_state, where the enumeration type is defined to simulate the state of the state machine;
[0056] @(posedge clk)disable_iff(reset==0), here the reset phase check is disabled;
[0057] (signal_trigger&(dut_state==cur_state),expect_state=next_state)
[0058] |=>dut_state==expect_state; This checker means that when the event trigger signal signal_trigger and the dut state machine are equal to the current input parameter cur_state state, the first sequence takes effect, and the expect_state variable obtains the expected correct next_state state); the next clock cycle determines whether the dut state machine is equal to the expected expect_state;
[0059] 4) Instantiate the assertion state machine. Taking the transition from the Active state to the LR2 state in Table 1 as an example, a state transition model ac_transfer_lr2 is constructed as follows:
[0060] Instantiate check check_state_ac_transfer_lr2: assert property(state_transfer(AC, only LR event triggered, LR2)) else$error("error state jump");
[0061] The meaning of this checker is that when the current dut state machine state is equal to the current input AC state, event LR2 occurs, and the expect_state variable obtains the expected correct LR2 state. After 1 clk cycle, it checks whether the dut state machine state is equal to LR2. If they are equal, it will succeed, otherwise an error prompt will be printed.
[0062] ac_transfer_lr2 also includes coverage check of the jump from Active state to LR2 state, as shown below:
[0063] Coverage check instantiation: c_check_state_ac_transfer_lr2: cover property(state_transfer(AC, only LR event triggered, LR2));
[0064] The meaning of coverage checker is that the coverage check will count how many attempts were made, how many succeeded, how many failed, etc. at the end of the simulation.
[0065] 5) The jump assertion simulation of other states in Table 1 is similar to the process of instantiating ac_transfer_lr2, so that all state machine jump behaviors can be realized.
[0066] Cache-to-cache flow control is available in Figure 2 The DUT is managed by the credit management module, and the credit management module mainly uses Figure 4 As shown, credit management is accomplished through signals such as a credit counter (bb_credit_cnt), a sent R_RDY counter (tra_bb_r_rdy_cnt), a sent frame counter (tra_bb_frame_cnt), a received R_RDY counter (rec_bb_r_rdy_cnt), a received frame unreturned R_RDY counter (rec_bb_frm_cnt), a primitive signal BB_SCs, and a primitive signal BB_SCr. Among them, R-RDY represents a confirmation signal on the sending port, and BB-SC represents a buffer-to-buffer status change signal on the sending port. Buffer-to-buffer status change-R-RDY (i.e., BB-SCr primitive signal) is transmitted periodically to enable the attached port to determine whether any R-RDY is lost; buffer-to-buffer status change-frame start SOF (i.e., BB-SCs primitive signal) is transmitted to enable the attached port to determine whether any frame is lost.
[0067] Table 2 Primitive signal functions in the credit management module
[0068]
[0069] Figure 4 The function in is to realize the dynamic management of credit by using the R_RDY primitive signal in the credit management module of Table 2 in conjunction with the data frame. The specific process can be described as follows:
[0070] The transmitter A sends a data frame to the receiver B, bb_credit_cnt increases by 1, indicating that the available buffer on the B side is reduced by 1, and the sending frame counter tra_bb_frame_cnt increases by 1; after the receiver B receives this data frame, it will feedback a primitive signal R_RDY; when the receiver A receives this primitive signal R_RDY, the received R_RDY counter rec_bb_r_rdy_cnt increases by 1, and bb_credit_cnt decreases by 1, thus maintaining the dynamic balance of the bb_credit_cnt count.
[0071] When the frame loss or R_RDY loss caused by bit errors in the link leads to a reduction in credit (bb_credit_cnt imbalance), the BB_SCs and BB_SCr primitive signals in the credit management module in Table 2 need to cooperate with the counter to compensate for the lost credit, thereby restoring the credit. The credit management assertion model in this embodiment mainly checks whether the recovery process after the credit is reduced in an abnormal scenario is correct. Specifically, the FC credit management model can be designed to include the following content:
[0072] The credit management port of the DUT under test is modeled through parallel assertions, the credit management assertion model is bound to the credit management of the DUT under test, and the credit management assertion model is used to check the correctness of credit compensation recovery when the credit is reduced under abnormal scenarios. The credit management of the DUT under test uses data frames and R-RDY primitive signals between the sending end and the receiving end to dynamically manage the credit.
[0073] Among them, the credit management port of the DUT under test is modeled through parallel assertions, which can be designed to include:
[0074] Constructing a lost credit period compensation count sequence;
[0075] Using the lost credit cycle compensation count sequence in the BB-SCs and BB-SCr primitive signals in conjunction with the counter to compensate for the lost credit recovery process and counting the credit loss recovery value based on adjacent clock cycles;
[0076] The assertion model is used to check whether the count sequence of lost credit cycle compensation during credit recovery is correct, and the assertion model and assertion coverage are instantiated.
[0077] For each abnormal scenario, a corresponding lost credit periodic compensation count sequence and assertion model are constructed respectively, so as to monitor the credit management behavior under each abnormal scenario by using the corresponding lost credit periodic compensation count sequence and assertion model. The abnormal scenario may include a frame loss scenario caused by link bit error and an R-RDY loss scenario.
[0078] like Figure 5 As shown in the figure, the credit management assertion model is bound to the credit management of the DUT under test, and the DUT credit management port signal can be directly used for modeling. The credit management assertion modeling process for each abnormal scenario can be described as follows:
[0079] 1. In the scenario where the local end loses r_rdy, the credit assertion model construction process is as follows:
[0080] 1) Construct the lost sequence r_rdy_lost of r_rdy:
[0081] sequence r_rdy_lost;
[0082] (rec_bb_r_rdy_cnt===0)&&($past(bb_credit_lost,1)==(2**bb_sc_n-$past(rec_bb_r_rdy_cnt,1) / (2**bb_sc_n))##1(bb_credit_cnt==$past(bb_credit_cnt,1)-$past(bb_credit_lost,2));
[0083] endseuence
[0084] When receiving the BB_SCr primitive signal, the assertion model calculates the number of lost r_rdy BB_Credits_lost local =mod(2 BB_SC_N -rec_bb_r_rdy_cnt,2 BB_SC_N ) process is as follows:
[0085] a) The r_rdy_lost sequence expresses that when bb_scr is received, the number of lost r_rdy is immediately calculated at the first clock edge (represented by the bb_credit_lost signal in dut);
[0086] b) Rec_bb_r_rdy_cnt is cleared at the second clock edge, and $past(bb_credit_lost, 1) is checked to see if the value of the first clock cycle is equal to the number of lost r_rdy (2**bb_sc_n-$past(rec_bb_r_rdy_cnt,
[0087] 1) / (2**bb_sc_n): $past(rec_bb_r_rdy_cnt, 1) the value at the first clock);
[0088] c) In the third clock cycle, check whether the value of the credit bb_credit_cnt is less than the credit lost by the local end;
[0089] $past(bb_credit_cnt,1) represents the value of bb_credit_cnt in the second clock cycle, that is, the value before the credit is restored; and $past(bb_credit_lost,2) represents the value of bb_credit_lost in the first clock cycle, that is, the value of lost credit. The value calculated by $past(bb_credit_cnt,1) minus $past(bb_credit_lost,2) represents the value of bb_credit_cnt before the credit is restored minus the value of lost credit of bb_credit_lost.
[0090] 2) The local_credit_lost assertion is modeled as follows:
[0091] property local_credit_lost;
[0092] @(posedge clk)disable iff(reset==0||bb_sc_n==0)
[0093] (bb_scr)|=>(no_receive_r_rdy&&no_send_frame)throughout r_rdy_lost;
[0094] endproperty:local_credit_lost
[0095] The local_credit_lost assertion indicates that when reset and bb_sc_n=0 are masked, as long as the BB_SCr primitive signal is received, the next clock cycle will be triggered to check whether the operator is successful during credit recovery (no_receive_r_rdy&&no_send_frame)throughout r_rdy_lost; (no_receive_r_rdy&&no_send_frame)throughout indicates whether the r_rdy_lost sequence can be successful regardless of the newly received r_rdy and sent data frames.
[0096] 3) Instantiation Assertions and Assertion Coverage:
[0097] Instantiate local_credit_lost: check_r_rdy_lost:assert property(local_credit_lost);
[0098] cover instantiate local_credit_lost:cov_local_credit_lost:cover property(local_credit_lost);
[0099] 2. In the scenario of remote data frame loss, the credit management assertion modeling process is as follows:
[0100] 1) Construct the data frame loss sequence lost_frame_seq:
[0101] sequence lost_frame_seq
[0102] frame_bb_lost==rec_bb_frame_cnt==0&&(2**bb_sc_n-$past(rec_bb_frame_cnt,1)) / (2**bb_sc_n);
[0103] endsequence
[0104] When receiving the BB_SCs primitive signal scenario, the assertion model calculates the number of r_rdy sent, BB_Credits_lost remote =mod(2 BB_SC_N -rec_bb_frm_cnt,2 BB_SC_N )The process is as follows:
[0105] a) The lost_frame_seq sequence indicates that the BB_SCs primitive signal is received. In the first clock cycle, the number of lost data frames is immediately calculated to be equal to frame_bb_lost (the number of lost data frames in dut is represented by frame_bb_lost);
[0106] b) In the second clock cycle, rec_bb_frame_cnt is cleared and frame_bb_lost is checked to see if it is equal to the assertion operator (2**bb_sc_n-$past(rec_bb_frame_cnt,1)) / (2**bb_sc_n).
[0107] And (2**bb_sc_n-$past(rec_bb_frame_cnt,1)) / (2**bb_sc_n) indicates that the assertion operator calculates the number of lost data frames.
[0108] 2) The remote_credit_lost assertion is modeled as follows:
[0109] property remote_credit_lost;
[0110] @(posedge clk)disable iff(reset==0||bb_sc_n==0)
[0111] (bb_scs)|=>lost_frame_seq;
[0112] endproperty:remote_credit_lost
[0113] The remote_credit_lost assertion indicates that after receiving the BB_SCs primitive signal, the next clock cycle checks whether the lost_frame_seq sequence is successful.
[0114] 3) Assertions and assertion coverage instantiation:
[0115] Instantiate remote_credit_lost: check_remote_credit_lost:assert property(remote_credit_lost);
[0116] Override instantiate remote_credit_lost:cov_remote_credit_lost:cover property(remote_credit_lost);
[0117] 3. In the scenario of remote credit loss, the credit management recovery assertion modeling process is as follows:
[0118] 1) Build the lost_frame_recover sequence:
[0119] sequence lost_frame_recover
[0120] frame_bb_lost==$past(frame_bb_lost,1)-1;
[0121] endsequence
[0122] The lost_frame_recover sequence indicates that the frame_bb_lost lost credit is compensated one clock cycle at a time.
[0123] 2) The lost credit recovery assertion is modeled as follows:
[0124] property remote_credit_recover;
[0125] @(posedge clk)disable iff(reset==0||bb_sc_n==0)
[0126] (no_bb_scs)&(lost_frame_rdy)&(frame_bb_lost!=0)|=>lost_frame_recover;
[0127] endproperty:remote_credit_recover
[0128] The remote_credit_recover assertion indicates that when there is no new input bb_scs (indicated by the no_bb_scs signal), and the compensation signal sent by the control end (indicated by the lost_frame_rdy signal) is valid, and the frame_bb_lost signal is greater than 0, the three conditions are met at the same time, and the lost_frame_recover sequence is checked in the next clock cycle to see if it is successful.
[0129] 3) Assertions and assertion coverage instantiation:
[0130] Instantiate remote_credit_recover:
[0131] check_remote_credit_recover:assert property(remote_credit_recover);
[0132] Override instantiation remote_credit_recover: cov_remote_credit_recover: coverproperty(remote_credit_recover)
[0133] S102. On the verification simulation platform, establish a connection relationship between the verification IP and the DUT to be tested, use the test sequence provided by the verification IP to test the correctness of the physical layer and link layer protocol data of the DUT to be tested, and trigger the probe during the test to monitor the transport layer port state machine and credit management behavior of the DUT to be tested in real time.
[0134] In the FC verification IP environment, connect the FC port state machine model and the FC credit management model to the module to be verified; input stimulus to the DUT through the FC verification IP, and the FC port state machine model checks whether the port state machine of the DUT can jump normally and whether the state machine jump is covered by the coverage statistics at the end of the simulation; for example, after the FC verification IP performs linkreset, the port state machine of the FC verification IP jumps from the active state to LR2, and the FC verification IP port state machine will issue LRR in the LR2 state; the DUT state machine is in the active state and receives LRR, so that the DUT jumps from the active state to LR3. If the DUT state machine jump does not meet the expected LR3 state of the port state machine model, an error message will be reported.
[0135] For example, the bb_sc_n of the FC authentication IP is configured as 4, indicating that the maximum buffer amount allocated to the port is 16 (parameter bb_credit = 2 BB_SC_N );like Figure 6 As shown, the FC verification IP can be replaced to send the R_RDY primitive signal, thereby achieving the purpose of "false" loss of r_rdy; for example, 13 R_RDYs are actually lost in the FC verification IP. The number of R_RDYs sent by the FC verification IP accumulates to 2 BB_SC_N Then send 1 BB_SCr.
[0136] When the BB_SCr primitive signal is received, the actual dut's rec_bb_r_rdy_cnt=3, the assertion rec_bb_r_rdy_cnt is cleared, the dut calculates the number of lost r_rdy bb_credit_lost=13, and at the same time, the dut's credit counter bb_credit_cnt subtracts the credit bb_credit_lost lost on this end. At the same time, the assertion model will also check whether these signals meet the above calculation process in terms of timing. If they do not meet the assertion calculation process, the assertion model will have an assertion failure prompt.
[0137] In order to construct the FC verification IP sent frame loss scenario, it is necessary to force the FC verification IP to drop a part of the frame, so as to verify whether the credit recovery of the DUT receiving end is normal after receiving the BB_SCs primitive signal. For example, the bb_sc_n of the FC verification IP is configured as 4, indicating that the maximum buffer amount allocated to a single port in the switch is 16 (parameter bb_credit=2 BB _SC_N );like Figure 5As shown in the figure, the FC verification IP rewrites part of the data frame header sof to an illegal value during the data frame transmission process, so that the DUT's rec_bb_frame_cnt does not count because the input data frame header value is illegal; for example, the FC verification IP actually modifies the sof of 8 data frames. The FC verification IP sends frame data up to 2 BB_SC_N Then send 1 BB_SCs.
[0138] When receiving the BB_SCs primitive signal, the DUT calculates that it should increase the number of r_rdy sent to frame_bb_lost = 2**bb_sc_n-rec_bb_frame_cnt(8) = 8. The assertion starts from receiving BB_SCs to check whether the number of r_rdy sent for compensation is correct. The assertion of credit recovery starts from the lost_frame_rdy pulse trigger to check whether frame_bb_lost is reduced by 1 in sequence according to the compensation number requirement.
[0139] This solution can directly check the DUT behavior at the signal level for credit management and port state machine functions during the FC protocol layer verification process, and report unreasonable timing signals during the simulation process, thereby accelerating the verifier's positioning and analysis of protocol layer function verification; at the same time, the coverage attribute of the assertion can guide the verifier's protocol function coverage, and write direct test cases to cover some codes that are difficult to cover and prone to design errors; at the same time, the assertion model supports portability and reusability, which can shorten the project development cycle.
[0140] Furthermore, based on the above method, an embodiment of the present invention also provides a chip function test optimization system based on FC protocol timing level modeling, comprising: a modeling module and a test module, wherein:
[0141] A modeling module, used for constructing an FC port state machine model and an FC credit management model, and inserting the FC port state machine model and the FC credit management model into the DUT to be tested as probes, wherein the FC port state machine model is used for checking whether the port state machine behavior of the DUT to be tested is correct through dynamic simulation, and the FC credit management model is used for checking whether the credit management behavior of the DUT to be tested is correct through dynamic simulation;
[0142] The test module establishes the connection relationship between the verification IP and the DUT under test on the verification simulation platform, uses the test sequence provided by the verification IP to test the correctness of the physical layer and link layer protocol data of the DUT under test, and triggers the probe during the test to monitor the transport layer port state machine and credit management behavior of the DUT under test in real time.
[0143] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0144] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0145] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.
[0146] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits, and accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present invention is not limited to any specific form of combination of hardware and software.
[0147] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A chip function test optimization method based on FC protocol timing level modeling, characterized in that: Include: Constructing an FC port state machine model and an FC credit management model, and inserting the FC port state machine model and the FC credit management model into the DUT to be tested as probes, wherein the FC port state machine model is used to check whether the port state machine behavior of the DUT to be tested is correct through dynamic simulation, and the FC credit management model is used to check whether the credit management behavior of the DUT to be tested is correct through dynamic simulation; On the verification simulation platform, establish a connection between the verification IP and the DUT to be tested, use the test sequence provided by the verification IP to test the correctness of the physical layer and link layer protocol data of the DUT to be tested, and trigger the probe during the test to monitor the transport layer port state machine and credit management behavior of the DUT to be tested in real time.
2. The chip function test optimization method based on FC protocol timing level modeling according to claim 1 is characterized in that: Build the FC port state machine model, including: Using a hardware description verification language to set the behavior content of a port state machine in the DUT under test, wherein the set behavior content of the port state machine includes an input event signal, an output event signal, and a port state machine; The event signal and the actual state of the port state machine are used for modeling to bind the FC port state machine model with the port state machine in the DUT under test.
3. The chip function test optimization method based on FC protocol timing level modeling according to claim 2 is characterized in that: Modeling using event signals and the actual state of the port state machine includes: Use parallel assertions to model a common state transition model, and set an enumeration type for simulating the state of the state machine and a checker model for judging whether the state machine of the DUT port under test meets the expected state of the current trigger input; A state machine state checker model and a coverage check model of the corresponding state checker are instantiated based on a common state transition model, a state machine enumeration type and a checker.
4. The chip function test optimization method based on FC protocol timing level modeling according to claim 1 is characterized in that: Construct FC credit management model, including: The credit management port of the DUT under test is modeled through parallel assertions, the credit management assertion model is bound to the credit management of the DUT under test, and the credit management assertion model is used to check the correctness of credit compensation recovery when the credit is reduced under abnormal scenarios. The credit management of the DUT under test uses data frames and R-RDY primitive signals between the sending end and the receiving end to dynamically manage the credit.
5. The chip function test optimization method based on FC protocol timing level modeling according to claim 4 is characterized in that: Model the credit management ports of the DUT under test through parallel assertions, including: Constructing a lost credit period compensation count sequence; Using the lost credit period compensation count sequence in the BB-SCs and BB-SCr primitive signals in conjunction with the counter to compensate for the lost credit recovery process and counting the credit loss recovery value based on the system clock; Instantiate the assertion model, use the assertion model to check whether the lost credit cycle compensation count sequence during credit recovery is correct, and collect assertion coverage to ensure the completeness of verification.
6. The chip function test optimization method based on FC protocol timing level modeling according to claim 5 is characterized in that: Modeling of the DUT credit management ports through parallel assertions, also includes: For each abnormal scenario, a corresponding lost credit periodic compensation count sequence and assertion model are constructed respectively, so as to monitor the credit management behavior under each abnormal scenario by using the corresponding lost credit periodic compensation count sequence and assertion model.
7. The chip function test optimization method based on FC protocol timing level modeling according to claim 4 or 7 is characterized in that: The abnormal scenarios include frame loss scenarios and R-RDY loss scenarios caused by link bit errors.
8. A chip function test optimization system based on FC protocol timing level modeling, characterized in that: Contains: modeling module and testing module, among which, A modeling module, used for constructing an FC port state machine model and an FC credit management model, and inserting the FC port state machine model and the FC credit management model into the DUT to be tested as probes, wherein the FC port state machine model is used for checking whether the port state machine behavior of the DUT to be tested is correct through dynamic simulation, and the FC credit management model is used for checking whether the credit management behavior of the DUT to be tested is correct through dynamic simulation; The test module establishes the connection relationship between the verification IP and the DUT under test on the verification simulation platform, uses the test sequence provided by the verification IP to test the correctness of the physical layer and link layer protocol data of the DUT under test, and triggers the probe during the test to monitor the transport layer port state machine and credit management behavior of the DUT under test in real time.
9. An electronic device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 can be implemented.
