Interrupt overflow alarm circuit, chip and electronic equipment
By designing an interrupt overflow alarm circuit, the interrupt trigger pulse and flag signal are used to process the interrupt request overflow problem, which solves the problem of request loss when the CPU handles interrupts and improves the reliability of the circuit.
Patent Information
- Application Number
- CN202411093742.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-15
AI Technical Summary
When the CPU processes an interrupt, if a new interrupt request is received in an unfinished interrupt request, it will lead to the loss of the interrupt request and affect the reliability of the circuit.
An interrupt overflow alarm circuit is designed to characterize the interrupt processing phase by generating interrupt trigger pulses and flag signals, and generate an alarm signal when a new interrupt request is received to record interrupt overflow to avoid the loss of interrupt request.
Improves the reliability of the circuit, ensures the correct processing of continuous interrupt requests, and avoids the loss of interrupt requests.
Smart Images

Figure CN118963957A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic circuits, and in particular to an interrupt overflow alarm circuit, a chip and an electronic device. Background Art
[0002] An interrupt is when a central processing unit (CPU) encounters an emergency or abnormal event during program execution. The CPU will pause the program being executed and handle the event. After the event is handled, the CPU will return to the breakpoint to continue executing the paused program.
[0003] That is to say, the process of CPU temporarily suspending the execution of the program to handle a new event is called an interrupt. The new event can be called an interrupt request, pausing the executing program to handle the event can be called an interrupt response, and the process of handling the event is interrupt processing.
[0004] In the related art, when the CPU responds to an interrupt request, it will respond to the next interrupt request only after the interrupt processing corresponding to the current interrupt request is completed. If a new interrupt request is received before the interrupt processing is completed, the CPU cannot respond to the new interrupt request, which will cause the interrupt request to be lost. Summary of the invention
[0005] In view of the above problems, the present application provides an interrupt overflow alarm circuit, chip and electronic device to solve the above technical problems.
[0006] In a first aspect, the present application provides an interrupt overflow alarm circuit, the interrupt overflow alarm circuit comprising a first interrupt circuit, the first interrupt circuit comprising:
[0007] A first pulse generating module, configured to generate a first interrupt triggering pulse according to a received first interrupt request signal;
[0008] A first flag signal output module, connected to the first pulse generating module, for controlling the output first interrupt flag signal to jump from invalid to valid in response to the first interrupt trigger pulse;
[0009] The first alarm module is connected to the first flag signal output module and the first pulse generating module, and is used for generating a valid first alarm signal in response to a next first interrupt trigger pulse when the first interrupt flag signal is valid.
[0010] The interrupt overflow alarm circuit generates a valid first interrupt flag signal to indicate that it is in the interrupt processing stage. If an interrupt trigger pulse corresponding to the next interrupt request signal is received at this time, a valid alarm signal is generated to indicate and record the overflow of the interrupt, thereby avoiding the loss of the interrupt request and improving the circuit reliability.
[0011] In a second aspect, the present application also provides a chip, including a chip body and the above-mentioned interrupt overflow alarm circuit arranged in the chip body.
[0012] In a third aspect, the present application also provides an electronic device, including a device body and an interrupt overflow alarm circuit or chip as described above, which is arranged in the device body.
[0013] The interrupt overflow alarm circuit provided in the present application generates a first interrupt trigger pulse based on a first interrupt request signal through a first pulse generating module, and causes the first interrupt flag signal output by the first flag signal output module to jump from invalid to valid through the first interrupt trigger pulse, thereby indicating that the interrupt is being processed. If the first pulse generating module receives a new first interrupt request signal to generate the next first interrupt trigger pulse at this time, the first alarm module can respond to the next first interrupt trigger pulse to generate a valid first alarm signal, thereby indicating and recording the overflow of the interrupt request, avoiding the loss of consecutive interrupt requests, improving the reliability of the circuit, and ensuring that the circuit can work normally. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1 This is a schematic diagram of an application scenario of the interrupt overflow alarm circuit provided in an embodiment of the present application;
[0016] Figure 2 It is a structural schematic diagram of an interrupt overflow alarm circuit provided in an embodiment of the present application;
[0017] Figure 3 is a structural schematic diagram of a first pulse generating module provided in an embodiment of the present application;
[0018] Figure 4 This is a schematic diagram of a circuit principle of a first pulse generating module provided in an embodiment of the present application;
[0019] Figure 5 This is a timing diagram of generating a first interrupt trigger pulse provided in an embodiment of the present application;
[0020] Figure 6 is a structural schematic diagram of a first flag signal output module provided in an embodiment of the present application;
[0021] Figure 7This is a circuit principle diagram of a first flag signal output module provided in an embodiment of the present application;
[0022] Figure 8 This is a timing diagram of generating a first interrupt flag signal provided in an embodiment of the present application;
[0023] Fig. 9 is a structural diagram of a first alarm module provided in an embodiment of the present application;
[0024] Fig.10 This is a schematic diagram of a circuit principle of the first alarm module provided in an embodiment of the present application;
[0025] Fig.11 This is a timing diagram of generating a first alarm signal provided in an embodiment of the present application;
[0026] Fig.12 is a structural schematic diagram of a first interruption circuit provided in an embodiment of the present application;
[0027] Fig.13 It is a structural diagram of a synchronization module provided in an embodiment of the present application;
[0028] Fig.14 is a schematic diagram of a circuit principle of a register unit provided in an embodiment of the present application;
[0029] Fig.15 This is a timing diagram of generating a first interrupt request signal provided in an embodiment of the present application;
[0030] Fig.16 is another structural schematic diagram of the first interruption circuit provided in an embodiment of the present application;
[0031] Fig.17 is another structural schematic diagram of the first interruption circuit provided in the embodiment of the present application;
[0032] Fig.18 is another structural schematic diagram of the first interruption circuit provided in the embodiment of the present application;
[0033] Fig.19 is a circuit principle schematic diagram of a first interruption circuit provided in an embodiment of the present application;
[0034] Fig. 20 is with Fig.19 A signal timing schematic diagram corresponding to the circuit schematic diagram;
[0035] Fig.21 It is another structural schematic diagram of the interrupt overflow alarm circuit provided in the embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0037] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0038] In the embodiments of the present application, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0039] Moreover, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that an article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such article or device. In the absence of more restrictions, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the article or device comprising the element.
[0040] In the description of the embodiments of the present application, words such as "example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "example" or "for example" in the embodiments of the present application is not to be interpreted as being more preferred or having more advantages than another embodiment or design. The use of words such as "example" or "for example" is intended to present relative concepts in a clear manner.
[0041] In addition, the "plurality" in the embodiments of the present application refers to two or more than two. In view of this, in the embodiments of the present application, "plurality" can also be understood as "at least two". "At least one" can be understood as one or more, for example, one, two or more. For example, including at least one means including one, two or more, and there is no limit on which ones are included. For example, including at least one of A, B and C, then A, B, C, A and B, A and C, B and C, or A, B and C can be included.
[0042] It should be noted that, in the embodiments of the present application, "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.
[0043] It should be noted that in the embodiments of the present application, "connection" can be understood as electrical connection, and the connection between two electrical components can be a direct or indirect connection between the two electrical components. For example, the connection between A and B can be either a direct connection between A and B or an indirect connection between A and B through one or more other electrical components.
[0044] Before introducing the interrupt overflow alarm circuit, chip and electronic device of the present application, the relevant background information of the embodiments of the present application is first introduced.
[0045] The interrupt system usually involves the interaction of peripherals, interrupt controllers, central processing units (CPU), direct memory access (DMA), etc. Common interrupt systems include interrupt sources from software and hardware, interrupt routers (IR) and corresponding service providers. The service provider here can be the CPU or DMA. The interrupt request issued by the interrupt source can trigger a CPU interrupt or a DMA conversion. Therefore, the interrupt request can also be called a service request.
[0046] Specifically, when an interrupt source such as an analog-to-digital converter (ADC) generates a service request signal, it will be sent to the IR. The IR will arbitrate according to the configured priority and route the winning service request to the corresponding service provider. If the service provider is the CPU, it is an interrupt service. If the service provider is the DMA, it is a conversion enable signal for a DMA channel.
[0047] Generally, the service request signal of the interrupt source has no switch, and a request will be sent to the IR after the corresponding event occurs. However, if a new service request is received while the IR is processing a service request, the new service request cannot be responded to, which may easily cause the request to be lost.
[0048] Based on this, the embodiments of the present application provide an interrupt overflow alarm circuit, a chip and an electronic device, which are described in detail below.
[0049] See also Figure 1 , Figure 1It is a schematic diagram of an application scenario of the interrupt overflow alarm circuit provided in an embodiment of the present application. The interrupt overflow alarm circuit 10 can be integrated into a chip 20 and is used to send an alarm signal to record the overflow of the interrupt when receiving continuous interrupt requests from an interrupt source 30.
[0050] In the embodiment of the present application, the interrupt overflow alarm circuit 10 may include an IR, and the interrupt overflow alarm circuit 10 may be connected to multiple downstream modules in the chip 20 to route the interrupt request from the interrupt source 30 to the corresponding downstream module.
[0051] like Figure 1 As shown, the interrupt source 30 may be a related module of an external device. It is understandable that in some other application scenarios, the interrupt source 30 may also be some modules located on the chip 20 that can issue interrupt requests, which is not specifically limited here.
[0052] The downstream module may be a DMA, a generic interrupt controller (GIC), etc. It is understandable that the type of downstream modules connected to the interrupt overflow alarm circuit 10 and the number of downstream modules of each type may be determined according to the actual application scenario and are not limited here.
[0053] Those skilled in the art will understand that Figure 1 The application environment shown in is only an application scenario adapted to the solution of the present application and does not constitute a limitation on the application scenario of the solution of the present application. The interrupt overflow alarm circuit 10 of the present application or the chip integrating the interrupt overflow alarm circuit 10 can be used in application scenarios such as communications, audio amplifiers, power supply equipment, and automobiles, and is not specifically limited here.
[0054] First, the embodiment of the present application provides an interrupt overflow alarm circuit, see Figure 2 , Figure 2 It is a structural diagram of an interrupt overflow alarm circuit provided in an embodiment of the present application. The interrupt overflow alarm circuit 10 may include a first interrupt circuit 100. The first interrupt circuit 100 may include a first pulse generating module 110, a first flag signal output module 120 and a first alarm module 130.
[0055] Among them, the first pulse generating module 110 can be used to generate a first interrupt trigger pulse int0_pos according to the received first interrupt request signal int0_r1; the first flag signal output module 120 can be connected to the first pulse generating module 110, and is used to control the output first interrupt flag signal ir_reg from invalid to valid in response to the first interrupt trigger pulse int0_pos; the first alarm module 130 can be connected to the first flag signal output module 120 and the first pulse generating module 110, and is used to generate a valid first alarm signal alarm_req in response to the next first interrupt trigger pulse int0_pos when the first interrupt flag signal ir_reg is valid.
[0056] In the embodiment of the present application, the first interrupt circuit 100 can be applied to IR or a circuit module integrated with IR.
[0057] The first interrupt request signal int0_r1 may be an interrupt request signal from an external interrupt source or an internal module of the chip.
[0058] If the first interrupt request signal int0_r1 is valid for a long time, then in the process of receiving the first interrupt request signal int0_r1, if the first pulse generating module 110 receives a new interrupt request, the subsequent modules may not be able to recognize the new interrupt request. Therefore, in order to distinguish the interrupt requests received successively, in the embodiment of the present application, the first pulse generating module 110 generates a first interrupt trigger pulse int0_pos in response to the received first interrupt request signal int0_r1, and the generated pulse is used to distinguish or count different interrupt requests.
[0059] It can be understood that the first pulse generating module 110 in the embodiment of the present application can adopt any existing pulse forming circuit, pulse signal generating circuit, pulse generator, etc., which is not limited here.
[0060] In an embodiment of the present application, the first flag signal output module 120 can output an invalid first interrupt flag signal ir_reg when the circuit has not received an interrupt request or the interrupt in the circuit has been cleared. That is to say, when the first pulse generating module 110 has not received the first interrupt request signal int0_r1, the first interrupt flag signal ir_reg output by the first flag signal output module 120 is always invalid, thereby indicating that there is no interrupt at present and it is in an idle state.
[0061] It can be understood that for hardware circuits, the state of a signal can be valid or invalid. In some application scenarios, the signal can be set to be valid at a high level and invalid at a low level. Of course, in other application scenarios, the signal can also be set to be valid at a low level and invalid at a high level. In actual applications, the state of the signal can be set according to the specific situation, and this is not limited here.
[0062] For example, the first interrupt flag signal ir_reg is set to be valid at a high level and invalid at a low level. When there is no interrupt request, there is no first interrupt trigger pulse int0_pos input to the first flag signal output module 120, so that the first interrupt flag signal ir_reg output by the first flag signal output module 120 remains at a low level.
[0063] On the contrary, if there is an interrupt request, the first pulse generating module 110 can generate a first interrupt trigger pulse int0_pos, and the first flag signal output module 120 can control the first interrupt flag signal ir_reg to jump from a low level to a high level in response to the first interrupt trigger pulse int0_pos, so that the first interrupt flag signal ir_reg output at this time is valid. That is to say, in the embodiment of the present application, the state of the first interrupt flag signal ir_reg can indicate whether there is an interrupt.
[0064] In the embodiment of the present application, the first alarm module 130 is connected to the first flag signal output module 120 and the first pulse generation module 110, respectively, and receives the first interrupt flag signal ir_reg from the first flag signal output module 120 and the first interrupt trigger pulse int0_pos from the first pulse generation module 110. Since the duration of the pulse is short, the first interrupt trigger pulse int0_pos can distinguish different interrupt requests in succession. Therefore, if the first alarm module 130 receives another first interrupt trigger pulse int0_pos when the first interrupt flag signal ir_reg is valid, it can be confirmed that the circuit has received two interrupt requests and the previous interrupt request has not been processed. At this time, the first alarm module 130 can generate a valid first alarm signal alarm_req to record the overflow of the interrupt request.
[0065] For example, the signal is set to be valid at a high level and invalid at a low level. When the first interrupt flag signal ir_reg is at a high level, the first alarm module 130 receives another first interrupt trigger pulse int0_pos. At this time, there is an interrupt overflow, and the first alarm signal alarm_req output by the first alarm module 130 is at a high level; if the first alarm module 130 does not receive a new first interrupt trigger pulse int0_pos when the first interrupt flag signal ir_reg is at a high level, there is no interrupt overflow, and the first alarm signal alarm_req output by the first alarm module 130 is at a low level; if the first interrupt flag signal ir_reg is at a low level, there is no interrupt request at this time, and naturally there is no interrupt overflow, and the first alarm signal alarm_req output by the first alarm module 130 is at a low level.
[0066] The interrupt overflow alarm circuit 10 provided in the embodiment of the present application generates a first interrupt trigger pulse int0_pos based on the first interrupt request signal int0_r1 through the first pulse generating module 110, and the first interrupt flag signal ir_reg output by the first flag signal output module 120 is changed from invalid to valid through the first interrupt trigger pulse int0_pos, so as to indicate that the interrupt is being processed. If the first pulse generating module 110 receives a new first interrupt request signal int0_r1 to generate the next first interrupt trigger pulse int0_pos at this time, the first alarm module 130 can respond to the next first interrupt trigger pulse int0_pos to generate a valid first alarm signal alarm_req, so as to indicate and record the overflow of the interrupt request, avoid the loss of continuous interrupt requests, improve the reliability of the circuit, and ensure that the circuit can work normally.
[0067] Next, continue to Figure 2 The modules shown and the specific implementation methods that may be used in practical applications are described in detail.
[0068] like Figure 3 As shown, in some embodiments of the present application, the first pulse generating module 110 may include a first pulse generating unit 1101 and a first delay flip unit 1102. The first delay flip unit 1102 may be used to delay the first interrupt request signal int0_r1 according to the first preset delay time length to obtain the first delay request signal int0_r2, and perform a level flip on the first delay request signal int0_r2 to obtain the first delay flip signal int0_r3; the first pulse generating unit 1101 may be connected to the first delay flip unit 1102, and is used to generate the first interrupt trigger pulse int0_pos according to the first interrupt request signal int0_r1 and the first delay flip signal int0_r3.
[0069] In the embodiment of the present application, the first preset delay time can be set according to the actual application scenario. For example, a register can be used for delay. If one register is used for delay, the first preset delay time is the length of one clock cycle. If two registers connected in series are used for delay, the first preset delay time is the total length of two clock cycles. The level flipping of the first delay request signal int0_r2 can be performed by inverting the first delay request signal int0_r2 to obtain the first delay flip signal int0_r3.
[0070] The first pulse generating unit 1101 can generate the first interrupt trigger pulse int0_pos according to the first interrupt request signal int0_r1 and the first delayed flip signal int0_r3. Since the first delayed flip signal int0_r3 is a signal that jumps and is inverted later than the first interrupt request signal int0_r1, only within the time range of the first preset delay time, the levels of the first delayed flip signal int0_r3 and the first interrupt request signal int0_r1 are consistent, based on which the first interrupt trigger pulse int0_pos can be generated.
[0071] See also Figure 4 and Figure 5 As an example, the first pulse generating unit 1101 adopts the first AND gate &1, and the first delay flip unit 1102 includes a first trigger D1 and a first NOT gate! 1. Specifically, the input ends of the first AND gate &1 and the first trigger D1 can be connected to the interrupt source at the same time to access the first interrupt request signal int0_r1.
[0072] When the first trigger D1 receives the first interrupt request signal int0_r1, it delays the first interrupt request signal int0_r1 by one clock cycle based on the clock signal clk_ir. Therefore, when the first interrupt request signal int0_r1 changes from a low level to a high level in the fifth clock cycle, the first delay request signal int0_r2 changes from a low level to a high level in the sixth clock cycle. The first delay flip signal int0_r3 is a signal obtained by inverting the first delay request signal int0_r2 by the first NOT gate! 1. Therefore, the first delay flip signal int0_r3 remains at a high level in the fifth clock cycle and changes from a high level to a low level in the sixth clock cycle. The first AND gate &1 performs an AND operation on the first interrupt request signal int0_r1 and the first delayed flip signal int0_r3. Since both the first interrupt request signal int0_r1 and the first delayed flip signal int0_r3 are at high level in the fifth clock cycle, a first interrupt trigger pulse int0_pos is generated in the fifth clock cycle. Similarly, another first interrupt trigger pulse int0_pos is generated in the fourteenth clock cycle. Thus, different interrupt requests can be distinguished according to the generated first interrupt trigger pulse int0_pos.
[0073] In some embodiments of the present application, the first flag signal output module 120 may also be used to: in response to an interrupt reply signal or a first clear instruction for the first interrupt request signal int0_r1, control the output first interrupt flag signal ir_reg to jump from valid to invalid.
[0074] The interrupt reply signal can be a signal sent to the first flag signal output module 120 after the downstream module completes the interrupt processing for the first interrupt request signal int0_r1. The interrupt reply signal can indicate that the interrupt processing has been completed. Therefore, when the first flag signal output module 120 receives the interrupt reply signal, it can control the first interrupt flag signal ir_reg to jump from valid to invalid, for example, from a low level to a high level, in response to the interrupt reply signal, thereby indicating that the current state is non-interruption.
[0075] It can be understood that in some embodiments, the first interrupt flag signal ir_reg can also be directly controlled by software instructions to jump from valid to invalid. At this time, the first clear instruction can be output to the first flag signal output module 120 through the software program. When the first flag signal output module 120 receives the first clear instruction, it can also control the first interrupt flag signal ir_reg to jump from valid to invalid in response to the first clear instruction.
[0076] like Figure 6As shown, in some embodiments of the present application, the first flag signal output module 120 may include a first pulse widening unit 1201 and a first selection unit 1202, wherein the first pulse widening unit 1201 may be connected to the first pulse generating module 110, for performing widening processing on the first interrupt trigger pulse int0_pos, and continuously outputting the first level value to the first selection unit 1202; the first selection unit 1202 may be connected to the first pulse widening unit 1201 and the first alarm module 130, for selecting to output the first level value or the first preset level value, wherein the priority of the first level value is higher than the first preset level value, the first level value is the level value corresponding to the first interrupt flag signal ir_reg when it is valid, and the first preset level value is the level value corresponding to the first interrupt flag signal ir_reg when it is invalid.
[0077] Since the continuous effective time of the first interrupt trigger pulse int0_pos is relatively short, in order to ensure that the first selection unit 1202 can accurately sample the first interrupt trigger pulse int0_pos and precisely control the state of the first interrupt flag signal ir_reg, in an embodiment of the present application, the first interrupt trigger pulse int0_pos is pulse stretched by the first pulse stretching unit 1201, thereby continuously outputting the first level value representing the validity of the first interrupt flag signal ir_reg to the first selection unit 1202. Since the priority of the first level value is higher than the first preset level value, the first selection unit 1202 can jump from outputting the first preset level value to outputting the first level value when receiving the first level value, so as to make the output of the first interrupt flag signal ir_reg jump from invalid to valid.
[0078] It can be understood that if there is no first interrupt trigger pulse int0_pos input into the first pulse stretching unit 1201, the first pulse stretching unit 1201 will not generate the first level value output to the first selection unit 1202. At this time, the first selection unit 1202 will continue to output the first preset level value, so as to keep the output first interrupt flag signal ir_reg in an invalid state.
[0079] In the embodiment of the present application, the first pulse stretching unit 1201 can adopt any existing pulse stretching circuit, and the first selection unit 1202 can adopt any existing multiplexer (MUX), data selector, etc., which can be selected according to the actual application scenario and are not limited here.
[0080] See also Figure 7 and Figure 8As an example, the first pulse stretching unit 1201 includes a first clock gating ECK1 and a second trigger D2, and the first gating unit 1202 adopts a first multiplexer MUX1 of a two-to-one channel. Specifically, the first pulse generating module 110 is connected to the enable terminal E of the first clock gating ECK1, the output terminal of the first clock gating ECK1 is connected to the clock input terminal of the second trigger D2, the input terminal of the second trigger D2 is connected to the first level value 1'b1, the output terminal of the second trigger D2 is connected to an input terminal of the first multiplexer MUX1, the other input terminal of the first multiplexer MUX1 is connected to the first preset level value 1'b0, and the output terminal of the first multiplexer MUX1 is connected to the first alarm module 130.
[0081] The setting signal is valid at a high level and invalid at a low level, so the first level value 1'b1 is 1, and the first preset level value 1'b0 is 0. In the first 4 clock cycles, since there is no first interrupt trigger pulse int0_pos input, the first clock gating ECK1 does not work, and the second trigger D2 does not work either. At this time, the first multiplexer MUX1 selects to output the first preset level value "0", so the first interrupt flag signal ir_reg is in a low level invalid state.
[0082] The first interrupt trigger pulse int0_pos that is valid at the 5th clock cycle is input to the enable terminal E of the first clock gating ECK1, enabling the first clock gating ECK1 to output the clock signal clk_ir to the clock input terminal of the second trigger D2. The second trigger D2 stores the first level value "1" based on the clock signal clk_ir, and when the next clock cycle, i.e., the 6th clock cycle, arrives, the second trigger D2 inputs the first level value "1" to the first multiplexer MUX1. Since the priority of the first level value "1" is higher than the first preset level value "0", the first multiplexer MUX1 outputs the first level value "1", so that the first interrupt flag signal ir_reg jumps from a low level to a high level, and due to the pulse stretching effect of the first clock gating ECK1 and the second trigger D2, the second trigger D2 can continuously output the first level value "1" to the first multiplexer MUX1, so that the first interrupt flag signal ir_reg is maintained at a high level.
[0083] In the 20th clock cycle, the interrupt reply signal or the first clear instruction is input into the first multiplexer MUX1, driving the first multiplexer MUX1 to select and output the first preset level value "0", so that the first interrupt flag signal ir_reg jumps from the high level to the low level again.
[0084] In some embodiments of the present application, the first alarm module 130 may also be used to: in response to the second clear instruction, control the output first alarm signal alarm_req to jump from valid to invalid.
[0085] In the embodiment of the present application, the first alarm signal alarm_req can also be controlled to jump from valid to invalid through software instructions. At this time, the second clear instruction can be output to the first alarm module 130 through the software program. When the first alarm module 130 receives the second clear instruction, it can also respond to the second clear instruction to control the first alarm signal alarm_req to jump from valid to invalid, for example, from a high level to a low level, to eliminate the alarm.
[0086] like Fig. 9 As shown, in some embodiments of the present application, the first alarm module 130 may include a first trigger unit 1301, a second pulse widening unit 1302 and a second gating unit 1303; wherein the first trigger unit 1301 may be connected to the first pulse generating module 110 and the first flag signal output module 120, and is used to generate a first trigger pulse signal int0_pul in response to a valid first interrupt flag signal ir_reg and a next first interrupt trigger pulse int0_pos; the second pulse widening unit 1302 may be connected to the first trigger unit 1301, and is used to perform widening processing on the first trigger pulse signal int0_pul, and continuously output a second level value to the second gating unit 1303; the second gating unit 1303 may be used to select and output a second level value or a second preset level value, wherein the priority of the second level value is higher than the second preset level value, the second level value is a level value corresponding to when the first alarm signal alarm_req is valid, and the second preset level value is a level value corresponding to when the first alarm signal alarm_req is invalid.
[0087] In order to record the interrupt overflow, it is possible to detect whether there is a new interrupt request when the first interrupt flag signal ir_reg is valid. Therefore, in an embodiment of the present application, the first interrupt flag signal ir_reg from the first flag signal output module 120 and the first interrupt trigger pulse int0_pos from the first pulse generating module 110 are simultaneously connected through the first trigger unit 1301. If the first interrupt trigger pulse int0_pos is received when the first interrupt flag signal ir_reg is valid, the first trigger unit 1301 can generate a first trigger pulse signal int0_pul and output it to the second pulse widening unit 1302.
[0088] Since the continuous effective time of the first trigger pulse signal int0_pul may be short, in order to ensure that the second selection unit 1303 can accurately sample the first trigger pulse signal int0_pul and accurately control the state of the first alarm signal alarm_req, in an embodiment of the present application, the first trigger pulse signal int0_pul is pulse stretched by the second pulse stretching unit 1302, so as to continuously output the second level value representing the validity of the first alarm signal alarm_req to the second selection unit 1303. Since the priority of the second level value is higher than the second preset level value, the second selection unit 1303 can jump from outputting the second preset level value to outputting the second level value when receiving the second level value, so as to make the output of the first alarm signal alarm_req jump from invalid to valid, and perform overflow recording.
[0089] It can be understood that if there is no new first interrupt trigger pulse int0_pos input into the first trigger unit 1301, the first trigger unit 1301 will not generate the first trigger pulse signal int0_pul output to the second pulse width unit 1302, and the second pulse width unit 1302 will not output the second level value to the second selection unit 1303. At this time, the second selection unit 1303 will continue to output the second preset level value, so as to keep the output first alarm signal alarm_req in an invalid state.
[0090] In the embodiment of the present application, the first trigger unit 1301 can adopt any existing logic and circuit, the second pulse stretching unit 1302 can adopt any existing pulse stretching circuit, and the second selection unit 1303 can adopt any existing multiplexer (Multiplexer, MUX), data selector, etc., which can be selected according to the actual application scenario and are not limited here.
[0091] See also Fig.10 and Fig.11As an example, the first trigger unit 1301 adopts the second AND gate &2, the second pulse stretching unit 1302 includes the second clock gating ECK2 and the third trigger D3, and the second selection unit 1303 adopts the second multiplexer MUX2 of two-to-one channels. Specifically, the input end of the second AND gate &2 is connected to the first pulse generating module 110 and the first flag signal output module 120 respectively, the output end of the second AND gate &2 is connected to the enable end E of the second clock gating ECK2, the output end of the second clock gating ECK2 is connected to the clock input end of the third trigger D3, the input end of the third trigger D3 is connected to the second level value 2'b1, the output end of the third trigger D3 is connected to one input end of the second multiplexer MUX2, the other input end of the second multiplexer MUX2 is connected to the second preset level value 2'b0, and the output end of the second multiplexer MUX2 outputs the first alarm signal alarm_req.
[0092] The setting signal is valid at a high level and invalid at a low level, then the second level value 2'b1 is 1, and the second preset level value 2'b0 is 0. According to the working principle of the AND gate, the first trigger pulse signal int0_pul output by the second AND gate &2 will be valid only when the first interrupt flag signal ir_reg and the first interrupt trigger pulse int0_pos are both at a high level. Therefore, in the first 14 clock cycles, since the first interrupt flag signal ir_reg and the first interrupt trigger pulse int0_pos are not in a valid state at the same time, there is no first trigger pulse signal int0_puls input, the second clock gating ECK2 does not work, and the third trigger D3 does not work. At this time, the second multiplexer MUX2 chooses to output the second preset level value "0", so the first alarm signal alarm_req is in a low-level invalid state, that is, there is no interrupt overflow at this time.
[0093] In the 14th clock cycle, the first interrupt flag signal ir_reg is at a high level, and the first interrupt trigger pulse int0_pos is also at a high level. At this time, the second AND gate &2 outputs a valid first trigger pulse signal int0_pul, that is, the first trigger pulse signal int0_pul is at a high level.
[0094] The high-level first trigger pulse signal int0_pul is input to the enable terminal E of the second clock gate ECK2, enabling the second clock gate ECK2 to output the clock signal clk_ir to the clock input terminal of the third trigger D3. The third trigger D3 stores the second level value "1" based on the clock signal clk_ir, and when the next clock cycle, i.e., the 15th clock cycle, arrives, the third trigger D3 inputs the second level value "1" to the second multiplexer MUX2. Since the priority of the second level value "1" is higher than the second preset level value "0", the second multiplexer MUX2 outputs the second level value "1", so that the first alarm signal alarm_req jumps from a low level to a high level, and due to the pulse stretching effect of the second clock gate ECK2 and the third trigger D3, the third trigger D3 can continuously output the second level value "1" to the second multiplexer MUX2, so that the first alarm signal alarm_req is maintained at a high level.
[0095] In the 20th clock cycle, the second clear instruction is input to the second multiplexer MUX2 through software, driving the second multiplexer MUX2 to select and output the second preset level value "0", so that the first alarm signal alarm_req jumps from a high level to a low level again, eliminating the overflow alarm.
[0096] like Fig.12 As shown, in some embodiments of the present application, the first interrupt circuit 100 may further include a synchronization module 140, which may be connected to the first pulse generating module 110, for obtaining the first request signal int0, and performing synchronization processing on the first request signal int0 to generate a first interrupt request signal int0_r1 and output it to the first pulse generating module 110.
[0097] It can be understood that the clock domain of the peripheral interrupt source or the internal module of the chip may be different from the clock domain of the first interrupt circuit 100, and the signals in different clock domains may have phase differences or frequency differences in time. Therefore, in order to ensure the correctness and consistency of the circuit operation, the synchronization module 140 is used in the embodiment of the present application to ensure the correct transmission and synchronization of the first interrupt request signal int0_r1.
[0098] The synchronization module 140 can perform synchronization processing on the received first request signal int0 to generate a first interrupt request signal int0_r1, so that the first interrupt request signal int0_r1 is located in the clock domain of the first interrupt circuit 100, which is convenient for subsequent signal transmission and processing.
[0099] like Fig.13As shown, in some embodiments of the present application, the synchronization module 140 may include a register unit 1401; the register unit 1401 may be used to receive the first request signal int0, synchronize the first request signal int0 to the current clock domain, and obtain the first interrupt request signal int0_r1.
[0100] In the embodiment of the present application, the register unit 1401 may adopt any existing register, for example, the register unit 1401 may include multiple cascaded triggers. The number of cascaded triggers may be 1, 2 or more. The greater the delay between the clock domain of the first request signal int0 and the clock domain of the first interrupt circuit 100, the greater the number of cascaded triggers; conversely, the smaller the delay between the clock domain of the first request signal int0 and the clock domain of the first interrupt circuit 100, the smaller the number of cascaded triggers; it can be understood that the number of cascaded triggers can be determined according to the actual application scenario, which is not limited here.
[0101] Of course, if the clock domain of the first request signal int0 is synchronized with the clock domain of the first interrupt circuit 100, the first interrupt circuit 100 may not include the synchronization module 140. The first interrupt request signal int0_r1 in this scenario is equivalent to the first request signal int0, which can be set according to actual conditions.
[0102] See also Fig.14 and Fig.15 As an example, the register unit 1401 includes a fourth trigger D4 and a fifth trigger D5. Specifically, the input end of the fourth trigger D4 is connected to the first request signal int0, the output end of the fourth trigger D4 is connected to the input end of the fifth trigger D5 to output the intermediate synchronization signal int0_r0 to the fifth trigger D5, and the output end of the fifth trigger D5 is connected to the first pulse generating module 110 to output the first interrupt request signal int0_r1.
[0103] The first interrupt request signal int0_r1 is input to the input terminal of the fourth trigger D4. In the third clock cycle, the first request signal int0 changes from a low level to a high level. At this time, the fourth trigger D4 latches the high level, maintains the intermediate synchronization signal int0_r0 at a low level, and outputs the intermediate synchronization signal int0_r0 at a high level in the next clock cycle. When the first request signal int0 changes from a high level to a low level in the sixth clock cycle, the fourth trigger D4 latches the low level, maintains the intermediate synchronization signal int0_r0 at a high level, and outputs the intermediate synchronization signal int0_r0 at a low level in the next clock cycle. In other words, the intermediate synchronization signal int0_r0 is a signal formed by the fourth trigger D4 delaying the first request signal int0 by one clock cycle. Similarly, the first interrupt request signal int0_r1 is a signal formed by the fifth trigger D5 delaying the intermediate synchronization signal int0_r0 by one clock cycle. Therefore, in this embodiment, the first interrupt request signal int0_r1 is delayed by 2 clock cycles relative to the first request signal int0, which ensures that the first interrupt request signal int0_r1 is synchronized with the clock domain of the first interrupt circuit 100.
[0104] Since a signal may generate glitches when it changes, in order to eliminate the glitches in the signal, in some embodiments of the present application, the first interrupt circuit 100 may further include at least one delay module.
[0105] like Fig.16 As shown, as an example, the first delay module 151 can be connected to the first flag signal output module 120 and the first alarm module 130 to delay the first interrupt flag signal ir_reg and output the delayed first interrupt flag signal ir_reg′ to the first alarm module 130 .
[0106] In the embodiment of the present application, the first delay module 151 may include a plurality of cascaded triggers, which can eliminate glitches that may exist when the first interrupt flag signal ir_reg jumps, so that the first interrupt flag signal ir_reg′ after delay processing is free of interference.
[0107] It is understandable that the more cascaded triggers there are, the better the glitch elimination effect will be, but the signal delay will also be greater. Therefore, the number of triggers can be determined based on the actual application scenario and is not limited here.
[0108] like Fig.17 As shown, as another example, the second delay module 152 may be connected to the first alarm module 130, and is configured to perform delay processing on the first alarm signal alarm_req, and output the first alarm signal alarm_req' after delay processing.
[0109] Similarly, the second delay module 152 may include a plurality of cascaded triggers, which can eliminate the glitches that may exist when the first alarm signal alarm_req changes, so that the first alarm signal alarm_req' after delay processing is free of interference.
[0110] like Fig.18 As shown, as another example, the first interrupt circuit 100 may include a first delay module 151 and a second delay module 152, wherein the first delay module 151 is connected between the first flag signal output module 120 and the first alarm module 130, and is used to perform delay processing on the first interrupt flag signal ir_reg, and output the first interrupt flag signal ir_reg' after delay processing to the first alarm module 130; the second delay module 152 is connected to the first alarm module 130, and is used to perform delay processing on the first alarm signal alarm_req, and output the first alarm signal alarm_req' after delay processing.
[0111] See also Fig.19 and Fig. 20 In a specific implementation, the first delay module 151 includes a sixth trigger D6, the output end of the first multiplexer MUX1 is connected to the input end of the sixth trigger D6 to transmit the first interrupt flag signal ir_reg thereto, the output end of the sixth trigger D6 is connected to an input end of the second AND gate &2 to transmit the first interrupt flag signal ir_reg' after delay processing thereto, and the other input end of the second AND gate &2 is connected to the output end of the first AND gate &1 to access the first interrupt trigger pulse int0_pos.
[0112] The second delay module 152 includes a seventh trigger D7. The output of the second multiplexer MUX2 is connected to the input of the seventh trigger D7 to transmit the first alarm signal alarm_reg thereto. The output of the seventh trigger D7 outputs the first alarm signal alarm_req' after delay processing to accurately record the interrupt overflow.
[0113] When the first first interrupt trigger pulse int0_pos is generated in the 5th clock cycle, based on the latching action of the second trigger D2, the first interrupt flag signal ir_reg jumps to a high level in the next clock cycle, that is, the 6th clock cycle, and the sixth trigger D6 delays it by one clock cycle, so that the delayed first interrupt flag signal ir_reg' jumps to a high level and maintains it in the 7th clock cycle. When the second first interrupt trigger pulse int0_pos is generated in the 14th clock cycle, the second AND gate &2 outputs a high-level first trigger pulse signal int0_puls, and based on the latching action of the third trigger D3, the first alarm signal alarm_reg jumps to a high level in the next clock cycle, that is, the 15th clock cycle, and the seventh trigger D7 delays it by one clock cycle, so that the delayed first alarm signal alarm_req' jumps to a high level and maintains it in the 16th clock cycle, and an interrupt overflow alarm is issued until it is cleared by software.
[0114] like Fig.21 As shown, in some embodiments of the present application, the interrupt overflow alarm circuit 10 may further include a second interrupt circuit 200 connected to the first interrupt circuit 100; the second interrupt circuit 200 may be used to generate a first interrupt request signal int0_r1 in response to the second interrupt request signal int and output it to the first interrupt circuit 100, as well as to generate a second interrupt trigger pulse int_pos, and to generate a valid second interrupt flag signal int_req in response to the second interrupt trigger pulse int_pos, and when the second interrupt flag signal int_req is valid, to generate a valid second alarm signal mod_alarm in response to the next second interrupt trigger pulse int_pos.
[0115] In the embodiment of the present application, the second interrupt circuit 200 can be a module on the chip that is connected to the first interrupt circuit 100 and can generate an interrupt request, or a module on a peripheral that can generate an interrupt request. Therefore, the second interrupt request signal int can come from a chip internal module or from a peripheral interrupt source, which can be determined according to the actual application scenario.
[0116] When the second interrupt circuit 200 receives the second interrupt request signal int, it can not only transmit the interrupt request to the first interrupt circuit 100, that is, generate the first interrupt request signal int0_r1 and output it to the first interrupt circuit 100; it can also record the interrupt request it receives, and can also generate an alarm signal when the interrupt overflows to record the overflow.
[0117] The second interrupt circuit 200 can generate a second interrupt trigger pulse int_pos based on the second interrupt request signal int, distinguish different interrupt requests received successively through the second interrupt trigger pulse int_pos, and can generate a valid second interrupt flag signal int_req in response to the second interrupt trigger pulse int_pos. When the second interrupt flag signal int_req is valid, it generates a valid second alarm signal mod_alarm in response to the next second interrupt trigger pulse int_pos.
[0118] The structure and working principle of the second interrupt circuit 200 can be similar to Figures 2 to 20 The first interrupt circuit 100 described in any embodiment is the same as that described in any embodiment. Figures 2 to 20 The description of the first interrupt circuit 100 in any embodiment will not be repeated here.
[0119] In the embodiment of the present application, a multi-level interrupt overflow alarm is realized by cascading the first interrupt circuit 100 and the second interrupt circuit 200. It can be understood that, in addition to the first interrupt circuit 100 and the second interrupt circuit 200, the interrupt overflow alarm circuit 10 in the embodiment of the present application can also include a larger number of cascaded interrupt circuits. Each interrupt circuit can not only transmit the interrupt request to the next level, but also realize the overflow alarm of the interrupt at the current level, record the overflow, and improve the reliability of the circuit.
[0120] Based on the above embodiments, the present application also provides a chip, which may include a chip body and a Figures 1 to 21 Corresponding to the interrupt overflow alarm circuit in any embodiment.
[0121] The chip may be an integrated circuit (IC), or microcircuit, microchip, or chip. The chip may be, but is not limited to, a system on chip (SOC) or a system in package (SIP) chip.
[0122] Since the chip is provided with the interrupt overflow alarm circuit of the above embodiment, it has all the beneficial effects of the interrupt overflow alarm circuit in any of the above embodiments, which will not be described in detail here.
[0123] The embodiment of the present application also provides an electronic device, which may include a device body and an interrupt overflow alarm circuit or chip as described above, which is provided in the device body. The electronic device may be, but is not limited to, a display device, a car central control panel, a car, a smart wearable device, a mobile terminal, or a smart home device.
[0124] Among them, display devices include but are not limited to conference tablets and commercial display screens. Smart wearable devices include but are not limited to smart watches, smart bracelets, and cervical massagers. Mobile terminals include but are not limited to smartphones, laptops, tablets, and point of sales terminals (POS). Smart home devices include but are not limited to smart sockets, smart rice cookers, smart sweepers, and smart lights.
[0125] Since the electronic device is provided with the interrupt overflow alarm circuit of the above embodiment, it has all the beneficial effects of the interrupt overflow alarm circuit in any of the above embodiments, which will not be described in detail here.
[0126] The above are only preferred embodiments of the present application, and are not intended to limit the present application in any form. Although the present application has been disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present application. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.
Claims
1. An interrupt overflow alarm circuit, characterized in that: A first interruption circuit is included, wherein the first interruption circuit includes: A first pulse generating module, configured to generate a first interrupt triggering pulse according to a received first interrupt request signal; A first flag signal output module, connected to the first pulse generating module, for controlling the output first interrupt flag signal to jump from invalid to valid in response to the first interrupt trigger pulse; The first alarm module is connected to the first flag signal output module and the first pulse generating module, and is used for generating a valid first alarm signal in response to a next first interrupt trigger pulse when the first interrupt flag signal is valid.
2. The interrupt overflow alarm circuit according to claim 1, characterized in that: The first pulse generating module comprises a first pulse generating unit and a first delay flipping unit; The first delay flip unit is used to delay the first interrupt request signal according to a first preset delay time to obtain a first delay request signal, and to perform a level flip on the first delay request signal to obtain a first delay flip signal; The first pulse generating unit is connected to the first delay flipping unit, and is used to generate the first interrupt triggering pulse according to the first interrupt request signal and the first delay flipping signal.
3. The interrupt overflow alarm circuit according to claim 1, characterized in that: The first flag signal output module is also used for: In response to an interrupt reply signal or a first clear instruction for the first interrupt request signal, the first interrupt flag signal output is controlled to jump from valid to invalid.
4. The interrupt overflow alarm circuit according to claim 3, characterized in that: The first flag signal output module includes a first pulse stretching unit and a first gating unit; The first pulse stretching unit is connected to the first pulse generating module, and is used for stretching the first interrupt trigger pulse and continuously outputting a first level value to the first gating unit; The first selection unit is connected to the first alarm module, and is used to select and output the first level value or the first preset level value, wherein the first level value has a higher priority than the first preset level value, the first level value is the level value corresponding to when the first interrupt flag signal is valid, and the first preset level value is the level value corresponding to when the first interrupt flag signal is invalid.
5. The interrupt overflow alarm circuit according to claim 1, characterized in that: The first alarm module is also used for: In response to the second clear instruction, the first alarm signal output is controlled to change from valid to invalid.
6. The interrupt overflow alarm circuit according to claim 5, characterized in that: The first alarm module includes a first trigger unit, a second pulse stretching unit and a second gating unit; The first trigger unit is connected to the first pulse generating module and the first flag signal output module, and is used to generate a first trigger pulse signal in response to the valid first interrupt flag signal and the next first interrupt trigger pulse; The second pulse stretching unit is connected to the first trigger unit, and is used to stretch the first trigger pulse signal and continuously output a second level value to the second gating unit; The second selection unit is used to select and output the second level value or the second preset level value, wherein the second level value has a higher priority than the second preset level value, the second level value is the level value corresponding to when the first alarm signal is valid, and the second preset level value is the level value corresponding to when the first alarm signal is invalid.
7. The interrupt overflow alarm circuit according to claim 1, characterized in that: The first interrupt circuit also includes a synchronization module, which is connected to the first pulse generating module and is used to obtain a first request signal, perform synchronization processing on the first request signal, and generate the first interrupt request signal to output to the first pulse generating module.
8. The interrupt overflow alarm circuit according to claim 7, characterized in that: The synchronization module includes a register unit; The register unit is used to receive the first request signal, synchronize the first request signal to the current clock domain, and obtain the first interrupt request signal.
9. The interrupt overflow alarm circuit according to claim 1, characterized in that: The first interrupt circuit further includes at least one delay module; The delay module is connected to the first flag signal output module and the first alarm module, and is used to perform delay processing on the first interrupt flag signal and output the first interrupt flag signal after delay processing to the first alarm module; and / or, The delay module is connected to the first alarm module, and is used to perform delay processing on the first alarm signal and output the first alarm signal after delay processing.
10. The interrupt overflow alarm circuit according to any one of claims 1 to 9, characterized in that: The interrupt overflow alarm circuit further includes a second interrupt circuit connected to the first interrupt circuit; The second interrupt circuit is used to generate the first interrupt request signal in response to a second interrupt request signal and output it to the first interrupt circuit, as well as to generate a second interrupt trigger pulse, and to generate a valid second interrupt flag signal in response to the second interrupt trigger pulse, and when the second interrupt flag signal is valid, to generate a valid second alarm signal in response to the next second interrupt trigger pulse.
11. A chip, characterized in that: The invention comprises a chip body and an interrupt overflow alarm circuit as claimed in any one of claims 1 to 10 arranged on the chip body.
12. An electronic device, characterized in that: The invention comprises a device body and an interrupt overflow alarm circuit as claimed in any one of claims 1 to 10 or a chip as claimed in claim 11, which is arranged on the device body.
