Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

To live is always desirable. -- Eleen the Capellan, "Friday's Child", stardate 3498.9


devel / comp.lang.vhdl / VHDL Looking for clock dropout on clocks of different speeds.

SubjectAuthor
* VHDL Looking for clock dropout on clocks of different speeds.Steve Auch-Schwelk
`- VHDL Looking for clock dropout on clocks of different speeds.Richard Damon

1
VHDL Looking for clock dropout on clocks of different speeds.

<609002d9-b5cb-40c9-a01f-e0fc3a380ac3n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=165&group=comp.lang.vhdl#165

  copy link   Newsgroups: comp.lang.vhdl
X-Received: by 2002:a05:622a:1827:b0:35b:bb7f:6851 with SMTP id t39-20020a05622a182700b0035bbb7f6851mr891889qtc.457.1664426869032;
Wed, 28 Sep 2022 21:47:49 -0700 (PDT)
X-Received: by 2002:ad4:596f:0:b0:4ad:79fc:9ae0 with SMTP id
eq15-20020ad4596f000000b004ad79fc9ae0mr1095811qvb.53.1664426868789; Wed, 28
Sep 2022 21:47:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.vhdl
Date: Wed, 28 Sep 2022 21:47:48 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=58.174.64.206; posting-account=NtVegAkAAABqonxLV7Yqx9pBYUwTn2yC
NNTP-Posting-Host: 58.174.64.206
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <609002d9-b5cb-40c9-a01f-e0fc3a380ac3n@googlegroups.com>
Subject: VHDL Looking for clock dropout on clocks of different speeds.
From: steve.auchschwelk@gmail.com (Steve Auch-Schwelk)
Injection-Date: Thu, 29 Sep 2022 04:47:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2824
 by: Steve Auch-Schwelk - Thu, 29 Sep 2022 04:47 UTC

I have a SoC which is being fed an external 125MHz clock. I am using the Zynq processor with internal clock speed of 100MHz as an independent source to see if there are any dropouts.

Here is the heavily redacted code, to just produce the problem I am seeing.

Basic premise is that the faster clock will always have updated it’s clock_count, by the time the slower clock checks to see if it has changed.. If it is the same, the faster clock has failed for some reason, and I want to record how may cycles it has failed for.

Clock_in is 125MHZ. Clock_100 is 100MHz.

The error_count_s is being incremented about .05% of the time, even though there is no failure or fallout of Clock_in.

I have independently verified that the counters are updating at the correct rate.

Is there some timing issue here I’m missing?

---------------------------------------------------
process(Clock_in,reset)
begin
if (reset='0') then
clock_counter <= (others=>'0');
elsif rising_edge(Clock_in) then
clock_counter <= clock_counter + 1;
end if; -- rising edge clock_in
end process;
process(Clock_100,reset) --loss of clock detector, clocked from onboard processor clock
begin
if (rising_edge(Clock_100)) then
if (clock_counter = clock_counter_old) then -- clock_counter hasn't been updated since the last pulse
error_count_s <= error_count_s + 1;
CSO_down_out <= error_count_s; --count how long we've been without 125MHz clock
end if;
clock_counter_old <= clock_counter;
end if; -- rising edge
end process;

Re: VHDL Looking for clock dropout on clocks of different speeds.

<ZZeZK.701033$BKL8.665286@fx15.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=166&group=comp.lang.vhdl#166

  copy link   Newsgroups: comp.lang.vhdl
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.13.1
Subject: Re: VHDL Looking for clock dropout on clocks of different speeds.
Content-Language: en-US
Newsgroups: comp.lang.vhdl
References: <609002d9-b5cb-40c9-a01f-e0fc3a380ac3n@googlegroups.com>
From: Richard@Damon-Family.org (Richard Damon)
In-Reply-To: <609002d9-b5cb-40c9-a01f-e0fc3a380ac3n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 60
Message-ID: <ZZeZK.701033$BKL8.665286@fx15.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Thu, 29 Sep 2022 07:05:27 -0400
X-Received-Bytes: 3339
 by: Richard Damon - Thu, 29 Sep 2022 11:05 UTC

On 9/29/22 12:47 AM, Steve Auch-Schwelk wrote:
> I have a SoC which is being fed an external 125MHz clock. I am using the Zynq processor with internal clock speed of 100MHz as an independent source to see if there are any dropouts.
>
> Here is the heavily redacted code, to just produce the problem I am seeing.
>
> Basic premise is that the faster clock will always have updated it’s clock_count, by the time the slower clock checks to see if it has changed. If it is the same, the faster clock has failed for some reason, and I want to record how may cycles it has failed for.
>
> Clock_in is 125MHZ. Clock_100 is 100MHz.
>
> The error_count_s is being incremented about .05% of the time, even though there is no failure or fallout of Clock_in.
>
> I have independently verified that the counters are updating at the correct rate.
>
> Is there some timing issue here I’m missing?
>
> ---------------------------------------------------
> process(Clock_in,reset)
> begin
> if (reset='0') then
> clock_counter <= (others=>'0');
> elsif rising_edge(Clock_in) then
> clock_counter <= clock_counter + 1;
> end if; -- rising edge clock_in
> end process;
> process(Clock_100,reset) --loss of clock detector, clocked from onboard processor clock
> begin
> if (rising_edge(Clock_100)) then
> if (clock_counter = clock_counter_old) then -- clock_counter hasn't been updated since the last pulse
> error_count_s <= error_count_s + 1;
> CSO_down_out <= error_count_s; --count how long we've been without 125MHz clock
> end if;
> clock_counter_old <= clock_counter;
> end if; -- rising edge
> end process;

The problem is syncronization, and slight differences in propigation
time for each bit of the counter.

This can cause the faster counter, when sampled by the slower clock,
when it is counting from a value like 0111 to the value 1000 to see
some of the new bits and some of the old bits, allowing ANY value
between 0000 and 1111 to appear.

One simple solution is to change the counters to "Gray Counters" which
only change a single bit on each transisition, counting like:

000
001
010
011
111
110
100
101
100
000

And that sort of value won't get grabled crossing the clock domain.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor