0
\$\begingroup\$
module teset(
    input clk,
    input rst ,
    input acc_end,
    input weight_cnt,
    output [4:0] acc_end_cnt_0

);
    reg [4:0] acc_end_cnt;      

always @(posedge clk or negedge rst) begin
    if (rst == 1'b0)
        acc_end_cnt <= 0;
    else  if (acc_end || (weight_cnt == 0 && acc_end_cnt != 0))
        acc_end_cnt <= (acc_end_cnt >= 16) ? 0 : acc_end_cnt + 1;
end

assign acc_end_cnt_0 = acc_end_cnt;

endmodule

This is the code, The function is to update the acc_end_cnt ,when I synthesize in Vivado,the total hold slack is negative,

here are the time.xdc

create_clock -period 5 -name clk  [get_ports clk]

Here are the design timing summary

design timing summary

intra-path-clock

It's strange why the total hold slack is negative when synthesizing, but it becomes positive after implementation

implementation

\$\endgroup\$
1
  • 1
    \$\begingroup\$ It appears you have just a little too much combinatorial logic to execute in the 200MHz clock period. Assuming 'rst' is just a power on reset, i.e. not used dynamically at runtime, then it would be more efficient to remove it entirely from your process and just initialize acc_end_cnt to zero when it is instantiated ( reg [4:0] acc_reg_cnt = 0; ). This may be enough to get your timing to squeak by. Also, although Vivado would be lame to not figure it itself, the term (acc_end_cnt >= 16) simplifies to a single bit (acc_end_cnt[4]). \$\endgroup\$ Commented Aug 9, 2023 at 3:50

1 Answer 1

2
\$\begingroup\$

There is a Question/answer on the Xilinx/AMD support page is very similar to this one.

The last answer at negative-slack-after-synthesis:

Vivado synthesis delay estimates for both cells and routing is quite pessimistic and inaccurate. I almost never pay attention to synthesis timing report given that the synthesis numbers are withing 20-30% of the period you are working with. The first somewhat usable timing values come at place_design stage.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.