Skip to content

Commit 74ce459

Browse files
committed
sdc: Add test for missing arguments in read_sdc command
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
1 parent 7f52181 commit 74ce459

File tree

4 files changed

+85
-1
lines changed

4 files changed

+85
-1
lines changed

sdc-plugin/tests/Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ TESTS = abc9 \
3232
period_check \
3333
waveform_check \
3434
period_format_check \
35-
get_clocks
35+
get_clocks \
36+
sdc_errors_missing_arguments
37+
3638

3739
UNIT_TESTS = escaping
3840

@@ -57,4 +59,6 @@ waveform_check_verify = true
5759
waveform_check_negative = 1
5860
period_format_check_verify = true
5961
period_format_check_negative = 1
62+
sdc_errors_missing_arguments_verify = tail -n 1 sdc_errors_missing_arguments/sdc_errors_missing_arguments.log | grep sdc_errors_missing_arguments.input.sdc:1 > /dev/null
63+
sdc_errors_missing_arguments_negative = 1
6064
get_clocks_verify = $(call diff_test,get_clocks,txt)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
create_clock -period 10.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
yosys -import
2+
if { [info procs read_sdc] == {} } { plugin -i sdc }
3+
yosys -import ;# ingest plugin commands
4+
5+
read_verilog $::env(DESIGN_TOP).v
6+
read_verilog -specify -lib -D_EXPLICIT_CARRY +/xilinx/cells_sim.v
7+
read_verilog -lib +/xilinx/cells_xtra.v
8+
hierarchy -check -auto-top
9+
# Start flow after library reading
10+
synth_xilinx -flatten -abc9 -nosrl -nodsp -iopad -run prepare:check
11+
12+
# Read the design's timing constraints
13+
read_sdc $::env(DESIGN_TOP).input.sdc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright (C) 2020-2021 The SymbiFlow Authors.
2+
//
3+
// Use of this source code is governed by a ISC-style
4+
// license that can be found in the LICENSE file or at
5+
// https://opensource.org/licenses/ISC
6+
//
7+
// SPDX-License-Identifier:ISC
8+
9+
module top (
10+
input clk,
11+
input clk2,
12+
input [1:0] in,
13+
output [5:0] out
14+
);
15+
16+
reg [1:0] cnt = 0;
17+
wire clk_int_1, clk_int_2;
18+
IBUF ibuf_proxy (
19+
.I(clk),
20+
.O(ibuf_proxy_out)
21+
);
22+
IBUF ibuf_inst (
23+
.I(ibuf_proxy_out),
24+
.O(ibuf_out)
25+
);
26+
assign clk_int_1 = ibuf_out;
27+
assign clk_int_2 = clk_int_1;
28+
29+
always @(posedge clk_int_2) begin
30+
cnt <= cnt + 1;
31+
end
32+
33+
middle middle_inst_1 (
34+
.clk(ibuf_out),
35+
.out(out[2])
36+
);
37+
middle middle_inst_2 (
38+
.clk(clk_int_1),
39+
.out(out[3])
40+
);
41+
middle middle_inst_3 (
42+
.clk(clk_int_2),
43+
.out(out[4])
44+
);
45+
middle middle_inst_4 (
46+
.clk(clk2),
47+
.out(out[5])
48+
);
49+
50+
assign out[1:0] = {cnt[0], in[0]};
51+
endmodule
52+
53+
module middle (
54+
input clk,
55+
output out
56+
);
57+
58+
reg [1:0] cnt = 0;
59+
wire clk_int;
60+
assign clk_int = clk;
61+
always @(posedge clk_int) begin
62+
cnt <= cnt + 1;
63+
end
64+
65+
assign out = cnt[0];
66+
endmodule

0 commit comments

Comments
 (0)