A ymodem protocol simulation method for chip simulation verification stage
Patent Information
- Application Number
- CN202611258686.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-09-22
AI Technical Summary
[0006]本发明的目的在于提供一种用于芯片仿真验证阶段的Ymodem协议仿真方法,以解决上述无法验证芯片内部Ymodem协议固件功能的问题
本发明通过设计Ymodem协议数据包生成软件,实现了将镜像数据生成为符合芯片内部Ymodem协议固件采用的协议的分立数据包,根据芯片内部Ymodem协议固件采用的协议,设计了VIP与芯片内部Ymodem协议固件的交互流程;并支持错误注入,以验证芯片内部Ymodem协议固件对错误状态的处理能力、支持Ymodem协议标准规定的2个EOT以及简化的1个EOT、支持Ymodem协议的数据重传机制,并将数据重传机制可配置为使能和关闭功能、以及同时支持单个和多个文件传输,从而解决了芯片仿真验证阶段无法验证芯片内部Ymodem协议固件功能的问题。
Smart Images

Figure CN122797409A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip simulation and verification technology, and in particular to a Ymodem protocol simulation method for the chip simulation and verification stage. Background Technology
[0002] The Ymodem protocol is a commonly used communication protocol suitable for byte-stream communication channels. Byte-stream communication channels are used to carry byte-by-byte interactive data of the Ymodem protocol. Byte-stream communication channels typically include UART, USB, SPI, and I2C. The Ymodem protocol firmware inside the chip is generally used to download image data. Functionally, image data includes, but is not limited to, configuration data or secondary boot programs.
[0003] During the chip simulation and verification phase, in order to verify the functionality of the chip's internal Ymodem protocol firmware, it is necessary to connect the communication interface used by the chip's internal Ymodem protocol firmware to the corresponding VIP and perform Ymodem protocol interaction.
[0004] Currently, in the chip's EDA simulation environment, the VIP does not support the Ymodem protocol and can only send and receive byte stream data. Therefore, the VIP cannot complete the Ymodem protocol simulation with the chip's internal Ymodem protocol firmware, making it impossible to verify the functionality of the chip's internal Ymodem protocol firmware.
[0005] Therefore, there is an urgent need to propose a Ymodem protocol simulation method for the chip simulation and verification stage to solve the above-mentioned technical defects. Summary of the Invention
[0006] The purpose of this invention is to provide a Ymodem protocol simulation method for the chip simulation and verification stage, so as to solve the problem of being unable to verify the internal Ymodem protocol firmware function of the chip.
[0007] To address the aforementioned technical problems, this invention provides a Ymodem protocol simulation method for the chip simulation and verification stage, applied in an EDA simulation environment for chip design, comprising: By using Ymodem protocol packet generation software, the image data is generated into discrete data packets that conform to the protocol used by the Ymodem protocol firmware inside the chip; According to the protocol adopted by the Ymodem protocol firmware, the interaction process between the VIP verification module and the Ymodem protocol firmware is configured to complete the Ymodem protocol interaction of control packets and discrete data packets; wherein the interaction process supports error injection to verify the Ymodem protocol firmware's ability to handle error states. After obtaining the flag indicating the completion of the Ymodem protocol interaction through the Testbench testing platform, the simulation process ends.
[0008] Preferably, the process of generating discrete data packets using Ymodem protocol data packet generation software includes: The input parameters are parsed and the input file is opened; the input parameters include the image file path and configuration options; the configuration options include the packet size and the injection error type. The discrete data packets are generated according to the Ymodem protocol; wherein the discrete data packets include a header packet, a data packet, and an end packet; Based on the injection error type, execute the injection error logic; Close the input file and all output files.
[0009] Preferably, the data packet size includes 128 bytes and 1024 bytes; the injection error type includes one or more of the following: verification error, packet sequence number error, control packet error, timing error, and semantic error.
[0010] Preferably, the verification errors include one or more of the following: a 16-bit CRC checksum error or an 8-bit checksum error; a missing 16-bit CRC checksum or an 8-bit checksum; the packet sequence number errors include one or more of the following: a mismatch between the packet sequence number and its complement; the same sequence number for two adjacent packets; and the packet sequence number not incremented by 1; the control packet errors include one or more of the following: a mismatch between the start character SOH or STX and the data area length; an illegal value other than SOH or STX as the start character; and failure to send an EOT transmission end command after data transmission is complete; the timing errors include failure to send data to the Ymodem protocol firmware within the specified maximum time; and the semantic level errors include one or more of the following: the verification method used by the VIP authentication module is inconsistent with the C or NAK transmission mode characters sent by the Ymodem protocol firmware; the VIP authentication module sends a data packet directly instead of a header information packet; and the VIP authentication module sends the next data packet without receiving an ACK confirmation response.
[0011] Preferably, the interaction process includes: The Ymodem protocol firmware sends C or NAK transmission mode characters to request CRC mode transmission or 8-bit checksum mode transmission respectively. After receiving the C or NAK transmission mode character through the VIP authentication module, a header information packet is sent; when the Ymodem protocol firmware verifies the received header information packet, an ACK confirmation response is sent; when the VIP authentication module receives an ACK confirmation response, a corresponding data packet is sent, until the last data packet is sent; When the Ymodem protocol firmware receives and verifies each data packet, it sends an ACK confirmation response. When the VIP authentication module receives the ACK confirmation response corresponding to the last data packet, it sends an EOT transmission end command and waits for the Ymodem protocol firmware to return a response signal. The VIP authentication module executes different strategies based on different response signals. When the Ymodem protocol firmware receives the end packet, it sends an ACK confirmation response. When the VIP verification module receives the ACK confirmation response corresponding to the end packet, the Testbench test platform determines that the Ymodem protocol interaction is successful and ends the simulation process.
[0012] Preferably, the VIP verification module executes different strategies based on different response signals, and the different strategies include: Strategy 1: When the Ymodem protocol firmware directly returns an ACK confirmation response, the Ymodem protocol firmware sends a C or NAK transmission mode character to the VIP authentication module to request the next file transmission; if there is no next file to send, the VIP authentication module sends an end packet; if there is a next file to send, the VIP authentication module sends the header information packet of the next file and completes the subsequent Ymodem protocol interaction. Strategy 2: When the Ymodem protocol firmware returns a negative response (NAK), the VIP authentication module sends a second EOT transmission end command. Then, the Ymodem protocol firmware returns an ACK confirmation response. The Ymodem protocol firmware sends a C or NAK transmission mode character to the VIP authentication module to request the next file transmission. If there is no next file to send, the VIP authentication module sends an end packet. If there is a next file to send, the VIP authentication module sends the header information packet of the next file and completes the subsequent Ymodem protocol interaction.
[0013] Preferably, the VIP verification module further includes a data retransmission mechanism supporting the Ymodem protocol, the data retransmission mechanism including: When the Ymodem protocol firmware detects an abnormality in the received data packet, it sends a data retransmission signal, i.e., a denial response (NAK), to the VIP authentication module. When the retransmission function is enabled, the VIP authentication module, upon receiving the data retransmission signal, retransmits the current data packet to the Ymodem protocol firmware. When the retransmission function is disabled, the VIP authentication module, upon receiving the data retransmission signal, does not retransmit the current data packet to the Ymodem protocol firmware, but only uses the denial response (NAK) sent by the Ymodem protocol firmware as the basis for evaluating the simulation results.
[0014] Preferably, the VIP verification module also includes support for the two EOT transmission termination commands specified in the Ymodem protocol standard and a simplified EOT transmission termination command, and supports single and multiple file transmissions.
[0015] This invention also provides a chip Ymodem protocol simulation and verification system, which executes the Ymodem protocol simulation method for the chip simulation and verification stage as described above, including: The verification environment includes a DUT (Device Under Test) module to be verified and a VIP (Virtual Identity) verification module; wherein the DUT module to be verified includes Ymodem protocol firmware and a communication interface located inside the chip; the Ymodem protocol firmware is connected to the VIP verification module through the communication interface. The Testbench testing platform is used to control the Ymodem protocol simulation process and check the simulation results.
[0016] Preferably, the communication interface adopts a byte-stream communication channel to carry byte-by-byte interactive data of the Ymodem protocol, and the interface type of the byte-stream communication channel includes UART, USB, SPI or I2C interface.
[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention designs Ymodem protocol data packet generation software, which generates discrete data packets from image data that conform to the protocol used by the chip's internal Ymodem protocol firmware. Based on the protocol used by the chip's internal Ymodem protocol firmware, an interaction process between the VIP and the chip's internal Ymodem protocol firmware is designed. It also supports error injection to verify the chip's internal Ymodem protocol firmware's ability to handle error states, supports the two EOTs specified in the Ymodem protocol standard and a simplified one EOT, supports the Ymodem protocol's data retransmission mechanism, and allows the data retransmission mechanism to be enabled and disabled. Furthermore, it supports both single and multiple file transfers, thereby solving the problem that the chip's internal Ymodem protocol firmware functionality cannot be verified during the chip simulation verification stage. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a Ymodem protocol simulation method for chip simulation and verification provided by the present invention.
[0019] Figure 2 This is a schematic diagram of the chip Ymodem protocol simulation and verification system provided by the present invention.
[0020] Figure 3 This is a schematic diagram of the Ymodem protocol data packet generation software process provided by the present invention.
[0021] Figure 4 This is a schematic diagram of the Ymodem protocol interaction process provided by the present invention. Detailed Implementation
[0022] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of the present invention will become clearer from the following description. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.
[0023] like Figure 1 As shown, this embodiment of the invention specifically provides a Ymodem protocol simulation method for the chip simulation and verification stage, applied in the EDA simulation environment of chip design, including: By using Ymodem protocol packet generation software, the image data is generated into discrete data packets that conform to the protocol used by the Ymodem protocol firmware inside the chip; According to the protocol adopted by the Ymodem protocol firmware, the interaction process between the VIP verification module and the Ymodem protocol firmware is configured to complete the Ymodem protocol interaction of control packets and discrete data packets; wherein the interaction process supports error injection to verify the Ymodem protocol firmware's ability to handle error states. After obtaining the flag indicating the completion of the Ymodem protocol interaction through the Testbench testing platform, the simulation process ends.
[0024] like Figure 3 As shown, the process of generating discrete data packets using Ymodem protocol data packet generation software includes the following steps: input parameter parsing, opening the input file, generating header information packets, generating data packets, generating end packets, error injection, and closing the input and output files; Specifically, it includes: The input parameters are parsed and the input file is opened; the input parameters include the image file path and configuration options; the configuration options include the packet size and the injection error type. The discrete data packets are generated according to the Ymodem protocol; wherein the discrete data packets include a header packet, a data packet, and an end packet; Based on the injection error type, execute the injection error logic; Close the input file and all output files.
[0025] The Ymodem protocol packet generation software first checks the input parameters, which include the image file path and configuration options. Configuration options include packet size and injection error type. The packet size includes 128 bytes and 1024 bytes.
[0026] The injected error types include one or more of the following: verification errors, packet sequence number errors, control packet errors, timing errors, and semantic errors. Verification errors include one or more of the following: 16-bit CRC checksum or 8-bit checksum error; missing 16-bit CRC checksum or 8-bit checksum. Packet sequence number errors include one or more of the following: mismatch between packet sequence number and its complement; identical sequence numbers for two adjacent packets; and packet sequence numbers not incremented by 1. Control packet errors include one or more of the following: mismatch between the start character (SOH) or STX and the data area length; an illegal value other than SOH or STX as the start character; and failure to send an EOT (End of Transmission) command after data transmission. Timing errors include failure to send data to the Ymodem protocol firmware within the specified maximum time. Semantic errors include one or more of the following: the verification method used by the VIP authentication module is inconsistent with the C or NAK transmission mode characters sent by the Ymodem protocol firmware; the VIP authentication module sends data packets directly without sending header information packets; and the VIP authentication module sends the next data packet without receiving an ACK confirmation response.
[0027] The above execution injects error logic, and the corresponding error logic is as follows: For errors in the 16-bit CRC checksum or 8-bit checksum, the correct value is incremented by 1 to obtain the check result. For missing 16-bit CRC checksum or 8-bit checksum, the field is removed. For mismatches between packet sequence numbers and their complements, the correct complement value is incremented by 1 to obtain the complement. For packet sequence numbers not incrementing by 1, the previous packet number is incremented by 2 to obtain the next packet number. Finally, the input file and all output files are closed.
[0028] like Figure 4 The diagram shows the Ymodem protocol interaction process. This process is configured according to the specific protocol used by the Ymodem protocol firmware inside the chip, and includes: The Ymodem protocol firmware sends C or NAK transmission mode characters to request CRC mode transmission or 8-bit checksum mode transmission respectively. After receiving the C or NAK transmission mode character through the VIP authentication module, a header information packet is sent; when the Ymodem protocol firmware verifies the received header information packet, an ACK confirmation response is sent; when the VIP authentication module receives an ACK confirmation response, a corresponding data packet is sent, until the last data packet is sent; When the Ymodem protocol firmware receives and verifies each data packet, it sends an ACK confirmation response. When the VIP authentication module receives the ACK confirmation response corresponding to the last data packet, it sends an EOT transmission end command and waits for the Ymodem protocol firmware to return a response signal. The VIP authentication module executes different strategies based on different response signals. When the Ymodem protocol firmware receives the end packet, it sends an ACK confirmation response. When the VIP verification module receives the ACK confirmation response corresponding to the end packet, the Testbench test platform determines that the Ymodem protocol interaction is successful and ends the simulation process.
[0029] As a preferred embodiment of the present invention, the Ymodem protocol interaction process specifically includes: (1) The Ymodem protocol firmware inside the chip first sends the C transmission mode character to request CRC mode transmission; (2) After receiving the C transmission mode characters, the VIP sends a header information packet; (3) The Ymodem protocol firmware receives the header information packet and performs verification. After the verification is successful, it sends an ACK.
[0030] (4) After receiving an ACK, the VIP sends a data packet until the last data packet is sent. (5) The Ymodem protocol firmware performs verification after receiving each data packet. After the verification is successful, it sends an ACK. (6) After the VIP receives the ACK corresponding to the last data packet, it sends EOT and then waits for the Ymodem protocol firmware to return an acknowledgment signal. The Ymodem protocol firmware directly returns ACK and sends C to the VIP to request the next file transfer. The VIP then sends an end packet. (7) After receiving the end packet, the Ymodem protocol firmware sends an ACK; (8) After the VIP receives the ACK corresponding to the end packet, Testbench determines that the Ymodem protocol interaction is successful and ends the simulation process.
[0031] Preferably, the VIP verification module executes different strategies based on different response signals, and the different strategies include: Strategy 1: When the Ymodem protocol firmware directly returns an ACK confirmation response, the Ymodem protocol firmware sends a C or NAK transmission mode character to the VIP authentication module to request the next file transmission; if there is no next file to send, the VIP authentication module sends an end packet; if there is a next file to send, the VIP authentication module sends the header information packet of the next file and completes the subsequent Ymodem protocol interaction. Strategy 2: When the Ymodem protocol firmware returns a negative response (NAK), the VIP authentication module sends a second EOT transmission end command. Then, the Ymodem protocol firmware returns an ACK confirmation response. The Ymodem protocol firmware sends a C or NAK transmission mode character to the VIP authentication module to request the next file transmission. If there is no next file to send, the VIP authentication module sends an end packet. If there is a next file to send, the VIP authentication module sends the header information packet of the next file and completes the subsequent Ymodem protocol interaction.
[0032] Preferably, the VIP verification module further includes a data retransmission mechanism supporting the Ymodem protocol, the data retransmission mechanism including: When the Ymodem protocol firmware detects an abnormality in the received data packet, it sends a data retransmission signal, i.e., a denial response (NAK), to the VIP authentication module. When the retransmission function is enabled, the VIP authentication module, upon receiving the data retransmission signal, retransmits the current data packet to the Ymodem protocol firmware. When the retransmission function is disabled, the VIP authentication module, upon receiving the data retransmission signal, does not retransmit the current data packet to the Ymodem protocol firmware, but only uses the denial response (NAK) sent by the Ymodem protocol firmware as the basis for evaluating the simulation results.
[0033] Preferably, the VIP verification module also includes support for the two EOT transfer termination commands specified in the Ymodem protocol standard and a simplified EOT transfer termination command, and supports single and multiple file transfers.
[0034] This embodiment uses a checksum error as an example for specific explanation. The Ymodem protocol data packet generation software first calculates the 16-bit CRC checksum value of the header packet. When generating the header packet, it adds 1 to the 16-bit CRC checksum value and writes it into the header packet. In the Ymodem protocol interaction process, Testbench disables the retransmission function. When the Ymodem protocol firmware receives the header packet with the injected error, it checks for a 16-bit CRC checksum error and sends a NAK to the VIP. Subsequently, Testbench uses the NAK sent by the Ymodem protocol firmware as the basis for judging the simulation results, determines that the Ymodem protocol firmware has CRC checksum functionality, and ends the simulation.
[0035] like Figure 2As shown, this embodiment of the invention also provides a chip Ymodem protocol simulation and verification system, which consists of a verification environment and a Testbench. The verification environment consists of a DUT and a VIP. The DUT includes the chip's internal Ymodem protocol firmware and communication interface. The communication interface adopts UART. The UART communication interface used by the Ymodem protocol firmware is connected to the corresponding UART interface VIP to form the verification environment. The Testbench controls the Ymodem protocol simulation process and checks the simulation results.
[0036] Preferably, the communication interface uses a byte-stream communication channel to carry byte-by-byte interactive data of the Ymodem protocol, including but not limited to UART, USB, SPI, I2C or other equivalent byte-stream communication interfaces at the emulation abstraction level.
[0037] The above description is merely a description of preferred embodiments of the present invention and is not intended to limit the scope of the present invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure shall fall within the protection scope of the claims.
Claims
1. A Ymodem protocol simulation method for chip simulation and verification, characterized in that, EDA simulation environments used in chip design include: By using Ymodem protocol packet generation software, the image data is generated into discrete data packets that conform to the protocol used by the Ymodem protocol firmware inside the chip; According to the protocol adopted by the Ymodem protocol firmware, the interaction process between the VIP verification module and the Ymodem protocol firmware is configured to complete the Ymodem protocol interaction of control packets and discrete data packets; wherein the interaction process supports error injection to verify the Ymodem protocol firmware's ability to handle error states. After obtaining the flag indicating the completion of the Ymodem protocol interaction through the Testbench testing platform, the simulation process ends.
2. The Ymodem protocol simulation method for chip simulation and verification as described in claim 1, characterized in that, The process of generating discrete data packets using Ymodem protocol data packet generation software includes: The input parameters are parsed and the input file is opened; the input parameters include the image file path and configuration options; the configuration options include the packet size and the injection error type. The discrete data packets are generated according to the Ymodem protocol; wherein the discrete data packets include a header packet, a data packet, and an end packet; Based on the injection error type, execute the injection error logic; Close the input file and all output files.
3. The Ymodem protocol simulation method for chip simulation and verification as described in claim 2, characterized in that, The data packet size includes 128 bytes and 1024 bytes; the injection error type includes one or more of the following: verification error, packet sequence number error, control packet error, timing error, and semantic error.
4. The Ymodem protocol simulation method for chip simulation and verification as described in claim 3, characterized in that, The verification errors include one or more of the following: a 16-bit CRC checksum error or an 8-bit checksum error; a missing 16-bit CRC checksum or an 8-bit checksum. The packet sequence number errors include one or more of the following: a mismatch between the packet sequence number and its complement; the same sequence number for two adjacent packets; and the packet sequence number not incremented by "+1". The control packet errors include one or more of the following: a mismatch between the start character SOH or STX and the data area length; an illegal value other than SOH or STX as the start character; and failure to send an EOT (End of Transmission) command after data transmission. The timing errors include failure to send data to the Ymodem protocol firmware within the specified maximum time. The semantic-level errors include one or more of the following: the verification method used by the VIP authentication module is inconsistent with the C or NAK transmission mode characters sent by the Ymodem protocol firmware; the VIP authentication module sends a data packet directly instead of a header information packet; and the VIP authentication module sends the next data packet without receiving an ACK confirmation response.
5. The Ymodem protocol simulation method for chip simulation and verification as described in claim 1, characterized in that, The interaction process includes: The Ymodem protocol firmware sends C or NAK transmission mode characters to request CRC mode transmission or 8-bit checksum mode transmission respectively. After receiving the C or NAK transmission mode character through the VIP authentication module, a header information packet is sent; when the Ymodem protocol firmware verifies the received header information packet, an ACK confirmation response is sent; when the VIP authentication module receives an ACK confirmation response, a corresponding data packet is sent, until the last data packet is sent; When the Ymodem protocol firmware receives and verifies each data packet, it sends an ACK confirmation response. When the VIP authentication module receives the ACK confirmation response corresponding to the last data packet, it sends an EOT transmission end command and waits for the Ymodem protocol firmware to return a response signal. The VIP authentication module executes different strategies based on different response signals. When the Ymodem protocol firmware receives the end packet, it sends an ACK confirmation response. When the VIP verification module receives the ACK confirmation response corresponding to the end packet, the Testbench test platform determines that the Ymodem protocol interaction is successful and ends the simulation process.
6. The Ymodem protocol simulation method for chip simulation and verification as described in claim 5, characterized in that, The VIP verification module executes different strategies based on different response signals, and the different strategies include: Strategy 1: When the Ymodem protocol firmware directly returns an ACK confirmation response, the Ymodem protocol firmware sends a C or NAK transmission mode character to the VIP authentication module to request the next file transmission; if there is no next file to send, the VIP authentication module sends an end packet; if there is a next file to send, the VIP authentication module sends the header information packet of the next file and completes the subsequent Ymodem protocol interaction. Strategy 2: When the Ymodem protocol firmware returns a negative response (NAK), the VIP authentication module sends a second EOT transmission end command. Then, the Ymodem protocol firmware returns an ACK confirmation response. The Ymodem protocol firmware sends a C or NAK transmission mode character to the VIP authentication module to request the next file transmission. If there is no next file to send, the VIP authentication module sends an end packet. If there is a next file to send, the VIP authentication module sends the header information packet of the next file and completes the subsequent Ymodem protocol interaction.
7. The Ymodem protocol simulation method for chip simulation and verification as described in claim 1, characterized in that, The VIP verification module also includes a data retransmission mechanism supporting the Ymodem protocol, which includes: When the Ymodem protocol firmware detects an abnormality in the received data packet, it sends a data retransmission signal, i.e., a denial response (NAK), to the VIP authentication module. When the retransmission function is enabled, the VIP authentication module, upon receiving the data retransmission signal, retransmits the current data packet to the Ymodem protocol firmware. When the retransmission function is disabled, the VIP authentication module, upon receiving the data retransmission signal, does not retransmit the current data packet to the Ymodem protocol firmware, but only uses the denial response (NAK) sent by the Ymodem protocol firmware as the basis for evaluating the simulation results.
8. The Ymodem protocol simulation method for chip simulation and verification as described in claim 1, characterized in that, The VIP authentication module also supports two EOT transmission termination commands specified in the Ymodem protocol standard, as well as a simplified EOT transmission termination command, and supports single and multiple file transfers.
9. A chip Ymodem protocol simulation and verification system, executing the Ymodem protocol simulation method for the chip simulation and verification stage as described in any one of claims 1 to 8, characterized in that, include: The verification environment includes the DUT module to be verified and the VIP verification module; The DUT to be verified module includes Ymodem protocol firmware and a communication interface located inside the chip; the Ymodem protocol firmware is connected to the VIP verification module through the communication interface; The Testbench testing platform is used to control the Ymodem protocol simulation process and check the simulation results.
10. The chip Ymodem protocol simulation and verification system as described in claim 9, characterized in that, The communication interface uses a byte-stream communication channel to carry byte-by-byte interactive data of the Ymodem protocol. The interface type of the byte-stream communication channel includes UART, USB, SPI or I2C interface.