-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdc: Add test for missing arguments in read_sdc command
Signed-off-by: Tomasz Michalak <[email protected]>
- Loading branch information
Showing
4 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
sdc-plugin/tests/sdc_errors_missing_arguments/sdc_errors_missing_arguments.input.sdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
create_clock -period 10.0 |
13 changes: 13 additions & 0 deletions
13
sdc-plugin/tests/sdc_errors_missing_arguments/sdc_errors_missing_arguments.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
yosys -import | ||
if { [info procs read_sdc] == {} } { plugin -i sdc } | ||
yosys -import ;# ingest plugin commands | ||
|
||
read_verilog $::env(DESIGN_TOP).v | ||
read_verilog -specify -lib -D_EXPLICIT_CARRY +/xilinx/cells_sim.v | ||
read_verilog -lib +/xilinx/cells_xtra.v | ||
hierarchy -check -auto-top | ||
# Start flow after library reading | ||
synth_xilinx -flatten -abc9 -nosrl -nodsp -iopad -run prepare:check | ||
|
||
# Read the design's timing constraints | ||
read_sdc $::env(DESIGN_TOP).input.sdc |
66 changes: 66 additions & 0 deletions
66
sdc-plugin/tests/sdc_errors_missing_arguments/sdc_errors_missing_arguments.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (C) 2020-2021 The SymbiFlow Authors. | ||
// | ||
// Use of this source code is governed by a ISC-style | ||
// license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/ISC | ||
// | ||
// SPDX-License-Identifier:ISC | ||
|
||
module top ( | ||
input clk, | ||
input clk2, | ||
input [1:0] in, | ||
output [5:0] out | ||
); | ||
|
||
reg [1:0] cnt = 0; | ||
wire clk_int_1, clk_int_2; | ||
IBUF ibuf_proxy ( | ||
.I(clk), | ||
.O(ibuf_proxy_out) | ||
); | ||
IBUF ibuf_inst ( | ||
.I(ibuf_proxy_out), | ||
.O(ibuf_out) | ||
); | ||
assign clk_int_1 = ibuf_out; | ||
assign clk_int_2 = clk_int_1; | ||
|
||
always @(posedge clk_int_2) begin | ||
cnt <= cnt + 1; | ||
end | ||
|
||
middle middle_inst_1 ( | ||
.clk(ibuf_out), | ||
.out(out[2]) | ||
); | ||
middle middle_inst_2 ( | ||
.clk(clk_int_1), | ||
.out(out[3]) | ||
); | ||
middle middle_inst_3 ( | ||
.clk(clk_int_2), | ||
.out(out[4]) | ||
); | ||
middle middle_inst_4 ( | ||
.clk(clk2), | ||
.out(out[5]) | ||
); | ||
|
||
assign out[1:0] = {cnt[0], in[0]}; | ||
endmodule | ||
|
||
module middle ( | ||
input clk, | ||
output out | ||
); | ||
|
||
reg [1:0] cnt = 0; | ||
wire clk_int; | ||
assign clk_int = clk; | ||
always @(posedge clk_int) begin | ||
cnt <= cnt + 1; | ||
end | ||
|
||
assign out = cnt[0]; | ||
endmodule |