Reset device, method, clock system and electronic equipment
By designing a clock generation circuit in a large-scale integrated circuit and using an asynchronous reset signal to generate a second clock signal to trigger the reset of the synchronous reset circuit, the problem of mismatch of reset signals of the asynchronous reset sequential circuit and the synchronous reset sequential circuit is solved, ensuring system stability. sex.
Patent Information
- Application Number
- CN202011098378.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-14
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-10-14
AI Technical Summary
In large-scale integrated circuits, the coexistence of asynchronous reset sequential circuits and synchronous reset sequential circuits results in mismatch of reset signals, which may lead to system instability. The asynchronous reset sequential circuit is reset but the synchronous reset sequential circuit is not reset, affecting the normal operation of the system.
A reset device is designed, including a clock generation circuit. When detecting that the system clock circuit does not output the first clock signal, the circuit obtains an asynchronous reset signal and generates a second clock signal based on the asynchronous reset signal to trigger the synchronous reset circuit. Reset operation ensures the stability of the entire system.
This effectively avoids the situation where the asynchronous reset circuit is reset but the synchronous reset circuit is not reset when the synchronous reset circuit does not receive the first clock signal, ensuring stable system output and preventing system disorder.
Smart Images

Figure CN112187233B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of clock design, and more specifically, to a reset device, method, clock system and electronic equipment. Background Art
[0002] Current system-on-chip or other large-scale integrated circuits will include processors, buses and other electronic components. Since different electronic components may use different timing circuits, asynchronous reset timing circuits and synchronous reset timing circuits may coexist in the system-on-chip or other large-scale integrated circuits, which puts forward new requirements for clock design. Summary of the invention
[0003] The present application proposes a reset device, method, clock system and electronic device to improve the above-mentioned defects.
[0004] In the first aspect, an embodiment of the present application provides a reset device, which is applied to a clock system, wherein the clock system includes an asynchronous reset timing circuit, a synchronous reset timing circuit and a system clock circuit, wherein the system clock circuit is connected to a clock signal input terminal of the synchronous reset circuit, wherein the system clock circuit is used to input a first clock signal to the clock signal input terminal, wherein the first clock signal is used to trigger the synchronous reset circuit to perform a reset operation, and wherein the reset device includes: a clock generation circuit, wherein an output terminal of the clock generation circuit is connected to the clock signal input terminal, wherein the clock generation circuit is used to: when it is detected that the system clock circuit does not output the first clock signal, obtain an asynchronous reset signal, wherein the asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit; and generate a second clock signal according to the asynchronous reset signal, wherein the second clock signal is used to trigger the synchronous reset circuit to perform a reset operation.
[0005] In the second aspect, an embodiment of the present application also provides a clock system, including: an asynchronous reset timing circuit, a synchronous reset timing circuit, a system clock circuit and the above-mentioned reset device, the system clock circuit is connected to the clock signal input end of the synchronous reset circuit, the system clock circuit is used to input a first clock signal to the clock signal input end, the first clock signal is used to trigger the synchronous reset circuit to perform a reset operation, and the output end of the clock generation circuit is connected to the clock signal input end.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a device body and the above-mentioned clock system, wherein the clock system is disposed in the device body.
[0007] In a fourth aspect, an embodiment of the present application also provides a reset method, which is applied to a clock system, wherein the clock system includes an asynchronous reset timing circuit, a synchronous reset timing circuit and a system clock circuit, wherein the system clock circuit is connected to a clock signal input terminal of the synchronous reset circuit, and the system clock circuit is used to input a first clock signal to the clock signal input terminal, and the first clock signal is used to trigger the synchronous reset circuit to perform a reset operation. The method includes: when it is detected that the system clock circuit does not output the first clock signal, obtaining an asynchronous reset signal, and the asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit; generating a second clock signal according to the asynchronous reset signal; and inputting the second clock signal to the clock signal input terminal to instruct the synchronous reset timing circuit to perform a reset operation according to the second clock signal.
[0008] The reset device, method, clock system and electronic device provided in the present application are applied to the clock system, wherein the clock system includes an asynchronous reset timing circuit, a synchronous reset timing circuit and a system clock circuit, wherein the system clock circuit is connected to the clock signal input terminal of the synchronous reset circuit, and the reset device includes: a clock generation circuit. The system clock circuit can output a first clock signal to the clock signal input terminal of the synchronous reset circuit, and the synchronous reset circuit performs a reset operation when receiving the first clock signal at the clock signal input terminal. When the clock generation circuit detects that the system clock circuit does not output the first clock signal, the synchronous reset circuit cannot be reset according to the first clock, and then, when the clock generation circuit obtains the asynchronous reset signal, it generates a second clock signal according to the asynchronous reset signal, and inputs the second clock signal to the clock signal input terminal. Among them, the asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit, and at this time the synchronous reset circuit cannot perform the reset operation if it does not receive the first clock signal. Therefore, when the system does not output the first clock signal to reset the synchronous reset circuit, the clock generation circuit can generate a second clock signal for performing a reset operation on the synchronous reset circuit according to the asynchronous reset signal, thereby avoiding the situation where the asynchronous reset circuit is reset but the synchronous reset circuit is not reset when the synchronous reset circuit does not receive the first clock signal, which will cause the output of the entire system to be unstable, thereby avoiding system disorder.
[0009] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] 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.
[0011] Figure 1 A schematic diagram of an asynchronous reset circuit provided in an embodiment of the present application is shown;
[0012] Figure 2 A schematic diagram of a synchronous reset circuit provided in an embodiment of the present application is shown;
[0013] Figure 3 Shows Figure 2 The corresponding timing diagram;
[0014] Figure 4 A circuit diagram of a reset device provided in an embodiment of the present application is shown;
[0015] Figure 5 Shows Figure 4 The corresponding timing diagram;
[0016] Figure 6 A circuit diagram of a reset device provided in another embodiment of the present application is shown;
[0017] Figure 7 A circuit diagram of a reset device provided by another embodiment of the present application is shown;
[0018] Figure 8 A circuit diagram of a reset device provided in yet another embodiment of the present application is shown;
[0019] Fig. 9 A circuit diagram of a reset device provided in yet another embodiment of the present application is shown;
[0020] Fig.10 Shows Fig. 9 The corresponding timing diagram;
[0021] Fig.11 A method flow chart of a reset method provided by an embodiment of the present application is shown;
[0022] Fig.12 A module block diagram of a clock system provided by an embodiment of the present application is shown;
[0023] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown;
[0024] Fig.14A storage unit for storing or carrying program codes for implementing the methods according to the embodiments of the present application is provided in the embodiments of the present application. DETAILED DESCRIPTION
[0025] 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 a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0026] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0027] In digital integrated circuit chips, the reset circuit is an indispensable part to ensure the normal operation of the chip. As the chip scale continues to increase, the structure of the reset circuit and its access method with other circuits are becoming more and more complicated. Especially in ultra-large-scale integrated circuit chips, there are generally multiple clock domains, and each clock domain has its own reset signal. For example, in a complex system on chip (System on Chip, SOC) design, it is often necessary to integrate multiple circuit designs, where the multiple circuits may include modules such as CPU, bus and accelerator. However, due to different circuit design rules, it may cause asynchronous reset and synchronous reset timing circuits to exist in SOC at the same time, which puts forward new requirements for the high-level reset logic design of SOC.
[0028] The asynchronous reset sequential circuit refers to a circuit that uses a clock and whose reset mode is asynchronous reset. Specifically, the sequential circuit can be a register, and the asynchronous reset is implemented by using a register with an asynchronous reset port, such as Figure 1 As shown, the asynchronous reset register resets the output at the moment the reset signal is detected to be valid. This operation has no direct connection with the clock signal CLK input.
[0029] In addition, a synchronous reset sequential circuit refers to a circuit that uses a clock and whose reset mode is synchronous reset. Specifically, the sequential circuit can be a register. The register in the synchronous reset circuit design does not have an asynchronous reset port. When resetting this type of register, a data port selector is used to input the reset value to the data port of the register when the reset signal is valid. Figure 2 As shown, when the clock signal CLK is valid, the register J1 changes the output value of the register to the input value of the register at the time before the clock signal is valid. Therefore, Figure 2 In the synchronous reset timing circuit shown, the input value of the register needs to be equal to the reset value at the moment before the clock signal CLK is valid. For example, the reset value can be 0. In the embodiment of the present application, when the reset signal of the selector M1 is valid, the output of the selector M1 is the input of the S1 terminal. When the reset signal of the selector M1 is not valid, the output of the selector M1 is the input of the S2 terminal. As an implementation method, the input signal can be a signal of a normally high level, that is, the logic value of the input signal is always 1.
[0030] therefore, Figure 2 The synchronous reset timing circuit shown in the figure requires that the reset signal is valid at the moment before the clock signal CLK is valid. Assume that the clock signal CLK is valid means that the clock signal changes from low level to high level, that is, triggers a rising edge, and the reset signal is valid means that the reset signal is low level, so that at the moment before the rising edge of the clock signal CLK, the reset signal should be low level, so that the output of the selector M1, that is, the input of the register J1 is low level, that is, D n =0, and then when the clock signal CLK rises, Q n+1 =D n =0, where n represents the time. Therefore, the synchronous reset timing circuit requires that the reset signal is synchronized with the input clock.
[0031] However, the inventors found in their research that since the asynchronous reset timing circuit has no requirement for the clock signal CLK, when resetting the asynchronous reset timing circuit, it is possible that the system does not generate the clock signal CLK, resulting in the asynchronous reset timing circuit being reset while the synchronous reset timing circuit is not reset. Figure 3 As shown, Figure 3 The gate clock in is Figure 2The clock signal CLK in the system clock signal, wherein the system clock signal, the enable signal and the gate enable signal are signals used to generate the clock signal CLK. Specifically, the system clock signal is a basic clock signal provided by the system (such as a system on a chip) for each chip in the system. Each chip can receive the system clock signal at the right time based on the system clock signal through the control of the enable signal and the logic gate according to its own clock needs, and can also generate a new clock signal through frequency multiplication, frequency division and latching.
[0032] The enable signal is used to Figure 2 The clock signal CLK in the gate enable is enabled. For example, the enable signal can be used as an instruction for a processor such as a CPU to notify the system to input a clock to a register. The gate enable signal is used to become a high level when the enable signal and the system clock signal are both high levels. When the gate enable signal is high, the system clock signal is used as the clock signal CLK of the register.
[0033] Depend on Figure 3 It can be seen that the reset signal is valid, that is, the time period of the low level is the 2nd and 3rd clocks of the system clock signal, and the 7th and 8th clocks of the system clock signal. It should be noted that one clock of the system clock signal refers to the time experienced by an adjacent high level and a low level, that is, the cycle of a clock signal. The system clock signal is a clock signal of multiple cycles.
[0034] At the 7th and 8th clocks of the system clock signal, at the rising edge between the 7th and 8th clocks, when the output value of the output signal is equal to the 7th clock, the input D of the register is low level, that is, logic 0, so that at the rising edge between the 7th and 8th clocks, the output of the register becomes 0, that is, reset. At the 2nd and 3rd clocks, since the gate clock is not enabled and is in a normally low state, the rising edge is not triggered. Therefore, the synchronous reset timing circuit is not reset, and the asynchronous reset timing circuit is reset, which will cause system instability. Specifically, it is assumed that the circuit of the CPU in the SOC uses synchronous reset, while the bus and peripherals use asynchronous reset. During the system power-on process, if the reset signal appears before the clock is enabled, the CPU cannot be reset. At this time, the internal register of the CPU is in an indeterminate state, which will be transmitted to the peripherals along with the data and control buses connected to it. When the system clock is turned on, the peripherals sample these indeterminate signals from the CPU bus, and further transmit these indeterminate states, resulting in more registers in the SOC system being counted into the indeterminate state, thereby affecting the normal operation of the entire system.
[0035] Therefore, in order to overcome the above-mentioned defects, an embodiment of the present application provides a reset device, which can still be reset when the clock signal CLK of the synchronous reset timing circuit is not enabled. At the same time, it can effectively avoid the situation in the SOC design where asynchronous reset and synchronous reset circuits coexist, where the asynchronous reset timing circuit completes the reset, but the synchronous reset timing circuit cannot be effectively reset.
[0036] Specifically, please refer to Figure 4 , Figure 4 A reset device is shown. The reset device is applied to a clock system, which can be the above-mentioned SOC or other circuit systems using clock signals. The clock system includes an asynchronous reset timing circuit, a synchronous reset timing circuit and a system clock circuit, wherein the asynchronous reset timing circuit and the system clock circuit are not shown in the figure, and the register J1 and the selector M1 constitute a synchronous reset timing circuit. Specifically, the reset device includes: a clock generation circuit 410.
[0037] As an implementation mode, the system clock circuit is connected to the clock signal input terminal of the synchronous reset circuit (i.e., the clock terminal C of the register J1), and the system clock circuit is used to provide a first clock signal for the synchronous reset circuit, and the first clock signal is a clock signal provided by the system for triggering the synchronous reset circuit to perform a reset operation, that is, the first clock signal is used as a trigger signal for the synchronous reset circuit to perform a reset operation. For example, the first clock signal can be the above-mentioned gate clock. The description of the asynchronous reset timing circuit and the synchronous reset timing circuit can refer to the above content, and will not be repeated here.
[0038] The output end of the clock generation circuit 410 is connected to the clock signal input end. Specifically, the output end of the clock generation circuit 410 is connected to the clock end C of the register J1, and the control end CN of the selector M1 is used to receive the asynchronous reset signal. When the asynchronous reset signal is at a high level, the logic value of the output end of the selector M1 is the logic value of the input signal at the S2 end. When the asynchronous reset signal is at a low level, the logic value of the output end of the selector M1 is the logic value of the input signal at the S1 end. Figure 4 It can be seen that the logic value of the input signal at the S1 terminal is 0. Therefore, when the reset signal is at a low level, the logic value of the input terminal D of the input register J1 is 0. Therefore, when the next rising edge of the clock terminal C of the register J1 arrives, the output value of the register J1 is equal to the logic value of the input terminal D when the reset signal is at a low level, that is, the output value of the register J1 is equal to 0, which means it is reset.
[0039] The clock generation circuit 410 is used to obtain an asynchronous reset signal when it is detected that the system clock circuit does not output the first clock signal. The asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit. For example, the asynchronous reset signal can be the above Figure 3 In the reset signal, specifically, when the asynchronous reset signal is at a low level, the asynchronous reset timing circuit is reset. Then, the clock generation circuit 410 generates a second clock signal according to the asynchronous reset signal; the second clock signal is input to the clock signal input terminal, and the second clock signal is used to trigger the synchronous reset circuit to perform a reset operation, that is, the second clock signal is used as a trigger signal for the synchronous reset circuit to perform a reset operation.
[0040] As an implementation, the second clock signal generated by the clock generation circuit 410 can also generate an effective level state, and the effective level state is the same as the effective level state that can be generated by the first clock signal provided by the system. For example, taking the first clock signal as the aforementioned gate clock as an example, the effective level state of the first clock signal is a state where a low level changes to a high level, that is, a rising edge, and the second clock signal generated by the clock generation circuit 410 can also generate a rising edge.
[0041] As an implementation method, the implementation method of the clock generation circuit 410 generating the second clock signal according to the asynchronous reset signal can be that the clock generation circuit 410 can generate a clock signal. Specifically, the clock generation circuit 410 is a clock generator, which can receive a system clock and generate a second clock signal by performing a preset process on the system clock. The second clock signal can be the same as the first clock signal, that is, the period and pulse width are consistent, wherein the preset process can be no processing, or can be through frequency multiplication, frequency division, phase lock or logical operation, wherein the logical operation includes operations such as logic AND and logic NOT, for example, the signal is inverted so that the high level of the signal becomes a low level, and the low level becomes a high level. Then the clock generation circuit 410 can monitor the level change of the asynchronous reset signal, and generate the second clock signal when the level of the asynchronous reset signal becomes a specified level.
[0042] As an implementation method, the clock generation circuit 410 generates the second clock signal according to the asynchronous reset signal in such a manner that the clock generation circuit 410 can monitor the level change of the asynchronous reset signal, and when the level of the asynchronous reset signal becomes a specified level, the asynchronous reset signal is processed in a preset manner to generate the second clock signal. Specifically, the asynchronous reset signal can be directly used as the second clock signal, or the asynchronous reset signal can be processed by a logic element such as a trigger to obtain the second clock signal, which will be described in detail in subsequent embodiments.
[0043] Therefore, when the system does not output the first clock signal to reset the synchronous reset circuit, the clock generation circuit can generate a second clock signal for triggering the synchronous reset circuit to perform a reset operation according to the asynchronous reset signal, thereby avoiding the situation where the asynchronous reset circuit is reset but the synchronous reset circuit is not reset when the synchronous reset circuit does not receive the first clock signal, which will cause the output of the entire system to be unstable, thereby avoiding system disorder. Figure 5 , Figure 5 shows the timing diagram of the clock system. Figure 5 and Figure 3 By comparison, it can be seen that during the period when the system clock circuit does not provide the first clock signal to the synchronous reset timing circuit, that is, during the period when the gate clock is not enabled and is continuously in a low level state, that is, during the period when the clock terminal C of the register J1 does not receive the gate clock, Figure 3 In this period, the output signal is not reset, that is, it continues to be high level, and Figure 5 In this period, when the reset signal changes from a low level to a high level, the clock terminal C of the register J1 can respond to the transition from the low level to the high level and change the output signal to the logic value of D in the low level stage of the reset signal.
[0044] By the above Figure 3 and Figure 5 It can be seen that the asynchronous reset signal is a signal that alternates between a first level and a second level, and the synchronous reset timing circuit is used to perform a reset operation when the signal input to the clock signal input terminal is at a specified level or a level change occurs, wherein the first level can be a low level or a high level, and if the first level is a low level, the second level is a high level, and if the first level is a high level, the second level is a low level. As an implementation method, the specified level can be a low level or a high level, wherein the level change can be a change from a low level to a high level (i.e., a rising edge) or a change from a high level to a low level (i.e., a falling edge).
[0045] Therefore, as an implementation method, the clock generation circuit 410 can directly use the asynchronous reset signal as the second clock signal, such as Figure 4 As shown, the clock generation circuit 410 can input the asynchronous reset signal into the clock terminal C of the register J1 when the asynchronous reset signal is obtained. Therefore, as the asynchronous reset signal alternates between the first level and the second level, the signal of the clock terminal C of the register J1 also alternates between the first level and the second level, so that it can become a specified level or a level change occurs, thereby resetting the register J1.
[0046] In addition, if the asynchronous reset signal is a pulse signal, and the pulse width is relatively narrow, the time between the high and low levels will be too short, and the synchronous reset timing circuit will not be able to respond to the asynchronous reset signal in time, and the synchronous reset timing circuit will not be able to accurately assign a value to the output value, which will lead to an indeterminate output result. Therefore, in order to avoid this problem, the clock generation circuit is also used to: when it is detected that the asynchronous reset signal changes from the second level to the first level, generate a signal that remains at the first level within a first time length; when it is detected that the asynchronous reset signal changes from the first level to the second level, generate a signal that remains at the second level within a second time length, and the signal generated by the clock generation circuit that alternates between the first level and the second level is used as the second clock signal.
[0047] As an implementation method, the first time length and the second time length can be set according to actual use. In some embodiments, the signal output by the clock generation circuit is also a periodic signal that alternates between the first level and the second level. The time length of one cycle is the sum of the time length t1 when the output signal is at the first level and the time length t2 when the output signal is at the second level, that is, the period T = t1 + t2. As an implementation method, t1 and t2 can be different or different. In the embodiment of the present application, t1 and t2 are the same, and the period of the signal output by the clock generation circuit is the same as the period of the first clock signal. As another embodiment, when the pulse width of the asynchronous reset signal is less than the specified width, the first time length is the same as the time length that the asynchronous reset signal is at a first level, and the second time length is the same as the time length that the asynchronous reset signal is at a second level, that is, the period of the signal output by the clock generation circuit is the same as the period of the asynchronous reset signal. If the pulse width of the asynchronous reset signal is not less than the specified width, the pulse width of the signal output by the clock generation circuit can be made greater than the pulse width of the asynchronous reset signal by reasonably setting the first time length and the second time length, so that when the signal output by the clock generation circuit is used as the second clock signal, the second clock signal can meet the requirements of the synchronous reset timing circuit, and avoid the pulse width of the second clock signal being too narrow, which may cause the synchronous reset timing circuit to output an indeterminate state.
[0048] As an implementation, see Figure 6 , Figure 6 Another embodiment of the present application provides a reset device, such as Figure 6As shown, the clock generation circuit 410 also includes a trigger 411 and an assignment circuit 412, the clock end of the trigger 411 is used to receive the asynchronous reset signal, the output end of the trigger 411 is connected to the clock signal input end, and the assignment circuit 412 is connected to the input end of the trigger 411, wherein the output end of the trigger 411 serves as the output end of the clock generation circuit 410.
[0049] like Figure 6 As shown, the synchronous reset timing circuit can be composed of a register J1 and a selector M1, then the clock signal input end is the clock end C1 of the register J1, the assignment circuit 412 and the trigger 411 can both receive an asynchronous reset signal, the control end CN of the selector M1 also receives an asynchronous reset signal, and the output end of the trigger 411 is connected to the clock end C of the register J1.
[0050] The assignment circuit 412 is used to output a first signal when the asynchronous reset signal is at the second level, and the first signal is a signal at the first level; the trigger 411 is used to output a signal equal to the first signal when the asynchronous reset signal received at the clock end changes from the second level to the first level, and to output a signal equal to the inverted signal of the first signal when the asynchronous reset signal received at the clock end changes from the first level to the second level. As an implementation method, the first level is a low level and the second level is a high level.
[0051] Specifically, Figure 7 As shown, the assignment circuit 412 includes a first selector M2 and an inverter L1. The first selector M2 includes a first selection input terminal S22, a second selection input terminal S21, a first control terminal CN2 and a first selection output terminal P2. The signal input to the first selection input terminal S22 is a first level, that is, Figure 7 The logic value of the input S22 is 0, the output terminal of the trigger 411 is connected to the second selection input terminal S21 through the inverter, and the first control terminal CN2 is used to receive the asynchronous reset signal. Figure 7 The register J2 in the register J2 can be a double-edge trigger, that is, an assignment operation is performed when the signal at the clock end is a rising edge and a falling edge.
[0052] The first selector M2 is used to control the output signal of the first selection output terminal P2 to be the signal input to the first selection input terminal S22 when the asynchronous reset signal received by the first control terminal CN2 is at a high level, and to control the output signal of the first selection output terminal P2 to be the signal input to the second selection input terminal S21 when the asynchronous reset signal received by the first control terminal CN2 is at a low level. Figure 7As shown, the first selector M2, the inverter L1 and the register J2 constitute a dual-edge trigger, that is, the register J2 performs an assignment operation when the signal at the clock terminal C1 has a rising edge (low level changes to high level) or a falling edge (high level changes to low level), that is, the output value is equal to the value of the D1 terminal at the previous moment of the rising edge or falling edge.
[0053] Specifically, the logic value of each port changes as follows:
[0054] When the asynchronous reset signal is 1, CN2 is 1, P2 is equal to the value of S22, that is, P2 is equal to 0, and the value of the D1 terminal of the register J2 is also 0. Since the signal at the clock terminal C of the register J1 does not have a rising edge, the value of the output terminal Q1 of the register J2 remains unchanged from the previous state value. For example, if the previous state logic value is 1, the output terminal Q1 of the register J2 is also 1.
[0055] When the asynchronous reset signal is 0, that is, the signal at the clock end C1 triggers the falling edge, CN2 is 0, P2 is equal to the value of S21, that is, P2 is equal to the inverted logical value of Q1, that is, P2 is equal to 0, then the logical value of the D1 end of the input register J2 is 0, and the output value Q1 is equal to the moment before the falling edge, that is, when the previous asynchronous reset signal is 1, the value of the D1 end, that is, the output value Q1 is 0, and at the current moment, the value of the S21 end is the inverted value of Q1, that is, equal to 1, that is, D1 at the current moment is equal to 1.
[0056] When the asynchronous reset signal is 1 again, that is, the signal at the clock terminal C1 triggers the rising edge, P2 is equal to the value of S22, that is, P2 is equal to 0, and the output value Q1 is equal to the value of the D1 terminal at the previous moment of the rising edge, that is, when the previous asynchronous reset signal is 0, the output value Q1 is 1, and D1 at the current moment is 0.
[0057] Therefore, the output Q1 is pulled low when the falling edge of the asynchronous reset signal is detected, and Q1 is pulled high when the rising edge of the asynchronous reset signal is detected. Therefore, this process generates a rising edge at Q1, and the rising edge of Q1 is used as the reset clock signal of register J1.
[0058] As an implementation mode, in order to facilitate the synchronous reset timing circuit to use the first clock signal to reset when the system clock circuit outputs the first clock signal, and to use the second clock signal to reset when the system clock circuit does not output the first clock signal, the reset device also includes a selection switch. Figure 8As shown, assuming that the synchronous reset timing circuit is composed of the above-mentioned register J1 and selector M1, the system clock circuit 310 and the clock generation circuit 410 are both connected to the clock terminal C of the register J1 through the selection switch 420. The selection switch 420 is used to: when it is detected that the system clock circuit 310 does not output the first clock signal, cut off the system clock circuit 310 and the clock signal input terminal C, and connect the clock generation circuit 410 and the clock signal input terminal C; when it is detected that the system clock circuit 310 outputs the first clock signal, connect the system clock circuit 310 and the clock signal input terminal C, and cut off the clock generation circuit 410 and the clock signal input terminal C.
[0059] As an implementation mode, the selection switch may include two input terminals, one output terminal and one control terminal, the two input terminals are respectively connected to the clock generation circuit 410 and the system clock circuit 310, the output terminal is connected to the clock terminal C of the register J1, and the control terminal is used to detect whether the system clock circuit outputs the first clock signal. The specific detection method may be that the system clock circuit outputs the first clock signal according to the clock enable signal, and the clock enable signal may be the aforementioned enable signal or gate enable signal. When the clock enable signal is at an effective level (for example, a high level), the system clock circuit outputs the first clock signal, and when the clock enable signal is at an ineffective level, the system clock circuit does not output the first clock signal. Then the control terminal can receive the clock enable signal, and when the clock enable signal is at an ineffective level, control the connection between the input terminal and the output terminal of the clock generation circuit 410 to be conducted, while the connection between the other input terminal and the output terminal is cut off. When the clock enable signal is at an effective level, control the connection between the input terminal and the output terminal of the system clock circuit 310 to be conducted, while the connection between the other input terminal and the output terminal is cut off.
[0060] In the embodiments of the present application, the selectors may be electronic devices such as triodes, transistors, and thyristors having a control terminal and two connection terminals.
[0061] Specifically, see Fig. 9 , the selection switch 420 can be Fig. 9The selector M3 in the selection switch 420 includes a second selector M3, and the second selector M3 includes a third selection input terminal S31, a fourth selection input terminal S32, a second control terminal CN3, and a second selection output terminal P3. The clock generation circuit is connected to the third selection input terminal S31, that is, the output terminal Q1 of the register J2 is connected to the third selection input terminal S31. The system clock circuit is connected to the fourth selection input terminal S32, and the second selection output terminal P3 is connected to the clock signal input terminal, that is, the second selection output terminal P3 is connected to the clock terminal C of the register J1. The second control terminal CN3 is used to receive a clock start signal EN, and the system clock circuit 310 is used to output a first clock signal when the clock start signal EN is at an effective level, wherein the effective level can be a high level. The specific implementation of the clock start signal EN can refer to the aforementioned enable signal, which will not be repeated here.
[0062] The selector M3 is used to: when the clock start signal EN received by the second control terminal CN3 is at a valid level, control the output signal of the second selection output terminal P3 to be the first clock signal of the fourth selection input terminal S32 input to the system clock circuit 310; when the clock start signal EN received by the second control terminal CN3 is not at a valid level, control the output signal of the second selection output terminal P3 to be the second clock signal of the third selection input terminal S31 input to the clock generation circuit.
[0063] The system clock circuit 310 includes a latch J3 and a logic AND gate L2, wherein the latch J3 may also be a register, and unlike the aforementioned register J1, the latch J3 is effective when the clock terminal E is at a low level. In the embodiment of the present application, the aforementioned register and trigger may both be D triggers.
[0064] The clock terminal E of the latch J3 is used to receive the inverted signal of the system clock CLK, the input terminal D3 of the latch J3 is used to receive the clock start signal EN, the output terminal Q3 of the latch J3 is connected to a logic input terminal of the logic AND gate L2, the other logic input terminal of the logic AND gate L2 receives the system clock CLK, and the output terminal of the logic AND gate L2 is connected to the fourth selection input terminal S32.
[0065] Specifically, described in terms of logical values Fig. 9 Principle:
[0066] When the asynchronous reset signal is 0, the clock terminal C1 of register J2 is 0, and Q1 maintains the previous state of D1, that is, 0, then Q1=0, and Q1 is 1 after being inverted. The output of selector M2 is equal to the inverted value of Q1 at this time, so D1 becomes 1.
[0067] At this time, the clock start signal EN is 0, the system clock CLK is 1, and the output terminal Q3 of the latch J3 maintains the logic value of the clock start signal EN in the previous state, that is, the output terminal Q3 of the latch J3 is equal to 0, and then, the output of the AND gate is 0, and the output of the selector M3 is equal to Q1 at this time, that is, the output of the selector M3 is 0, the output of the selector M1 is 0, and the output Q of the register J1 is also 0.
[0068] If the asynchronous reset signal becomes 1, the clock terminal C1 of register J2 is 1, Q1 is equal to D1, that is, Q1 is equal to 1, and Q1 is 0 after being inverted. The output of M selector M2 is equal to the value of S22 at this time, so D1 becomes 0. Then, at this time, the clock start signal EN is 0, the system clock CLK is 1, and the output terminal Q3 of latch J3 maintains the EN of the previous state, that is, Q3 is equal to 0. Then, the output of the AND gate is 0, and the output of the selector M3 is equal to Q1 at this time. At this time, the clock signal of register J1 is high, and the output Q of register J1 is equal to D at the previous moment, that is, equal to 1.
[0069] When the clock start signal EN is at a valid level, wherein the clock start signal EN is at a valid level means that the clock start signal EN is at a high level, that is, the logic value is 1, when the system clock CLK is at a low level, the gate enable signal Gate EN output by the latch J3 is also at a high level. Then, when Gate EN is also at a high level, the output of the AND gate is equal to the system clock, that is, the gate clock Gateed CLK is equal to the system clock CLK. At this time, the selector M3 uses the gate clock Gateed CLK as the first clock signal and inputs it to the clock terminal C of the register J1.
[0070] Fig. 9 The corresponding timing diagram is as follows Fig.10 As shown by Fig.10It can be seen that when the enable signal is at a low level, the gate clock is continuously at a low level and cannot be used as the reset clock of register J1 to reset register J1. When the first clock signal, that is, the gate clock is not enabled, when the reset signal changes from a low level to a high level, the output terminal Q1 of register J2 also changes from a low level to a high level, that is, the rising edge is also triggered. At the moment before the rising edge, the input terminal D of register J1 is at a low level. When the output terminal Q1 rises, the logic value of the output signal of register J1 becomes 0, that is, it is reset. When the enable signal is at a high level, that is, during the time period when the enable signal is valid, when the gate clock triggers the rising edge, the logic value of the output signal of register J1 becomes 0, that is, it is reset. That is to say, in the time period of the 7th clock of the system clock, the asynchronous reset signal is at a low level, which causes the output of the selector M1 to be 0, that is, the input terminal D of the register J1 is 0. Then, at the rising edge of the 8th clock of the system clock, the output signal of the register J1 is equal to the value of D at the previous moment of the rising edge, that is, in the time period of the 7th clock of the system clock, which is equal to 0, and is thus reset.
[0071] Therefore, when the enable signal is not enabled, the second clock signal is obtained by using the asynchronous reset signal, so that the synchronous reset timing circuit can be reset according to the second clock signal, and it can be seen from the above timing diagram that when the asynchronous reset signal is at a low level, the asynchronous reset timing circuit is reset, and when the asynchronous reset signal is pulled high, the synchronous reset timing circuit is reset, so that the asynchronous reset timing circuit and the synchronous reset timing circuit can be reset successively even when the first clock signal is not enabled.
[0072] See also Fig.11 , which shows a reset method provided in an embodiment of the present application, the reset method is applied to the above-mentioned clock system, as an implementation mode, the method is applied to the above-mentioned reset device, specifically, the method includes: S1101 to S1103.
[0073] S1101: When it is detected that the system clock circuit does not output the first clock signal, an asynchronous reset signal is obtained.
[0074] The asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit, and the first clock signal is used to trigger the synchronous reset circuit to perform a reset operation.
[0075] As an implementation mode, when it is detected that the system clock circuit does not output the first clock signal, the implementation mode of obtaining the asynchronous reset signal may be, when the selection switch detects that the system clock circuit does not output the first clock signal, the system clock circuit is disconnected from the clock signal input terminal, the clock generation circuit is connected to the clock signal input terminal, and the asynchronous reset signal is obtained. When the selection switch detects that the system clock circuit outputs the first clock signal, the system clock circuit is connected to the clock signal input terminal, and the clock generation circuit is disconnected from the clock signal input terminal.
[0076] S1102: Generate a second clock signal according to the asynchronous reset signal.
[0077] The second clock signal is used to trigger the synchronous reset circuit to perform a reset operation.
[0078] As an implementation mode, the asynchronous reset signal is a signal that alternates between a first level and a second level, and the synchronous reset timing circuit is used to perform a reset operation when the signal input to the clock signal input terminal is at a specified level or a level change occurs, and the specified level is the first level or the second level. The implementation mode of generating the second clock signal according to the asynchronous reset signal may be to use the asynchronous reset signal as the second clock signal.
[0079] As another implementation, the asynchronous reset signal is a signal that alternates between a first level and a second level, and the synchronous reset timing circuit is used to perform a reset operation when the signal input to the clock signal input terminal changes from the first level to the second level. The implementation of generating the second clock signal according to the asynchronous reset signal may be that when it is detected that the asynchronous reset signal changes from the second level to the first level, a signal that is maintained at the first level within a first time length is generated; when it is detected that the asynchronous reset signal changes from the first level to the second level, a signal at the second level within a second time length is generated, and the signal that alternates between the first level and the second level generated by the clock generation circuit is used as the second clock signal.
[0080] In some embodiments, the assignment circuit outputs a first signal when the asynchronous reset signal is at the second level, and the first signal is a signal of the first level; when the asynchronous reset signal received by the trigger at the clock end changes from the second level to the first level, the output signal is equal to the first signal, and when the asynchronous reset signal received at the clock end changes from the first level to the second level, the output signal is equal to the inverted signal of the first signal.
[0081] S1103: Input the second clock signal to the clock signal input terminal to trigger the synchronous reset circuit to perform a reset operation.
[0082] Please refer to Fig.12 , which shows a clock system provided by an embodiment of the present application. The clock system 100 can be the above-mentioned SOC, or can be other circuit systems using clock signals. As an implementation method, the clock system can be arranged on at least one chip. Fig.12 As shown, the clock system 100 includes an asynchronous reset timing circuit 320, a synchronous reset timing circuit 330, a system clock circuit 310 and a reset device 400, wherein the system clock circuit 310 is connected to the clock signal input terminal of the synchronous reset circuit 330, and the clock generation circuit is connected to the clock signal input terminal.
[0083] Specifically, the specific implementations of the asynchronous reset timing circuit 320 , the synchronous reset timing circuit 330 , the system clock circuit 310 and the reset device 400 can refer to the aforementioned embodiments, which will not be described in detail herein.
[0084] Please refer to Fig.13 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 10 can be an electronic device such as a smart phone, a tablet computer, an e-book, etc. that can run applications. The electronic device 10 in the present application may include a device body 11 and a clock system 100, and the clock system 100 is arranged in the device body 11. Among them, the device body 11 includes a shell and a main display screen arranged on the shell. The shell can be made of metal, such as steel or aluminum alloy. In this embodiment, the main display screen generally includes a display panel, and may also include a circuit for responding to touch operations on the display panel. In some embodiments, the display panel is also a touch screen. As an embodiment, the clock system 100 is arranged in the shell. Specifically, the main board of the electronic device is located in the shell, and the clock system 100 is arranged on the main board of the electronic device.
[0085] In addition, the electronic device may also include a processor, a memory, and one or more applications, wherein the one or more applications may be stored in the memory and configured to be executed by one or more processors, and the one or more programs are configured to execute the methods described in the aforementioned method embodiments.
[0086] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect the various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor can integrate one or a combination of a central processing unit (CPU), a graphics processor (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor, but may be implemented separately through a communication chip.
[0087] The memory may include a random access memory (RAM) or a read-only memory (ROM). The memory may be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0088] Please refer to Fig.14 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0089] The computer readable storage medium 1300 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1300 includes a non-transitory computer readable storage medium. The computer readable storage medium 1300 has storage space for program code 1310 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1310 can be compressed, for example, in an appropriate form.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A reset device, characterized in that: Applied to a clock system, the clock system comprises an asynchronous reset timing circuit, a synchronous reset timing circuit and a system clock circuit, the system clock circuit is connected to a clock signal input terminal of the synchronous reset timing circuit, the system clock circuit is used to input a first clock signal to the clock signal input terminal, the first clock signal is used to trigger the synchronous reset timing circuit to perform a reset operation, and the reset device comprises: A clock generating circuit, wherein the output end of the clock generating circuit is connected to the clock signal input end, and the clock generating circuit is used to: When it is detected that the system clock circuit does not output the first clock signal, acquiring an asynchronous reset signal, wherein the asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit; A second clock signal is generated according to the asynchronous reset signal, and the second clock signal is used to trigger the synchronous reset timing circuit to perform a reset operation, wherein: The asynchronous reset signal is a signal that alternates between a first level and a second level. The synchronous reset timing circuit is used to perform a reset operation when the signal input to the clock signal input terminal changes from the first level to the second level. The clock generation circuit is also used to: When detecting that the asynchronous reset signal changes from the second level to the first level, generating a signal that is maintained at the first level for a first time length; When it is detected that the asynchronous reset signal changes from the first level to the second level, a signal maintained at the second level for a second time length is generated, and the signal generated by the clock generation circuit that alternates between the first level and the second level is used as the second clock signal.
2. The device according to claim 1, characterized in that The asynchronous reset signal is a signal that alternates between a first level and a second level. The synchronous reset timing circuit is used to perform a reset operation when the signal input to the clock signal input terminal is at a specified level or a level change occurs. The specified level is the first level or the second level. The clock generation circuit is also used to: The asynchronous reset signal is used as the second clock signal.
3. The device according to claim 1, characterized in that The clock generation circuit comprises a trigger and an assignment circuit, wherein the clock terminal of the trigger is used to receive the asynchronous reset signal, the output terminal of the trigger is connected to the clock signal input terminal, and the assignment circuit is connected to the input terminal of the trigger, wherein the output terminal of the trigger serves as the output terminal of the clock generation circuit; The assignment circuit is used for outputting a first signal when the asynchronous reset signal is at a second level, wherein the first signal is a signal at a first level; The trigger is used to output a signal equal to the first signal when the asynchronous reset signal received at the clock end changes from the second level to the first level, and to output a signal equal to the inverted signal of the first signal when the asynchronous reset signal received at the clock end changes from the first level to the second level.
4. The device according to claim 3, characterized in that The assignment circuit includes a first selector and an inverter, the first selector includes a first selection input terminal, a second selection input terminal, a first control terminal and a first selection output terminal, the signal input to the first selection input terminal is a first level, the output terminal of the trigger is connected to the second selection input terminal through the inverter, the first control terminal is used to receive the asynchronous reset signal, and the first selector is used to: When the asynchronous reset signal received at the first control terminal is at the second level, the output signal of the first selection output terminal is controlled to be the signal input to the first selection input terminal, and when the asynchronous reset signal received at the first control terminal is at the first level, the output signal of the first selection output terminal is controlled to be the signal input to the second selection input terminal.
5. The device according to claim 3, characterized in that The trigger is a D trigger.
6. The device according to any one of claims 1 to 5, characterized in that: The resetting device further comprises: A selection switch, wherein the system clock circuit and the clock generation circuit are both connected to the clock signal input terminal through the selection switch, and the selection switch is used to: When it is detected that the system clock circuit does not output the first clock signal, the system clock circuit and the clock signal input terminal are cut off, and the clock generation circuit and the clock signal input terminal are connected; When it is detected that the system clock circuit outputs the first clock signal, the system clock circuit is connected to the clock signal input terminal, and the clock generation circuit is disconnected from the clock signal input terminal.
7. The device according to claim 6, characterized in that The selection switch includes a second selector, the second selector includes a third selection input terminal, a fourth selection input terminal, a second control terminal and a second selection output terminal, the clock generation circuit is connected to the third selection input terminal, the system clock circuit is connected to the fourth selection input terminal, the second selection output terminal is connected to the clock signal input terminal, the second control terminal is used to receive a clock start signal, the system clock circuit is used to output a first clock signal when the clock start signal is at a valid level, and the selector is used to: When the clock start signal received by the second control terminal is at a valid level, controlling the output signal of the second selection output terminal to be the first clock signal input to the fourth selection input terminal of the system clock circuit; When the clock start signal received by the second control terminal is not at a valid level, the output signal of the second selection output terminal is controlled to be the second clock signal input to the third selection input terminal of the clock generation circuit.
8. A clock system, characterized in that: include: An asynchronous reset timing circuit, a synchronous reset timing circuit, a system clock circuit and a reset device as described in any one of claims 1 to 7 above, wherein the system clock circuit is connected to the clock signal input terminal of the synchronous reset timing circuit, the system clock circuit is used to input a first clock signal to the clock signal input terminal, the first clock signal is used to trigger the synchronous reset timing circuit to perform a reset operation, and the output terminal of the clock generation circuit is connected to the clock signal input terminal.
9. An electronic device, characterized in that: It comprises a device body and the clock system as claimed in claim 8, wherein the clock system is arranged in the device body.
10. A resetting method, characterized in that: Applied to a clock system, the clock system comprises an asynchronous reset timing circuit, a synchronous reset timing circuit and a system clock circuit, the system clock circuit is connected to a clock signal input terminal of the synchronous reset timing circuit, the clock signal input terminal is connected to an output terminal of a clock generating circuit, the system clock circuit is used to input a first clock signal to the clock signal input terminal, the first clock signal is used to trigger the synchronous reset timing circuit to perform a reset operation, the method comprises: When it is detected that the system clock circuit does not output the first clock signal, acquiring an asynchronous reset signal, wherein the asynchronous reset signal is used to perform a reset operation on the asynchronous reset timing circuit; Generate a second clock signal according to the asynchronous reset signal, wherein the second clock signal is used to trigger the synchronous reset timing circuit to perform a reset operation; The second clock signal is input to the clock signal input terminal to trigger the synchronous reset timing circuit to perform a reset operation, wherein: The asynchronous reset signal is a signal that alternates between a first level and a second level, and the synchronous reset timing circuit is used to perform a reset operation when the signal input to the clock signal input terminal changes from the first level to the second level; When detecting that the asynchronous reset signal changes from the second level to the first level, generating a signal that is maintained at the first level for a first time length; When it is detected that the asynchronous reset signal changes from the first level to the second level, a signal maintained at the second level for a second time length is generated, and the signal generated by the clock generation circuit that alternates between the first level and the second level is used as the second clock signal.
Citation Information
Patent Citations
Method for preventing bus collision, circuit and integrated circuit chip
CN101452425A
