CN-122027388-A - CAN protocol-based verification method
Abstract
The application provides a verification method based on a CAN protocol, which constructs a test CAN frame according to the time sequence requirement of the CAN bus protocol through a second sending module, wherein the whole verification platform is configured into a mirror feedback mode (Mirror Feedback Mode), in the mode, the verification platform does not execute protocol analysis, and the test CAN frame which is identical with the standard CAN frame is constructed and sent back to a bus according to the time sequence requirement of the CAN bus protocol, meanwhile, the synchronization of the transmission CAN frames of the standard CAN frame and the test CAN frame is ensured, and whether the turning point of each time in the starting period to the ending period of the transmission CAN frames of the standard CAN frame and the test CAN frame is identical is compared. The application changes the verification key from protocol analysis correctness to communication link integrity and time sequence consistency, reduces the complexity of verification environment and improves the verification efficiency and reliability.
Inventors
- WANG BAIHUI
- MU LEI
- WU JIA
- ZHANG MIN
Assignees
- 芯合电子(上海)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251229
Claims (5)
- 1. A CAN protocol based authentication method, the method comprising: constructing a test CAN frame according to the CAN bus protocol time sequence requirement through a second transmitting module, and transmitting the test CAN frame to the synchronizing module; Transmitting a CAN frame construction completion signal to the first transmitting module through the second transmitting module; After the first sending module receives the CAN frame construction completion signal, the first sending module sends a standard CAN frame to the synchronous module; Synchronously transmitting the standard CAN frame and the test CAN frame to a comparison module through the synchronization module; and comparing whether the test CAN frame is identical with the standard CAN frame or not through the comparison module.
- 2. The CAN protocol based authentication method of claim 1, wherein the constructing the test CAN frame by the second transmitting module comprises: configuring test CAN frame attributes according to CAN bus protocol time sequence requirements through the second transmitting module; Storing the field of the test CAN frame attribute into a corresponding buffer; and transmitting the bit rate and the bit stream of the test CAN frame through the configuration of the second transmitting module.
- 3. The CAN protocol based authentication method of claim 1, wherein comparing whether the test CAN frame is identical to a standard CAN frame by the comparison module comprises: Comparing whether the signal generated by the test CAN frame transmitted by each bit of the synchronous module is completely consistent with the signal generated by the standard CAN frame transmitted by each bit of the synchronous module in real time through the comparison module; If so, the test CAN frame is identical to the standard CAN frame.
- 4. The CAN protocol-based authentication method of claim 1, wherein the method further comprises the synchronization module sending a response signal to the second sending module that the test CAN frame is the same as a standard CAN frame if all bits are the same as the standard CAN during the entire test CAN frame transmission; if there are bits that do not match the standard CAN during the entire transmission of the test CAN frame, the test CAN frame location that does not match the standard CAN frame is recorded.
- 5. The CAN protocol-based authentication method of claim 1, the method further comprising: And when the synchronous module sends each bit of the test CAN frame to the comparison module, the synchronous module sends a signal of each bit of the test CAN frame to the second sending module.
Description
CAN protocol-based verification method Technical Field The embodiment of the application belongs to the technical field of verification, and particularly relates to a CAN protocol-based verification method. Background In the conventional controller area network (Controller Area Network, hereinafter referred to as CAN) protocol verification process, the following steps are generally adopted, the CAN controller generates and transmits CAN frames, the CAN frames specifically comprise standard frames, extended frames, data frames, remote frames and the like, a verification component (Verification Intellectual Property, hereinafter referred to as VIP) deployed in a verification platform receives CAN frames from a Register transmission level (Register-TRANSFER LEVEL, hereinafter referred to as RTL), complete CAN protocol analysis logic is needed to be realized inside the VIP, the complete CAN protocol analysis logic comprises frame type Identification, identifier (Identification) analysis of a message, data field extraction, cyclic redundancy check (Cyclic Redundancy Check, hereinafter referred to as CRC), validation characters (Acknowledge character, hereinafter referred to as ACK) response and the like, the VIP judges the correctness of RTL transmission behaviors according to analysis results and generates corresponding verification reports, and complex scenes such as bus error simulation, node conflict, frame interval processing and the like are often needed in a verification environment. The complexity of the verification environment in the prior art is high, the VIP needs to realize a complete CAN protocol analysis stack, and the development and maintenance cost is high. The VIP development process takes longer time, the difference exists between the early VIP analysis logic and the RTL implementation, the VIP needs to be continuously debugged, and the time consumption is longer. When the analysis is inconsistent, the RTL code and the VIP analysis logic need to be checked at the same time, and the problem of positioning is time-consuming. The scene coverage is limited and complicated, and error injection and time sequence adjustment are required to be controlled finely in the VIP analysis logic, so that the difficulty in setting up the verification scene is increased. The performance overhead parses each frame in real time and performs a check that may affect the speed of the simulation when a large number of frames are transmitted. Disclosure of Invention In order to solve or alleviate the technical problem in the prior art, the application does not analyze the test CAN frame sent by the second sending module through the first sending module, but directly feeds back and sends a mirror image frame (standard CAN frame) which is completely the same as the receiving frame (test CAN frame), thereby turning the verification key from the protocol analysis accuracy to the communication link integrity and time sequence consistency, reducing the complexity of the verification environment and improving the verification efficiency and reliability. The embodiment of the application provides a verification method based on a CAN protocol, which comprises the following steps: constructing a test CAN frame according to the CAN bus protocol time sequence requirement through a second transmitting module, and transmitting the test CAN frame to the synchronizing module; Transmitting a CAN frame construction completion signal to the first transmitting module through the second transmitting module; After the first sending module receives the CAN frame construction completion signal, the first sending module sends a standard CAN frame to the synchronous module; Synchronously transmitting the standard CAN frame and the test CAN frame to a comparison module through the synchronization module; and comparing whether the test CAN frame is identical with the standard CAN frame or not through the comparison module. As a preferred embodiment of the present application, the constructing, by the second transmitting module, the test CAN frame includes: configuring test CAN frame attributes according to CAN bus protocol time sequence requirements through the second transmitting module; Storing the field of the test CAN frame attribute into a corresponding buffer; and transmitting the bit rate and the bit stream of the test CAN frame type through the second transmitting module configuration. As a preferred embodiment of the present application, comparing, by the comparison module, whether the test CAN frame is identical to a standard CAN frame includes: Comparing whether the signal generated by the test CAN frame transmitted by each bit of the synchronous module is completely consistent with the signal generated by the standard CAN frame transmitted by each bit of the synchronous module in real time through the comparison module; If so, the test CAN frame is identical to the standard CAN frame. As a preferred embodiment of the present applicat