Questions on Synopsys Behavioral Coding Rules

P

Peng Yu

Guest
Hi,
Synopsys document "Behavioral Compiler Verilog User and Modeling
Guide" states some behavioral coding guidelines. It's easy to know the
reasons of some rules. But it's hard for me to figure out the reasons
of the others.
In particular, I don't understand Chapter 11's General Coding Rule 5
& 6.
Rule 5 read as "Place at least one clock statement after the last
write inside a loop and before a loop continue or exit".
Rule 6 read as "Place at least one clock statement after the last
write before a loop".
An example for Rule 5 & 6 is listed below.

/*************************************/
re <= (a * c * d);
@(posedge clk);
if (reset == 1) disable reset_loop;
begin: for_loop1
for (i = 0; i < 12; i = i + 1)
begin:for_loop_label
re <= (a * c * d + i);
@(posedge clk);
if (reset == 1) disable reset_loop;
im <= (c * d);
@(posedge clk);
if (reset == 1) disable reset_loop;
end
end
/**********************************/

I wonder whether I should follow Rule 5&6 in this example. Because
I can change the previous code to the following. The rules change to
"Place at least one clock statement before the first write inside a
loop" and "Place at least one clock statement before the first write
after a loop".

/*************************************/
re <= (a * c * d);
begin: for_loop1
for (i = 0; i < 12; i = i + 1)
begin:for_loop_label
@(posedge clk);
if (reset == 1) disable reset_loop;
re <= (a * c * d + i);
@(posedge clk);
if (reset == 1) disable reset_loop;
im <= (c * d);
end
end
@(posedge clk);
if (reset == 1) disable reset_loop;
/*************************************/

Best wishes,
Peng

PS:
The "clock statement" means something like this:

@(posedge clk);
if (reset == 1) disable reset_loop;
 
"Peng Yu" <yupeng_@hotmail.com> wrote in message
news:d7b3726c.0308061740.375b19ba@posting.google.com...
Hi,
Synopsys document "Behavioral Compiler Verilog User and Modeling
Guide" states some behavioral coding guidelines. It's easy to know the
reasons of some rules. But it's hard for me to figure out the reasons
of the others.
Yes. It's not easy.

Get hold of a copy of the book on Behavioural Compiler by one of
the team that wrote it...

I don't have it to hand but I think it's called "Behavioral
Synthesis using Synopsys Behavioral Compiler" by Stephen Knapp.

--

Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
"Jonathan Bromley" <jonathan@doulos.com> wrote in message news:<bgtlhc$dk9$1$8300dec7@news.demon.co.uk>...
BTW: When coding for Behavioral Compiler, choice of blocking vs.
nonblocking assignment is based on very different criteria than
it is in ordinary RTL coding. Blocking assignments can be re-
organised pretty much arbitrarily by the scheduler; nonblocking
assignments are used when doing I/O to/from the current process
and their user-defined timing will be respected, within limits,
by the scheduler.
Could you tell me some more references on this topic?
 
"Peng Yu" <yupeng_@hotmail.com> wrote in message
news:d7b3726c.0308071825.416434bc@posting.google.com...

BTW: When coding for Behavioral Compiler, choice of blocking vs.
nonblocking assignment [...]

Could you tell me some more references on this topic?
I already told you about Stephen Knapp's book; you also know
about the Synopsys documentation. There is not much else,
now that we have removed the BC material from our Expert
Verilog and Expert VHDL courses :)
--

Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
"Jonathan Bromley" <jonathan@doulos.com> wrote in message
news:bgvkji$dl$1$8302bc10@news.demon.co.uk...
I already told you about Stephen Knapp's book;
A colleague has pointed out that it's probably DAVID Knapp,
not Stephen. Apologies. Our copy has gone AWOL from the
office library, and I can't be bothered looking it up properly.
--

Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

Welcome to EDABoard.com

Sponsor

Back
Top