Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > On HDL Synthesis

Reply
Thread Tools

On HDL Synthesis

 
 
devices
Guest
Posts: n/a
 
      06-25-2007
I was trying to detect a start (or stop) condition (i2c).
A first approach consisted in "always @ (negedge isda)"
and setting a flag accordingly. The simulation woked.
When i wanted to check whether the module were
synthesizable the troubles began. No error, actually.
But the warnings were serious. The Timing Analysis
started to blame it on Ripple Clocks, Gated Clocks
and mostly on Clock skews. I fixed things by deploying
the common "always @ (posedge clk)" and detecting
the edges. I would like to know what happens behind
the scenes when a synthesis tool comes across a case
like the first "always" i listed.


 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      06-25-2007
devices wrote:
> I was trying to detect a start (or stop) condition (i2c).
> A first approach consisted in "always @ (negedge isda)"


That's verilog.
You probably want a synchronous always block.
Try comp.lang.verilog
See also pg 6-55
http://www.altera.com/literature/hb/...s_qii51007.pdf
 
Reply With Quote
 
 
 
 
Peter
Guest
Posts: n/a
 
      06-25-2007
On 25 Juni, 02:07, "devices" <me@home> wrote:
> I was trying to detect a start (or stop) condition (i2c).
> A first approach consisted in "always @ (negedge isda)"
> and setting a flag accordingly. The simulation woked.
> When i wanted to check whether the module were
> synthesizable the troubles began. No error, actually.
> But the warnings were serious. The Timing Analysis
> started to blame it on Ripple Clocks, Gated Clocks
> and mostly on Clock skews. I fixed things by deploying
> the common "always @ (posedge clk)" and detecting
> the edges. I would like to know what happens behind
> the scenes when a synthesis tool comes across a case
> like the first "always" i listed.


Use a common clock and sample SDA and SCL (with synchronising
registers) as data, into a start/stop detector, instead of using SDA
as a clock.

/Peter

 
Reply With Quote
 
devices
Guest
Posts: n/a
 
      06-25-2007

Thanks for the link. I collected lots of info about coding style.
The one you show was not in my list.

> That's verilog.
> Try comp.lang.verilog


My issue was independent of the language that's why i
simply referred to it as HDL. I guess that that kind of
clock skew issue might arise whathever language you
use. I saw examples where the rising or falling edge of
SDA or a registered version of it drove a VDHL process.
I was just wondering what was inferred in such a case.

> You probably want a synchronous always block.

Using "posedge clk" i've already made it synchronous.



 
Reply With Quote
 
devices
Guest
Posts: n/a
 
      06-25-2007

"Peter" <> wrote in message
news: oups.com...
> On 25 Juni, 02:07, "devices" <me@home> wrote:
> > I was trying to detect a start (or stop) condition (i2c).
> > A first approach consisted in "always @ (negedge isda)"
> > and setting a flag accordingly. The simulation woked.
> > When i wanted to check whether the module were
> > synthesizable the troubles began. No error, actually.
> > But the warnings were serious. The Timing Analysis
> > started to blame it on Ripple Clocks, Gated Clocks
> > and mostly on Clock skews. I fixed things by deploying
> > the common "always @ (posedge clk)" and detecting
> > the edges. I would like to know what happens behind
> > the scenes when a synthesis tool comes across a case
> > like the first "always" i listed.

>
> Use a common clock and sample SDA and SCL (with synchronising
> registers) as data, into a start/stop detector, instead of using SDA
> as a clock.


That's what i did when i used the "posedge clk".
It behaves more or less like: "process(clk)" plus
"if (clk='1' and clk'event) ..." or "if rising_edge(clk) ..."



 
Reply With Quote
 
Macias Wojtas
Guest
Posts: n/a
 
      06-25-2007

"devices" <me@home> wrote in message
news:467fd623$0$10620$ ...
>
> "Peter" <> wrote in message
> news: oups.com...
>> On 25 Juni, 02:07, "devices" <me@home> wrote:
>> > I was trying to detect a start (or stop) condition (i2c).
>> > A first approach consisted in "always @ (negedge isda)"
>> > and setting a flag accordingly. The simulation woked.
>> > When i wanted to check whether the module were
>> > synthesizable the troubles began. No error, actually.
>> > But the warnings were serious. The Timing Analysis
>> > started to blame it on Ripple Clocks, Gated Clocks
>> > and mostly on Clock skews. I fixed things by deploying
>> > the common "always @ (posedge clk)" and detecting
>> > the edges. I would like to know what happens behind
>> > the scenes when a synthesis tool comes across a case
>> > like the first "always" i listed.

>>
>> Use a common clock and sample SDA and SCL (with synchronising
>> registers) as data, into a start/stop detector, instead of using SDA
>> as a clock.

>
> That's what i did when i used the "posedge clk".
> It behaves more or less like: "process(clk)" plus
> "if (clk='1' and clk'event) ..." or "if rising_edge(clk) ..."


