FPGA internal online logic analysis monitoring circuit and method

Through the internal online logic analysis and monitoring circuit of FPGA, the state machine and ring storage structure are used to realize the storage of FPGA signals before and after triggering, which solves the problem in the existing technology that the data before signal triggering cannot be monitored and stored in real time, and improves the logic analysis. instrument usage efficiency and transmission efficiency.

CN114184942BActive Publication Date: 2024-10-15SHANGHAI ANLOGIC INFOTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111518344.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2024-10-15
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

Existing logic analyzers cannot monitor and store data before signal triggering in real time during FPGA debugging, resulting in testers being unable to observe the status before signal triggering.

Method used

An FPGA internal online logic analysis and monitoring circuit is designed, including a state machine unit, a configuration unit, a circuit monitoring unit and a ring storage unit. The state machine analyzes the input signal, configures the register, compares the sampling signal and the control register, and generates write control information. And use the ring storage structure to store the sampling signals before and after triggering.

Benefits of technology

It realizes the state storage and recording of the circuit signal under test before and after triggering, which facilitates observation and positioning, improves the use efficiency of the logic analyzer, and improves the transmission efficiency by parameterizing the dynamic bit width.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114184942B_ABST
    Figure CN114184942B_ABST
Patent Text Reader

Abstract

The present invention provides an internal online logic analysis monitoring circuit and method of an FPGA. The internal online logic analysis monitoring circuit of the FPGA comprises a state machine unit, a configuration unit, a circuit monitoring unit and a ring storage unit. The state machine unit is electrically connected to the circuit monitoring unit through the configuration unit. The state machine unit is used to analyze an input signal and output an analysis result. The configuration unit is used to configure a register in the circuit monitoring unit according to the analysis result. The circuit monitoring unit is used to output write control information according to an acquired sampling signal and a configured register. The ring storage unit is used to store the sampling signal according to the write control information. The circuit monitoring unit comprises a trigger comparator and a storage controller, which can store the sampling signals before and after the monitoring trigger, facilitate the observation of the state before the signal is triggered, selectively shield the sampling signal, and effectively improve the data transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of field programmable gate arrays, and in particular to an online logic analysis monitoring circuit and method inside an FPGA. Background Art

[0002] A logic analyzer is a device that observes timing signals. It can monitor the level changes of test signals when the hardware circuit is working, store them in the memory inside the device, and finally display the collected waveform data in the form of a graph. Testers can visually observe the state changes of the test signal through the screen, which is convenient for quick positioning and problem solving. It is mainly used in fields related to communication protocols, such as automotive electronics, digital circuit testing, automation systems, etc.

[0003] When the logic analyzer device is used to debug the Field Programmable Gate Arrays (FPGA), the measured signal needs to be led to the input and output (IO) pins, and then connected to the logic analyzer. However, with the increase in design complexity, the disadvantages of traditional logic analyzer equipment have gradually emerged. Because with the increase in FPGA functions, the bit width of the measured signal increases accordingly, and the number of available IO pins decreases, which results in the number of IO pins being unable to meet the bit width of the measured signal. This limits the use of logic analyzer equipment to a certain extent. At present, FPGA manufacturers have integrated online logic analyzer tools in their respective electronic design automation (EDA) software, and domestic research institutions have also developed their own circuit designs. However, the current online logic analyzer needs to wait until the trigger signal meets the trigger condition before the RAM starts to store the sampled signal, resulting in no data before the trigger is stored in the RAM, and the tester cannot observe the state of the signal before the trigger.

[0004] Therefore, it is necessary to provide a novel FPGA internal online logic analysis monitoring circuit and method to solve the above problems existing in the prior art. Summary of the invention

[0005] The purpose of the present invention is to provide an FPGA internal online logic analysis monitoring circuit and method, which can store the sampling signals before and after the monitoring trigger, so as to facilitate the observation of the state before the signal is triggered.

[0006] To achieve the above-mentioned purpose, the FPGA internal online logic analysis and monitoring circuit of the present invention includes a state machine unit, a configuration unit, a circuit monitoring unit and a ring storage unit, wherein the state machine unit is electrically connected to the circuit monitoring unit through the configuration unit, and the output end of the circuit monitoring unit is electrically connected to the ring storage unit, the state machine unit is used to parse the input signal and output the parsing result, the configuration unit is used to configure the register in the circuit monitoring unit according to the parsing result, the circuit monitoring unit is used to output write control information according to the acquired sampling signal and the configured register, and the ring storage unit is electrically connected to the circuit monitoring unit and is used to store the sampling signal according to the write control information;

[0007] Among them, the circuit monitoring unit includes a trigger comparator and a storage controller, the trigger comparator has a built-in control register, the configuration unit is electrically connected to the trigger unit to configure the control register, the trigger comparator compares the sampling signal with the control register to output trigger status information, and the storage controller outputs the write control information according to the trigger status information and generates a status register.

[0008] The beneficial effect of the FPGA internal sub-line logic analysis circuit described in the present invention is that: the input signal is analyzed and the analysis result is generated by the state machine unit, and the control register in the circuit monitoring unit is configured according to the analysis result by the configuration unit, so that the circuit monitoring unit compares the sampling signal with the control register through the trigger comparator and outputs the trigger state, the storage controller outputs write control information according to the trigger state and generates a state register, and the ring storage unit stores the sampling signal according to the output write control information. Since the ring storage unit adopts a ring storage structure to store the sampling signal, the sampling signals before and after the trigger can be continuously stored in a loop, which is convenient for observing the state of the circuit to be tested before the trigger, and it is convenient to locate the sampling signal stored in the ring storage unit through the state register.

[0009] Optionally, the control register includes a group of trigger control bits and at least one group of trigger signal groups, the trigger signal group includes a trigger mask bit, a trigger comparison bit and a trigger condition bit, and the bit width of the trigger mask bit is the same as the bit width of the trigger comparison bit. The beneficial effect is that by setting the trigger mask bit with the same bit width as the trigger comparison bit, it is convenient to selectively mask some bits in the sampled signal.

[0010] Optionally, the bit width of the trigger comparison bit is a parameterized dynamic bit width. The beneficial effect is that the use of parameterized dynamic bit width can effectively improve the transmission efficiency during the transmission process, and compared with the fixed bit width, the use of dynamic bit width significantly increases the number of trigger signal groups and the upper limit of the bit width.

[0011] Optionally, the status register includes an address indication bit, an overflow indication bit and a stop indication bit.

[0012] Optionally, it further comprises an extended function unit, which is electrically connected to the configuration unit to achieve functional expansion. Its beneficial effect is that it is convenient to expand the internal online logic analysis and monitoring circuit of the FPGA through the extended function unit.

[0013] Optionally, the configuration unit includes a handshake synchronization circuit and a shift register circuit, and the shift register circuit is electrically connected to the state machine unit and the handshake synchronization circuit respectively, and is used to shift configure the control register according to the analysis result, or shift output the state register;

[0014] The handshake synchronization circuit is electrically connected to the trigger comparator, the storage controller and the shift register circuit respectively, and the handshake synchronization circuit is used to perform clock domain synchronization on the control register and the status register.

[0015] The present invention also provides an FPGA internal online logic analysis monitoring method, the monitoring method comprising the following steps:

[0016] Providing the above-mentioned FPGA internal online logic analysis and monitoring circuit;

[0017] Input a switch control instruction, and parse the switch control instruction through a state machine unit to turn on a configuration switch of a control register;

[0018] Input configuration information, parse the configuration information through the state machine unit to generate a configuration parsing result, and configure the control register according to the configuration parsing result;

[0019] Synchronizing the clock domain of the control register to the clock domain of the circuit monitoring unit through the configuration unit;

[0020] A sampling signal of the circuit to be tested is obtained, and the operating state of the ring storage unit is obtained according to the comparison between the sampling signal and the control register, and the sampling signal is stored in the ring storage unit according to the operating state of the ring storage unit.

[0021] The beneficial effect of the FPGA internal online logic analysis and monitoring method described in the present invention is that: the above-mentioned FPGA internal online logic analysis and monitoring circuit is used to analyze and test the sampling signal of the circuit to be tested, and the sampling signal is compared with the control register to obtain the operating status of the ring storage unit, so that the sampling signal is stored in the ring storage unit according to the operating status of the ring storage unit, thereby completing the monitoring and storage of the sampling signal, facilitating the storage and recording of the status before and after the sampling signal is triggered, and some bits in the sampling signal can be selectively shielded by triggering the mask bit, and the use of parameterized trigger comparison bits with dynamic bit width can effectively improve the transmission efficiency during the transmission process.

