Methods, systems, media, terminals, and software products for cross-platform conformance closed-loop verification of PCIe FPGA devices
By extracting platform-independent benchmark transactions and converting them into test transactions for the target verification platform during multi-platform verification of PCIe FPGA devices, the problems of hardware behavior inequivalence and the inability to automatically compare test results are solved, thereby achieving automated fault location and improved verification efficiency.
Patent Information
- Application Number
- CN202611627821.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies for multi-platform verification of PCIe FPGA devices suffer from problems such as hardware behavior inequivalence, inability to automatically compare test results, difficulty in locating the root cause of single-point faults, and the need for extensive manual intervention after test failures.
By acquiring test information from the UVM simulation environment, transaction semantics are extracted, platform-independent baseline transactions are generated, and these transactions are converted into test transactions for each target verification platform. Raw observation data is collected and converted into unified observation records. Judgments are made based on equivalence rules, judgment results are generated, and closed-loop iterative verification is performed until the test is passed.
It enables automatic assurance of hardware behavior equivalence of register operations under multiple access paths, achieves direct automatic comparison of results from different platforms and automatic location of single points of failure, reduces manual intervention and improves verification efficiency.
Smart Images

Figure CN123114876A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of chip verification technology, and in particular to a cross-platform conformance closed-loop verification method, system, medium, terminal and program product for PCIe FPGA devices. Background Technology
[0002] PCIe (Peripheral Component Interconnect Express) and FPGA (Field-Programmable Gate Array) devices typically require multi-stage, multi-platform functional verification during development. First, at the RTL (Register-Transfer Level) stage, a simulation environment is built using UVM (Universal Verification Methodology) to systematically verify the functions of registers, DMA (Direct Memory Access), interrupts, links, power management, reset, and peripheral control. After onboard deployment, the driver executes BAR (Base Address Register), DMA, MSI (Message Signaled Interrupt), MSI-X (Message Signaled Interrupts Extended), and link tests under Linux or Windows operating systems. Meanwhile, to facilitate debugging, UART (Universal Asynchronous Receiver-Transmitter), JTAG (Joint Test Action Group), or SPI (Serial Peripheral Interface) debug paths are often used to bypass the PCIe bus and directly access the same CSR (Control and Status Register) to perform low-level hardware debugging and status observation when the driver is not yet complete or the PCIe link is not established. These verification environments differ in their invocation methods, access bit widths, log formats, and status representations.
[0003] To improve verification efficiency and reduce errors caused by configuration inconsistencies, existing technologies have attempted to share configuration files between the UVM simulation environment and the FPGA prototype, generating UVM and embedded software configurations through a unified template. They also support automatic comparison of tests and results via serial port or Ethernet on a host computer. However, these solutions primarily focus on configuration uniformity and simple comparison of test results, failing to fundamentally eliminate the deep differences between different verification environments and still presenting the following technical problems:
[0004] (1) Although different access paths can write the same value to the same register, the actual hardware behavior may not be equivalent due to differences in effective bit width, byte order, operation order, access delay, trigger pulse generation and register side effect handling. Simple data comparison is difficult to find such deep inconsistencies.
[0005] (2) The return values from Linux character devices, Windows driver events, UART text output and UVM logs are different in data format and semantic expression, lacking an effective intermediate abstraction layer, which makes it impossible to directly compare test results automatically.
[0006] (3) When a single access path test fails, the existing solution is difficult to effectively distinguish whether the root cause of the fault is in the write path, read path, PCIe BAR decoding logic, driver, RTL design, reset domain synchronization or external device, resulting in low location efficiency.
[0007] (4) Conventional automated tests usually only output a pass (PASS) or fail (FAIL) result and archive the log. Once the test fails, the debugging personnel still need to manually switch the access path, adjust the bit width, modify the timing or change the reset strategy to further investigate the problem. The degree of automation is insufficient and it is difficult to meet the needs of efficient verification of complex field programmable gate array devices.
[0008] Therefore, it is necessary to provide a cross-platform conformance closed-loop verification method, system, media, terminal, and program product for PCIe FPGA devices to solve the above-mentioned problems in the prior art. Summary of the Invention
[0009] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a cross-platform consistency closed-loop verification method, system, medium, terminal and program product for PCIe FPGA devices, to solve the technical problems of the prior art that it is difficult to automatically ensure the hardware behavior equivalence of register operations under multiple access paths, cannot directly and automatically compare the return results of different verification platforms, lacks the ability to automatically locate the root cause of single point of failure, and still requires a lot of manual intervention in the debugging process after test failure.
[0010] To achieve the above and other related objectives, the first aspect of this application provides a cross-platform consistency closed-loop verification method for PCIe FPGA devices, comprising: acquiring test information in a UVM simulation environment and extracting transaction semantics from the acquired test information to obtain platform-independent baseline transactions; converting the obtained platform-independent baseline transactions into test transactions for the corresponding target verification platforms according to the access interface types of each target verification platform, so that each target verification platform executes the corresponding test transactions; collecting raw observation data obtained by each target verification platform from executing test transactions, and converting the collected raw observation data into unified observation records based on a preset unified observation model; performing equivalence determination on the unified observation records corresponding to the same test transaction on each target verification platform based on preset equivalence rules, generating determination results for each target verification platform and writing them into a path result matrix; matching fault candidate levels according to the combination of determination results of each target verification platform in the path result matrix, and determining confirmation transactions according to the matched fault candidate levels, so that the corresponding target verification platform executes the confirmation transactions, and repeating the above unified observation record conversion operation, equivalence determination operation, and fault candidate level matching operation for closed-loop iterative verification until verification is passed.
[0011] In some embodiments of the first aspect of this application, the test information includes test cases, sequences, register abstraction layers, scoreboards, and mapping tables; the platform-independent benchmark transaction includes the target, address, operation type, effective bit width, mask, actual bus access bit width, step order, inter-step delay, side effects, and expected results.
[0012] In some embodiments of the first aspect of this application, the target verification platform includes a UVM simulation environment, a Linux PCIe operating system, a Windows PCIe operating system, a UART debugging path, a JTAG access path, and an SPI access path.
[0013] In some embodiments of the first aspect of this application, the conversion of collected raw observation data into unified observation records based on a preset unified observation model specifically includes: mapping the raw observation data to unified record fields according to preset field mapping rules, and establishing record associations for the raw observation data during the execution of test transactions on each target verification platform based on the test case identifier, transaction step identifier, access path identifier, operating system identifier, and timestamp in the unified record fields; performing data cleaning on the raw observation data, and normalizing the cleaned raw observation data according to the field type and access bit width to normalize the different data formats corresponding to each target verification platform. The data is converted into a unified data representation. Based on the byte order attribute corresponding to the access path identifier in the unified record field, the original observation data in the unified data representation is rearranged byte by byte, and multiple register fragments are concatenated into wide data with bit width extension according to the data segment number. For reserved bits, unrealized bits, read-only status bits, or bits unrelated to the current operation in the register, a valid bit mask is applied to exclude invalid bits from participating in the judgment. The interrupt events in the original observation data corresponding to each target verification platform are converted into a unified event increment. The completion status information and error status information in the original observation data corresponding to each target verification platform are converted into a predefined unified status set.
[0014] In some embodiments of the first aspect of this application, the equivalence rules include numerical equivalence rules, access semantic equivalence rules, event equivalence rules, temporal equivalence rules, and state equivalence rules; equivalence determination is performed based on the numerical equivalence rules, the access semantic equivalence rules, the event equivalence rules, the temporal equivalence rules, and the state equivalence rules, and if the determination is that the numerical equivalence, access semantic equivalence, event equivalence, temporal equivalence, and state equivalence are all valid, the determination result is "pass"; if any one of the determinations is not equivalent, the determination result is "fail".
[0015] In some embodiments of the first aspect of this application, the equivalence determination based on the numerical equivalence rule, the access semantic equivalence rule, the event equivalence rule, the timing equivalence rule, and the state equivalence rule specifically includes: performing a bitwise AND operation on the observed value after byte rearrangement and bit width expansion, and a pre-set expected value with the effective bit mask, respectively, to obtain the actual effective value and the expected effective value; comparing the obtained actual effective value and expected effective value, if the actual effective value and the expected effective value are equal, then it is determined that the values are equivalent within the effective bits; if the actual effective value and the expected effective value are not equal, then it is determined that the values are not equivalent within the effective bits; checking the target, operation type, address, effective bit width, byte enable, write value, operation order, pulse semantics, and side effects one by one, if the preset semantic consistency condition is met, then it is determined that the values are semantically equivalent; if the preset semantic consistency condition is not met, then it is determined that the values are semantically inequivalent; comparing the observed event increment obtained and converted by executing the test transaction with the expected event increment, if the observed event increment... If the observed event increment is equal to the expected event increment, the event is considered equivalent; if the observed event increment is not equal to the expected event increment, the event is considered inequivalent. The observed delay time is calculated based on the transaction completion timestamp and the trigger operation timestamp. It is then determined whether the observed delay time falls between the minimum and maximum delay times. If it does, the event is considered time-equivalent; otherwise, it is considered time-inequivalent. Alternatively, the absolute difference between the observed delay time and the expected delay time is calculated and compared with a preset time tolerance. If the absolute difference is less than or equal to the time tolerance, the event is considered time-equivalent; otherwise, it is marked as time-inequivalent. Finally, it is determined whether the completed and error states in the transformed unified state set have reached the expected completed and error states. If they have, the event is considered state-equivalent; otherwise, it is considered state-inequivalent.
[0016] To achieve the above and other related objectives, a second aspect of this application provides a cross-platform consistency closed-loop verification system for PCIe FPGA devices, comprising: a transaction semantic extraction module for acquiring test information in a UVM simulation environment and extracting transaction semantics from the acquired test information to obtain a platform-independent baseline transaction; a path adaptation module for converting the obtained platform-independent baseline transaction into a test transaction for the corresponding target verification platform based on the access interface type of each target verification platform, so that each target verification platform executes the corresponding test transaction; and a unified observation record conversion module for collecting raw observation data obtained by each target verification platform from executing test transactions and converting the collected raw observation data into a unified observation record based on a preset unified observation model. The process involves converting the data into a unified observation record; an equivalence determination module, which performs equivalence determination on the unified observation records corresponding to the same test transaction on each target verification platform based on preset equivalence rules, generates the determination results for each target verification platform, and writes them into the path result matrix; and a confirmation transaction determination and replay module, which matches the fault candidate level based on the combination of the determination results of each target verification platform in the path result matrix, and determines the confirmation transaction based on the matched fault candidate level, so that the corresponding target verification platform executes the confirmation transaction. The process of converting the unified observation record, performing the equivalence determination, and matching the fault candidate level is repeated for closed-loop iterative verification until the verification is successful.
[0017] To achieve the above and other related objectives, a third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method.
[0018] To achieve the above and other related objectives, a fourth aspect of this application provides a computer program product comprising computer program code that, when executed on a computer, causes the computer to implement the method.
[0019] To achieve the above and other related objectives, a fifth aspect of this application provides an electronic terminal, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the method.
[0020] As described above, the cross-platform conformance closed-loop verification method, system, media, terminal, and program products for PCIe FPGA devices of this application have the following beneficial effects:
[0021] First, transaction semantics are extracted from the test information obtained in the UVM simulation environment to obtain platform-independent baseline transactions. Then, based on the access interface type corresponding to each target verification platform, the obtained platform-independent baseline transactions are converted into test transactions for the corresponding target verification platforms, so that each target verification platform executes the corresponding test transactions. After the test transactions are executed, the raw observation data obtained from the execution of the test transactions on each target verification platform is collected, and the collected raw observation data is converted into unified observation records based on a preset unified observation model. Then, based on preset equivalence rules, equivalence determination is performed on the unified observation records corresponding to the same test transaction on each target verification platform, generating the determination results for each target verification platform. The path result matrix is written; finally, the fault candidate level is matched according to the combination of the judgment results of each target verification platform in the path result matrix, and the confirmation transaction is determined according to the matched fault candidate level, so that the corresponding target verification platform executes the confirmation transaction. The above unified observation record conversion operation, equivalent judgment operation, and fault candidate level matching operation are repeated for closed-loop iterative verification until the verification is passed. In this way, the hardware behavior equivalence of register operations is automatically ensured in multi-access path scenarios, the direct automatic comparison of the results returned by different target verification platforms is realized, the root cause of single-point faults is automatically located, and the debugging process after test failure is transformed into automated closed-loop processing, which significantly reduces manual intervention and greatly improves the verification efficiency of PCIe FPGA devices. Attached Figure Description
[0022] Figure 1 The diagram shows a flowchart of a cross-platform consistency closed-loop verification method for PCIe FPGA devices according to an embodiment of this application.
[0023] Figure 2 The diagram shown illustrates the working principle of a cross-platform consistency closed-loop verification method for PCIe FPGA devices according to an embodiment of this application.
[0024] Figure 3 The diagram shown is a block diagram of a cross-platform conformance closed-loop verification system for PCIe FPGA devices according to an embodiment of this application.
[0025] Figure 4 The diagram shown is a structural schematic of an electronic terminal according to an embodiment of this application. Detailed Implementation
[0026] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0027] In the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.
[0028] It should be noted that, in the embodiments of this application, the words "exemplary" or "for example" indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0029] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0030] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:
[0031] <1> PCIe (Peripheral Component Interconnect express) FPGA (Field-Programmable Gate Array) devices: These are hardware devices under test that use an FPGA as their core and are configured with a PCIe interface. They interact with a host running a Linux or Windows operating system via the PCIe bus.
[0032] <2> UVM (Universal Verification Methodology): In integrated circuit design, it is a verification method based on System Verilog. It provides a complete set of verification libraries and frameworks for creating complex chip verification environments.
[0033] <3> UART (Universal Asynchronous Receiver / Transmitter) is a universal serial data bus used for asynchronous communication. It can achieve full-duplex transmission and reception and is widely used in embedded design for communication with PCs, monitoring and debugging devices, and other devices (such as EEPROM).
[0034] <4> JTAG (Joint Test Action Group) is an international standard electronic test and debug interface used for chip testing, embedded system debugging, and FPGA programming.
[0035] <5> SPI (Serial Peripheral Interface) is a high-speed, full-duplex, synchronous communication bus, mainly used for short-distance communication and widely used in embedded systems.
[0036] <6> RTL (Register Transfer Level) is a level in digital circuit design that abstracts and describes hardware functions. It describes the flow of signals between units such as registers, memories, combinational logic, and buses in digital circuits, as well as the logical operations of these signals. It focuses on the data flow between registers and combinational logic operations, rather than the specific device implementation.
[0037] <7> DMA (Direct Memory Access) is a hardware mechanism widely used in computers and embedded systems that allows data to be transferred directly between memory and peripherals or between memory without frequent CPU intervention, thereby improving system efficiency.
[0038] To facilitate understanding of the embodiments of this application, in conjunction with Figure 1 and Figure 2 Detailed explanation. Figure 1 A flowchart illustrating the cross-platform conformance closed-loop verification method for PCIe FPGA devices according to an embodiment of the present invention is shown. Figure 2 This illustration shows the working principle of the cross-platform conformance closed-loop verification method for PCIe FPGA devices according to an embodiment of the present invention. The cross-platform conformance closed-loop verification method for PCIe FPGA devices in this embodiment includes the following steps:
[0039] Step S11: Obtain test information from the UVM simulation environment and extract transaction semantics from the obtained test information to obtain platform-independent baseline transactions.
[0040] Specifically, since the UVM simulation environment is usually used as the gold reference, the test information contained therein contains the most complete protocol semantic information. Transaction semantics are extracted from the acquired test information. The transaction semantics explicitly retain the effective bit width, order, delay, impulse, and side effects, and finally obtains the platform-independent benchmark transaction. This aims to strip away the implementation details related to a specific target verification platform and retain the core semantic elements of the transaction, so as not to depend on the bus width, clock domain, or interface protocol version of any specific target verification platform.
[0041] In some embodiments of this application, the test information includes test cases, sequences, register abstraction layers, scoreboards, and mapping tables; the platform-independent benchmark transactions include targets, addresses, operation types, effective bit widths, masks, actual bus access bit widths, step sequences, inter-step delays, side effects, and expected results.
[0042] Specifically, test cases define the specific goals and scenarios for verification, typically encapsulating operational requirements for PCIe configuration space or memory-mapped registers in the form of UVM test classes; sequences, as the stimulus carriers generated by the UVM sequencer, describe the initiation order and timing relationships of transactions, enabling precise control over the read and write access process to target registers; the Register Abstraction Layer (RAL) provides an abstract mapping between register models and physical addresses, including register attribute definitions, access permissions, reset values, and domain segmentation, allowing test stimuli to operate based on register names without being tied to specific hardware addresses; the scoreboard maintains the expected state of the reference model in the UVM simulation environment, recording the expected response and register state changes after transaction execution, providing a crucial reference for subsequent equivalence determination; and the mapping table maintains the correspondence between each register in the Register Abstraction Layer and the bus address space, as well as address translation rules under different access paths, ensuring accurate addressing during cross-platform distribution.
[0043] Furthermore, transaction semantics are extracted from test cases, sequences, register abstraction layers, scoreboards, and mapping tables. Specifically: First, the test intent in the test cases is parsed to identify the target register and its corresponding functional module; then, the transaction description in the sequence is read to determine the initiation order and timing constraints of the operations; combined with the register definitions in the register abstraction layer, physical features such as register bit width, access attributes, and domain segment masks are extracted; by querying the mapping table, the register abstract name is parsed into a specific bus address, and the order of operation steps is determined according to the steps in the sequence; the expected response data in the scoreboard is extracted as a reference benchmark for subsequent comparisons; finally, the parsed information is integrated into a structured platform-independent benchmark transaction.
[0044] Furthermore, the obtained platform-independent baseline transaction includes the target, address, operation type, effective bit width, mask, actual bus access bit width, step order, inter-step delay, side effects, and expected results, as shown in Table 1 below. The target field identifies the register or functional module targeted in this test transaction. A hierarchical naming convention can be used to support differentiated organization of device trees or address spaces across different target verification platforms. The address field records the physical bus address after parsing through the mapping table, ensuring that the same hardware register can be uniquely located on each target verification platform. The operation type field distinguishes different access behaviors such as read, write, or reset operations. The effective bit width field indicates the number of valid data bits actually involved in this test transaction. The mask field is used to mask invalid bits. The actual bus access bit width field records the physical data channel width of the target bus. The step sequence field defines the execution order of each sub-transaction step in the composite transaction. The inter-step delay field specifies the minimum waiting time or number of clock cycles that must be maintained between adjacent steps. The side effect field describes the indirect hardware behavior that this test transaction may cause. The expected result field directly inherits the reference data from the scoring board and serves as the direct comparison basis in the equivalence determination stage.
[0045] Table 1 Specific fields of platform-independent benchmark transactions
[0046]
[0047] Step S12: Based on the access interface type corresponding to each target verification platform, convert the obtained platform-independent baseline transaction into a test transaction for the corresponding target verification platform, so that each target verification platform can execute the corresponding test transaction.
[0048] Specifically, due to significant differences in the access interface types of different target verification platforms—for example, some target verification platforms operate through register access interfaces, some communicate through transaction layer packet interfaces, and others initiate direct memory access requests through kernel driver interfaces—the core semantic fields in the platform-independent baseline transaction are converted into specific command formats, register configuration sequences, or bus cycle descriptions that can be recognized by the target verification platform, thereby generating test transactions adapted to each target verification platform. These test transactions are then distributed to the corresponding target verification platforms and triggered for execution.
[0049] In some embodiments of this application, the target verification platform includes a UVM simulation environment, a Linux PCIe operating system, a Windows PCIe operating system, a UART debugging path, a JTAG access path, and an SPI access path.
[0050] Specifically, the UVM simulation environment serves as a benchmark platform for functional verification. Its access interface is built based on SystemVerilog transaction-level modeling. Transformed test transactions are injected into the bus agent as UVM sequence items, initiating read / write requests to PCIe endpoint devices through register models or direct memory mapping interfaces. The Linux PCIe operating system platform interacts with PCIe devices through kernel-mode drivers or user-mode library functions. Transformed test transactions are mapped to operations on Linux character device files, sysfs node read / write operations, or ioctl system calls, subsequently initiating configuration cycles or memory-mapped I / O accesses through the PCIe root complex. The Windows PCIe operating system platform relies on standard interfaces provided by the Windows driver framework to access PCIe FPGA devices. Transformed test transactions are encapsulated as device control requests or dedicated API calls, reaching the FPGA hardware via bus drivers and port drivers. The UART debug path uses asynchronous serial communication, typically existing as a low-speed management channel for the device. Transformed test transactions form text commands or binary frame structures in a specific format, which are sent to the internal debug module of the PCIe FPGA device through the UART controller. The JTAG access path is based on the IEEE standard boundary scan protocol. It directly manipulates the FPGA's internal scan chain via debugger hardware. The converted test transactions are translated into JTAG instruction sequences and data register shift operations, enabling bypass access to the device's internal registers. The SPI access path communicates with the slave controller of the PCIe FPGA device via the serial peripheral interface. The test transactions are converted and adapted to read / write timings under SPI clock polarity and phase configurations, completing register access through chip select signals and master-slave data exchange.
[0051] The specific implementation of each target verification platform may differ, but the target hardware resources, valid data, operation sequence and functional expectations should remain unchanged, and the adaptation actions should be set to include WRITE, READ, PULSE, WAIT, POLL, EXPECT_EVENT, RESET and SNAPSHOT.
[0052] Step S13: Collect the raw observation data obtained from the test transactions executed by each target verification platform, and convert the collected raw observation data into unified observation records based on the preset unified observation model.
[0053] Specifically, due to differences in data formats output by different access paths, operating systems, and testing tools, the same test transaction may return results with different field names, data bases, data widths, event representations, and error representations. To enable comparison of results across different paths, a unified observation model is established. This model converts the raw observation data generated by various target verification platforms into unified observation records with identical field definitions and semantics, thus laying the foundation for subsequent automatic comparison.
[0054] In some embodiments of this application, the conversion of collected raw observation data into unified observation records based on a preset unified observation model specifically includes: mapping the raw observation data to unified record fields according to preset field mapping rules, and establishing record associations for the raw observation data during the execution of test transactions on each target verification platform based on the test case identifier, transaction step identifier, access path identifier, operating system identifier, and timestamp in the unified record fields; performing data cleaning on the raw observation data, and normalizing the cleaned raw observation data according to the field type and access bit width to convert the different data formats corresponding to each target verification platform into... Unified data representation; based on the byte order attribute corresponding to the access path identifier in the unified record field, the raw observation data in the unified data representation is byte-rearranged, and multiple register fragments are concatenated into wide data with bit-width expansion according to the data segment number; valid bit masking is performed on reserved bits, unrealized bits, read-only status bits, or bits unrelated to the current operation in the registers to exclude invalid bits from participating in the judgment; interrupt events in the raw observation data corresponding to each target verification platform are converted into unified event increments; completion status information and error status information in the raw observation data corresponding to each target verification platform are converted into a predefined unified status set.
[0055] First, during the execution of the test transaction, raw observation data is collected from the corresponding access paths. Different target verification platforms generate raw observation data in different formats. Furthermore, each piece of raw observation data is assigned a unique transaction identifier, step identifier, and timestamp to facilitate tracing the raw observation data in case of transformation errors or result conflicts. Examples of raw observation data generated by different target verification platforms are as follows:
[0056] Linux PCIe:
[0057] read_value = 0x00000064;
[0058] irq_count_before = 100;
[0059] irq_count_after = 101;
[0060] aer_status = 0.
[0061] Windows PCIe:
[0062] register_value = 0x64;
[0063] interrupt_event = signaled;
[0064] aer_status = none.
[0065] UART:
[0066] response = "64\r\n".
[0067] Then, the original observation data is mapped to unified record fields according to the preset field mapping rules. The specific unified record fields are shown in Table 2 below:
[0068] Table 2 Unified Record Fields
[0069]
[0070] To avoid mismatching results from different transactions or rounds, records are associated with the raw observation data during the execution of test transactions on each target verification platform based on the test case identifier, transaction step identifier, access path identifier, operating system identifier, and timestamp in the unified record fields. Furthermore, for each transaction step, the following timestamps are recorded: transaction_start_timestamp (transaction start timestamp), write_timestamp (write operation timestamp), trigger_timestamp (trigger operation timestamp), completion_timestamp (transaction completion timestamp), and read_timestamp (read operation timestamp).
[0071] Furthermore, since different access paths may use different number systems, case sensitivity, and data representations, the same numerical value may be represented as follows:
[0072] Linux: 00000064;
[0073] Windows: 0x64;
[0074] UART: 64;
[0075] SPI: 0x000000000000064.
[0076] The raw observation data is then cleaned, specifically by removing prefixes, spaces, carriage returns, newlines, and irrelevant log characters. Then, the cleaned raw observation data is normalized according to the field type and access bit width, converting it into a unified unsigned integer format. For example, it can be converted to the following unified data format:
[0077] 00000064→0x64;
[0078] 0x64 → 0x64;
[0079] 64→0x64.
[0080] The normalized results are stored as numerical fields, and comparisons are no longer based on the original output's number system. For original observation data with sign meaning, such as error codes or signed counts, sign extension is performed according to the field definition; for fields such as registers, addresses, lengths, and masks, they are treated as unsigned numbers.
[0081] Furthermore, for 32-bit, 64-bit, or 128-bit data, different access paths may have differences in byte order. In response, the original observation data is byte rearranged according to the byte order attribute in the transaction semantics.
[0082] For example, if the SPI path transmits the least significant byte first, while the PCIe path stores data in little-endian format, then a 32-bit data can be converted as follows:
[0083] SPI receive sequence: 11 22 33 44;
[0084] PCIe memory is represented as: 0x44332211;
[0085] The unified representation is: 0x11223344.
[0086] For 128-bit read / write data, multiple register segments are concatenated into a unified data based on the data segment number, and then further concatenated using shift and OR operations, as shown in the following example:
[0087] observed_value=data3 << 96 |data2 << 64 |data1 << 32 |data0.
[0088] At the same time, based on the effective bit width and effective bit mask, unused high-order data is removed. Byte rearrangement and concatenation operations can avoid misjudgment due to different order of path data.
[0089] Furthermore, since not all register bits have a valid meaning, reserved bits, unimplemented bits, read-only status bits, or bits unrelated to the current operation are masked using valid_mask (valid bit mask).
[0090] By setting different valid masks for the same register for different access bit widths, differences caused by narrow bit width access, Byte Enable, or high-bit data padding can be identified. For example:
[0091] 8-bit access: valid_mask=0x000000FF;
[0092] 16-bit access: valid_mask=0x0000FFFF;
[0093] 32-bit access: valid_mask=0xFFFFFFFF.
[0094] The unified comparison value for subsequent numerical equivalence determination is generated in the following manner:
[0095] normalized_value=observed_value & valid_mask;
[0096] normalized_expected=expected_value & valid_mask;
[0097] Wherein, normalized_value represents the normalized value; normalized_expected represents the normalized expected value; observed_value represents the observed value; and expected_value represents the expected value.
[0098] When normalized_value == normalized_expected, the observed value is considered to be within the valid bit range. For example, if the valid bits of a register are bits[7:0], then valid_mask = 0x000000FF.
[0099] Linux reads: observed_value = 0x00000164;
[0100] The expected value is: expected_value = 0x00000064.
[0101] After effective bitmasking:
[0102] 0x00000164 & 0x000000FF = 0x64;
[0103] 0x00000064 & 0x000000FF = 0x64.
[0104] Therefore, the observation is determined to pass, and the invalid bits above bit[8] are not included in the comparison.
[0105] Furthermore, since different operating systems represent interrupts differently—for example, Linux typically returns the cumulative interrupt count, Windows may return a one-time event, and UART or debug interface may return an event flag—this application does not directly compare the original interrupt fields, but instead uniformly converts the interrupt events of each target verification platform into event_delta (event increment).
[0106] For Linux paths, record the cumulative interrupt count before and after the test transaction execution: event_delta = irq_count_after - irq_count_before, where irq_count_after represents the cumulative interrupt count after the transaction execution; irq_count_before represents the cumulative interrupt count before the transaction execution. For example:
[0107] irq_count_before = 100;
[0108] irq_count_after = 101;
[0109] event_delta = 1.
[0110] For Windows paths, if the waiting object successfully receives an interruption event in this transaction, then: event_delta = 1; if the wait times out, then: event_delta = 0, completion_state = timeout; if multiple events are received within a single wait window, then: event_delta = received_event_count, where completion_state represents the completion status; timeout represents the timeout; and received_event_count represents the count of received events.
[0111] For UART or SPI paths that can only return an interrupt flag, the transition is based on the state changes before and after the transaction:
[0112] irq_raw_before = 0;
[0113] irq_raw_after = 1;
[0114] event_delta = 1;
[0115] Here, irq_raw_before represents the original interrupt status value before the transaction is executed; irq_raw_after represents the original interrupt status value after the transaction is executed.
[0116] If the interrupt status is write-clear, the original state is saved before the clear operation is recorded to avoid the loss of event information caused by the clearing action.
[0117] Through the above event increment transformation, the following different original results can all be represented as the same unified event result:
[0118] Linux: irq_count changed from 100 to 101 → event_delta = 1;
[0119] Windows: Received an interrupt event → event_delta = 1;
[0120] UART: irq_raw changes from 0 to 1 → event_delta = 1;
[0121] Therefore, the subsequent event equivalence rule compares the "event increment caused by this transaction", rather than the absolute value of the underlying interrupt counter in different operating systems.
[0122] Furthermore, since different access paths may use different names for complete, busy, timeout, and error states, the original states are transformed into a predefined, unified set of states. Examples are shown in Table 3 below:
[0123] Table 3 Unified State Set Table
[0124]
[0125] The error states in Table 3 can be further divided into:
[0126] NO_ERROR (No error);
[0127] VALUE_MISMATCH (Value mismatch);
[0128] WIDTH_MISMATCH (bit width mismatch);
[0129] BYTE_ENABLE_MISMATCH (byte enable mismatch);
[0130] TIMEOUT (timeout);
[0131] INTERRUPT_MISSING (Interrupt Missing);
[0132] DMA_LENGTH_MISMATCH (DMA length mismatch);
[0133] PAYLOAD_MISMATCH (payload mismatch);
[0134] AER_ERROR (Advanced Error Reporting);
[0135] LINK_STATE_ERROR (Link status error);
[0136] RESET_RECOVERY_ERROR (Reset recovery error);
[0137] PATH_ACCESS_ERROR (Path access error).
[0138] The completed and error states after the above transformations can be saved simultaneously. For example, `completion_state = completed; error_state = VALUE_MISMATCH` indicates that the transaction has been completed, but the return value is inconsistent with the expected value. Conversely, `completion_state = timeout; error_state = INTERRUPT_MISSING` indicates that the transaction did not complete within the specified time and is further classified as an interruption that did not occur.
[0139] For example, for the same register read step_id=12, the original observations from different access paths can be converted into the following unified observation record:
[0140] case_id = spi_csr_read_001;
[0141] step_id = 12;
[0142] target = SPI_CSR_0x170;
[0143] operation = read;
[0144] requested_width= 8;
[0145] valid_mask = 0xFF;
[0146] expected_value = 0x64.
[0147] Linux notes:
[0148] path_id= PCIE_BAR0;
[0149] os_id= Linux;
[0150] raw_value= 00000064;
[0151] observed_value= 0x64;
[0152] completion_state= completed;
[0153] event_delta= 0;
[0154] error_state= NO_ERROR.
[0155] Windows record:
[0156] path_id= PCIE_BAR0;
[0157] os_id= Windows;
[0158] raw_value= 0x64;
[0159] observed_value= 0x64;
[0160] completion_state= completed;
[0161] event_delta= 0;
[0162] error_state= NO_ERROR.
[0163] UART record:
[0164] path_id= UART;
[0165] os_id= Linux;
[0166] raw_value= "64\r\n";
[0167] observed_value= 0x64;
[0168] completion_state= completed;
[0169] event_delta= 0;
[0170] error_state = NO_ERROR.
[0171] After normalization and valid bitmask processing, the valid observation values for the three paths are all: observed_value & valid_mask = 0x64. Based on this, it is determined that the three access paths are functionally equivalent.
[0172] Through the transformation process of the unified observation model described above, the subsequent equivalence judgment compares the unified semantic results of different paths for the same test transaction, specifically including: whether the same target was accessed; whether the same operation was performed; whether the same effective bit width was used; whether the same effective data was written or read; whether it was completed in the same order; whether it was completed within the allowed timing tolerance; whether the expected completion event was generated; and whether AER, DMA, link, or reset errors occurred. Therefore, this application does not require that the output text of Linux, Windows, UART, SPI, and UVM be completely consistent. Instead, it converts the original observation data of the original output of each target verification platform into a unified record field, and then performs functional equivalence judgment based on the effective bit mask, byte order rules, access bit width, and timing tolerance.
[0173] Step S14: Based on the preset equivalence rules, perform equivalence determination on the unified observation records corresponding to the same test transaction on each target verification platform, generate the determination results of each target verification platform, and write them into the path result matrix.
[0174] Specifically, the equivalence rules are set according to the verification requirements. For each set of unified observation records corresponding to the same platform-independent benchmark transaction, the set equivalence rules are applied for comparative analysis to generate the judgment results for each target verification platform. Subsequently, the judgment results of each target verification platform are written into the path result matrix. The path result matrix is organized in a two-dimensional structure, where one row corresponds to a test transaction step, one column corresponds to a target verification platform, and the matrix elements record the judgment result of the corresponding platform for the transaction. Through this path result matrix, the verification status distribution of the same test transaction on different platforms can be intuitively presented. That is, this application does not directly compare the original observation data output by different verification paths, nor does it require that the cumulative count values, timestamps, or log formats of different platforms be exactly the same. Instead, it first transforms the results of each path according to the unified observation model, then generates step-level judgment results according to the preset equivalence rules, and writes the judgment results into the path result matrix.
[0175] In some embodiments of this application, the equivalence rules include numerical equivalence rules, access semantic equivalence rules, event equivalence rules, temporal equivalence rules, and state equivalence rules. Equivalence is determined based on the numerical equivalence rules, access semantic equivalence rules, event equivalence rules, temporal equivalence rules, and state equivalence rules. If the values are determined to be numerically equivalent, access semantically equivalent, event equivalent, temporally equivalent, and state equivalent, the determination result is considered successful. If any one of these values is determined to be unequal, the determination result is considered unsuccessful.
[0176] Specifically, for unified observation records corresponding to the same case_id and step_id, their equivalence is determined based on numerical equivalence rules, access semantic equivalence rules, event equivalence rules, temporal equivalence rules, and state equivalence rules, respectively. The comprehensive determination is expressed as follows:
[0177] step_pass =value_equal AND semantic_equal AND event_equal AND timing_acceptable AND completion_state_acceptable AND error_state_acceptable;
[0178] Among them, step_pass indicates that the transaction step has passed; value_equal indicates numerical equivalence; semantic_equal indicates access semantic equivalence; event_equal indicates event equivalence; timing_acceptable indicates timing equivalence; completion_state_acceptable indicates completion state equivalence; and error_state_acceptable indicates error state equivalence.
[0179] For regular CSR read / write steps that do not require the generation of events, event_equal can be set to not participate in the determination; for DMA or MSI steps, event and completion status determination must be enabled.
[0180] In some embodiments of this application, the equivalence determination based on the numerical equivalence rule, the access semantic equivalence rule, the event equivalence rule, the timing equivalence rule, and the state equivalence rule specifically includes: performing a bitwise AND operation on the observed value after byte rearrangement and bit width expansion, and a pre-set expected value with the effective bit mask, respectively, to obtain the actual effective value and the expected effective value; comparing the obtained actual effective value and expected effective value, if the actual effective value and the expected effective value are equal, then the numerical equivalence within the effective bits is determined; if the actual effective value and the expected effective value are not equal, then the numerical inequality within the effective bits is determined; checking the target, operation type, address, effective bit width, byte enable, write value, operation order, pulse semantics, and side effects one by one, if the preset semantic consistency condition is met, then the semantic equivalence is determined; if the preset semantic consistency condition is not met, then the semantic inequality is determined; comparing the observed event increment obtained and converted by executing the test transaction with the expected event increment, if the observed event increment and the expected event increment are equal, then the equivalence is determined; ... If the observed event increments are equal to the expected event increments, the events are considered equivalent. If the observed event increments are not equal to the expected event increments, the events are considered inequivalent. The observed delay time is calculated based on the transaction completion timestamp and the trigger operation timestamp. It is then determined whether the observed delay time falls between the minimum and maximum delay times. If it does, the events are considered time-equivalent; otherwise, they are considered time-inequivalent. Alternatively, the absolute difference between the observed delay time and the expected delay time is calculated and compared with a preset time tolerance. If the absolute difference is less than or equal to the time tolerance, the events are considered time-equivalent; otherwise, they are marked as time-inequivalent. Finally, it is determined whether the completed and error states in the transformed unified state set have reached the expected completed and error states. If they have, the events are considered state-equivalent; otherwise, they are considered state-inequivalent.
[0181] Specifically, when enforcing the numerical equivalence rule, for registers, status fields, and data fields, byte order conversion and bit width expansion are performed first, followed by comparison using a valid bitmask:
[0182] actual_effective= endian_convert(observed_value) & valid_mask;
[0183] expected_effective = expected_value & valid_mask;
[0184] Wherein, actual_effective represents the actual effective value; endian_convert represents the byte order conversion; and expected_effective represents the expected effective value.
[0185] When the two are equal, value_equal = (actual_effective == expected_effective), then the values are considered equivalent.
[0186] For example, if the effective bit width of register 0x170 is 8 bits, then: valid_mask = 0xFF.
[0187] The following returned raw observation data values can all be considered equivalent:
[0188] UVM: 8'h64;
[0189] Linux PCIe: 0x00000064;
[0190] Windows: 0x64;
[0191] UART: "64\r\n".
[0192] If the PCIe read result is 0x00000164, it will still be 0x64 after being masked with 0xFF. The reserved bits will not be used in this functional comparison.
[0193] When executing access semantic equivalence rules, check whether test transactions executed under different access paths maintain the following semantic consistency:
[0194] Target;
[0195] Operation (operation type);
[0196] Address;
[0197] valid_width (valid bit width);
[0198] byte_enable (byte enable);
[0199] write_value (write value);
[0200] operation_order (operation order);
[0201] pulse_semantics;
[0202] side effect.
[0203] For example, when UART writes SPI_TX_DATA1[15:0] with a 16-bit command and PCIe accesses the same address with a 32-bit bus transaction, as long as the Byte Enable and valid mask in the PCIe transaction are limited to the lower 16 bits and the final valid data is consistent, it can be determined as semantically equivalent.
[0204] When executing event equivalence rules, for events such as MSI, task completion, and DMA completion, the event equivalence rules compare the event increments generated by the current transaction:
[0205] event_equal = (observed_event_delta == expected_event_delta);
[0206] Among them, observed_event_delta represents the observed event increment; expected_event_delta represents the expected event increment; and event_equal represents event equivalence.
[0207] For example, if the Linux interrupt count increases from 100 to 101, and Windows receives an interrupt event, both are converted to: event_delta = 1. If the task completion bit is set normally, but event_delta = 0, then the data transaction and the interrupt transaction are recorded separately. The entire process cannot be considered complete simply because DMA has been completed.
[0208] When executing timing equivalence rules, the absolute execution time may differ for different operating systems and access paths. Timing equivalence is determined by the allowed range or timeout period, specifically as follows:
[0209] minimum_latency<=observed_latency<= maximum_latency;
[0210] Or: abs(observed_latency - expected_latency) <= timing_tolerance;
[0211] Among them, observed_latency represents the observation delay time; minimum_latency represents the minimum delay time; maximum_latency represents the maximum delay time; expected_latency represents the expected delay time; and timing_tolerance represents the timing tolerance.
[0212] Within the timing tolerance range, even if the absolute delays of different access paths are not exactly the same, their functional results can be determined to be equivalent. If the tolerance is exceeded, the transaction step is marked as a timing difference and enters the subsequent timing confirmation strategy.
[0213] For example, a transaction in UVM completes within 20 cycles, on a Linux platform it completes within 150 microseconds, and on Windows it completes within 230 microseconds. As long as all three meet the preset completion window of their respective platforms, they can be considered functionally equivalent, without requiring the completion time to be exactly the same.
[0214] When executing state equivalence rules, the completion status representations of different access paths are converted into a unified status, such as completed; busy; timeout; error; not_executed. This step is only considered successful when the transaction reaches the expected completion status and the value, event, and error status meet the corresponding rules.
[0215] It should be noted that the order of equivalence determination for the above numerical equivalence rules, access semantic equivalence rules, event equivalence rules, temporal equivalence rules, and state equivalence rules is not specifically limited, and the specific implementation of one or more of them can be adjusted according to the actual situation.
[0216] The above equivalence determination results are written into the path result matrix. Based on the pass or fail combination of different access paths in the path result matrix, it is determined that the difference is more likely to be located in RTL logic, FPGA integration, PCIe read / write path, driver processing, operating system environment or external SPI device, and a subsequent confirmation transaction is generated accordingly.
[0217] Step S15: Match the fault candidate level according to the combination of the judgment results of each target verification platform in the path result matrix, and determine the confirmation transaction according to the matched fault candidate level so that the corresponding target verification platform executes the confirmation transaction. Repeat the above unified observation record conversion operation, equivalent judgment operation, and fault candidate level matching operation to perform closed-loop iterative verification until the verification is passed.
[0218] Specifically, in the fault location and closed-loop confirmation phase, different combinations of judgment results often correspond to different types of fault sources. By performing pattern matching between the combinations of judgment results in the current path result matrix and a pre-built fault candidate level knowledge base, the most likely fault candidate level can be determined. The fault candidate level knowledge base stores the mapping relationship between various combinations of judgment results and fault candidate levels. Subsequently, confirmation transactions are generated by changing the path, bus access bit width, timing, or reset range. The generation logic of the confirmation transaction can be specifically designed based on the characteristics of the fault candidate level. For example, if the fault candidate level points to a data path problem, the confirmation transaction can be designed as a read-write loopback test for a specific address range. Then, the determined confirmation transaction is sent to the corresponding target verification platform for execution, and the above unified observation record conversion operation, equivalent judgment operation, and fault candidate level matching operation are repeated. During this iteration, the fault candidate level is updated according to the new path result matrix, gradually narrowing the fault range until verification is passed. The condition for successful verification can be set as all target verification platforms passing the judgment results of the current test transaction and all confirmation transactions, and no new inconsistencies are found in multiple consecutive iterations.
[0219] In some embodiments of this application, the determination result includes pass and failure. A path result matrix is generated with the test transaction steps as rows and the target verification platform as columns. Each matrix cell stores at least the following: case_id (test case identifier), step_id (transaction step identifier), path_id (access path identifier), pass_state (pass status), failure_type (failure status), normalized_value (normalized value), event_delta (event delta), completion_state (completion status), and error_state (error status).
[0220] For example, the path result matrix is shown in Table 4 below:
[0221] Table 4 Path Result Matrix
[0222]
[0223] The path result matrix can be generated for the entire test case or for each step_id in the test case. The step-level matrix can identify local problems such as "the configuration step passes but the triggering step fails".
[0224] The levels generated by the path result matrix belong to the candidate fault levels and are not directly used as the final root cause. According to the path differences, corresponding preset rules are applied. For example, the path strategy is: UART write / PCIe read, PCIe write / UART read to distinguish the PCIe read / write direction; the bit width strategy is: to perform 8, 16, and 32-bit bus access on narrow registers respectively to determine Byte Enable or bit width processing; the timing strategy is: to adjust the frequency divider, step interval, pulse width, and wait or timeout after triggering; the reset strategy is: to use module soft reset, FLR (Function Level Reset), hot reset, remove (unload the driver and let the kernel ignore the device) / rescan (re-scan the bus to see if the device responds) or global reset in sequence. Although the selected strategies are different, the target function remains unchanged.
[0225] For example, if UART write → UART read succeeds but UART write → PCIe read fails, it means that the register body can store the data and the UART access path is normal, but the PCIe cannot read the same data. Therefore, the PCIe read-back select, BAR address decoding, or return data path should be prioritized as the fault candidate level.
[0226] For example, if UART write → UART read succeeds but PCIe write → UART read fails, it means that UART can access the register, but the PCIe write is not applied to that register. Therefore, PCIe write enable, Byte Enable, address decoding, and access bit width processing should be checked first.
[0227] For example, in SPI function testing: 0x100, 0x108, and 0x110 configuration readbacks are normal, and the 0x138 trigger pulse is normal, but CS (Chip Select) and SCLK (Serial Clock) remain unchanged. The fault candidate levels are the SPI control state machine, trigger pulse crossing clock domains, or SPI module clock / reset. If CS and SCLK are normal, MOSI (MasterOut SlaveIn) is correct, but MISO (MasterIn SlaveOut) remains zero, then the candidate levels shift to the SPI sampling edge, board-level interconnects, chip select object, or external SPI device.
[0228] Furthermore, the confirmation transaction is automatically or manually selected based on the fault candidate level, as shown in Table 5 below:
[0229] Table 5. Confirmation Transactions Corresponding to Fault Candidate Levels
[0230]
[0231] After the confirmation transaction is executed, the original path result matrix is updated, eliminating candidate levels inconsistent with the new results and increasing the priority of candidate levels that match the new results. If the confirmation transaction still cannot distinguish candidate levels, the observation range is expanded or the next confirmation strategy is selected. Therefore, the technical role of the path result matrix is not simply to summarize test logs, but to use the combination of results from the same transaction on different operating systems and different physical access paths to narrow down the scope of failures and drive subsequent confirmation transactions to replay, thereby forming a closed-loop verification.
[0232] In some other embodiments of this application, the determination results include pass, numerical failure, event exception failure, timing exception failure, access exception failure, execution error failure, not executed, and inapplicable. This avoids confusing "not executed" with "execution failed," as shown in Table 6 below:
[0233] Table 6 Judgment Results
[0234]
[0235] The cross-platform consistency closed-loop verification method for PCIe FPGA devices proposed in this application has the following beneficial effects: reducing false failures across platforms caused by loss of bit width, byte order, sequence, timing, pulse, and side effects; transforming results from different operating systems and physical paths into comparable hardware states, rather than just unifying the log appearance; utilizing the path differences between shared and independent links to narrow down system failures to the read path, write path, bridging, driver, RTL, or peripheral level; automatically generating targeted confirmation transactions based on preliminary classification, reducing repeated manual modifications to test programs; improving the repeatability and traceability of fault location by replaying and verifying classification conclusions; and being applicable to various PCIe FPGA functions such as CSR, DMA, MSI, ASPM, link retraining, reset, and peripheral interfaces.
[0236] To further illustrate the cross-platform conformance closed-loop verification method for PCIe FPGA devices in this application, the following specific embodiments are provided.
[0237] Example 1: SPI CSR multipath fault location:
[0238] The SPI registers include: 0x100 opcode[2:0], 0x108 CNT[4:0], 0x110 first-stage data, 0x118 to 0x130 write data, 0x138 TX_EN pulse, 0x140 to 0x160 read data / status, 0x168 second-stage data[15:0], and 0x170 interval[7:0]. Opcodes 0 to 5 correspond to command only, QUERY, 32-bit write, 128-bit write, 32-bit read, and 128-bit read, respectively.
[0239] Platform-independent baseline transactions are executed in the order of opcode, CNT, TX_DATA, INTERVAL, TX_DATA1, TX_EN pulse, and RD_DATA. Current Linux PCIe testing shows that the lower bytes of opcode, CNT, and TX_DATA are writable and readable, while 0x168 and 0x170 return 0 after being written; the phenomenon persists even after adjustments to 8 / 16-bit software access. This result proves that the problem is not solely caused by the output format, but it is not yet possible to distinguish between write and read paths solely based on PCIe self-readback.
[0240] The following confirmation transactions are generated: UART write to 0x168 / 0x170 followed by reading from both UART and PCIe; PCIe write followed by reading from UART; 8 / 16 / 32-bit access comparison; replay after soft reset; when configuration readback is normal but function fails, adjust the CNT, INTERVAL, and TX_EN pulses and observe CS / SCLK / MOSI / MISO. If the UART self-read is correct but the PCIe read is incorrect, the bias is towards PCIe readback selection; if the UART read is incorrect after PCIe write, the bias is towards PCIe write enable or Byte Enable.
[0241] Verification boundaries: Linux PCIe path and register scan logs already exist; UART and PCIe cross read / write, Windows path and automatic policy selection need to be further verified.
[0242] Example 2: task_done to MSI:
[0243] Save the original values of irq_mask, ADC / DAC timing, reset, and clock registers; clear irq_raw; remove mask bit 2; configure fast timing and dac2adc valid; trigger the DAC doorbell; poll task_done; compare host interrupt increments; and finally restore CSR. On a Linux implementation, task_done_irq_repeat 100 results in pass=100, fail=0, and exit code=0.
[0244] When crossing systems, the difference between Linux's irq_count and Windows' interrupt wait events are converted into event_delta and compared with the UVM's expected number of interrupts. If FPGA task_done is set but Linux interrupts do not increase while Windows interrupts do, then Linux MSI configuration or driver processing is listed as a candidate level, and MSI capability, vector, and driver registration status are collected.
[0245] Example 3: DMA Data Integrity:
[0246] The process involves generating a pattern, configuring the DMA length, starting DMA, polling the completion bit, reading the buffer, and verifying the data. The completion / status area is isolated from the payload area to prevent status writes from overwriting data. In actual testing on existing Linux systems, dma_repeat 1000 passes with 1000 / 1000 results, and all scans of 512 / 1024 / 2048 / 4096 bytes pass.
[0247] The unified observation log includes direction, length, completion status, actual length, payload_match, checksum, interrupt increment, and AER. If Windows passes but Linux fails, further changes are made to cache synchronization, mapping, and driver paths; if both fail but UVM passes, then the process switches to physical DMA integration and address mapping.
[0248] Example 4: Link and Reset Recovery:
[0249] ASPM L1 tests the ability to read Endpoint and Root Port, and performs DMA smoke after idle. The retraining test sets the target rate to Gen1, triggers retraining, checks 2.5GT / s and link width, and then performs DMA again. Currently, both aspm_l1 and speed_retrain_gen1 have exit codes of 0. DMA smoke also passes after function reset recovery.
[0250] When recovery fails, the scope is expanded step by step from module soft reset, FLR, thermal reset, to global reset. The type of reset recovery is used to determine the reset domain of the residual state. Remove / rescan is a high-risk operation and should only be performed under explicit authorization and protection conditions.
[0251] Figure 3 This is a schematic block diagram of a cross-platform conformance closed-loop verification system for PCIe FPGA devices provided in an embodiment of this application. Figure 3 As shown, the cross-platform conformance closed-loop verification system 300 for PCIe FPGA devices includes:
[0252] The transaction semantic extraction module 301 is used to acquire test information in the UVM simulation environment and extract transaction semantics from the acquired test information to obtain platform-independent baseline transactions.
[0253] The path adaptation module 302 is used to convert the obtained platform-independent baseline transaction into the test transaction of the corresponding target verification platform according to the access interface type of each target verification platform, so that each target verification platform can execute the corresponding test transaction.
[0254] The unified observation record conversion module 303 is used to collect the raw observation data obtained by each target verification platform from executing test transactions, and convert the collected raw observation data into unified observation records based on the preset unified observation model.
[0255] The equivalence determination module 304 is used to determine the equivalence of the unified observation records corresponding to the same test transaction on each target verification platform based on preset equivalence rules, generate the determination results of each target verification platform and write them into the path result matrix.
[0256] The confirmation transaction determination and replay module 305 is used to match the fault candidate level according to the combination of the judgment results of each target verification platform in the path result matrix, and determine the confirmation transaction according to the matched fault candidate level, so that the corresponding target verification platform executes the confirmation transaction, repeats the above unified observation record conversion operation, equivalent judgment operation, and fault candidate level matching operation to perform closed-loop iterative verification until the verification is passed.
[0257] It should be understood that the specific process of each module performing the above-mentioned steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.
[0258] It should also be understood that the module division in the embodiments of this application is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods. Furthermore, the functional modules in the various embodiments of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0259] Figure 4 This is a schematic block diagram of the electronic terminal provided in an embodiment of this application. Figure 4 As shown, the electronic terminal 400 includes at least one processor 401, a memory 402, at least one network interface 403, and a user interface 405. The various components in the electronic terminal 400 are coupled together via a bus system 404. It is understood that the bus system 404 is used to implement communication between these components. In addition to a data bus, the bus system 404 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 4 The general will label all buses as bus systems.
[0260] The user interface 405 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.
[0261] It is understood that memory 402 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable categories of memory.
[0262] In this embodiment of the invention, the memory 402 is used to store various types of data to support the operation of the electronic terminal 400. Examples of this data include: any executable program for operation on the electronic terminal 400, such as the operating system 4021 and application programs 4022; the operating system 4021 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. The application program 4022 may contain various applications, such as a media player, browser, etc., for implementing various application services. The methods provided in this embodiment of the invention can be included in the application program 4022.
[0263] The methods disclosed in the above embodiments of the present invention can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 401 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 401 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in a memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.
[0264] In an exemplary embodiment, the electronic terminal 400 may be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to execute the aforementioned method.
[0265] According to the method provided in the embodiments of this application, this application also provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to execute... Figures 1 to 2 The method of any of the embodiments shown.
[0266] According to the method provided in the embodiments of this application, this application also provides a computer-readable storage medium storing program code, which, when executed on a computer, causes the computer to perform... Figures 1 to 2 The method of any of the embodiments shown.
[0267] As used in this specification, the terms "component," "module," "system," etc., are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. As illustrated, applications running on computing devices and computing devices can both be components. One or more components may reside in a process and / or an execution thread, and components may be located on a single computer and / or distributed among two or more computers. Furthermore, these components can be executed from various computer-readable media on which various data structures are stored. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).
[0268] Those skilled in the art will recognize that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0269] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0270] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0271] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0272] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0273] In the above embodiments, the functions of each functional unit can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. A computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0274] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0275] In summary, addressing the technical challenges of existing technologies in automatically ensuring hardware behavior equivalence of register operations under multiple access paths, the inability to automatically compare return results from different verification platforms, the lack of automatic root cause localization for single-point faults, and the need for significant manual intervention in debugging after test failures, this application provides a cross-platform consistency closed-loop verification method, system, medium, terminal, and program product for PCIe FPGA devices. This method converts hardware transaction semantics in UVM test cases into physical board transactions across operating systems and physical access paths. It performs equivalence comparisons under a unified observation model and determines candidate fault levels based on multi-path result combinations, generates confirmation transactions, and replays them in a closed-loop verification process. Specifically, it first extracts transaction semantics from the test information obtained in the UVM simulation environment to obtain platform-independent baseline transactions. Then, based on the access interface type corresponding to each target verification platform, the obtained platform-independent baseline transactions are converted into test transactions for the corresponding target verification platform, enabling each target verification platform to execute the corresponding test transactions. After the test transactions are executed, the raw observation data obtained from the execution of test transactions by each target verification platform is collected, and the collected raw observation data is converted into a unified observation model based on a preset unified observation model. The process involves several steps: first, recording test data; then, based on preset equivalence rules, performing equivalence judgment on the unified observation records corresponding to the same test transaction across various target verification platforms, generating judgment results for each target verification platform, and writing them into the path result matrix; finally, matching fault candidate levels based on the combination of judgment results from each target verification platform in the path result matrix, and determining confirmation transactions based on the matched fault candidate levels, so that the corresponding target verification platform executes the confirmation transaction. This process repeats the unified observation record conversion operation, equivalence judgment operation, and fault candidate level matching operation for closed-loop iterative verification until verification is successful. This automatically ensures the hardware behavior equivalence of register operations in multi-access path scenarios, enables direct automatic comparison of results returned by different target verification platforms, achieves automatic location of single-point fault root causes, and transforms the debugging process after test failure into automated closed-loop processing, significantly reducing manual intervention and greatly improving the verification efficiency of PCIe FPGA devices. Therefore, this application effectively overcomes the various shortcomings of existing technologies and has high industrial applicability.
[0276] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A cross-platform conformance closed-loop verification method for PCIe FPGA devices, characterized in that, include: Acquire test information from the UVM simulation environment and extract transaction semantics from the acquired test information to obtain platform-independent baseline transactions; Based on the access interface type corresponding to each target verification platform, the obtained platform-independent baseline transaction is converted into a test transaction for the corresponding target verification platform, so that each target verification platform can execute the corresponding test transaction. Collect raw observation data obtained from the execution of test transactions on each target verification platform, and convert the collected raw observation data into unified observation records based on a preset unified observation model; Based on the preset equivalence rules, the unified observation records corresponding to the same test transaction on each target verification platform are evaluated for equivalence, and the evaluation results of each target verification platform are generated and written into the path result matrix. Based on the combination of judgment results of each target verification platform in the path result matrix, the fault candidate level is matched, and the confirmation transaction is determined according to the matched fault candidate level, so that the corresponding target verification platform executes the confirmation transaction. The above unified observation record transformation operation, equivalent judgment operation, and fault candidate level matching operation are repeated for closed-loop iterative verification until the verification is passed.
2. The cross-platform conformance closed-loop verification method for PCIe FPGA devices according to claim 1, characterized in that, The test information includes test cases, sequences, register abstraction layers, scoreboards, and mapping tables; the platform-independent benchmark transactions include the target, address, operation type, effective bit width, mask, actual bus access bit width, step order, inter-step delay, side effects, and expected results.
3. The cross-platform conformance closed-loop verification method for PCIe FPGA devices according to claim 1, characterized in that, The target verification platform includes a UVM simulation environment, a Linux PCIe operating system, a Windows PCIe operating system, a UART debugging path, a JTAG access path, and an SPI access path.
4. The cross-platform conformance closed-loop verification method for PCIe FPGA devices according to claim 1, characterized in that, The pre-defined unified observation model converts the collected raw observation data into unified observation records, specifically including: According to the preset field mapping rules, the original observation data is mapped to the unified record field, and the record association is established for the original observation data during the execution of test transactions on each target verification platform based on the test case identifier, transaction step identifier, access path identifier, operating system identifier and timestamp in the unified record field; The raw observation data is cleaned and normalized according to the field type and access bit width to convert the different data formats corresponding to each target verification platform into a unified data representation. Based on the byte order attribute corresponding to the access path identifier in the unified record field, the original observation data represented by the unified data is rearranged by bytes, and multiple register fragments are spliced into wide data with bit width extension according to the data segment number. For reserved bits, unrealized bits, read-only status bits, or bits unrelated to the current operation in the register, a valid bit mask is used to exclude invalid bits from the decision. The interruption events in the raw observation data corresponding to each target verification platform are converted into a unified event increment; The completion status information and error status information in the original observation data corresponding to each target verification platform are converted into a predefined unified status set.
5. The cross-platform conformance closed-loop verification method for PCIe FPGA devices according to claim 4, characterized in that, The equivalence rules include numerical equivalence rules, access semantic equivalence rules, event equivalence rules, temporal equivalence rules, and state equivalence rules; Equivalence is determined based on the numerical equivalence rule, the access semantic equivalence rule, the event equivalence rule, the temporal equivalence rule, and the state equivalence rule. If the numerical equivalence, access semantic equivalence, event equivalence, temporal equivalence, and state equivalence are all determined, the determination result is "pass"; if any one of them is determined to be equivalent, the determination result is "fail".
6. The cross-platform conformance closed-loop verification method for PCIe FPGA devices according to claim 5, characterized in that, The equivalence determination based on the numerical equivalence rule, the access semantic equivalence rule, the event equivalence rule, the temporal equivalence rule, and the state equivalence rule specifically includes: The observed value after byte rearrangement and bit width expansion, along with the pre-set expected value, are bitwise ANDed with the valid bit mask to obtain the actual valid value and the expected valid value, respectively. The obtained actual valid value and expected valid value are compared. If the actual valid value and the expected valid value are equal, they are determined to be equivalent in the valid bits. If the actual valid value and the expected valid value are not equal, they are determined to be inequivalent in the valid bits. Each target, operation type, address, effective bit width, byte enable, write value, operation order, pulse semantics, and side effects are checked one by one. If the preset semantic consistency conditions are met, the operation is determined to be semantically equivalent; if the preset semantic consistency conditions are not met, the operation is determined to be semantically inequivalent. The observed event increment obtained and transformed from the test transaction is compared with the expected event increment. If the observed event increment is equal to the expected event increment, the events are considered equivalent; if the observed event increment is not equal to the expected event increment, the events are considered inequivalent. The observed latency is calculated based on the transaction completion timestamp and the triggering operation timestamp. It is then determined whether the observed latency falls between the minimum and maximum latency. If it does, the time series is considered equivalent; otherwise, it is considered inequivalent. Alternatively, the absolute difference between the observed latency and the expected latency is calculated and compared to a preset time series tolerance. If the absolute difference is less than or equal to the tolerance, the time series is considered equivalent; otherwise, it is marked as inequivalent. Determine whether the completed state and the error state in the unified state set after the transformation have reached the expected completed state and the error state. If they have reached the expected completed state and the error state, they are considered to be equivalent. If they have not reached the expected completed state and the error state, they are considered to be inequivalent.
7. A cross-platform conformance closed-loop verification system for PCIe FPGA devices, characterized in that, include: The transaction semantic extraction module is used to acquire test information in the UVM simulation environment and extract transaction semantics from the acquired test information to obtain platform-independent baseline transactions. The path adaptation module is used to convert the obtained platform-independent baseline transaction into the test transaction of the corresponding target verification platform according to the access interface type of each target verification platform, so that each target verification platform can execute the corresponding test transaction. The unified observation record conversion module is used to collect the raw observation data obtained by each target verification platform from executing test transactions, and convert the collected raw observation data into unified observation records based on the preset unified observation model. The equivalence determination module is used to determine the equivalence of the unified observation records corresponding to the same test transaction on various target verification platforms based on preset equivalence rules, generate the determination results of each target verification platform and write them into the path result matrix. The confirmation transaction determination and replay module is used to match the fault candidate level based on the combination of judgment results of each target verification platform in the path result matrix, and determine the confirmation transaction based on the matched fault candidate level, so that the corresponding target verification platform executes the confirmation transaction, repeats the above unified observation record transformation operation, equivalent judgment operation, and fault candidate level matching operation to perform closed-loop iterative verification until the verification is passed.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
9. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer, causes the computer to implement the method as described in any one of claims 1 to 6.
10. An electronic terminal, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method as described in any one of claims 1 to 6.
