cherjier
Member level 5
this is an example code:
module counter(CLOCK, ENABLE, COUNT);
input CLOCK;
input ENABLE;
output [3:0] COUNT;
reg [3:0] COUNT = 3'b000;
always @(posedge CLOCK)
if (ENABLE)
COUNT <= COUNT + 1;
else
COUNT <= 3'b000;
endmodule
the constraints :
NET "CLOCK" TNM_NET = "CLOCK";
TIMESPEC "TS_CLOCK" = PERIOD "CLOCK" 5 ns HIGH 50 %;
for behavoural simulation, the output pad COUNT and register COUNT will toggle at the same clock which is the ideal case,
after PAR and run the post PAR simulation, the register COUNT will have around 1.5ns delay with respect to current clock edge and the output pad will delay 6+ns to the same clock edge. the output pad is almost 1 clock cycle delay.
i try to experiment with the offset constraints:
OFFSET = IN 2 ns BEFORE "CLOCK" ;
OFFSET = OUT 10 ns AFTER "CLOCK" ;
but the PAR will return me an error
Slack: -1.478ns (requirement - (clock arrival + clock path + data path + uncertainty))
Source: count_int_0 (FF)
Destination: COUNT_OUT<0> (PAD)
Source Clock: CLOCK_BUFGP rising at 0.000ns
Requirement: 10.000ns
Data Path Delay: 5.282ns (Levels of Logic = 1)
Clock Path Delay: 6.196ns (Levels of Logic = 2)
Clock Uncertainty: 0.000ns
Clock Path: CLOCK to count_int_0
Location Delay type Delay(ns) Physical Resource
Logical Resource(s)
------------------------------------------------- -------------------
M17.I Tiopi 0.885 CLOCK
CLOCK
CLOCK_BUFGP/IBUFG
BUFGCTRL_X0Y31.I0 net (fanout=1) 0.875 CLOCK_BUFGP/IBUFG
BUFGCTRL_X0Y31.O Tbgck 0.900 CLOCK_BUFGP/BUFG
CLOCK_BUFGP/BUFG
SLICE_X174Y368.CLK net (fanout=3) 3.536 CLOCK_BUFGP
------------------------------------------------- ---------------------------
Total 6.196ns (1.785ns logic, 4.411ns route)
(28.8% logic, 71.2% route)
Data Path: count_int_0 to COUNT_OUT<0>
Location Delay type Delay(ns) Physical Resource
Logical Resource(s)
------------------------------------------------- -------------------
SLICE_X174Y368.XQ Tcko 0.360 count_int<0>
count_int_0
G10.O net (fanout=6) 1.399 count_int<0>
G10.PAD Tioop 3.523 COUNT_OUT<0>
COUNT_OUT_0_OBUF
COUNT_OUT<0>
------------------------------------------------- ---------------------------
Total 5.282ns (3.883ns logic, 1.399ns route)
(73.5% logic, 26.5% route)
the clock path delay and data path delay is large but the design is simple enough.
beside,once the offset added by increase the offset out to 12ns,the design will fail on post par simulation. if without offset constraints, the design can pass on the post par simulation but with a large delay between the FF and the pad.
lastly,how do determine the correct offset value for an input/output?
thank you..
module counter(CLOCK, ENABLE, COUNT);
input CLOCK;
input ENABLE;
output [3:0] COUNT;
reg [3:0] COUNT = 3'b000;
always @(posedge CLOCK)
if (ENABLE)
COUNT <= COUNT + 1;
else
COUNT <= 3'b000;
endmodule
the constraints :
NET "CLOCK" TNM_NET = "CLOCK";
TIMESPEC "TS_CLOCK" = PERIOD "CLOCK" 5 ns HIGH 50 %;
for behavoural simulation, the output pad COUNT and register COUNT will toggle at the same clock which is the ideal case,
after PAR and run the post PAR simulation, the register COUNT will have around 1.5ns delay with respect to current clock edge and the output pad will delay 6+ns to the same clock edge. the output pad is almost 1 clock cycle delay.
i try to experiment with the offset constraints:
OFFSET = IN 2 ns BEFORE "CLOCK" ;
OFFSET = OUT 10 ns AFTER "CLOCK" ;
but the PAR will return me an error
Slack: -1.478ns (requirement - (clock arrival + clock path + data path + uncertainty))
Source: count_int_0 (FF)
Destination: COUNT_OUT<0> (PAD)
Source Clock: CLOCK_BUFGP rising at 0.000ns
Requirement: 10.000ns
Data Path Delay: 5.282ns (Levels of Logic = 1)
Clock Path Delay: 6.196ns (Levels of Logic = 2)
Clock Uncertainty: 0.000ns
Clock Path: CLOCK to count_int_0
Location Delay type Delay(ns) Physical Resource
Logical Resource(s)
------------------------------------------------- -------------------
M17.I Tiopi 0.885 CLOCK
CLOCK
CLOCK_BUFGP/IBUFG
BUFGCTRL_X0Y31.I0 net (fanout=1) 0.875 CLOCK_BUFGP/IBUFG
BUFGCTRL_X0Y31.O Tbgck 0.900 CLOCK_BUFGP/BUFG
CLOCK_BUFGP/BUFG
SLICE_X174Y368.CLK net (fanout=3) 3.536 CLOCK_BUFGP
------------------------------------------------- ---------------------------
Total 6.196ns (1.785ns logic, 4.411ns route)
(28.8% logic, 71.2% route)
Data Path: count_int_0 to COUNT_OUT<0>
Location Delay type Delay(ns) Physical Resource
Logical Resource(s)
------------------------------------------------- -------------------
SLICE_X174Y368.XQ Tcko 0.360 count_int<0>
count_int_0
G10.O net (fanout=6) 1.399 count_int<0>
G10.PAD Tioop 3.523 COUNT_OUT<0>
COUNT_OUT_0_OBUF
COUNT_OUT<0>
------------------------------------------------- ---------------------------
Total 5.282ns (3.883ns logic, 1.399ns route)
(73.5% logic, 26.5% route)
the clock path delay and data path delay is large but the design is simple enough.
beside,once the offset added by increase the offset out to 12ns,the design will fail on post par simulation. if without offset constraints, the design can pass on the post par simulation but with a large delay between the FF and the pad.
lastly,how do determine the correct offset value for an input/output?
thank you..