Skip to content

Commit fd590d8

Browse files
smunautmattvenn
authored andcommitted
rtl: Use negedge FF at end of scan chain for better hold margin
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
1 parent db18eca commit fd590d8

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/base.sdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
create_clock -name clk_scan_in -period 5 [get_ports {clk_in}]
33
create_generated_clock -name clk_scan_out -source clk_in -combinational [get_ports {clk_out}]
44

5-
# Scan chain input 1.9 ns setup time, -0.1 ns hold time
6-
set_input_delay -min -0.1 -clock [get_clocks clk_scan_in] [get_ports {data_in}]
7-
set_input_delay -max 1.9 -clock [get_clocks clk_scan_in] [get_ports {data_in}]
5+
# Scan chain input 0.5 ns setup time, 0.5 ns hold time
6+
set_input_delay -min 0.5 -clock [get_clocks clk_scan_in] [get_ports {data_in}]
7+
set_input_delay -max 0.5 -clock [get_clocks clk_scan_in] [get_ports {data_in}]
88

9-
# Scan chain output 2.1 ns setup time, 0.1 ns hold time
10-
set_output_delay -min -0.1 -clock [get_clocks clk_scan_out] [get_ports {data_out}]
11-
set_output_delay -max 2.1 -clock [get_clocks clk_scan_out] [get_ports {data_out}]
9+
# Scan chain output 1.5 ns setup time, 1.5 ns hold time
10+
set_output_delay -min -1.5 -clock [get_clocks clk_scan_out] [get_ports {data_out}]
11+
set_output_delay -max 1.5 -clock [get_clocks clk_scan_out] [get_ports {data_out}]
1212

1313
# Misc
1414
set_max_fanout $::env(SYNTH_MAX_FANOUT) [current_design]

template/scan_wrapper.v

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ module scan_wrapper_USER_MODULE_ID (
4545

4646
// scan chain - link all the flops, with data coming from data_in
4747
assign scan_data_in = {scan_data_out[NUM_IOS-2:0], data_in};
48-
49-
// end of the chain is the last scan flop's out
50-
assign data_out = scan_data_out[NUM_IOS-1];
48+
49+
// end of the chain is a negedge FF to increase hold margin between blocks
50+
sky130_fd_sc_hd__dfrtn_1 out_flop (
51+
.RESET_B (1'b1),
52+
.CLK_N (clk),
53+
.D (scan_data_out[NUM_IOS-1]),
54+
.Q (data_out),
55+
.VPWR (1'b1),
56+
.VGND (1'b0)
57+
);
5158

5259
// scan flops have a mux on their inputs to choose either data from the user module or the previous flop's output
5360
// https://antmicro-skywater-pdk-docs.readthedocs.io/en/test-submodules-in-rtd/contents/libraries/sky130_fd_sc_ls/cells/sdfxtp/README.html

0 commit comments

Comments
 (0)