[0022] Optionally, the comparing the sampling signal with the control register to obtain the operating state of the ring storage unit includes:

[0023] Obtaining the number of sampling signals currently to be stored in the annular storage unit;

[0024] After determining that the stored quantity is greater than the trigger position of the control register, the trigger comparator compares the sampling signal with the control register for trigger conditions and outputs a trigger state;

[0025] After determining that the sampling signal satisfies the trigger condition bit according to the trigger state, the storage controller outputs write control information according to the trigger state;

[0026] After determining that the write control information is write stop information, the write operation state of the ring storage unit is acquired.

[0027] Optionally, the comparing the sampling signal with the control register to obtain the operating state of the ring storage unit includes:

[0028] Obtaining the states of the trigger enable bit and the trigger pause bit in the control register;

[0029] After determining that the trigger enable bit and the trigger pause bit meet the requirements, the operating state of the ring storage unit is acquired.

[0030] Optionally, storing the sampling signal into the annular storage unit according to the operating state of the annular storage unit includes:

[0031] Determining whether the operation state of the annular storage unit is a stopped state;

[0032] After determining that the annular storage unit is in a stopped state, stop collecting the sampling signal, and the annular storage unit stops storing the sampling signal;

[0033] After determining that the annular storage unit is not in the stopped state, the sampling signal continues to be collected, and the annular storage unit continues to store the sampling signal.

[0034] Optionally, after the storage controller outputs a write control stop signal, the method further includes generating a status register through the storage controller, and inputting a read back instruction to read back the status register through the state machine unit.

[0035] Optionally, the inputting a read-back instruction to read back the status register through the state machine unit includes:

[0036] Input the read-back instruction and parse it through the state machine unit to turn on the read-back status register switch;

[0037] Synchronizing the clock domain of the state register to the clock domain of the state machine unit through a handshake synchronization circuit;

[0038] The state register is shifted and outputted through the shift register circuit, and the output state register is read back through the state machine unit. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A circuit diagram of an online logic analysis and monitoring circuit inside an FPGA according to an embodiment of the present invention;

[0040] Figure 2 A schematic diagram of the structure of a control register of an online logic analysis and monitoring circuit inside an FPGA according to an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of the structure of a status register of an online logic analysis and monitoring circuit inside an FPGA according to an embodiment of the present invention;

[0042] Figure 4 This is a flow chart of the FPGA internal online logic analysis and monitoring method according to an embodiment of the present invention;

[0043] Figure 5 A flowchart of the method for online logic analysis and monitoring inside the FPGA according to an embodiment of the present invention for obtaining the operating status of the ring storage unit by comparing the sampling signal with the control register;

[0044] Figure 6 A schematic diagram of the execution process of the FPGA internal online logic analysis and monitoring method in some embodiments of the present invention;

[0045] Figure 7 The present invention is a flowchart of the FPGA internal online logic analysis and monitoring method for reading back the status register. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0047] In view of the problems existing in the prior art, an embodiment of the present invention provides an FPGA internal online logic analysis monitoring circuit, referring to Figure 1 , comprising a state machine unit 101, a configuration unit 108, a circuit monitoring unit 109 and a ring storage unit 106, wherein the state machine unit 101 is electrically connected to the circuit monitoring unit 109 through the configuration unit 108, and the output end of the circuit monitoring unit 109 is electrically connected to the ring storage unit 106, the state machine unit 101 is used to parse an input signal and output a parsing result, the configuration unit 108 is used to configure a register in the circuit monitoring unit 109 according to the parsing result, the circuit monitoring unit 109 is used to output write control information according to the acquired sampling signal and the configured register, and the ring storage unit 106 is electrically connected to the circuit monitoring unit 109, and is used to store the sampling signal according to the write control information;

