CN101135921A - Multi-clock switching device and switching method thereof - Google Patents
Multi-clock switching device and switching method thereof Download PDFInfo
- Publication number
- CN101135921A CN101135921A CNA2007101628130A CN200710162813A CN101135921A CN 101135921 A CN101135921 A CN 101135921A CN A2007101628130 A CNA2007101628130 A CN A2007101628130A CN 200710162813 A CN200710162813 A CN 200710162813A CN 101135921 A CN101135921 A CN 101135921A
- Authority
- CN
- China
- Prior art keywords
- clock
- signal
- selection
- output
- stop
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000005070 sampling Methods 0.000 claims abstract description 26
- 102100040856 Dual specificity protein kinase CLK3 Human genes 0.000 description 9
- 101000749304 Homo sapiens Dual specificity protein kinase CLK3 Proteins 0.000 description 9
- 102100040862 Dual specificity protein kinase CLK1 Human genes 0.000 description 8
- 101000749294 Homo sapiens Dual specificity protein kinase CLK1 Proteins 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000000630 rising effect Effects 0.000 description 6
- 230000009471 action Effects 0.000 description 5
- 102100040844 Dual specificity protein kinase CLK2 Human genes 0.000 description 3
- 101000749291 Homo sapiens Dual specificity protein kinase CLK2 Proteins 0.000 description 3
- 238000007781 pre-processing Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000007704 transition Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Landscapes
- Information Transfer Systems (AREA)
Abstract
Description
技术领域 technical field
本发明涉及的是一种多时钟切换装置及方法,更具体地说,是一种防止在切换时产生毛刺(glitch)的多时钟切换装置及其切换方法。The present invention relates to a multi-clock switching device and method, more specifically, a multi-clock switching device and a switching method thereof which prevent glitches during switching.
背景技术 Background technique
现在的计算机系统中一般都会存在不同频率的多个时钟信号,这些不同频率的时钟信号通常由一主机板上的一时钟芯片提供。为了降低功耗,或者为了在即插即用(Plug-and-Play)的外围设备改变时,提供不同频率时钟信号,需要专门的来实现时钟信号的切换。A plurality of clock signals with different frequencies generally exist in current computer systems, and these clock signals with different frequencies are usually provided by a clock chip on a motherboard. In order to reduce power consumption, or to provide clock signals with different frequencies when plug-and-play (Plug-and-Play) peripherals are changed, special clock signal switching is required.
图1是传统的多时钟切换装置的示意图。传统多时钟切换装置,这里用三个时钟信号的切换装置来说明,是通过一多工器(MUX)10以及一时钟选择信号CLK_SEL[1:0]来实现时钟信号CLK1、CLK2及CLK3的切换。FIG. 1 is a schematic diagram of a conventional multi-clock switching device. The traditional multi-clock switching device is described here as a switching device for three clock signals. The switching of the clock signals CLK1, CLK2 and CLK3 is realized through a multiplexer (MUX) 10 and a clock selection signal CLK_SEL[1:0]. .
现在参考图2,当时钟选择信号CLK_SEL[1:0]为01时,多工器10选中时钟信号CLK1,即输出时钟信号CLK_OUT为时钟信号CLK1;当系统欲切换输出时钟信号CLK_OUT时,在时刻t改变时钟选择信号CLK_SEL[1:0]的值,如图2所示,时钟选择信号CLK_SEL[1:0]在时刻t以后变为11,则多工器10应选择时钟信号CLK3,即输出时钟信号CLK_OUT为时钟信号CLK3。但实际的情况是,当多工器10切换输出时,时钟信号CLK1和CLK3处于不同电平,于是就会出现如图2所示的毛刺(glitch)201。毛刺的出现可能会使得以该输出时钟信号为参考时钟信号的电路出现同步失败、丢失数据等误操作,从而会影响整个系统的正常运行。Referring now to FIG. 2, when the clock selection signal CLK_SEL[1:0] is 01, the
现有技术中,采用不同的电路和方法来防止多时钟切换时的毛刺产生。通常是在多工器之前对时钟选择信号进行一些预处理,例如通过预处理可以使时钟切换发生在时钟信号CLK1和CLK3同为低电平时,这种情形下发生的时钟切换,输出时钟信号CLK_OUT就不会出现毛刺。但是这些预处理电路通常是由一些时序电路来实现,时序电路就存在时延,在非理想情况下,输出时钟信号同样会有毛刺出现。In the prior art, different circuits and methods are used to prevent glitches during multi-clock switching. Usually, some preprocessing is performed on the clock selection signal before the multiplexer. For example, through preprocessing, the clock switching can occur when the clock signals CLK1 and CLK3 are both low. In this case, the clock switching occurs and the output clock signal CLK_OUT There will be no glitches. However, these preprocessing circuits are usually implemented by some sequential circuits, and there is a time delay in the sequential circuits, and under non-ideal conditions, the output clock signal also has glitches.
发明内容 Contents of the invention
为了更有效地防止时钟切换时输出时钟信号上出现毛刺,本发明提供了一种多时钟切换装置及其切换方法。该多时钟切换装置包括:一控制单元,根据一从控就绪信号,一有效寄存器地址以及一时钟选择寄存器地址产生一时钟停止信号;一时钟选择信号单元,根据一时钟选择延迟信号,将一时钟选择信号输出为一时钟选择寄存信号;一多工器,其根据该时钟选择寄存信号在多个时钟信号中选择一个,产生一预输出时钟信号;以及一锁存单元,耦接至该多工器和该时钟选择信号单元,根据一时钟停止延迟信号和该预输出时钟信号,产生一输出时钟信号;该多时钟切换装置还包括一采样延时单元,其采样该时钟停止信号产生该时钟停止延迟信号,并在一第一预定时间后置低该时钟停止延迟信号;其采样该时钟停止信号产生该时钟选择延迟信号,并在一第二预定时间后置低该时钟选择延迟信号。In order to more effectively prevent burrs from appearing on the output clock signal during clock switching, the invention provides a multi-clock switching device and a switching method thereof. The multi-clock switching device includes: a control unit, which generates a clock stop signal according to a slave ready signal, an effective register address and a clock selection register address; a clock selection signal unit, which generates a clock according to a clock selection delay signal The selection signal output is a clock selection register signal; a multiplexer, which selects one of the multiple clock signals according to the clock selection register signal, and generates a pre-output clock signal; and a latch unit, coupled to the multiplexer The device and the clock selection signal unit generate an output clock signal according to a clock stop delay signal and the pre-output clock signal; the multi-clock switching device also includes a sampling delay unit, which samples the clock stop signal to generate the clock stop Delaying the signal, and setting the clock stop delay signal low after a first predetermined time; sampling the clock stop signal to generate the clock selection delay signal, and setting the clock selection delay signal low after a second predetermined time.
本发明提供的该多时钟切换方法包括:根据一从控就绪信号,一有效寄存器地址以及一时钟选择寄存器地址产生一时钟停止信号;采样该时钟停止信号产生一时钟停止延迟信号,并在一第一预定时间后置低该时钟停止延迟信号;采样该时钟停止信号产生一时钟选择延迟信号,并在一第二预定时间后置低该时钟选择延迟信号;根据该时钟选择延迟信号将一时钟选择信号输出并保持为一时钟选择寄存信号;根据该时钟选择寄存信号在多个时钟信号中选择一个,产生一预输出时钟信号;以及根据该时钟停止延迟信号和该预输出时钟信号,产生一输出时钟信号。The multi-clock switching method provided by the present invention includes: generating a clock stop signal according to a slave ready signal, an effective register address and a clock selection register address; sampling the clock stop signal to generate a clock stop delay signal, and Set the clock stop delay signal low after a predetermined time; sample the clock stop signal to generate a clock selection delay signal, and set the clock selection delay signal low after a second predetermined time; select a clock according to the clock selection delay signal The signal is output and maintained as a clock selection register signal; one of the plurality of clock signals is selected according to the clock selection register signal to generate a pre-output clock signal; and an output is generated according to the clock stop delay signal and the pre-output clock signal clock signal.
本发明所述的多时钟切换装置及其切换方法利用了系统总线上信号的时序来有效探测时钟切换的时机,从而能有效地防止输出时钟信号上出现毛刺信号。The multi-clock switching device and the switching method thereof in the present invention utilize the timing sequence of signals on the system bus to effectively detect the timing of clock switching, thereby effectively preventing glitch signals from appearing on the output clock signal.
附图说明 Description of drawings
图1是传统的多时钟切换装置的示意图。FIG. 1 is a schematic diagram of a conventional multi-clock switching device.
图2是传统的多时钟切换的信号时序图。FIG. 2 is a signal timing diagram of traditional multi-clock switching.
图3是本发明多时钟切换装置的一实施例的示意图。FIG. 3 is a schematic diagram of an embodiment of a multi-clock switching device of the present invention.
图4是本发明多时钟切换的信号时序图。FIG. 4 is a signal timing diagram of multi-clock switching in the present invention.
图5是本发明多时钟切换方法的步骤流程图。FIG. 5 is a flow chart of the steps of the multi-clock switching method of the present invention.
具体实施方式 Detailed ways
基于系统总线的计算机结构已经成为现代主流的计算机体系结构。在基于系统总线的计算机结构中,中央处理器与其它设备的通信都会经由总线。时钟切换请求通常是由操作系统发出的,该时钟选择信号通常都会经由总线发给需要该输出时钟的设备或电路,因此时钟切换动作何时发生可以在总线上探测到。基于此,本发明便是提供了一种多时钟切换装置和方法来更有效地防止输出时钟信号上毛刺的出现。The computer architecture based on the system bus has become the modern mainstream computer architecture. In the computer structure based on the system bus, the communication between the central processing unit and other devices will go through the bus. The clock switching request is usually issued by the operating system, and the clock selection signal is usually sent to the device or circuit that needs the output clock through the bus, so when the clock switching action occurs can be detected on the bus. Based on this, the present invention provides a multi-clock switching device and method to more effectively prevent the occurrence of burrs on the output clock signal.
为了让本发明的目的、特征及优点能更明显易懂,下文特举较佳实施例,并配合所附图3至图5做详细的说明。In order to make the purpose, features and advantages of the present invention more comprehensible, preferred embodiments are specifically cited below and described in detail in conjunction with accompanying drawings 3 to 5 .
图3是本发明多时钟切换装置的一实施例的示意图。该多时钟切换装置300包括总线接口模块310、控制单元320、采样延时单元330、时钟选择单元340、多工器350和锁存单元360。总线接口模块310挂于一系统总线上,这里以常用的系统总线PCI总线为例,该总线接口模块310接收来自于PCI总线的有效寄存器地址Addr[7:0]和时钟选择信号CLK_SEL[1:0],CLK_SEL[1:0]可以是来自于操作系统中某电路的驱动程序要求切换时钟的请求。现有PCI总线技术的人都知道,当挂在PCI总线上的设备作为总线上数据传输的目标设备被寻址时,会发出应答信号以回应总线时序,因此当该总线接口模块310被寻址且准备好接收总线上的数据CLK_SEL[1:0]时,发出一从控就绪信号TRDY#来回应。控制单元320根据该从控就绪信号TRDY#,该有效寄存器地址Addr[7:0]和时钟选择寄存器地址Add CLK_SEL_NF[7:0]产生时钟停止信号CLK_STOP。采样延时单元330通过采样时钟停止信号CLK_STOP产生时钟停止延迟信号CLK_STOP1,并在一第一预定时间后置低时钟停止延迟信号CLK_STOP1;在一第二预定时间后置低时钟停止延迟信号CLK_STOP1,产生时钟选择延迟信号CLK_DELAY。时钟选择信号单元340根据该时钟选择延迟信号CLK_DELAY,将时钟选择信号CLK_SEL[1:0]延迟输出为时钟选择寄存信号CLK_SEL_NF[1:0]。多工器350根据该时钟选择寄存信号CLK_SEL_NF[1:0]在多个时钟信号CLK1、CLK2、CLK3中选择一个,输出为预输出时钟信号CLK_G。锁存单元360根据该时钟停止延迟信号CLK_STOP1和该预输出时钟信号CLK_G,产生输出时钟信号CLK_OUT。该多时钟切换装置300的时钟切换发生在时钟选择寄存信号CLK_SEL_NF[1:0]更新时,该时刻输出的CLK_G上可能会出现毛刺,但是由于时钟停止延迟信号CLK_STOP1的控制,使得输出时钟信号CLK_OUT在时钟切换前后足够长的时间内置低,因此能够保证滤掉可能出现的毛刺信号。下面将详细阐述该多时钟切换装置300的具体结构,说明如何保证该时序。FIG. 3 is a schematic diagram of an embodiment of a multi-clock switching device of the present invention. The
控制单元320包括比较逻辑321、或逻辑门322及反相器323,其中该比较逻辑321可以是一个多位数值比较器,由最高位开始,逐位比较该有效寄存器地址Addr[7:0]和该时钟选择寄存器地址Add_CLK_SEL_NF[7:0]的每一位是否相等,若都相等,则置低其输出;或逻辑门322根据该比较逻辑321的输出和从控就绪信号TRDY#,输出再经由反相器323输出时钟停止信号CLK_STOP。The
采样延时单元330采用PCI总线的总线时钟CLK_BUS作为参考时钟信号。其包括反相器331、或逻辑门332、与逻辑门333、触发器334、触发器335、触发器336、反相器337、与逻辑门338、反相器339、与逻辑门3310。时钟停止信号CLK_STOP通过或逻辑门332和与逻辑门333耦接至触发器334,触发器334在总线时钟CLK_BUS控制下,输出时钟停止延迟信号CLK_STOP1,触发器335耦接至触发器334的输出端,在总线时钟CLK_BUS控制下,输出第二时钟停止延迟信号CLK_STOP2,触发器336耦接至触发器335的输出端,在总线时钟CLK_BUS控制下,输出第三时钟停止延迟信号CLK_STOP3;与逻辑门338根据第三时钟停止延迟信号CLK_STOP3经反相器337后的输出信号和第二时钟停止延迟信号CLK_STOP2,产生时钟停止反馈信号CLK_STOP_BACK; 时钟停止反馈信号CLK_STOP_BACK通过反相器331 输出到与逻辑门333,而或逻辑门332的另一输入端耦接时钟停止延迟信号CLK_STOP1。因此与逻辑门333的输出可以保持高电位直到时钟停止反馈信号CLK_STOP_BACK的反相信号将其拉低。 这部分电路实现了采样时钟停止信号CLK_STOP的置高跳变沿来产生时钟停止延迟信号CLK_STOP1,并将CLKS_TOP1的置高时间保持一第一预定时间(本实施例为两个总线时钟周期)。与逻辑门3310根据第二时钟停止延迟信号CLK_STOP2经过反相器339的输出信号和时钟停止延迟信号CLK_STOP1,产生时钟选择延迟信号CLK_DELAY,其置高时间保持了一第二预定时间(本实施例为一个总线时钟周期)。The
在本发明的另一实施例中,采样延时单元330可以在触发器334和触发器335之间加触发器来实现第一预定时间长于两个总线时钟周期。在本发明的另一实施例中,可以采用时钟停止延迟信号CLK_STOP1代替CLK_DELAY作为时钟选择信号模块341的使能信号。采样延时单元330实现了采样时钟停止信号CLK_STOP的置高跳变沿来产生时钟停止延迟信号CLK_STOP1,并将CLK_STOP1的置高时间保持一第一预定时间(至少两个总线时钟周期),依照本发明实施例对采样延迟单元330做其它改进来实现这些功能,对本领域技术人员来说是显而易见的。In another embodiment of the present invention, the
该时钟选择信号单元340包括时钟选择信号模块341和时钟选择信号寄存器342。时钟选择信号模块341耦接至该总线接口模块310和该采样延时单元330,依据总线时钟CLK_BUS,当时钟选择延迟信号CLK_DELAY置高时,将总线接口模块接收到的时钟选择信号CLK_SEL[1:0]输出为时钟选择寄存信号CLK_SEL_NF[1:0],并在之后保持输出该时钟选择寄存信号CLK_SEL_NF[1:0]。时钟选择信号寄存器342耦接至该时钟选择信号模块341,其保存该时钟选择寄存信号CLK_SEL_NF[1:0],时钟选择信号寄存器342的地址即为时钟选择寄存器地址Add_CLK_SEL_NF[7:0]。The clock
表1是时钟选择信号模块341的逻辑功能表。Table 1 is a logical function table of the clock selection signal module 341 .
表1Table 1
时钟选择信号模块341以总线时钟信号CLK_BUS作为时钟信号,在其上升沿触发动作:当时钟选择延迟信号CLK_DELAY为高电位时,时钟选择寄存信号CLK_SEL_NF[1:0]等于时钟选择信号CLK_SEL[1:0];当时钟选择延迟信号CLK_DELAY为低电位时,时钟选择寄存信号CLK_SEL_NF[1:0]的值保持不变。The clock selection signal module 341 uses the bus clock signal CLK_BUS as a clock signal, and triggers an action on its rising edge: when the clock selection delay signal CLK_DELAY is at a high potential, the clock selection register signal CLK_SEL_NF[1:0] is equal to the clock selection signal CLK_SEL[1: 0]; when the clock selection delay signal CLK_DELAY is low, the value of the clock selection register signal CLK_SEL_NF[1:0] remains unchanged.
锁存单元360包括反相器361、反相器362、锁存器363和与逻辑门364。其中反相器361的输入端耦接时钟停止延迟信号CLK_STOP1,其输出端耦接至锁存器363的数据输入端。反相器362的输入端耦接至预输出时钟信号CLK_G,其输出端耦接至锁存器363的使能端。本领域技术人员都知道,锁存器的使能端为高电位时使能输出,因此,当预输出时钟信号CLK_G置低时,使能该锁存器363输出时钟门控信号CLK_EN,当该预输出时钟信号CLK_G置高时,保持时钟门控信号CLK_EN不变。与逻辑门364根据时钟门控信号CLK_EN和预输出时钟信号CLK_G,产生输出时钟信号CLK_OUT。这样保证了时钟门控信号CLK_EN的跳变一定出现在预输出时钟信号CLK_G置低时。The
图4是本发明多时钟切换的时序图。 图中从控就绪信号TRDY#、时钟停止信号CLK_STOP、 时钟停止延迟信号CLK_STOP1、第二时钟停止延迟信号CLK_STOP2、第三时钟停止延迟信号CLK_STOP3、时钟停止反馈信号CLK_STOP_BACK、时钟选择延迟信号CLK_DELAY、时钟选择寄存信号CLK_SEL_NF[1:0]、时钟门控信号CLK_EN均与总线时钟信号CLK_BUS同步,即这些信号的动作都在总线时钟信号CLK_BUS的上升沿进行;而待切换的时钟信号CLK1_CLK2和CLK3与总线时钟信号CLK_BUS可以是完全异步的。FIG. 4 is a timing diagram of multi-clock switching in the present invention. In the figure, slave ready signal TRDY#, clock stop signal CLK_STOP, clock stop delay signal CLK_STOP1, second clock stop delay signal CLK_STOP2, third clock stop delay signal CLK_STOP3, clock stop feedback signal CLK_STOP_BACK, clock selection delay signal CLK_DELAY, clock selection The registered signal CLK_SEL_NF[1:0] and the clock gating signal CLK_EN are synchronized with the bus clock signal CLK_BUS, that is, the actions of these signals are performed on the rising edge of the bus clock signal CLK_BUS; and the clock signals CLK1_CLK2 and CLK3 to be switched are synchronized with the bus clock signal The signal CLK_BUS can be fully asynchronous.
PCI总线的数据地址线AD上,首先出现有效寄存器地址Addr[7:0],发送完毕后,出现时钟选择信号CLK_SEL[1:0],图中示出从控就绪信号TRDY#被总线接口模块310置低一个总线时钟周期,在此期间总线接口模块310接收来自总线的时钟选择信号CLK_SEL[1:0]。控制单元320确认有效寄存器地址Addr[7:0]等于时钟选择寄存器地址Add_CLK_SEL_NF[7:0]时,将时钟停止信号CLK_STOP在从控就绪信号TRDY#置低的同时置高。时钟停止延迟信号CLK_STOP1的上升沿是采样时钟停止信号CLK_STOP产生的,而第二时钟停止延迟信号CLK_STOP2的上升沿是采样时钟停止延迟信号CLK_STOP1产生的,而第三时钟停止延迟信号CLK_STOP3的上升沿是采样第二时钟停止延迟信号CLK_STOP2产生的。时钟停止反馈信号CLK_STOPBACK由第三时钟停止延迟信号CLK_STOP3反相后与第二时钟停止延迟信号CLK_STOP2做与运算产生,将其反相后去控制时钟停止延迟信号CLK_STOP1置低,这样时钟停止延迟信号CLK_STOP1置高两个总线时钟周期后置低,本领域技术人员都知道,这里也可以通过增加触发器的个数来实现时钟停止延迟信号CLK_STOP1置高的第一预定时间可以为任意多个总线时钟周期。时钟选择延迟信号CLK_DELAY由第二时钟停止延迟信号CLK_STOP2反相后与时钟停止延迟信号CLK_STOP1做与运算产生,因此其置高的第二预定时间为一个总线周期。在探测到时钟选择延迟信号CLK_DELAY为高时,根据时钟选择信号CLK_SEL[1:0]更新时钟选择寄存信号CLK_SEL_NF[1:0],此时发生时钟切换动作,即在图中的时刻t2,预输出时钟信号CLK_G由时钟信号CLK1切换至CLK3,在预输出时钟信号CLK_G上会出现毛刺信号401。时钟门控信号CLK_EN由锁存器363根据时钟停止延迟信号CLK_STOP1和预输出时钟信号CLK_G产生,其只在预输出时钟信号CLK_G置低时才会跳变;时钟门控信号CLK_EN与预输出时钟信号CLK_G做与运算产生输出时钟信号CLK_OUT,在时刻t1和时刻t3之间输出时钟信号CLK_OUT被置低,从而过滤掉了毛刺信号401。On the data address line AD of the PCI bus, the effective register address Addr[7:0] first appears, and after the transmission is completed, the clock selection signal CLK_SEL[1:0] appears, and the figure shows that the slave control ready signal TRDY# is controlled by the
图5是本发明多时钟切换方法的步骤流程图。首先步骤S501“判断是否从控就绪信号TRDY#置低,且有效寄存器地址Addr[7:0]等于时钟选择寄存器地址Add_CLK_SEL_NF[7:0]”,如果是,表明总线上出现了时钟切换请求,则执行步骤S502“置高时钟停止信号CLK_STOP”。接着执行步骤S503“采样该时钟停止信号CLK_STOP产生时钟停止延迟信号CLK_STOP1,并在一第一预定时间后置低该时钟停止延迟信号CLK_STOP1;其采样该时钟停止信号CLK_STOP产生时钟选择延迟信号CLK_DELAY,并在一第二预定时间后置低该时钟选择延迟信号CLK_DELAY”,参考图4可以知道,“采样时钟停止信号CLK_STOP”是指依据总线时钟信号CLK_BUS,采样时钟停止信号CLK_STOP的上升跳变沿来产生时钟停止延迟信号CLK_STOP1和时钟选择延迟信号CLK_DELAY,“在一第一预定时间后置低该时钟停止延迟信号”是指经过如图4所示的两个总线时钟周期,置低时钟停止延迟信号CLK_STOP1;“ 在一第二预定时间后置低该时钟选择延迟信号”是指经过如图4所示的一个总线时钟周期,置低时钟选择延迟信号CLK_DELAY。接着执行步骤S504“根据该时钟选择延迟信号CLK_DELAY将时钟选择信号CLK_SEL[1:0]输出并保持为时钟选择寄存信号CLK_SEL_NF[1:0]”指依据总线时钟CLK_BUS,当时钟选择延迟信号CLK_DELAY置高时,将来自系统总线的时钟选择信号CLK_SEL[1:0]输出为时钟选择寄存信号CLK_SEL_NF[1:0],并在之后保持输出该时钟选择寄存信号CLK_SEL_NF[1:0]。接着执行步骤S505“根据该时钟选择寄存信号CLK_SEL_NF[1:0]在多个时钟信号中选择一个,产生预输出时钟信号CLK_G”,即在时钟选择寄存信号更新的同时,进行时钟切换,产生的预输出时钟信号CLK_G上可能会有毛刺信号。接着执行步骤S506“根据该时钟停止延迟信号CLK_STOP1和该预输出时钟信号CLK_G,产生输出时钟信号CLK_OUT”,参照图4,即当该预输出时钟信号CLK_G置低时, 由该时钟停止延迟信号CLK_STOP1的反相信号,产生时钟门控信号CLK_EN;当该预输出时钟信号CLK_G置高时,保持该时钟门控信号CLK_EN不变。且当该时钟门控信号CLK_EN置低时,置低该预输出时钟信号CLK_G,输出为该输出时钟信号CLK_OUT。FIG. 5 is a flow chart of the steps of the multi-clock switching method of the present invention. First step S501 "judging whether the slave ready signal TRDY# is set low, and the effective register address Addr[7:0] is equal to the clock selection register address Add_CLK_SEL_NF[7:0]", if yes, it indicates that a clock switching request has occurred on the bus, Then step S502 of “setting the clock stop signal CLK_STOP high” is executed. Then perform step S503 "sample the clock stop signal CLK_STOP to generate a clock stop delay signal CLK_STOP1, and set the clock stop delay signal CLK_STOP1 low after a first predetermined time; it samples the clock stop signal CLK_STOP to generate a clock selection delay signal CLK_DELAY, and Set the clock selection delay signal CLK_DELAY low after a second predetermined time. Referring to FIG. 4, it can be known that the "sampling clock stop signal CLK_STOP" refers to the rising edge of the sampling clock stop signal CLK_STOP according to the bus clock signal CLK_BUS. Clock stop delay signal CLK_STOP1 and clock selection delay signal CLK_DELAY, "setting the clock stop delay signal low after a first predetermined time" means that after two bus clock cycles as shown in Figure 4, set low clock stop delay signal CLK_STOP1 ; "setting the clock selection delay signal low after a second predetermined time" refers to setting the clock selection delay signal CLK_DELAY low after a bus clock cycle as shown in FIG. 4 . Then execute step S504 "output the clock selection signal CLK_SEL[1:0] according to the clock selection delay signal CLK_DELAY and keep it as the clock selection registration signal CLK_SEL_NF[1:0]" means that according to the bus clock CLK_BUS, when the clock selection delay signal CLK_DELAY is set When high, the clock selection signal CLK_SEL[1:0] from the system bus is output as the clock selection registration signal CLK_SEL_NF[1:0], and then the clock selection registration signal CLK_SEL_NF[1:0] is kept output. Then execute step S505 "select one of the multiple clock signals according to the clock selection register signal CLK_SEL_NF[1:0] to generate the pre-output clock signal CLK_G", that is, clock switching is performed while the clock selection register signal is updated, and the generated There may be glitches on the pre-output clock signal CLK_G. Then execute step S506 "according to the clock stop delay signal CLK_STOP1 and the pre-output clock signal CLK_G, generate the output clock signal CLK_OUT", referring to Figure 4, that is, when the pre-output clock signal CLK_G is set low, the clock stop delay signal CLK_STOP1 The inverse signal of the clock gating signal CLK_EN is generated; when the pre-output clock signal CLK_G is set high, the clock gating signal CLK_EN remains unchanged. And when the clock gating signal CLK_EN is set low, the pre-output clock signal CLK_G is set low, and the output is the output clock signal CLK_OUT.
综合以上的叙述,本发明所揭露的多时钟切换的装置和方法克服了现有技术中时钟切换中出现毛刺的问题。本发明利用了系统总线上信号的时序来有效探测时钟切换的时机,当探测到总线上有时钟切换请求后,延迟一第二预定时间,再更新时钟选择信号寄存器中的数据,此时才产生时钟切换的动作,而时钟切换时刻前后的一第一预定时间内,输出时钟信号都是置低的,从而有效地防止了输出时钟信号上的毛刺信号。Based on the above description, the multi-clock switching device and method disclosed in the present invention overcomes the problem of glitches in clock switching in the prior art. The present invention utilizes the timing of signals on the system bus to effectively detect the timing of clock switching. When a clock switching request is detected on the bus, it delays for a second predetermined time, and then updates the data in the clock selection signal register. The action of clock switching, and the output clock signal is set low within a first predetermined time before and after the clock switching time, thereby effectively preventing the glitch signal on the output clock signal.
实施例示出的是三个时钟信号CLK1,CLK2,CLK3,实际上,本领域技术人员都知道,本发明所揭露的多时钟切换的装置和方法可以适用于N个时钟信号的切换(N≥2)。以上所述仅为本发明较佳实施例,然其并非用以限定本发明的范围,任何本领域技术人员,在不脱离本发明的精神和范围内,可在此基础上做进一步的改进和变化,因此本发明的保护范围当以本申请的权利要求书所界定的范围为准。The embodiment shows three clock signals CLK1, CLK2, and CLK3. In fact, those skilled in the art know that the multi-clock switching device and method disclosed in the present invention can be applied to the switching of N clock signals (N≥2 ). The above description is only a preferred embodiment of the present invention, but it is not intended to limit the scope of the present invention. Any person skilled in the art can make further improvements and improvements on this basis without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the scope defined in the claims of the present application.
附图中符号的简单说明如下:A brief description of the symbols in the drawings is as follows:
300:时钟切换装置300: clock switching device
310:总线接口模块310: bus interface module
320:控制单元320: control unit
321:比较逻辑321: Comparison logic
322:或逻辑门322: OR logic gate
323:反相器323: Inverter
330:采样延时单元330: Sampling delay unit
331:反相器331: Inverter
332:或逻辑门332: OR logic gate
333:与逻辑门333: AND logic gate
334:触发器334: Trigger
335:触发器335: Trigger
336:触发器336: Trigger
337:反相器337: Inverter
338:与逻辑门338: AND logic gate
339:反相器339: Inverter
3310:与逻辑门3310: AND logic gate
340:时钟选择单元340: clock selection unit
341:时钟选择信号模块341: Clock selection signal module
342:时钟选择信号寄存器342: Clock selection signal register
350:多工器350: multiplexer
360:锁存单元360: Latch unit
361:反相器361: Inverter
362:反相器362: Inverter
363:锁存器363: Latches
364:与逻辑门364: AND logic gate
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101628130A CN101135921B (en) | 2007-10-10 | 2007-10-10 | Multi-clock switching device and switching method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007101628130A CN101135921B (en) | 2007-10-10 | 2007-10-10 | Multi-clock switching device and switching method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101135921A true CN101135921A (en) | 2008-03-05 |
CN101135921B CN101135921B (en) | 2010-04-14 |
Family
ID=39160040
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2007101628130A Active CN101135921B (en) | 2007-10-10 | 2007-10-10 | Multi-clock switching device and switching method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101135921B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102377425A (en) * | 2010-08-09 | 2012-03-14 | 瑞昱半导体股份有限公司 | Multi-phase clock switch device and method thereof |
CN102999464A (en) * | 2011-09-08 | 2013-03-27 | 上海华虹集成电路有限责任公司 | Advanced high-performance bus (AHB) clock switching circuit |
CN103197728A (en) * | 2012-01-06 | 2013-07-10 | 上海华虹集成电路有限责任公司 | Method for realizing burr-free clock switching circuit in different clock domains as well as circuit |
CN103631318A (en) * | 2012-08-20 | 2014-03-12 | 上海华虹集成电路有限责任公司 | Burr-free clock switching circuit |
CN104536511A (en) * | 2014-12-03 | 2015-04-22 | 泰斗微电子科技有限公司 | RTC (Real Time Clock) timing based clock switching circuit |
CN104579570A (en) * | 2015-01-14 | 2015-04-29 | 灿芯半导体(上海)有限公司 | Data receiver, data receiving system and data transmission system |
CN104813250A (en) * | 2012-11-26 | 2015-07-29 | 密克罗奇普技术公司 | Microcontroller with digital clock source |
CN105743464A (en) * | 2016-01-21 | 2016-07-06 | 深圳市同创国芯电子有限公司 | Clock conversion method, clock conversion device, clock conversion circuit and integrated circuit |
CN106774632A (en) * | 2016-12-15 | 2017-05-31 | 深圳市博巨兴实业发展有限公司 | A kind of clock multi-channel control unit in microcontroller chip |
CN111241026A (en) * | 2020-01-02 | 2020-06-05 | 航天信息股份有限公司 | Self-adaptive system of multiple clocks |
CN111613257A (en) * | 2020-05-29 | 2020-09-01 | 西安紫光国芯半导体有限公司 | Gating circuit and method for multi-phase clock signals and electronic equipment |
WO2021129050A1 (en) * | 2019-12-26 | 2021-07-01 | 深圳市紫光同创电子有限公司 | Glitch-free clock switching circuit |
CN114047799A (en) * | 2021-10-21 | 2022-02-15 | 深圳市德明利技术股份有限公司 | System and method for switching discontinuous clocks |
CN114938440A (en) * | 2022-03-18 | 2022-08-23 | 嘉兴智瞳科技有限公司 | Microsurgery image pickup system with switchable imaging modes, microsurgery image pickup method and switching circuit |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5274678A (en) * | 1991-12-30 | 1993-12-28 | Intel Corporation | Clock switching apparatus and method for computer systems |
US5604452A (en) * | 1995-04-03 | 1997-02-18 | Exar Corporation | Clock generator using a state machine to switch between two offset clocks |
GB2358531B (en) * | 2000-01-18 | 2003-06-04 | 3Com Corp | Glitch free clock multiplexer circuit |
US6639449B1 (en) * | 2002-10-22 | 2003-10-28 | Lattice Semiconductor Corporation | Asynchronous glitch-free clock multiplexer |
CN1329789C (en) * | 2003-07-30 | 2007-08-01 | 华为技术有限公司 | Method for preventing total clock output from generating burr at master spare clock switching |
CN100426182C (en) * | 2006-11-30 | 2008-10-15 | 北京中星微电子有限公司 | Realizing circuit of asynchronous clock signal switching and method thereof |
-
2007
- 2007-10-10 CN CN2007101628130A patent/CN101135921B/en active Active
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102377425A (en) * | 2010-08-09 | 2012-03-14 | 瑞昱半导体股份有限公司 | Multi-phase clock switch device and method thereof |
CN102377425B (en) * | 2010-08-09 | 2014-07-16 | 瑞昱半导体股份有限公司 | Multi-phase clock switch device and method thereof |
CN102999464A (en) * | 2011-09-08 | 2013-03-27 | 上海华虹集成电路有限责任公司 | Advanced high-performance bus (AHB) clock switching circuit |
CN102999464B (en) * | 2011-09-08 | 2017-02-08 | 上海华虹集成电路有限责任公司 | Advanced high-performance bus (AHB) clock switching circuit |
CN103197728A (en) * | 2012-01-06 | 2013-07-10 | 上海华虹集成电路有限责任公司 | Method for realizing burr-free clock switching circuit in different clock domains as well as circuit |
CN103197728B (en) * | 2012-01-06 | 2017-07-04 | 上海华虹集成电路有限责任公司 | The implementation method and circuit of different clock-domains burr-free clock switching circuit |
CN103631318A (en) * | 2012-08-20 | 2014-03-12 | 上海华虹集成电路有限责任公司 | Burr-free clock switching circuit |
CN103631318B (en) * | 2012-08-20 | 2017-07-04 | 上海华虹集成电路有限责任公司 | burr-free clock switching circuit |
CN104813250A (en) * | 2012-11-26 | 2015-07-29 | 密克罗奇普技术公司 | Microcontroller with digital clock source |
CN104536511A (en) * | 2014-12-03 | 2015-04-22 | 泰斗微电子科技有限公司 | RTC (Real Time Clock) timing based clock switching circuit |
CN104536511B (en) * | 2014-12-03 | 2017-10-31 | 泰斗微电子科技有限公司 | A kind of clock switch circuit based on RTC timing |
CN104579570A (en) * | 2015-01-14 | 2015-04-29 | 灿芯半导体(上海)有限公司 | Data receiver, data receiving system and data transmission system |
CN104579570B (en) * | 2015-01-14 | 2018-04-13 | 灿芯半导体(上海)有限公司 | Data sink, data receiving system and data transmission system |
CN105743464B (en) * | 2016-01-21 | 2018-09-07 | 深圳市紫光同创电子有限公司 | Clock slewing methods, device, circuit and integrated circuit |
CN105743464A (en) * | 2016-01-21 | 2016-07-06 | 深圳市同创国芯电子有限公司 | Clock conversion method, clock conversion device, clock conversion circuit and integrated circuit |
CN106774632A (en) * | 2016-12-15 | 2017-05-31 | 深圳市博巨兴实业发展有限公司 | A kind of clock multi-channel control unit in microcontroller chip |
WO2021129050A1 (en) * | 2019-12-26 | 2021-07-01 | 深圳市紫光同创电子有限公司 | Glitch-free clock switching circuit |
CN111241026A (en) * | 2020-01-02 | 2020-06-05 | 航天信息股份有限公司 | Self-adaptive system of multiple clocks |
CN111241026B (en) * | 2020-01-02 | 2024-01-02 | 航天信息股份有限公司 | Self-adaptive system of a plurality of clocks |
CN111613257A (en) * | 2020-05-29 | 2020-09-01 | 西安紫光国芯半导体有限公司 | Gating circuit and method for multi-phase clock signals and electronic equipment |
CN111613257B (en) * | 2020-05-29 | 2022-07-15 | 西安紫光国芯半导体有限公司 | Gating circuit and method for multi-phase clock signals and electronic equipment |
CN114047799A (en) * | 2021-10-21 | 2022-02-15 | 深圳市德明利技术股份有限公司 | System and method for switching discontinuous clocks |
CN114938440A (en) * | 2022-03-18 | 2022-08-23 | 嘉兴智瞳科技有限公司 | Microsurgery image pickup system with switchable imaging modes, microsurgery image pickup method and switching circuit |
Also Published As
Publication number | Publication date |
---|---|
CN101135921B (en) | 2010-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101135921B (en) | Multi-clock switching device and switching method thereof | |
US9753486B2 (en) | Clock gating with an asynchronous wrapper cell | |
US6822478B2 (en) | Data-driven clock gating for a sequential data-capture device | |
US20090121756A1 (en) | Pseudo-synchronous small register designs with very low power consumption and methods to implement | |
US9685953B1 (en) | Low latency asynchronous interface circuits | |
US8659336B2 (en) | Apparatus and method for synchronising signals | |
US6989695B2 (en) | Apparatus and method for reducing power consumption by a data synchronizer | |
US8570069B2 (en) | Clock gating cell circuit | |
KR20120005469A (en) | Low-Power Dual-Edge-Trigger Storage Cell with Scan Test and Clock-Gating Circuit for It | |
US8644439B2 (en) | Circuits and methods for signal transfer between different clock domains | |
US8132036B2 (en) | Reducing latency in data transfer between asynchronous clock domains | |
US8384437B2 (en) | Method and apparatus for gating a clock signal | |
US9436647B2 (en) | IIC bus start-stop detection circuit | |
CN104049672A (en) | Data Synchronization Across Asynchronous Boundaries Using Selectable Synchronizers To Minimize Latency | |
US6957399B2 (en) | Controlling the propagation of a digital signal by means of variable I/O delay compensation using delay-tracking | |
JP2020513628A (en) | Clock gating enable generation | |
KR100963706B1 (en) | Data transmission method, data transmission bridge and high speed data transmission device | |
EP3739463B1 (en) | Circuit for asynchronous data transfer | |
US7945806B2 (en) | Data processing apparatus and method for controlling a transfer of payload data over a communication channel | |
KR20170139673A (en) | Communication between integrated circuits | |
US10312886B2 (en) | Asynchronous clock gating circuit | |
JP2007293845A (en) | Method and device for reading data from serial data source in parallel format | |
US7400178B2 (en) | Data output clock selection circuit for quad-data rate interface | |
JPH1185304A (en) | Clock input control circuit | |
US20230238969A1 (en) | Sampling signals |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |