Skip to content

Commit e23c83a

Browse files
committed
make test more complex
1 parent a1ef340 commit e23c83a

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

passes/techmap/lakeroad.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN
120120
read_verilog_args.push_back(out_verilog_filename);
121121
Pass::call(design, read_verilog_args);
122122

123-
log("Replacing module %s with the output of Lakeroad", top_module_name.c_str());
123+
log("Replacing module %s with the output of Lakeroad\n", top_module_name.c_str());
124124
design->remove(module);
125125
auto new_module = design->module(RTLIL::escape_id(temp_module_name));
126126
if (new_module == nullptr)

tests/techmap/lakeroad.ys

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,35 @@
44
read_verilog << EOT
55
(* template = "dsp",
66
architecture = "xilinx-ultrascale-plus",
7-
initiation_interval = 1 *)
7+
initiation_interval = 2 *)
88
module test (
99
(* data *)
10-
input [7:0] a,
10+
input [17:0] a,
1111
(* data *)
12-
input [7:0] b,
12+
input [17:0] b,
13+
(* data *)
14+
input [17:0] c,
15+
(* data *)
16+
input [17:0] d,
1317
(* clk *)
1418
input clk,
1519
(* out *)
16-
output [7:0] o);
20+
output [17:0] o);
1721

18-
reg [7:0] r0;
19-
always @ (posedge clk)
20-
r0 <= a*b;
21-
assign o = r0;
22+
reg [17:0] r0;
23+
reg [17:0] r1;
24+
always @ (posedge clk) begin
25+
r0 <= (d+a)*b&c;
26+
r1 <= r0;
27+
end
28+
assign o = r1;
2229

2330
endmodule
2431
EOT
2532

2633
# Call Lakeroad pass.
2734
lakeroad
2835

29-
# Ensure that one DSP has been instantiated.
30-
select -assert-count 1 */t:DSP48E2
36+
# Ensure there's exactly one cell, and that that cell is a DSP48E2.
37+
select -assert-count 1 */t:*
38+
select -assert-count 1 */t:DSP48E2

0 commit comments

Comments
 (0)