[0048] Among them, the circuit monitoring unit 109 includes a trigger comparator 104 and a storage controller 105, the trigger comparator 104 has a built-in control register, the configuration unit 108 is electrically connected to the trigger unit 104 to configure the control register, the trigger comparator 104 compares the sampling signal with the control register to output trigger status information, and the storage controller 105 outputs the write control information according to the trigger status information and generates a status register.

[0049] In the above-mentioned FPGA internal online logic analysis and monitoring circuit, after the external input signal is input through the state machine unit 101, the input signal is analyzed by the state machine unit 101 and the analysis result is obtained. Then, the configuration unit 108 configures the control register in the trigger comparator 104 according to the analysis result output by the state machine unit 101. After the configuration is completed, the sampling signal of the circuit to be tested is input into the trigger comparator 104, and the sampling signal and the control register are compared by the trigger comparator 104 and the trigger status information is output to the storage controller 105, so that the storage controller 105 outputs the write control information after receiving the trigger status information and generates the status register accordingly, wherein the generated status register can be subsequently read back through the state machine unit 101.

[0050] After the storage controller 105 outputs the write control information, the ring storage unit 106 stores the sampling signal according to the write control information, thereby completing the triggering and storing process of the sampling signal of the circuit to be tested.

[0051] In the above circuit, since the annular storage unit 106 adopts an annular storage structure, when the maximum storage address is reached, storage will start from address 0, and the storage status in the annular storage unit 106 is recorded through the status register, so that in the subsequent read-back process, the address of the sampling signal stored in the annular storage unit can be located through the status register, and in the process of storing the sampling signal, the sampling signals before and after the trigger comparator 104 is triggered can be stored, so that subsequent testers can observe the status of the circuit under test before and after the sampling signal is triggered at any time.

[0052] In some embodiments, Figure 2 This is a schematic diagram of the structure of the control register according to an embodiment of the present invention, referring to Figure 2 The control register includes a group of trigger control bits 201 and at least one group of trigger signal groups 207, the trigger signal group 207 includes a trigger mask bit 208, a trigger comparison bit 209 and a trigger condition bit 210, and the bit width of the trigger mask bit 208 is the same as the bit width of the trigger comparison bit 209.

[0053] By setting a trigger mask bit 208 having the same bit width as the trigger comparison bit 209 in the control register, some specific bits in the sampling signal can be selectively masked during the process of the trigger comparator 104 comparing the sampling signal with the control register, thereby realizing the trigger mask function under specific conditions.

[0054] In some other embodiments, the bit width of the trigger comparison bit 209 is a parameterized dynamic bit width. By setting the bit width of the trigger comparison bit 209 to a parameterized dynamic bit width, the bit width of the trigger comparison bit 209 is made more flexible and adjustable, which facilitates dynamic changes in the number and bit width of the trigger signal groups 207, reduces the fixed bit width length of the transmission, and improves transmission efficiency.

[0055] In this embodiment, the trigger control bit 201 includes m binary bits, including control conditions for triggering a sampling signal. Specifically, the trigger control bit 201 includes a trigger enable bit 202, a trigger pause bit 203, a trigger logic bit 204, a trigger position bit 205, and a trigger depth bit 206, wherein the trigger enable bit 202 is 1 binary bit, used to determine whether a trigger detection process is started, the trigger pause bit 203 is 1 binary bit, used to determine whether a trigger detection process is paused, the trigger logic bit 204 is 1 binary bit, used to determine whether the trigger logic between multiple trigger signal groups 207 is an OR logic or an AND logic, the trigger position bit 205 is k binary bits, used to determine the position of the trigger position in the trigger depth bit 206, and the trigger depth bit 206 is k binary bits, used to determine the storage depth of the sampling signal in the ring storage unit 106.

[0056] The trigger signal group 207 includes n binary bits, wherein the trigger comparison bit 209 is j binary bits after parameter configuration through the state machine unit 101 and the configuration unit 108. Since the specific bit width of the trigger comparison bit 209 is a dynamic bit width set by parameters, the trigger mask bit 208 is also j binary bits, which is used to mask the sampling signal of the bit corresponding to the trigger comparison bit 209. The trigger condition bit 210 is 4 binary bits, which is used to determine the condition for comparing the sampling signal with the trigger comparison bit 209.

