Professional Documents
Culture Documents
ver 1.0
By
default,
the
synthesis
and
implementation
tools
treat
all
paths
as
single
cycle
paths,
i.e.,
any
combinational
path
between
two
registers
in
the
implemented
circuit
is
assumed
to
have
a
propagation
delay
shorter
than
one
clock
cycle.
Hence,
if
you
have
a
combinational
path
between
two
registers
that
takes
more
than
one
clock
cycle
to
propagate
through,
a
constraint
file
is
required.
Without
the
constraint
file
the
tool
will
not
know
where
the
multi-‐cycle
path
is
located.
For
Xilinx,
we
can
either
specify
these
paths
for
synthesis
(using
UCF
file)
or
for
implementation
(using
XCF
file).
All
constraints
applied
during
synthesis
will
propagate
to
implementation.
The
full
details
on
how
to
create
a
constraint
file
can
be
found
in
the
Constraints
Guide,
http://www.xilinx.com/support/documentation/dt_ise11-‐
1.htm.
In
this
tutorial,
we
will
show
how
to
create
a
constraint
file
for
a
multi-‐cycle
path
using
Xilinx
ISE
v.11.1.
We
assume
the
use
of
Spartan
3
FPGA
(xc3s50pq208-‐5).
An
example
used
in
this
tutorial
is
the
radix-‐2
sequential
multiplier
based
on
the
shift/add
algorithm,
right-‐shift
version
with
carry
save
adder
(CSA).
Source
codes
for
this
example
are
provided
with
this
tutorial.
The
circuit
contains
two
critical
paths:
single-‐cycle
path,
passing
through
the
carry
save
adder
and
omitting
the
carry
propagate
adder,
and
a
multi-‐cycle
path
passing
through
both
the
carry
save
adder
and
the
carry
propagate
adder.
Compared
to
the
version
based
on
the
carry
propagate
adder
only,
the
execution
time
is
reduced
considerably,
especially
for
the
large
values
of
the
operand
size
k.
In
this
example,
we
assume
k=64.
Figure
1:
Datapath
Basic
Implementation
Before
we
proceed
any
further,
let
us
make
sure
that
the
critical
path
is
always
included
in
the
Post-‐PAR
static
timing
report.
To
make
it
happen,
select
the
"Process
Properties"
of
"Implement
Design
-‐>
Place
&
Route
-‐>
Generate
Post-‐Place
&
Route
Static
Timing"
located
inside
the
Processes
window,
under
Design
tab.
Then,
specify
the
following
settings.
Once
done,
you
can
implement
the
design
and
view
the
results.
Below
is
a
portion
of
the
generated
Post-‐PAR
Static
Timing
Report
:
As
expected,
the
critical
path
in
Post-‐PAR
Static
Timing
Report
goes
through
the
CPA
unit.
However,
this
is
not
the
actual
critical
path
for
this
circuit.
Hence,
the
tool
needs
to
be
informed
that
the
path
that
goes
through
the
CPA
is
allowed
to
take
multiple
clock
cycles.
The
exact
number
of
clock
cycles
depends
on
the
operand
size,
FPGA
device
used
for
implementation,
and
other
factors.
This
number
can
be
determined,
for
example,
by
first
implementing
the
circuit
with
a
multi-‐cycle
path,
then
without
multi-‐
cycle
path,
and
then
computing
the
ratio
of
the
obtained
clock
periods,
and
rounding
it
up
to
the
nearest
integer.
Then,
under
To
group,
the
destination
must
be
selected.
In
our
case,
the
destination
is
pp
register.
We
can
create
the
destination
group
by
selecting
the
Create
button
and
filling
the
pop
up
as
shown
below:
When
done,
select
Constraint
Type
as
”Relative
to
other
path
TIMESPEC"
with
Reference
TIMESPEC
as
TS_clk,
with
a
multiply
factor
of
2.
The
final
Path
Exceptions
should
look
like
those
shown
in
the
below
figure:
Press
OK,
then
navigate
to
Timing
Constraints
under
Constraint
Type
window.
You
will
see
the
code
generated
inside
your
UCF
file
as
shown
below
:
The
lines
number
1
-‐
3
specify
the
group
names
and
their
associated
nets
and
instances.
Line
number
4
is
telling
the
tool
to
optimize
for
the
clock
period
equal
to
6.5
ns
with
the
50%
duty
cycle.
Line
number
5
tells
that
any
path
starting
from
any
flip
flop
that
goes
through
"addout"
signal
and
ending
with
the
"pp"
group
can
have
the
critical
path
equal
to
two
times
the
clock
period.
Save
the
constraint
file
by
using
"ctrl+s"
key
on
your
keyboard.
The
constraint
file
is
now
ready
for
implementation.
Design
Optimization
Implement
the
design
with
the
UCF
file.
Once
done,
you
should
see
that
the
PAR
result
file
contains
the
following
summary:
As
opposed
to
implementation
without
UCF
file
(Figure
4),
we
can
now
see
two
separate
results
for
each
of
our
constraints.
Clock
path
without
CPA
and
with
CPA
are
5.583
ns
and
12.403
ns,
respectively.
In
this
case,
the
tool
tries
to
optimize
the
design
for
the
basic
clock
period
6.5
ns,
and
optimize
the
path
through
CPA
to
the
delay
smaller
than
twice
the
clock
period.
Note
that
we
do
not
need
to
set
our
clock
period
to
5.583
ns
when
we
actually
implement
the
design
on
FPGA.
In
fact,
if
we
use
the
design
on
FPGA
with
the
above
clock
period,
the
design
will
probably
fail
to
operate
correctly
as
the
minimum
delay
of
the
multi-‐cycle
path
is
12.403
ns;
which
is
bigger
than
twice
the
clock
period.
The
results
shown
above
are
the
minimum
possible
values
for
each
path
separately.
We
will
need
to
select
an
appropriate
value
for
our
clock
when
the
above
constraints
are
taken
into
consideration.
The
best
course
is
to
use
the
clock
period
as
specified
inside
the
UCF
file
or
to
modify
the
constraint
file
so
the
tools
can
optimize
the
path
accordingly.
Let
us
try
to
optimize
the
path.
Again,
we
need
to
go
back
and
edit
the
timing
constraint
for
our
clock
domain
from
the
constraint
editor.
The
value
should
be
set
for
5
ns.
After
re-‐implementing
the
design,
you
should
receive
the
following
result:
The
results
do
not
meet
the
timing
requirement.
When
constraint
is
not
met,
timing
score
is
not
equal
to
0.
Let
us
relax
our
requirement
and
implement
the
design
for
5.2
ns.
All
constraints
are
met
for
the
clock
period
of
5.2
ns.
These
steps
can
be
repeated
until
an
optimal
result
is
reached.
Let
us
look
at
the
improvement
of
our
circuit’s
latency
when
a
multi-‐cycle
path
is
specified.
For
k
=
64,
the
total
number
of
clock
cycles
required
without
multi-‐cycle
path
is
128.
When
a
multi-‐cycle
path
is
specified,
the
total
number
of
clock
cycles
required
is
127+2=129.
The
total
latencies
with
and
without
multi-‐cycle
path
are
5.2*129
=
670.8
ns
and
10.943*128
=
1400.7
ns.
The
performance
of
the
circuit
with
a
multi-‐cycle
path
is
higher
by
108%!
To
obtain
the
critical
path
information,
we
will
need
to
open
the
Timing
Analyzer
program.
This
program
is
normally
located
in
the
following
location
"Start
Menu
(Windows
button)
-‐>
Programs
-‐>
Xilinx
-‐>
ISE
-‐>
Accessories
-‐>
Timing
Analyzer".
Then,
open
our
design
by
choosing
"File
-‐>
Open
Design"
and
select
top_mult.ncd
from
the
ISE
project's
workspace,
top_mult.pcf
should
be
selected
automatically.
Next,
select
the
UCF
file,
top_mult.ucf,
under
User
constraints
file
and
press
OK.
Select
"Timing
-‐>
Run
Analysis"
and
analyze
against
"design
timing
constraint".
Under
Timing
Constraint
tab,
you
will
see
that
the
two
constraints
are
selected
for
analyzing.
Then
make
sure
that
Report
Options
tab
contain
the
following
settings
so
that
the
critical
path
is
generated
:
Press OK.
Figure
14:
Post-‐PAR
Static
Timing
Report
of
Timing
Analyzer
(TS_clk
constraint)
Looking
at
the
generated
timing
report,
we
can
see
that
the
critical
path
for
the
TS_clk
period
does
not
any
longer
go
through
the
CPA
unit.
The
path
that
goes
through
the
CPA
unit
is
TS_multipath,
which
is
what
we
expected.