File tree Expand file tree Collapse file tree 5 files changed +91
-1
lines changed
systemverilog-plugin/tests Expand file tree Collapse file tree 5 files changed +91
-1
lines changed Original file line number Diff line number Diff line change 1414#
1515# SPDX-License-Identifier: Apache-2.0
1616
17- TESTS = counter break_continue
17+ TESTS = counter \
18+ break_continue \
19+ separate-compilation
1820
1921include $(shell pwd) /../../Makefile_test.common
2022
2123counter_verify = true
2224break_continue_verify = $(call diff_test,break_continue,out)
25+ separate-compilation_verify = true
Original file line number Diff line number Diff line change 1+ // Copyright 2020-2022 F4PGA Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+ //
15+ // SPDX-License-Identifier: Apache-2.0
16+ module BUF (
17+ input I ,
18+ output O
19+ );
20+ assign O = I ;
21+ endmodule ;
Original file line number Diff line number Diff line change 1+ // Copyright 2020-2022 F4PGA Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+ //
15+ // SPDX-License-Identifier: Apache-2.0
16+ package pkg ;
17+ parameter BITS = 4 ;
18+ parameter LOG2DELAY = 22 ;
19+ endpackage
Original file line number Diff line number Diff line change 1+ yosys -import
2+ if { [info procs read_uhdm] == {} } { plugin -i systemverilog }
3+ yosys -import ;# ingest plugin commands
4+
5+ set TMP_DIR /tmp
6+ if { [info exists ::env(TMPDIR) ] } {
7+ set TMP_DIR $::env(TMPDIR)
8+ }
9+
10+ # Testing simple round-trip
11+ read_systemverilog -odir $TMP_DIR /separate-compilation-test -defer $::env(DESIGN_TOP) -pkg.sv
12+ read_systemverilog -odir $TMP_DIR /separate-compilation-test -defer $::env(DESIGN_TOP) -buf.sv
13+ read_systemverilog -odir $TMP_DIR /separate-compilation-test -defer $::env(DESIGN_TOP) .v
14+ read_systemverilog -odir $TMP_DIR /separate-compilation-test -link
15+ hierarchy
16+ write_verilog
Original file line number Diff line number Diff line change 1+ // Copyright 2020-2022 F4PGA Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+ //
15+ // SPDX-License-Identifier: Apache-2.0
16+ module top (
17+ input clk,
18+ output [3 :0 ] led
19+ );
20+
21+ wire bufg;
22+ BUF bufgctrl (
23+ .I(clk),
24+ .O(bufg)
25+ );
26+ reg [pkg::BITS + pkg::LOG2DELAY- 1 : 0 ] counter = 0 ;
27+ always @(posedge bufg) begin
28+ counter <= counter + 1 ;
29+ end
30+ assign led[3 :0 ] = counter >> pkg::LOG2DELAY;
31+ endmodule
You can’t perform that action at this time.
0 commit comments