[0057] In some embodiments, Figure 3 This is a schematic diagram of the structure of the status register according to an embodiment of the present invention, referring to Figure 3 , the status register includes an address indication bit 301, an overflow indication bit 302 and a stop indication bit 303, wherein the address indication bit 301 is k binary bits, used to determine the address information of the ring storage unit 106 storing the sampling signal, and the k value is the same as the k value of the control register; the overflow indication bit 302 is 1 binary bit, used to determine whether the ring storage unit 106 stores the sampling data exceeding the trigger depth bit 206; the stop indication bit 303 is 1 binary bit, used to determine whether the process of storing the sampling signal in the ring storage unit 106 is completed. It should be noted that the above j, k, m, and n are all integers.

[0058] In some further embodiments, the configuration unit 108 includes a handshake synchronization circuit 103 and a shift register circuit 102, wherein the shift register circuit 102 is electrically connected to the state machine unit 101 and the handshake synchronization circuit 103, respectively, and is used to shift configure the control register according to the analysis result, or shift output the state register;

[0059] The handshake synchronization circuit 103 is electrically connected to the trigger comparator 104 , the storage controller 105 and the shift register circuit 102 respectively, and the handshake synchronization circuit 103 is used to perform clock domain synchronization on the control register and the status register.

[0060] In this embodiment, the configuration unit 108 includes a handshake synchronization circuit 103 and a shift register circuit 102. When a signal is input through the state machine unit 101 to trigger and store the sampling signal of the circuit to be tested, after the state machine unit 101 parses the input signal and obtains the parsing result, the shift register circuit 102 shifts and configures the control register in the trigger comparator 104 according to the parsing result. After the configuration is completed, the handshake synchronization circuit 103 synchronizes the clock domain of the control register from the clock domain of the state machine unit 101 to the clock domain of the trigger comparator 104, so as to facilitate the subsequent trigger comparator 104 to compare the sampling signal and the control register.

[0061] After the trigger comparator 104 completes the comparison process of the sampling signal and the control register, and after the storage controller 105 generates the status register, after the storage process of the ring storage unit 106 is recorded through the status register, an external input instruction is used to turn on the read-back status register switch of the state machine unit 101, and then the status register is synchronized from the clock domain of the trigger comparator 104 to the clock domain of the state machine unit 101 through the handshake synchronization circuit 103, and then the status register is output through the shift register circuit 102, so that the state machine unit 101 can read the status register and display it on the graphical user interface (GUI).

[0062] In some embodiments, an extended function unit 107 is further included, and the extended function unit 107 is electrically connected to the configuration unit 108 to achieve functional expansion.

[0063] In this embodiment, the extended function unit 107 is a virtual probe interface circuit (Virtual Probe Interface, VPI), which will not be described in detail here.

[0064] In this embodiment, the state machine unit 101 adopts a Joint Test Action Group Test Access Port (JTAG TAP) state machine, and the ring storage unit 106 adopts an Embedded Random Access Memory (ERAM).

[0065] The present invention also provides an FPGA internal online logic analysis monitoring method, such as Figure 4 As shown, the monitoring method comprises the following steps:

[0066] S400, providing the above-mentioned FPGA internal online logic analysis and monitoring circuit.

[0067] S401 , input a switch control instruction, and parse the switch control instruction through a state machine unit to turn on a configuration switch of a control register.

[0068] S402 , input configuration information, parse the configuration information through the state machine unit to generate a configuration parsing result, and configure the control register according to the configuration parsing result.

[0069] S403 . Synchronize the clock domain of the control register to the clock domain of the circuit monitoring unit through the configuration unit.

[0070] S404, obtaining a sampling signal of the circuit to be tested, comparing the sampling signal with the control register to obtain the operating state of the ring storage unit, and storing the sampling signal in the ring storage unit according to the operating state of the ring storage unit.

[0071] In the above method, the sampling signal is triggered and monitored by the FPGA internal online logic analysis and monitoring circuit in the aforementioned content. After the switch control instruction is input to turn on the configuration switch of the control register in the state machine unit, the configuration information is input to the state machine unit, and the configuration parsing result is generated after the state machine unit parses it, so that the configuration unit can configure the control register according to the configuration parsing result.

