Skip to content

Commit de1ff06

Browse files
committed
rtl: Add manual buffer to scan_wrapper
Looking at results from different projects, the buffering on those is a bit inconsitent. So instead we make our own so that hopefully it's the same for all projects. Signed-off-by: Sylvain Munaut <[email protected]>
1 parent 1390ac9 commit de1ff06

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

template/scan_wrapper.v

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,29 @@ module scan_wrapper_USER_MODULE_ID (
1919
output wire scan_select_out,
2020
output wire latch_enable_out
2121
);
22-
23-
assign scan_select_out = scan_select_in;
24-
assign latch_enable_out = latch_enable_in;
25-
assign clk_out = clk_in;
26-
wire clk = clk_in;
22+
23+
// input buffers
24+
// Looking at results from multiple projects the bufferring is a bit
25+
// inconsistent. So instead, we ensure at least clk buf
26+
wire clk;
27+
28+
sky130_fd_sc_hd__clkbuf_2 input_buf_clk (
29+
.A (clk_in),
30+
.X (clk),
31+
.VPWR (1'b1),
32+
.VGND (1'b0)
33+
);
34+
35+
// output buffers
36+
// Same as for input, to try and be more consistent, we make our own
37+
wire data_out_i;
38+
39+
sky130_fd_sc_hd__buf_4 output_buffers[3:0] (
40+
.A ({clk, data_out_i, scan_select_in, latch_enable_in }),
41+
.X ({clk_out, data_out, scan_select_out, latch_enable_out }),
42+
.VPWR (1'b1),
43+
.VGND (1'b0)
44+
);
2745

2846
/*
2947
`ifdef COCOTB
@@ -51,7 +69,7 @@ module scan_wrapper_USER_MODULE_ID (
5169
.RESET_B (1'b1),
5270
.CLK_N (clk),
5371
.D (scan_data_out[NUM_IOS-1]),
54-
.Q (data_out),
72+
.Q (data_out_i),
5573
.VPWR (1'b1),
5674
.VGND (1'b0)
5775
);

0 commit comments

Comments
 (0)