[go: up one dir, main page]

CN113448381B - CPLD working clock keeping method, system, storage medium and device - Google Patents

CPLD working clock keeping method, system, storage medium and device Download PDF

Info

Publication number
CN113448381B
CN113448381B CN202110592477.3A CN202110592477A CN113448381B CN 113448381 B CN113448381 B CN 113448381B CN 202110592477 A CN202110592477 A CN 202110592477A CN 113448381 B CN113448381 B CN 113448381B
Authority
CN
China
Prior art keywords
signal
clock
cpld
logic
clock signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110592477.3A
Other languages
Chinese (zh)
Other versions
CN113448381A (en
Inventor
林正中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110592477.3A priority Critical patent/CN113448381B/en
Publication of CN113448381A publication Critical patent/CN113448381A/en
Application granted granted Critical
Publication of CN113448381B publication Critical patent/CN113448381B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention provides a CPLD working clock keeping method, a CPLD working clock keeping system, a CPLD working clock keeping storage medium and CPLD working clock keeping equipment, wherein the method comprises the following steps: responding to the starting of the CPLD, generating a logic clock signal through a delay logic module preset in the CPLD, and inputting the logic clock signal to a clock monitoring module so as to enable the logic clock signal to monitor the abnormality of a native clock signal in the CPLD based on the logic clock signal; outputting a clock monitoring signal based on a monitoring result through the clock monitoring module; the clock monitoring signal is received by a multiplexer and the logic clock signal or the native clock signal is selected based on the clock monitoring signal and output as the working clock of the CPLD. The invention monitors the abnormal condition of the original clock in the CPLD, and selects the original clock or the preset delay logic module in the CPLD according to the monitoring condition of the clock monitoring module, thereby selecting a normal clock signal to ensure that the CPLD always works normally.

Description

一种CPLD工作时钟保持方法、系统、存储介质及设备Method, system, storage medium and equipment for keeping CPLD working clock

技术领域technical field

本发明涉及CPLD技术领域,尤其涉及一种CPLD工作时钟保持方法、系统、存储介质及设备。The invention relates to the technical field of CPLDs, in particular to a method, system, storage medium and equipment for maintaining a CPLD working clock.

背景技术Background technique

现今的服务器设计的越来越庞大,同时代表了各种功能的芯片需求也越来越多,像是服务器会常用到的芯片如CPU、BMC芯片等等,而这些芯片都会有各自要求的电源时序规格。传统的方法就是使用硬件的方式去设计电源时序,这样会使电路板的面积变大,因为控制电源时序的电子零件增加;与此同时也会造成许多的不便性,例如,如果要调整电源的时序,就必须修改电路板的零件来调整电源时序。现今最常使用的方式就是使用CPLD来取代电路板上的电源时序。由于CPLD本身需要时钟讯号的搭配,否则CPLD将无法正常工作,像是电源的控制时序、数据缓存器的处理,或是各式各样的协议功能设计,所以说时钟信号是CPLD整个的运作核心,如果没有时钟信号,CPLD在循序电路的功能上将会无法实现,可能由于无法有效地把每个芯片所需要的电源时序产出,而导致整个服务器的系统都没有正确的电源时序。Today's servers are getting bigger and bigger, and there are more and more chips representing various functions, such as chips commonly used in servers, such as CPU, BMC chips, etc., and these chips will have their own power requirements. timing specification. The traditional method is to use hardware to design the power sequence, which will increase the area of the circuit board, because the electronic components that control the power sequence increase; at the same time, it will also cause a lot of inconvenience, for example, if you want to adjust the power supply Timing, it is necessary to modify the parts of the circuit board to adjust the power timing. The most commonly used method today is to use CPLDs to replace the power sequence on the board. Because the CPLD itself needs the matching of the clock signal, otherwise the CPLD will not work normally, such as the control sequence of the power supply, the processing of the data register, or the design of various protocol functions, so the clock signal is the core of the entire operation of the CPLD. If there is no clock signal, the CPLD will not be able to realize the function of the sequential circuit, and may not be able to effectively produce the power sequence required by each chip, resulting in the entire server system not having the correct power sequence.

现今CPLD的时钟信号来源,通常会有外部的时钟电路,并直接连接到CPLD内部来使用,或是采用CPLD厂商内部提供的时钟模块,对设计者来说,只需要开启该内部时间模块即可产生时钟,并将其实时时钟提供给CPLD内部的循序电路来使用,但假使CPLD内部的时钟出现问题或是没有连接外部电路的时钟到CPLD,将会导致CPLD无法正常工作。Nowadays, the clock signal source of CPLD usually has an external clock circuit, which is directly connected to the CPLD for use, or uses the clock module provided by the CPLD manufacturer. For designers, they only need to open the internal time module. Generate a clock and provide its real-time clock to the sequential circuit inside the CPLD for use, but if there is a problem with the clock inside the CPLD or the clock from the external circuit is not connected to the CPLD, the CPLD will not work properly.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提出一种CPLD工作时钟保持方法、系统、存储介质及设备,用以解决现有技术中CPLD内部时钟出现问题或是没有连接外部电路的时钟到CPLD,将会导致CPLD无法正常工作的问题。In view of this, the object of the present invention is to propose a kind of CPLD work clock maintenance method, system, storage medium and equipment, in order to solve the problem that CPLD internal clock occurs in the prior art or the clock that does not connect external circuit to CPLD, will Problems that prevent CPLDs from functioning properly.

基于上述目的,本发明提供了一种CPLD工作时钟保持方法,包括以下步骤:Based on above-mentioned purpose, the present invention provides a kind of CPLD work clock keeping method, comprises the following steps:

响应于CPLD开启,通过CPLD中预置的延迟逻辑模块产生逻辑时钟信号,并将逻辑时钟信号输入到时钟监测模块以使其基于逻辑时钟信号监测CPLD内的原生时钟信号的异常;In response to the CPLD being turned on, a logic clock signal is generated by a preset delay logic module in the CPLD, and the logic clock signal is input to the clock monitoring module so that it monitors the abnormality of the original clock signal in the CPLD based on the logic clock signal;

通过时钟监测模块基于监测结果输出时钟监测信号;Outputting a clock monitoring signal based on the monitoring result through the clock monitoring module;

通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟。The multiplexer receives the clock monitoring signal, selects a logic clock signal or an original clock signal based on the clock monitoring signal, and outputs it as a working clock of the CPLD.

在一些实施例中,将逻辑时钟信号输入到时钟监测模块以使其基于逻辑时钟信号监测CPLD内的原生时钟信号的异常包括:In some embodiments, inputting the logic clock signal to the clock monitoring module to make it monitor the abnormality of the native clock signal in the CPLD based on the logic clock signal includes:

将逻辑时钟信号输入到时钟监测模块,且通过时钟监测模块的低电平计数器和高电平计数器分别接收逻辑时钟信号和原生时钟信号;input the logic clock signal to the clock monitoring module, and respectively receive the logic clock signal and the original clock signal through the low level counter and the high level counter of the clock monitoring module;

通过低电平计数器基于逻辑时钟信号监测原生时钟信号是否在预设时间段内持续为低电平脉冲信号,以及通过高电平计数器基于逻辑时钟信号监测原生时钟信号是否在预设时间段内持续为高电平脉冲信号。Use a low-level counter to monitor whether the original clock signal continues to be a low-level pulse signal for a preset period of time based on the logic clock signal, and use a high-level counter to monitor whether the original clock signal continues for a preset period of time based on the logic clock signal It is a high-level pulse signal.

在一些实施例中,通过时钟监测模块基于监测结果输出时钟监测信号包括:In some embodiments, outputting the clock monitoring signal based on the monitoring result by the clock monitoring module includes:

响应于低电平计数器监测到原生时钟信号在预设时间段内持续为低电平脉冲信号,通过低电平计数器输出高电平信号;或者In response to the low-level counter detecting that the original clock signal continues to be a low-level pulse signal within a preset period of time, outputting a high-level signal through the low-level counter; or

响应于高电平计数器监测到原生时钟信号在预设时间段内持续为高电平脉冲信号,通过高电平计数器输出高电平信号;In response to the high-level counter detecting that the original clock signal continues to be a high-level pulse signal within a preset period of time, outputting a high-level signal through the high-level counter;

通过时钟监测模块将低电平计数器或高电平计数器的高电平信号输出。The high-level signal of the low-level counter or the high-level counter is output through the clock monitoring module.

在一些实施例中,通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟包括:In some embodiments, receiving a clock monitoring signal through a multiplexer and selecting a logic clock signal or an original clock signal based on the clock monitoring signal and outputting it as an operating clock of the CPLD includes:

通过多工器接收时钟监测模块的高电平信号,并基于高电平信号选择逻辑时钟信号且将其输出以作为CPLD的工作时钟。The high-level signal of the clock monitoring module is received through the multiplexer, and the logic clock signal is selected based on the high-level signal and output as the working clock of the CPLD.

在一些实施例中,通过时钟监测模块基于监测结果输出时钟监测信号包括:In some embodiments, outputting the clock monitoring signal based on the monitoring result by the clock monitoring module includes:

响应于低电平计数器监测到原生时钟信号在预设时间段内不持续为低电平脉冲信号并且高电平计数器监测到原生时钟信号在预设时间段内不持续为高电平脉冲信号,通过时钟监测模块输出低电平信号。In response to the low-level counter detecting that the original clock signal does not continue to be a low-level pulse signal within a preset time period and the high-level counter detecting that the original clock signal does not continue to be a high-level pulse signal within a preset time period, A low-level signal is output through the clock monitoring module.

在一些实施例中,通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟包括:In some embodiments, receiving a clock monitoring signal through a multiplexer and selecting a logic clock signal or an original clock signal based on the clock monitoring signal and outputting it as an operating clock of the CPLD includes:

通过多工器接收低电平信号并基于低电平信号选择原生时钟信号且将其输出以作为CPLD的工作时钟。The low-level signal is received through the multiplexer, and the original clock signal is selected based on the low-level signal and output as the working clock of the CPLD.

在一些实施例中,延迟逻辑模块包括正反器、反相器、异或门以及延迟缓冲器。In some embodiments, the delay logic module includes a flip-flop, an inverter, an XOR gate, and a delay buffer.

本发明的另一方面,还提供了一种CPLD工作时钟保持系统,包括:Another aspect of the present invention also provides a kind of CPLD working clock keeping system, comprising:

原生时钟信号监测模块,配置用于响应于CPLD开启,通过CPLD中预置的延迟逻辑模块产生逻辑时钟信号,并将逻辑时钟信号输入到时钟监测模块以使其基于逻辑时钟信号监测CPLD内的原生时钟信号的异常;The original clock signal monitoring module is configured to respond to the CPLD being turned on, generate a logic clock signal through the delay logic module preset in the CPLD, and input the logic clock signal to the clock monitoring module so that it can monitor the original clock signal in the CPLD based on the logic clock signal Abnormal clock signal;

时钟监测信号输出模块,配置用于通过时钟监测模块基于监测结果输出时钟监测信号;以及a clock monitoring signal output module configured to output a clock monitoring signal based on a monitoring result through the clock monitoring module; and

工作时钟选择模块,配置用于通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟。The working clock selection module is configured to receive a clock monitoring signal through a multiplexer, select a logic clock signal or an original clock signal based on the clock monitoring signal, and output it as a working clock of the CPLD.

本发明的又一方面,还提供了一种计算机可读存储介质,存储有计算机程序指令,该计算机程序指令被执行时实现上述任意一项方法。In yet another aspect of the present invention, a computer-readable storage medium is provided, which stores computer program instructions, and implements any one of the above-mentioned methods when the computer program instructions are executed.

本发明的再一方面,还提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该计算机程序被处理器执行时执行上述任意一项方法。In yet another aspect of the present invention, a computer device is provided, including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, any one of the above-mentioned methods is executed.

本发明至少具有以下有益技术效果:The present invention has at least the following beneficial technical effects:

本发明通过设置延迟逻辑模块,可以为CPLD提供时钟信号,使得CPLD无需使用外部电路提供的时钟,节省了外部硬件,减小了电路板面积;通过设置时钟监测模块,可以监测CPLD内部的原生时钟的异常情况;通过设置多工器,可以根据时钟监测模块的监测情况对CPLD内的原生时钟或预置的延迟逻辑模块进行选择,从而选择出正常的时钟信号,以使得CPLD一直正常工作。The present invention can provide a clock signal for the CPLD by setting the delay logic module, so that the CPLD does not need to use the clock provided by the external circuit, which saves the external hardware and reduces the area of the circuit board; by setting the clock monitoring module, the original clock inside the CPLD can be monitored abnormal situation; by setting the multiplexer, the original clock or the preset delay logic module in the CPLD can be selected according to the monitoring situation of the clock monitoring module, so as to select a normal clock signal so that the CPLD can always work normally.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and those skilled in the art can obtain other embodiments according to these drawings without any creative effort.

图1为根据本发明实施例提供的CPLD工作时钟保持方法的示意图;Fig. 1 is the schematic diagram of the CPLD working clock keeping method provided according to the embodiment of the present invention;

图2为根据本发明实施例提供的CPLD工作时钟保持方法的电路示意图;Fig. 2 is the schematic circuit diagram of the CPLD working clock keeping method provided according to the embodiment of the present invention;

图3为根据本发明实施例提供的CPLD工作时钟保持系统的示意图;Fig. 3 is the schematic diagram of the CPLD work clock keeping system provided according to the embodiment of the present invention;

图4为根据本发明实施例提供的实现CPLD工作时钟保持方法的计算机可读存储介质的示意图;Fig. 4 is the schematic diagram of the computer-readable storage medium that realizes the CPLD work clock keeping method provided according to the embodiment of the present invention;

图5为根据本发明实施例提供的执行CPLD工作时钟保持方法的计算机设备的硬件结构示意图。FIG. 5 is a schematic diagram of a hardware structure of a computer device implementing a method for maintaining a CPLD working clock according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称的非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备固有的其他步骤或单元。It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used to distinguish two entities with the same name or different parameters. It can be seen that "first" and "second" " is only for the convenience of expression, and should not be understood as limiting the embodiment of the present invention. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, of a process, method, system, product or other steps or elements inherent in a process, method, system, product, or device comprising a series of steps or elements.

基于上述目的,本发明实施例的第一个方面,提出了一种CPLD工作时钟保持方法的实施例。图1示出的是本发明提供的CPLD工作时钟保持方法的实施例的示意图。如图1所示,本发明实施例包括如下步骤:Based on the above purpose, the first aspect of the embodiments of the present invention proposes an embodiment of a method for keeping a working clock of a CPLD. What Fig. 1 shows is the schematic view of the embodiment of the CPLD working clock keeping method provided by the present invention. As shown in Figure 1, the embodiment of the present invention includes the following steps:

步骤S10、响应于CPLD开启,通过CPLD中预置的延迟逻辑模块产生逻辑时钟信号,并将逻辑时钟信号输入到时钟监测模块以使其基于逻辑时钟信号监测CPLD内的原生时钟信号的异常;Step S10, in response to the opening of the CPLD, generate a logic clock signal through the delay logic module preset in the CPLD, and input the logic clock signal to the clock monitoring module so that it can monitor the abnormality of the original clock signal in the CPLD based on the logic clock signal;

步骤S20、通过时钟监测模块基于监测结果输出时钟监测信号;Step S20, outputting a clock monitoring signal based on the monitoring result through the clock monitoring module;

步骤S30、通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟。Step S30, receiving the clock monitoring signal through the multiplexer, selecting a logic clock signal or an original clock signal based on the clock monitoring signal, and outputting it as a working clock of the CPLD.

CPLD(Complex Programming Logic Device)表示复杂可编程逻辑器件,通过采用CMOS EPROM、EEPROM、快闪存储器和SRAM(静态随机存储器)等编程技术,从而构成了高密度、高速度和低功耗的可编程逻辑器。是一种用户根据各自需要而自行构造逻辑功能的数字集成电路,其基本设计方法是借助集成开发软件平台,用原理图、硬件描述语言等方法,生成相应的目标文件,并通过下载电缆将代码传送到目标芯片中以实现设计的数字系统。CPLD (Complex Programming Logic Device) represents a complex programmable logic device. By using programming technologies such as CMOS EPROM, EEPROM, flash memory and SRAM (static random access memory), it forms a high-density, high-speed and low-power programmable logic. It is a digital integrated circuit in which users can construct logic functions according to their own needs. The basic design method is to use integrated development software platform, use schematic diagrams, hardware description languages, etc. to generate corresponding target files, and download the code to Transfer to the target chip to realize the digital system of the design.

本发明实施例通过设置延迟逻辑模块,可以为CPLD提供时钟信号,使得CPLD无需使用外部电路提供的时钟,节省了外部硬件,减小了电路板面积;通过设置时钟监测模块,可以监测CPLD内部的原生时钟的异常情况;通过设置多工器,可以根据时钟监测模块的监测情况对CPLD内的原生时钟或预置的延迟逻辑模块进行选择,从而选择出正常的时钟信号,以使得CPLD一直正常工作。The embodiment of the present invention can provide clock signal for CPLD by arranging delay logic module, makes CPLD need not use the clock that external circuit provides, has saved external hardware, has reduced circuit board area; By arranging clock monitoring module, can monitor CPLD internal The abnormal situation of the original clock; by setting the multiplexer, the original clock or the preset delay logic module in the CPLD can be selected according to the monitoring situation of the clock monitoring module, so as to select a normal clock signal, so that the CPLD can always work normally .

在一些实施例中,将逻辑时钟信号输入到时钟监测模块以使其基于逻辑时钟信号监测CPLD内的原生时钟信号的异常包括:将逻辑时钟信号输入到时钟监测模块,且通过时钟监测模块的低电平计数器和高电平计数器分别接收逻辑时钟信号和原生时钟信号;通过低电平计数器基于逻辑时钟信号监测原生时钟信号是否在预设时间段内持续为低电平脉冲信号,以及通过高电平计数器基于逻辑时钟信号监测原生时钟信号是否在预设时间段内持续为高电平脉冲信号。In some embodiments, inputting the logic clock signal to the clock monitoring module so that it monitors the abnormality of the native clock signal in the CPLD based on the logic clock signal includes: inputting the logic clock signal to the clock monitoring module, and passing the low voltage of the clock monitoring module The level counter and the high level counter receive the logic clock signal and the original clock signal respectively; through the low level counter, based on the logic clock signal, it is monitored whether the original clock signal continues to be a low level pulse signal within a preset period of time, and through the high level counter The flat counter monitors whether the original clock signal is a high-level pulse signal continuously within a preset time period based on the logic clock signal.

在一些实施例中,通过时钟监测模块基于监测结果输出时钟监测信号包括:响应于低电平计数器监测到原生时钟信号在预设时间段内持续为低电平脉冲信号,通过低电平计数器输出高电平信号;或者响应于高电平计数器监测到原生时钟信号在预设时间段内持续为高电平脉冲信号,通过高电平计数器输出高电平信号;通过时钟监测模块将低电平计数器或高电平计数器的高电平信号输出。In some embodiments, outputting the clock monitoring signal based on the monitoring result through the clock monitoring module includes: in response to the low level counter monitoring that the original clock signal continues to be a low level pulse signal within a preset period of time, outputting the clock monitoring signal through the low level counter High-level signal; or in response to the high-level counter monitoring that the original clock signal continues to be a high-level pulse signal within a preset period of time, the high-level signal is output through the high-level counter; the low-level signal is output through the clock monitoring module High level signal output of counter or high level counter.

在一些实施例中,通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟包括:通过多工器接收时钟监测模块的高电平信号,并基于高电平信号选择逻辑时钟信号且将其输出以作为CPLD的工作时钟。In some embodiments, receiving the clock monitoring signal through the multiplexer and selecting a logic clock signal or an original clock signal based on the clock monitoring signal and outputting it as the working clock of the CPLD includes: receiving the high power of the clock monitoring module through the multiplexer level signal, select a logic clock signal based on the high level signal and output it as the working clock of the CPLD.

在一些实施例中,通过时钟监测模块基于监测结果输出时钟监测信号包括:响应于低电平计数器监测到原生时钟信号在预设时间段内不持续为低电平脉冲信号并且高电平计数器监测到原生时钟信号在预设时间段内不持续为高电平脉冲信号,通过时钟监测模块输出低电平信号。In some embodiments, outputting the clock monitoring signal based on the monitoring result by the clock monitoring module includes: responding to the low-level counter monitoring that the original clock signal does not continue to be a low-level pulse signal within a preset period of time and the high-level counter monitoring When the original clock signal does not continue to be a high-level pulse signal within a preset period of time, a low-level signal is output through the clock monitoring module.

在一些实施例中,通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟包括:通过多工器接收低电平信号并基于低电平信号选择原生时钟信号且将其输出以作为CPLD的工作时钟。In some embodiments, receiving a clock monitoring signal through a multiplexer and selecting a logic clock signal or an original clock signal based on the clock monitoring signal and outputting it as the working clock of the CPLD includes: receiving a low-level signal through a multiplexer and based on The low-level signal selects the original clock signal and outputs it as the working clock of the CPLD.

在一些实施例中,延迟逻辑模块包括正反器、反相器、异或门以及延迟缓冲器。In some embodiments, the delay logic module includes a flip-flop, an inverter, an XOR gate, and a delay buffer.

图2示出了CPLD工作时钟保持方法的电路示意图。如图2所示,延迟逻辑模块使用正反器、反相器、异或门,且搭配延迟缓冲器对信号进行延迟。正反器中Q为输出引脚,其初始为由低电平跳变到高电平,逻辑上意为由0转为1,所以Q初始输出为高电平信号,当高电平信号经过一个反相器(即非门)后,变为低电平信号,输入到正反器的D引脚。异或门接收的未经过延迟缓冲器的信号(假设为第一信号)是高电平信号,异或门的需要经过延迟缓冲器的高电平信号还未收到,初始状态时延迟缓冲器会输出低电平信号给到异或门,所以初始时异或门接收的是两个不同的信号,其输出高电平信号,从而触发正反器。正反器的Q引脚将D引脚的低电平信号输出,异或门将该低电平信号作为第一信号接收,此时初始时的高电平信号达到异或门,因而异或门接受了两个不同的信号,又会输出高电平信号给到正反器,从而触发正反器。这样循环往复,延迟逻辑模块会持续输出高低电平信号。延迟缓冲器可以根据延迟逻辑模块要输出的时钟信号的频率而设置延迟时间或延时频率。所以,通过延迟缓冲器,可以使得异或门始终接收两个不同电平的信号(逻辑上表示0和1),从而输出高电平信号(逻辑上表示1),以触发正反器工作。FIG. 2 shows a schematic circuit diagram of a method for maintaining a working clock of a CPLD. As shown in Figure 2, the delay logic module uses flip-flops, inverters, XOR gates, and delays signals with a delay buffer. Q in the flip-flop is the output pin, which initially transitions from low level to high level, which logically means from 0 to 1, so the initial output of Q is a high level signal. When the high level signal passes through After an inverter (that is, a NOT gate), it becomes a low-level signal and is input to the D pin of the flip-flop. The signal received by the XOR gate that has not passed through the delay buffer (assumed to be the first signal) is a high-level signal, and the high-level signal that the XOR gate needs to pass through the delay buffer has not yet been received. In the initial state, the delay buffer A low-level signal will be output to the XOR gate, so initially the XOR gate receives two different signals, and it outputs a high-level signal to trigger the flip-flop. The Q pin of the flip-flop outputs the low-level signal of the D pin, and the XOR gate receives the low-level signal as the first signal. At this time, the initial high-level signal reaches the XOR gate, so the XOR gate After receiving two different signals, it will output a high-level signal to the flip-flop, thereby triggering the flip-flop. Repeating this cycle, the delay logic module will continuously output high and low level signals. The delay buffer can set the delay time or delay frequency according to the frequency of the clock signal to be output by the delay logic module. Therefore, through the delay buffer, the XOR gate can always receive two signals of different levels (logically representing 0 and 1), thereby outputting a high-level signal (logically representing 1) to trigger the operation of the flip-flop.

如图2所示,时钟监测模块包括低电平计数器、高电平计数器以及或门。低电平计数器和高电平计数器都需要延迟逻辑模块产生的时钟来进行正常工作。低电平计数器和高电平计数器可以分别记录低电平脉冲信号和高电平脉冲信号的持续时间。若CPLD内的原生时钟正常,低电平脉冲信号和高电平脉冲信号是均匀进行的;若低电平计数器记录到预设时间段内持续是低电平脉冲,则原生时钟信号异常;或者若高电平计数器记录到预设时间段内持续是高电平脉冲,则原生时钟信号异常。预设时间段需要大于CPLD内的原生时钟的单位时间的一半,例如,CPLD内的原生时钟的一个单位时间是1秒,那么预设时间段要大于0.5秒。或门接收低电平计数器或高电平计数器因原生时钟信号异常而输出的高电平信号。所以只要有一个计数器因原生时钟信号异常而输出高电平信号,或门就会输出高电平信号。或门输出的信号也就代表了延迟逻辑模块最终输出的信号。As shown in Figure 2, the clock monitoring module includes a low-level counter, a high-level counter and an OR gate. Both low-level and high-level counters require clocks generated by delay logic blocks to function properly. The low-level counter and the high-level counter can respectively record the duration of the low-level pulse signal and the high-level pulse signal. If the original clock in the CPLD is normal, the low-level pulse signal and the high-level pulse signal are carried out evenly; if the low-level counter records that the low-level pulse lasts for a preset period of time, the original clock signal is abnormal; or If the high-level counter records continuous high-level pulses within the preset time period, the original clock signal is abnormal. The preset time period needs to be greater than half of the unit time of the native clock in the CPLD. For example, if a unit time of the native clock in the CPLD is 1 second, then the preset time period must be greater than 0.5 second. The OR gate receives a high-level signal output by the low-level counter or the high-level counter due to an abnormal original clock signal. Therefore, as long as a counter outputs a high-level signal due to an abnormal original clock signal, the OR gate will output a high-level signal. The signal output by the OR gate also represents the final output signal of the delay logic module.

多工器可以是二选一多工器,即在接收的两路信号中选择其中一路信号输出。如图2所示,当多工器接收到时钟监测模块的或门输出的高电平信号时,也即CPLD内的原生时钟异常,所以多工器会选择延迟逻辑模块的逻辑时钟信号并将其输出;若多工器接收到时钟监测模块的或门输出的低电平信号时,也即CPLD内的原生时钟正常,多工器会选择原生时钟的原生时钟信号并将其输出。The multiplexer can be a two-to-one multiplexer, that is, one of the two received signals is selected for output. As shown in Figure 2, when the multiplexer receives the high-level signal output by the OR gate of the clock monitoring module, that is, the original clock in the CPLD is abnormal, so the multiplexer will choose to delay the logic clock signal of the logic module and Its output; if the multiplexer receives the low-level signal output by the OR gate of the clock monitoring module, that is, the original clock in the CPLD is normal, the multiplexer will select the original clock signal of the original clock and output it.

本发明实施例的第二个方面,还提供了一种CPLD工作时钟保持系统。图3示出的是本发明提供的CPLD工作时钟保持系统的实施例的示意图。一种CPLD工作时钟保持系统包括:原生时钟信号监测模块10,配置用于响应于CPLD开启,通过CPLD中预置的延迟逻辑模块产生逻辑时钟信号,并将逻辑时钟信号输入到时钟监测模块以使其基于逻辑时钟信号监测CPLD内的原生时钟信号的异常;时钟监测信号输出模块20,配置用于通过时钟监测模块基于监测结果输出时钟监测信号;以及工作时钟选择模块30,配置用于通过多工器接收时钟监测信号并基于时钟监测信号选择逻辑时钟信号或原生时钟信号且将其输出以作为CPLD的工作时钟。The second aspect of the embodiment of the present invention also provides a CPLD working clock keeping system. FIG. 3 is a schematic diagram of an embodiment of the CPLD working clock keeping system provided by the present invention. A kind of CPLD operation clock keeping system comprises: original clock signal monitoring module 10, is configured to respond to CPLD to open, produces logic clock signal by delay logic module preset in CPLD, and logic clock signal is input to clock monitoring module so that It monitors the abnormality of the original clock signal in the CPLD based on the logic clock signal; the clock monitoring signal output module 20 is configured to output the clock monitoring signal based on the monitoring result through the clock monitoring module; and the working clock selection module 30 is configured to pass multiplex The controller receives the clock monitoring signal and selects the logic clock signal or the original clock signal based on the clock monitoring signal and outputs it as the working clock of the CPLD.

本发明实施例的CPLD工作时钟保持系统通过设置延迟逻辑模块,可以为CPLD提供时钟信号,使得CPLD无需使用外部电路提供的时钟,节省了外部硬件,减小了电路板面积;通过设置时钟监测模块,可以监测CPLD内部的原生时钟的异常情况;通过设置多工器,可以根据时钟监测模块的监测情况对CPLD内的原生时钟或预置的延迟逻辑模块进行选择,从而选择出正常的时钟信号,以使得CPLD一直正常工作。The CPLD work clock maintenance system of the embodiment of the present invention can provide clock signal for CPLD by setting delay logic module, makes CPLD need not use the clock that external circuit provides, has saved external hardware, has reduced circuit board area; By setting clock monitoring module , can monitor the abnormality of the original clock inside the CPLD; by setting the multiplexer, the original clock or the preset delay logic module in the CPLD can be selected according to the monitoring situation of the clock monitoring module, thereby selecting a normal clock signal, In order to make the CPLD work normally all the time.

在一些实施例中,原生时钟信号监测模块10包括异常监测模块,配置用于将逻辑时钟信号输入到时钟监测模块,且通过时钟监测模块的低电平计数器和高电平计数器分别接收逻辑时钟信号和原生时钟信号;通过低电平计数器基于逻辑时钟信号监测原生时钟信号是否在预设时间段内持续为低电平脉冲信号,以及通过高电平计数器基于逻辑时钟信号监测原生时钟信号是否在预设时间段内持续为高电平脉冲信号。In some embodiments, the native clock signal monitoring module 10 includes an abnormality monitoring module configured to input the logic clock signal to the clock monitoring module, and receive the logic clock signal through the low level counter and the high level counter of the clock monitoring module respectively and the original clock signal; monitor whether the original clock signal continues to be a low-level pulse signal within a preset period of time through a low-level counter based on the logic clock signal, and monitor whether the original clock signal is in the preset time period based on the logic clock signal through a high-level counter It is assumed that the pulse signal of high level continues for a period of time.

在一些实施例中,时钟监测信号输出模块20进一步配置用于响应于低电平计数器监测到原生时钟信号在预设时间段内持续为低电平脉冲信号,通过低电平计数器输出高电平信号;或者响应于高电平计数器监测到原生时钟信号在预设时间段内持续为高电平脉冲信号,通过高电平计数器输出高电平信号;通过时钟监测模块将低电平计数器或高电平计数器的高电平信号输出。In some embodiments, the clock monitoring signal output module 20 is further configured to output a high level through the low level counter in response to the low level counter detecting that the original clock signal continues to be a low level pulse signal within a preset time period signal; or in response to the high-level counter monitoring that the original clock signal continues to be a high-level pulse signal within a preset period of time, a high-level signal is output through the high-level counter; the low-level counter or the high-level High level signal output of the level counter.

在一些实施例中,工作时钟选择模块30进一步配置用于通过多工器接收时钟监测模块的高电平信号,并基于高电平信号选择逻辑时钟信号且将其输出以作为CPLD的工作时钟。In some embodiments, the working clock selection module 30 is further configured to receive the high-level signal of the clock monitoring module through the multiplexer, select a logic clock signal based on the high-level signal, and output it as the working clock of the CPLD.

在一些实施例中,时钟监测信号输出模块20进一步配置用于响应于低电平计数器监测到原生时钟信号在预设时间段内不持续为低电平脉冲信号并且高电平计数器监测到原生时钟信号在预设时间段内不持续为高电平脉冲信号,通过时钟监测模块输出低电平信号。In some embodiments, the clock monitoring signal output module 20 is further configured to respond to the low-level counter detecting that the original clock signal does not continue to be a low-level pulse signal within a preset period of time and the high-level counter detecting that the original clock The signal does not continue to be a high-level pulse signal within a preset period of time, and outputs a low-level signal through the clock monitoring module.

在一些实施例中,工作时钟选择模块30进一步配置用于通过多工器接收低电平信号并基于低电平信号选择原生时钟信号且将其输出以作为CPLD的工作时钟。In some embodiments, the working clock selection module 30 is further configured to receive the low-level signal through the multiplexer, select the original clock signal based on the low-level signal, and output it as the working clock of the CPLD.

在一些实施例中,延迟逻辑模块包括正反器、反相器、异或门以及延迟缓冲器。In some embodiments, the delay logic module includes a flip-flop, an inverter, an XOR gate, and a delay buffer.

本发明实施例的第三个方面,还提供了一种计算机可读存储介质,图4示出了根据本发明实施例提供的实现CPLD工作时钟保持方法的计算机可读存储介质的示意图。如图4所示,计算机可读存储介质3存储有计算机程序指令31,该计算机程序指令31被执行时实现上述任意一项实施例的方法:In the third aspect of the embodiment of the present invention, a computer-readable storage medium is also provided. FIG. 4 shows a schematic diagram of a computer-readable storage medium for implementing a method for maintaining a working clock of a CPLD according to an embodiment of the present invention. As shown in Figure 4, the computer-readable storage medium 3 stores computer program instructions 31, and when the computer program instructions 31 are executed, the method of any one of the above-mentioned embodiments is realized:

应当理解,在相互不冲突的情况下,以上针对根据本发明的CPLD工作时钟保持方法阐述的所有实施方式、特征和优势同样地适用于根据本发明的CPLD工作时钟保持系统和存储介质。It should be understood that all the implementations, features and advantages described above for the CPLD working clock keeping method according to the present invention are equally applicable to the CPLD working clock keeping system and storage medium according to the present invention without conflicting with each other.

本发明实施例的第四个方面,还提供了一种计算机设备,包括存储器402和处理器401,该存储器中存储有计算机程序,该计算机程序被该处理器执行时实现上述任意一项实施例的方法。The fourth aspect of the embodiments of the present invention also provides a computer device, including a memory 402 and a processor 401, a computer program is stored in the memory, and when the computer program is executed by the processor, any one of the above-mentioned embodiments can be realized Methods.

如图5所示,为本发明提供的执行CPLD工作时钟保持方法的计算机设备的一个实施例的硬件结构示意图。以如图5所示的计算机设备为例,在该计算机设备中包括一个处理器401以及一个存储器402,并还可以包括:输入装置403和输出装置404。处理器401、存储器402、输入装置403和输出装置404可以通过总线或者其他方式连接,图5中以通过总线连接为例。输入装置403可接收输入的数字或字符信息,以及产生与CPLD工作时钟保持系统的用户设置以及功能控制有关的键信号输入。输出装置404可包括显示屏等显示设备。As shown in FIG. 5 , it is a schematic diagram of a hardware structure of an embodiment of a computer device implementing a method for maintaining a CPLD working clock provided by the present invention. Taking the computer equipment shown in FIG. 5 as an example, the computer equipment includes a processor 401 and a memory 402 , and may further include: an input device 403 and an output device 404 . The processor 401, the memory 402, the input device 403, and the output device 404 may be connected via a bus or in other ways. In FIG. 5, connection via a bus is taken as an example. The input device 403 can receive input numbers or character information, and generate key signal input related to user setting and function control of the CPLD working clock maintenance system. The output device 404 may include a display device such as a display screen.

存储器402作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的CPLD工作时钟保持方法对应的程序指令/模块。存储器402可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储CPLD工作时钟保持方法的使用所创建的数据等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器402可选包括相对于处理器401远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。Memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and modules, as in the CPLD working clock keeping method corresponding to the embodiment of the present application Program instructions/modules. The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; the data storage area may store data created by using the CPLD working clock keeping method, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 402 may optionally include memory that is remotely located relative to the processor 401, and these remote memories may be connected to the local module through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

处理器401通过运行存储在存储器402中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的CPLD工作时钟保持方法。The processor 401 executes various functional applications and data processing of the server by running non-volatile software programs, instructions and modules stored in the memory 402, that is, implements the CPLD working clock keeping method of the above method embodiment.

最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,CPLD工作时钟保持方法的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the process in the above-mentioned embodiment method can be realized, and the relevant hardware can be instructed by a computer program to complete, and the program of the CPLD working clock maintenance method can be stored in a computer-readable When the program is executed, the program may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium of the program may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), and the like. The foregoing computer program embodiments can achieve the same or similar effects as any of the foregoing method embodiments corresponding thereto.