[0072] After the configuration is completed, the clock domain of the control register is synchronized to the clock domain of the circuit monitoring unit, that is, the clock domain of the trigger comparator, through the configuration unit, and then the sampling signal of the circuit to be tested is obtained, and the sampling signal is compared with the control register by triggering the comparator to obtain the operating status of the ring storage unit, and the sampling signal is stored in the ring storage unit according to the operating status of the ring storage unit, thereby completing the monitoring and storage process of the sampling signal.

[0073] In some embodiments, the operation status of the ring storage unit is obtained by comparing the sampling signal with the control register in step S404, such as Figure 5 As shown, including:

[0074] S501, obtaining the number of sample signals currently to be stored in the annular storage unit;

[0075] S502: After determining that the stored quantity is greater than the trigger position of the control register, the trigger comparator compares the sampling signal with the trigger condition of the control register and outputs a trigger state.

[0076] It should be noted that during the execution of step S502, only when the sampling signal meets the trigger condition, the subsequent steps S503 and S504 will be executed, otherwise step S502 will continue to be executed until the sampling signal meets the trigger condition.

[0077] S503: After determining that the sampling signal meets the trigger condition bit according to the trigger state, the storage controller outputs write control information according to the trigger state.

[0078] It should be noted that, during the execution of step S503, only when it is determined according to the trigger state that the sampling signal satisfies both the trigger depth bit and the trigger condition bit, the storage controller outputs a write stop signal and proceeds to step S504, otherwise, step S503 is continued.

[0079] S504: After determining that the write control information is write stop information, obtain the write operation status of the ring storage unit.

[0080] Specifically, after the trigger comparator obtains the sampling signal of the circuit to be tested, the storage quantity of the sampling signal to be stored in the ring storage unit is obtained through the trigger comparator. After determining that the storage quantity is greater than the trigger position bit of the control register, the trigger comparator compares the sampling signal with the control register and outputs the trigger state. The comparison between the sampling signal and the control register includes the comparison process of the trigger condition bit, the trigger position bit, the trigger depth bit and the trigger comparison bit, and the final trigger state is output after the above comparison.

[0081] After obtaining the trigger state, the storage controller outputs write control information according to the trigger state. When the storage quantity of the sampling signal satisfies the trigger position bit and the trigger depth bit at the same time, the storage controller outputs a write stop signal. When the storage quantity is less than or equal to the trigger depth bit, the storage controller outputs a write run signal and continues to execute step S503 to store the sampling signal in the ring storage unit until the storage controller outputs a write stop signal.

[0082] Specifically, assuming that the trigger position bit is configured as 256 and the trigger depth bit is configured as 1024, when the trigger condition bit is met, the ring storage unit continues to store 768 sampling signals and then enters the stop state, which ensures that the correct number of data is sampled before and after the trigger position.

[0083] In some other embodiments, the step of comparing the sampling signal with the control register to obtain the operating state of the ring storage unit further includes:

[0084] Obtaining the states of the trigger enable bit and the trigger pause bit in the control register;

[0085] After determining that the trigger enable bit and the trigger pause bit meet the requirements, the operating state of the ring storage unit is acquired.

[0086] By judging the status of the trigger enable bit and the trigger pause bit in the control register, it is determined whether to obtain the operating status of the ring storage unit. When the trigger enable bit in the control register is on and the trigger pause bit is off, the requirements are met and the current operating status of the ring storage unit needs to be obtained.

[0087] It should be noted that in the above process

[0088] In some embodiments, storing the sampled signal into the annular storage unit according to the operating state of the annular storage unit comprises:

[0089] Determining whether the operation state of the annular storage unit is a stopped state;

[0090] After determining that the annular storage unit is in a stopped state, stop collecting the sampling signal, and the annular storage unit stops storing the sampling signal;

[0091] After determining that the annular storage unit is not in the stopped state, the sampling signal continues to be collected, and the annular storage unit continues to store the sampling signal.

[0092] To further illustrate the present solution, in some embodiments, the state machine unit adopts a JTAG TAP state machine. The specific process of the above method is as follows: Figure 6First, input the instruction through the JTAG interface, and parse it through the JTAG TAP state machine to turn on the configuration control register switch. Then the user inputs the configuration information through the JTAG TAP state machine, and the JTAG TAP state machine parses the configuration information. The configuration information includes the trigger signal group and the trigger control bit, including the trigger condition bit, the trigger position bit, the trigger depth bit, the trigger comparison bit, etc. The control register is configured according to the configuration information through the shift register circuit.