Yes, but 'posedge clk' in Verilog and "process(clk)" plus "if (clk='1' and
clk'event) ..." or "if rising_edge(clk) ..." in VHDL should be apply only to
clock signals. It is not the way u can detect the change of signal level. As
Peter said u should sample this signal.

--
Maciek Wojtynski


 
Reply With Quote
 
devices
Guest
Posts: n/a
 
      06-26-2007

"Macias Wojtas" <> wrote in message
news:f5ot8n$as$...
>
> "devices" <me@home> wrote in message
> news:467fd623$0$10620$ ...
> >
> > "Peter" <> wrote in message
> > news: oups.com...
> >> On 25 Juni, 02:07, "devices" <me@home> wrote:
> >> > I was trying to detect a start (or stop) condition (i2c).
> >> > A first approach consisted in "always @ (negedge isda)"
> >> > and setting a flag accordingly. The simulation woked.
> >> > When i wanted to check whether the module were
> >> > synthesizable the troubles began. No error, actually.
> >> > But the warnings were serious. The Timing Analysis
> >> > started to blame it on Ripple Clocks, Gated Clocks
> >> > and mostly on Clock skews. I fixed things by deploying
> >> > the common "always @ (posedge clk)" and detecting
> >> > the edges. I would like to know what happens behind
> >> > the scenes when a synthesis tool comes across a case
> >> > like the first "always" i listed.
> >>
> >> Use a common clock and sample SDA and SCL (with synchronising
> >> registers) as data, into a start/stop detector, instead of using SDA
> >> as a clock.

> >
> > That's what i did when i used the "posedge clk".
> > It behaves more or less like: "process(clk)" plus
> > "if (clk='1' and clk'event) ..." or "if rising_edge(clk) ..."

>
> Yes, but 'posedge clk' in Verilog and "process(clk)" plus "if (clk='1' and
> clk'event) ..." or "if rising_edge(clk) ..." in VHDL should be apply only

to
> clock signals. It is not the way u can detect the change of signal level.

As
> Peter said u should sample this signal.
>
> --
> Maciek Wojtynski


When did i say that CLK is the same as ISDA?

I stated two cases:

1) always @ (negedge isda)
which gave warnings

2) always @ (posedge clk)
which, as i said, fixed the issue.

in the second case i did the detection by
comparing the new and old sample.


 
Reply With Quote
 
Macias Wojtas
Guest
Posts: n/a
 
      06-27-2007
> When did i say that CLK is the same as ISDA?
>
> I stated two cases:
>
> 1) always @ (negedge isda)
> which gave warnings
>
> 2) always @ (posedge clk)
> which, as i said, fixed the issue.
>
> in the second case i did the detection by
> comparing the new and old sample.


U didn't said that isda was a the same as clk. I said that u can apply
'always @ (negedge xxx)' only to clock signal. Usually in FPGAs there is
only one dedicated clock line that's why when u try to use more then one
clock synthesis gives u warnings.

When in the same project u use always @ (posedge signal1) and always @
(posedge signal2) this require 2 clock lines - maybe this is your problem.



Best regards

Maciek Wojtynski


 
Reply With Quote
 
devices
Guest
Posts: n/a
 
      06-28-2007
> U didn't said that isda was a the same as clk. I said that u can apply
> 'always @ (negedge xxx)' only to clock signal. Usually in FPGAs there is
> only one dedicated clock line that's why when u try to use more then one
> clock synthesis gives u warnings.
>
> When in the same project u use always @ (posedge signal1) and always @
> (posedge signal2) this require 2 clock lines - maybe this is your problem.
>
>
>
> Best regards
>
> Maciek Wojtynski
>


With both clk and isda as clocking signals, the timing
analyzer computed the shortest and longest path, the
shortest and longest delay and, as a warning, concluded
that the circuit may not operate.

Here's an explanation (though it has nothing to do with
the edge detection)

http://groups.google.com/group/comp....1f8e28a059f3d3


 
Reply With Quote
 
Andy Peters
Guest
Posts: n/a
 
      07-03-2007
On Jun 27, 7:41 am, "Macias Wojtas" <wojt...@poczta.onet.pl> wrote:

> U didn't said that isda was a the same as clk. I said that u can apply
> 'always @ (negedge xxx)' only to clock signal. Usually in FPGAs there is
> only one dedicated clock line that's why when u try to use more then one
> clock synthesis gives u warnings.


What's this "u" thing??

Your information about "only one dedicated clock line" in FPGAs is
waaaaay out of date.

-a

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HDL - simulation vs synthesis digital pig VHDL 1 05-29-2008 03:38 AM
HDL Synthesis to 2-input base function gate netlist matthew.pullerits@gmail.com VHDL 1 11-07-2007 03:50 PM
mixed hdl synthesis bxbxb3 VHDL 2 03-29-2005 08:34 AM
SOS! newbie question about synthesizable VHDL : synthesis run successfully but post-synthesis failed... walala VHDL 4 09-09-2003 08:41 AM
what are the possible reasons that successful pre-synthesis simulation + successful synthesis = failed post-synthes walala VHDL 4 09-08-2003 01:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57