此外,上述方法步骤以及系统单元也可以利用控制器以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储介质实现。In addition, the above-mentioned method steps and system units can also be realized by using a controller and a computer-readable storage medium for storing a computer program for enabling the controller to realize the functions of the above-mentioned steps or units.

此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。作为例子而非限制性的,非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)或快闪存储器。易失性存储器可以包括随机存取存储器(RAM),该RAM可以充当外部高速缓存存储器。作为例子而非限制性的,RAM可以以多种形式获得,比如同步RAM(DRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据速率SDRAM(DDRSDRAM)、增强SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)、以及直接Rambus RAM(DRRAM)。所公开的方面的存储设备意在包括但不限于这些和其它合适类型的存储器。In addition, it should be appreciated that a computer-readable storage medium (eg, memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile memory and nonvolatile memory. By way of example and not limitation, nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory memory. Volatile memory can include random access memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in various forms such as Synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). Storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.

本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those of skill would also appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or as hardware depends upon the particular application and design constraints imposed on the overall system. Those skilled in the art may implement the functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope disclosed in the embodiments of the present invention.

结合这里的公开所描述的各种示例性逻辑块、模块和电路可以利用被设计成用于执行这里功能的下列部件来实现或执行:通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑器件、分立门或晶体管逻辑、分立的硬件组件或者这些部件的任何组合。通用处理器可以是微处理器,但是可替换地,处理器可以是任何传统处理器、控制器、微控制器或状态机。处理器也可以被实现为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、一个或多个微处理器结合DSP和/或任何其它这种配置。The various exemplary logical blocks, modules, and circuits described in connection with the disclosure herein can be implemented or performed using the following components designed to perform the functions herein: general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, eg, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.