[0093] After that, the handshake synchronization control register is completed by the handshake synchronization circuit, through which the control register is synchronized from the JTAG clock domain to the clock domain of the trigger comparator.

[0094] Determine whether the trigger enable bit of the control register is 1 and whether the trigger pause bit is 0. When the trigger enable bit = 1 and the trigger pause bit = 0, determine whether the running state of the annular storage unit is a stop state; when the annular storage unit is in a stop state, stop collecting the sampling signal, and the annular storage unit stops storing the sampling signal; when the annular storage unit is not in a stop state, continue to collect the sampling signal, and the annular storage unit continues to store the sampling signal.

[0095] While judging whether the trigger enable bit of the control register is 1 and whether the trigger pause bit is 0, the trigger comparator is used to compare the trigger conditions of the sampling signal and the control register. Specifically, the number of sampling signals currently to be stored in the annular storage unit is obtained; after determining that the number of storage is greater than the trigger position of the control register, the trigger comparator is used to compare the trigger conditions of the sampling signal and the control register, and output the trigger state. After determining that the sampling signal meets the trigger condition bit according to the trigger state, the storage controller outputs write control information according to the trigger state. Since the process of comparing the trigger conditions of the sampling signal and the control register by the trigger comparator has been described in the previous content, it will not be repeated here.

[0096] Afterwards, when the write control information output by the storage controller is a write stop signal, the current state of the annular storage unit is obtained as a write operation stop state, and then it is further determined whether the annular storage unit is in a stop state. When the annular storage unit is in a stop state, the sampling signal is stopped from being collected, and the annular storage unit stops storing the sampling signal; when the annular storage unit is not in a stop state, the sampling signal continues to be collected, and the annular storage unit continues to store the sampling signal.

[0097] In some embodiments, after the storage controller outputs a write control stop signal, the method further includes generating a status register through the storage controller, inputting a read back instruction to read back the status register through the state machine unit, such as Figure 7 As shown, the specific process includes the following steps:

[0098] S701, input the read-back instruction and parse it through the state machine unit to turn on the read-back status register switch;

[0099] S702, synchronizing the clock domain of the state register to the clock domain of the state machine unit through a handshake synchronization circuit;

[0100] S703 , shift and output the status register through the shift register circuit, and read back the output status register through the state machine unit.

[0101] Through the above method, after the triggering and storing of the sampling signal is completed by the ring storage unit, the storage status of the ring storage unit is known by reading back the status register output by the storage controller.

[0102] In order to further explain the above situation, we will explain it in combination with specific situations. First,

[0103] Specifically, first, an instruction is input through the state machine unit and parsed, and the read-back status register switch is turned on. Then, the status register is synchronized through handshake synchronization circuit 103 to synchronize the status register from the clock domain of the trigger comparator to the clock domain of the state machine unit. After the synchronization is completed, the state machine unit and the shift register circuit read back the status register. The status register can be read back through the JTAG interface of the state machine unit and displayed on the GUI interface, which will not be repeated here.

[0104] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.

Claims

1. An FPGA internal online logic analysis and monitoring circuit, characterized in that: It includes a state machine unit, a configuration unit, a circuit monitoring unit and a ring storage unit, wherein the state machine unit is electrically connected to the circuit monitoring unit through the configuration unit, and the output end of the circuit monitoring unit is electrically connected to the ring storage unit, the state machine unit is used to parse the input signal and output the parsing result, the configuration unit is used to configure the register in the circuit monitoring unit according to the parsing result, the circuit monitoring unit is used to output write control information according to the acquired sampling signal and the configured register, and the ring storage unit is electrically connected to the circuit monitoring unit to store the sampling signal according to the write control information; wherein the circuit monitoring unit includes a trigger comparator and a storage controller, the trigger comparator has a built-in control register, the configuration unit is electrically connected to the trigger comparator to configure the control register, the trigger comparator compares the sampling signal with the control register to output trigger state information, and the storage controller outputs the write control information according to the trigger state information and generates a state register; The monitoring method of the online logic analysis monitoring circuit inside the FPGA comprises the following steps: Provide online logic analysis and monitoring circuit inside FPGA; Input a switch control instruction, and parse the switch control instruction through a state machine unit to turn on a configuration switch of a control register; Input configuration information, parse the configuration information through the state machine unit to generate a configuration parsing result, and configure the control register according to the configuration parsing result; Synchronizing the clock domain of the control register to the clock domain of the circuit monitoring unit through the configuration unit; A sampling signal of the circuit to be tested is obtained, and the operating state of the ring storage unit is obtained according to the comparison between the sampling signal and the control register, and the sampling signal is stored in the ring storage unit according to the operating state of the ring storage unit.

2. The FPGA internal online logic analysis and monitoring circuit according to claim 1, characterized in that: The control register includes a group of trigger control bits and at least one group of trigger signal groups, the trigger signal group includes a trigger mask bit, a trigger comparison bit and a trigger condition bit, and the bit width of the trigger mask bit is the same as the bit width of the trigger comparison bit.

3. The FPGA internal online logic analysis and monitoring circuit according to claim 2, characterized in that: The bit width of the trigger comparison bit is a dynamic bit width set by parameters.

4. The FPGA internal online logic analysis and monitoring circuit according to claim 1, characterized in that: The status register includes an address indication bit, an overflow indication bit and a stop indication bit.

5. The FPGA internal online logic analysis and monitoring circuit according to claim 1, characterized in that: It also includes an extended function unit, which is electrically connected to the configuration unit to achieve function expansion.

6. The FPGA internal online logic analysis and monitoring circuit according to any one of claims 1 to 5, characterized in that: The configuration unit includes a handshake synchronization circuit and a shift register circuit, and the shift register circuit is electrically connected to the state machine unit and the handshake synchronization circuit respectively, and is used to shift the control register according to the analysis result, or shift and output the state register; The handshake synchronization circuit is electrically connected to the trigger comparator, the storage controller and the shift register circuit respectively, and the handshake synchronization circuit is used to perform clock domain synchronization on the control register and the status register.

7. The FPGA internal online logic analysis and monitoring circuit according to claim 2, characterized in that: The step of comparing the sampling signal with the control register to obtain the operating state of the ring storage unit includes: Obtaining the number of sampling signals currently to be stored in the annular storage unit; After determining that the stored quantity is greater than the trigger position of the control register, the trigger comparator compares the sampling signal with the control register for trigger conditions and outputs a trigger state; After determining that the sampling signal satisfies the trigger condition bit according to the trigger state, the storage controller outputs write control information according to the trigger state; After determining that the write control information is write stop information, the write operation state of the ring storage unit is acquired.

8. The FPGA internal online logic analysis and monitoring circuit according to claim 1, characterized in that: The step of comparing the sampling signal with the control register to obtain the operating state of the ring storage unit includes: Obtaining the states of the trigger enable bit and the trigger pause bit in the control register; After determining that the trigger enable bit and the trigger pause bit meet the requirements, the operating state of the ring storage unit is acquired.

9. The FPGA internal online logic analysis and monitoring circuit according to claim 7 or 8, characterized in that: The step of storing the sampling signal in the annular storage unit according to the operating state of the annular storage unit comprises: Determining whether the operation state of the annular storage unit is a stopped state; After determining that the annular storage unit is in a stopped state, stop collecting the sampling signal, and the annular storage unit stops storing the sampling signal; After determining that the annular storage unit is not in the stopped state, the sampling signal continues to be collected, and the annular storage unit continues to store the sampling signal.

10. The FPGA internal online logic analysis and monitoring circuit according to claim 7, characterized in that: After the memory controller outputs a write control stop signal, the method further includes generating a status register through the memory controller, and inputting a read back instruction to read back the status register through the state machine unit.

11. The FPGA internal online logic analysis and monitoring circuit according to claim 10, characterized in that: The inputting of the read-back instruction to read back the status register through the state machine unit includes: Input the read-back instruction and parse it through the state machine unit to turn on the read-back status register switch; Synchronizing the clock domain of the state register to the clock domain of the state machine unit through a handshake synchronization circuit; The state register is shifted and outputted through a shift register circuit, and the output state register is read back through the state machine unit.