99synth_quicklogic -family qlf_k6n10f -top top
1010select -assert-count 1 t:dff
1111
12+ design -reset
13+ # test: acceptable for output IOFF promotion
14+ read_verilog <<EOF
15+ module top (input clk, input [3:0] a, output reg [3:0] o);
16+ always @(posedge clk) begin
17+ o <= ~a;
18+ end
19+ endmodule
20+ EOF
21+ synth_quicklogic -family qlf_k6n10f -top top
22+ select -assert-count 4 t:dff
23+
1224design -reset
1325# test: acceptable for input IOFF promotion
1426read_verilog <<EOF
2335synth_quicklogic -family qlf_k6n10f -top top
2436select -assert-count 1 t:dff
2537
38+ design -reset
39+ # test: acceptable for input IOFF promotion
40+ read_verilog <<EOF
41+ module top (input clk, input [3:0] a, output [3:0] o);
42+ reg [3:0] r;
43+ always @(posedge clk) begin
44+ r <= a;
45+ end
46+ assign o = ~r;
47+ endmodule
48+ EOF
49+ synth_quicklogic -family qlf_k6n10f -top top
50+ select -assert-count 4 t:dff
51+
2652design -reset
2753# test: acceptable for either IOFF promotion
2854read_verilog <<EOF
4773synth_quicklogic -family qlf_k6n10f -top top
4874select -assert-count 0 t:dff
4975
76+ design -reset
77+ # test: not acceptable for output IOFF promotion: output signal is used
78+ read_verilog <<EOF
79+ module top (input clk, input [3:0] a, output reg [3:0] o);
80+ always @(posedge clk) begin
81+ o <= ~a | o;
82+ end
83+ endmodule
84+ EOF
85+ synth_quicklogic -family qlf_k6n10f -top top
86+ select -assert-count 0 t:dff
87+
5088design -reset
5189# test: not acceptable for input IOFF promotion: input signal is used
5290read_verilog <<EOF
62100synth_quicklogic -family qlf_k6n10f -top top
63101select -assert-count 0 t:dff
64102
103+ design -reset
104+ # test: not acceptable for input IOFF promotion: input signal is used
105+ read_verilog <<EOF
106+ module top (input clk, input [3:0] a, output [3:0] o, output [3:0] p);
107+ reg [3:0] r;
108+ always @(posedge clk) begin
109+ r <= a;
110+ end
111+ assign o = ~r;
112+ assign p = ~a;
113+ endmodule
114+ EOF
115+ synth_quicklogic -family qlf_k6n10f -top top
116+ select -assert-count 0 t:dff
117+
65118design -reset
66119# test: not acceptable for IOFF promotion: FF has reset
67120read_verilog <<EOF
77130synth_quicklogic -family qlf_k6n10f -top top
78131select -assert-count 0 t:dff
79132
133+ design -reset
134+ # test: not acceptable for IOFF promotion: FF has reset
135+ read_verilog <<EOF
136+ module top (input clk, input rst, input [3:0] a, output reg [3:0] o);
137+ always @(posedge clk) begin
138+ if (rst)
139+ o <= 4'b0;
140+ else
141+ o <= a;
142+ end
143+ endmodule
144+ EOF
145+ synth_quicklogic -family qlf_k6n10f -top top
146+ select -assert-count 0 t:dff
147+
80148design -reset
81149# test: not acceptable for IOFF promotion: FF has enable
82150read_verilog <<EOF
@@ -89,3 +157,16 @@ endmodule
89157EOF
90158synth_quicklogic -family qlf_k6n10f -top top
91159select -assert-count 0 t:dff
160+
161+ design -reset
162+ # test: not acceptable for IOFF promotion: FF has enable
163+ read_verilog <<EOF
164+ module top (input clk, input en, input [3:0] a, output reg [3:0] o);
165+ always @(posedge clk) begin
166+ if (en)
167+ o <= a;
168+ end
169+ endmodule
170+ EOF
171+ synth_quicklogic -family qlf_k6n10f -top top
172+ select -assert-count 0 t:dff
0 commit comments