以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are the exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications can be made without departing from the scope of the disclosed embodiments of the present invention defined in the claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in an individual form, they may also be understood as a plurality unless explicitly limited to a singular number.

应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。It should be understood that as used herein, the singular form "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The serial numbers of the embodiments disclosed in the above-mentioned embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is exemplary only, and is not intended to imply that the scope (including claims) disclosed by the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention , the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in details for the sake of brevity. Therefore, within the spirit and principle of the embodiments of the present invention, any omissions, modifications, equivalent replacements, improvements, etc., shall be included in the protection scope of the embodiments of the present invention.

Claims (9)

1. A CPLD working clock keeping method is characterized by comprising the following steps:
responding to the starting of the CPLD, generating a logic clock signal through a delay logic module preset in the CPLD, and inputting the logic clock signal to a clock monitoring module so as to enable the logic clock signal to monitor the abnormality of a native clock signal in the CPLD based on the logic clock signal;
outputting a clock monitoring signal based on a monitoring result through the clock monitoring module;
receiving the clock monitoring signal through a multiplexer, selecting the logic clock signal or the native clock signal based on the clock monitoring signal, and outputting the logic clock signal or the native clock signal as a working clock of the CPLD;
the delay logic module comprises a flip-flop, an inverter, an exclusive-OR gate and a delay buffer;
an output pin Q in the flip-flop is initially jumped from a low level to a high level, the Q is initially output as a high level signal, and the high level signal is changed into a low level signal after passing through the inverter and is input to a pin D of the flip-flop;
the first signal which is received by the exclusive-OR gate and does not pass through the delay buffer is a high level signal, the high level signal which needs to pass through the delay buffer is not received by the exclusive-OR gate, and the delay buffer can output a low level signal to the exclusive-OR gate in an initial state, so that the exclusive-OR gate receives two different signals initially and outputs the high level signal, and the flip-flop is triggered;
the Q pin of the flip-flop outputs the low level signal of the D pin, the XOR gate receives the low level signal as a first signal, and the initial high level signal reaches the XOR gate, so that the XOR gate receives two different signals and outputs the high level signal to the flip-flop, and the flip-flop is triggered to enable the delay logic module to continuously output the high level signal and the low level signal.
2. The method of claim 1, wherein inputting the logical clock signal to a clock monitoring module to cause it to monitor for anomalies in a native clock signal within the CPLD based on the logical clock signal comprises:
inputting the logic clock signal to a clock monitoring module, and respectively receiving the logic clock signal and a native clock signal through a low level counter and a high level counter of the clock monitoring module;
monitoring, by the low level counter, whether the native clock signal continues to be a low level pulse signal for a preset time period based on the logic clock signal, and monitoring, by the high level counter, whether the native clock signal continues to be a high level pulse signal for the preset time period based on the logic clock signal.
3. The method of claim 2, wherein outputting, by the clock monitoring module, a clock monitoring signal based on the monitoring result comprises:
responding to the low-level counter monitoring that the native clock signal is continuously a low-level pulse signal in the preset time period, and outputting a high-level signal through the low-level counter; or
Responding to the fact that the high-level counter monitors that the native clock signal is continuously a high-level pulse signal in the preset time period, and outputting a high-level signal through the high-level counter;
and outputting the high level signal of the low level counter or the high level counter through the clock monitoring module.
4. The method of claim 3, wherein receiving the clock monitor signal by a multiplexer and selecting and outputting the logical clock signal or native clock signal as an operating clock of a CPLD based on the clock monitor signal comprises:
and receiving a high level signal of the clock monitoring module through a multiplexer, selecting the logic clock signal based on the high level signal and outputting the logic clock signal to serve as a working clock of the CPLD.
5. The method of claim 2, wherein outputting, by the clock monitoring module, a clock monitoring signal based on the monitoring result comprises:
outputting, by the clock monitoring module, a low level signal in response to the low level counter monitoring that the native clock signal does not continue to be a low level pulse signal within the preset time period and the high level counter monitoring that the native clock signal does not continue to be a high level pulse signal within the preset time period.
6. The method of claim 5, wherein receiving the clock monitor signal by a multiplexer and selecting and outputting the logical clock signal or native clock signal as an operating clock of a CPLD based on the clock monitor signal comprises:
the low level signal is received by a multiplexer and based on the low level signal the native clock signal is selected and output as the operating clock of the CPLD.
7. A CPLD working clock holding system is characterized by comprising:
the native clock signal monitoring module is configured to respond to the starting of the CPLD, generate a logic clock signal through a delay logic module preset in the CPLD, and input the logic clock signal to the clock monitoring module so as to enable the clock monitoring module to monitor the abnormality of the native clock signal in the CPLD based on the logic clock signal;
the clock monitoring signal output module is configured for outputting a clock monitoring signal based on a monitoring result through the clock monitoring module; and
the working clock selection module is configured to receive the clock monitoring signal through a multiplexer, select the logic clock signal or the native clock signal based on the clock monitoring signal and output the logic clock signal or the native clock signal as a working clock of the CPLD;
the delay logic module comprises a flip-flop, an inverter, an exclusive-OR gate and a delay buffer;
an output pin Q in the flip-flop is initially jumped from a low level to a high level, the Q is initially output as a high level signal, and the high level signal is changed into a low level signal after passing through the inverter and is input to a pin D of the flip-flop;
the first signal which is received by the exclusive-OR gate and does not pass through the delay buffer is a high level signal, the high level signal which needs to pass through the delay buffer is not received by the exclusive-OR gate, and the delay buffer can output a low level signal to the exclusive-OR gate in an initial state, so that the exclusive-OR gate receives two different signals initially and outputs the high level signal, and the flip-flop is triggered;
the Q pin of the flip-flop outputs the low level signal of the D pin, the XOR gate receives the low level signal as a first signal, and the initial high level signal reaches the XOR gate, so that the XOR gate receives two different signals and outputs the high level signal to the flip-flop, and the flip-flop is triggered to enable the delay logic module to continuously output the high level signal and the low level signal.
8. A computer-readable storage medium, characterized in that computer program instructions are stored which, when executed, implement the method according to any one of claims 1-6.
9. A computer device comprising a memory and a processor, characterized in that the memory has stored therein a computer program which, when executed by the processor, performs the method according to any one of claims 1-6.
CN202110592477.3A 2021-05-28 2021-05-28 CPLD working clock keeping method, system, storage medium and device Active CN113448381B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110592477.3A CN113448381B (en) 2021-05-28 2021-05-28 CPLD working clock keeping method, system, storage medium and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110592477.3A CN113448381B (en) 2021-05-28 2021-05-28 CPLD working clock keeping method, system, storage medium and device

Publications (2)

Publication Number Publication Date
CN113448381A CN113448381A (en) 2021-09-28
CN113448381B true CN113448381B (en) 2023-02-28

Family

ID=77810355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110592477.3A Active CN113448381B (en) 2021-05-28 2021-05-28 CPLD working clock keeping method, system, storage medium and device

Country Status (1)

Country Link
CN (1) CN113448381B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115236497A (en) * 2022-07-07 2022-10-25 浙江正泰中自控制工程有限公司 On-chip SOC clock and timer diagnosis method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100337404C (en) * 2004-06-24 2007-09-12 华为技术有限公司 Crystal oscillation duplicaltion and its duplicating circuit
US20080013664A1 (en) * 2006-07-11 2008-01-17 Mediatek Inc. Phase error measurement circuit and method thereof
CN100563171C (en) * 2006-09-29 2009-11-25 华为技术有限公司 A method and system for improving output reliability of BITS equipment
CN101494498B (en) * 2009-03-06 2012-09-05 中兴通讯股份有限公司 Apparatus and method for collecting SFP optical module signal
CN101764594A (en) * 2009-11-09 2010-06-30 天津南大强芯半导体芯片设计有限公司 Clock signal detection circuit and abnormal clock signal detection method
CN102223143A (en) * 2010-04-16 2011-10-19 电信科学技术研究院 Clock signal protective device, clock signal protective method and clock detection compensating circuit
CN102694616B (en) * 2012-06-11 2014-11-26 福建星网锐捷网络有限公司 Clock detection circuit, clock circuit and clock exception detection method
CN111856916A (en) * 2019-04-30 2020-10-30 联合汽车电子有限公司 External clock diagnosis method
CN112114616B (en) * 2020-08-04 2022-10-25 深圳市宏电技术股份有限公司 Switching method of real-time clock, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
CN113448381A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
JP4856848B2 (en) Error detection on programmable logic resources
CN106452394A (en) Clock switching structure having automatic resetting function
CN113448381B (en) CPLD working clock keeping method, system, storage medium and device
WO2021098077A1 (en) True random number generator and true random number generation method
US9536086B2 (en) Circuit arrangement, a method for forming a circuit arrangement, and method for integrity checking
JP2006190441A (en) Latency-controlling device for synchronous semiconductor device and latency-controlling method
CN102831934B (en) Method for entering into internal test mode of ASRAM chip
US20190018062A1 (en) Flip flop of a digital electronic chip
CN109491491A (en) A kind of server timing control and signal monitoring board
CN100576140C (en) Circuit and method for generating clock signal for digital signal processor and memory
JP3479389B2 (en) Data processing system and semiconductor integrated circuit
US11085965B2 (en) Clock gating and scan clock generation for circuit test
WO2015144011A1 (en) Device and method for avoiding failure of internal reset signal of chip
US9847869B1 (en) Frequency synthesizer with microcode control
CN116187231A (en) A signal generation method, device, equipment and medium based on DDR verification
EP4082152B1 (en) Method for detecting perturbations in a logic circuit and logic circuit for implementing this method
CN108594695A (en) A kind of FPGA low power architectures of sub-module management
US5267199A (en) Apparatus for simultaneous write access to a single bit memory
TWI660355B (en) Semiconductor memory device and data setting method
US20030005347A1 (en) Flip-flop having multiple clock sources and method therefore
US7061284B2 (en) High frequency divider state correction circuit with data path correction
US7119587B2 (en) High frequency divider state correction circuit
JP2003288278A (en) Microcontroller
JP4114722B2 (en) State circuit
KR0157925B1 (en) Variable time reset device in the system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant