Skip to content

Commit dbb0adc

Browse files
committed
lint passing
1 parent f912e86 commit dbb0adc

File tree

9 files changed

+90
-40
lines changed

9 files changed

+90
-40
lines changed

apps/guass-pyramid/ready-val/conv/conv2d_16.v renamed to apps/guass-pyramid/ready-val/conv/1.sv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4823,7 +4823,7 @@ endmodule
48234823
/*verilator lint_on WIDTHTRUNC*/
48244824
/*verilator lint_on UNUSEDSIGNAL*/
48254825
/*verilator lint_on UNDRIVEN*/
4826-
module Conv2d (
4826+
module AetherlingConv #(parameter N = 1) (
48274827
input clk,
48284828
input valid_i,
48294829
input [7:0] I,
@@ -4832,6 +4832,11 @@ module Conv2d (
48324832
output [7:0] O
48334833
);
48344834

4835+
generate
4836+
if (N != 1) $error("Incorrect binding for conv 1: %0d", N);
4837+
endgenerate
4838+
4839+
48354840
logic [7:0] I_0 = I;
48364841
logic [7:0] O_0;
48374842
assign O = O_0;

apps/guass-pyramid/ready-val/conv/conv2d_1.v renamed to apps/guass-pyramid/ready-val/conv/16.sv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12658,7 +12658,7 @@ endmodule
1265812658
/*verilator lint_on WIDTHTRUNC*/
1265912659
/*verilator lint_on UNUSEDSIGNAL*/
1266012660
/*verilator lint_on UNDRIVEN*/
12661-
module Conv2d (
12661+
module AetherlingConv #(parameter N = 16) (
1266212662
input clk,
1266312663
input valid_i,
1266412664
input [15:0][7:0] I,
@@ -12667,6 +12667,10 @@ module Conv2d (
1266712667
output [15:0][7:0] O
1266812668
);
1266912669

12670+
generate
12671+
if (N != 16) $error("Incorrect binding for conv 16: %0d", N);
12672+
endgenerate
12673+
1267012674
logic [7:0] I_0 = I[0];
1267112675
logic [7:0] I_1 = I[1];
1267212676
logic [7:0] I_2 = I[2];

apps/guass-pyramid/ready-val/conv/conv2d_8.v renamed to apps/guass-pyramid/ready-val/conv/2.sv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5356,7 +5356,7 @@ endmodule
53565356
/*verilator lint_on WIDTHTRUNC*/
53575357
/*verilator lint_on UNUSEDSIGNAL*/
53585358
/*verilator lint_on UNDRIVEN*/
5359-
module Conv2d (
5359+
module AetherlingConv#(parameter N = 2) (
53605360
input clk,
53615361
input valid_i,
53625362
input [1:0][7:0] I,
@@ -5373,6 +5373,10 @@ assign O[0] = O_0;
53735373
logic [7:0] O_1;
53745374
assign O[1] = O_1;
53755375

5376+
generate
5377+
if (N != 2) $error("Incorrect binding for conv 2: %0d", N);
5378+
endgenerate
5379+
53765380
top t (
53775381
.clk(clk),
53785382
.valid_up(valid_i),

apps/guass-pyramid/ready-val/conv/conv2d_4.v renamed to apps/guass-pyramid/ready-val/conv/4.sv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6957,7 +6957,7 @@ endmodule
69576957
/*verilator lint_on WIDTHTRUNC*/
69586958
/*verilator lint_on UNUSEDSIGNAL*/
69596959
/*verilator lint_on UNDRIVEN*/
6960-
module Conv2d (
6960+
module AetherlingConv #(parameter N = 4) (
69616961
input clk,
69626962
input valid_i,
69636963
input [3:0][7:0] I,
@@ -6966,6 +6966,10 @@ module Conv2d (
69666966
output [3:0][7:0] O
69676967
);
69686968

6969+
generate
6970+
if (N != 4) $error("Incorrect binding for conv 4: %0d", N);
6971+
endgenerate
6972+
69696973
logic [7:0] I_0 = I[0];
69706974
logic [7:0] I_1 = I[1];
69716975
logic [7:0] I_2 = I[2];

apps/guass-pyramid/ready-val/conv/conv2d_2.v renamed to apps/guass-pyramid/ready-val/conv/8.sv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10537,14 +10537,18 @@ endmodule
1053710537
/*verilator lint_on WIDTHTRUNC*/
1053810538
/*verilator lint_on UNUSEDSIGNAL*/
1053910539
/*verilator lint_on UNDRIVEN*/
10540-
module Conv2d (
10540+
module AetherlingConv #(parameter N = 8) (
1054110541
input clk,
1054210542
input valid_i,
1054310543
output valid_o,
1054410544
input [7:0][7:0] I,
1054510545
output [7:0][7:0] O
1054610546
);
1054710547

10548+
generate
10549+
if (N != 8) $error("Incorrect binding for conv 8: %0d", N);
10550+
endgenerate
10551+
1054810552
logic [7:0] I_0 = I[0];
1054910553
logic [7:0] I_1 = I[1];
1055010554
logic [7:0] I_2 = I[2];
File renamed without changes.
File renamed without changes.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Script to generate pyramid testbench with custom parameters
5+
# Usage: ./gen-pyramid-tb.sh <blur0_n> <blur1_n> <blur_up_n>
6+
7+
usage() {
8+
echo "Usage: $0 <blur0_n> <blur1_n> <blur_up_n>"
9+
echo ""
10+
echo "Generate pyramid testbench SystemVerilog file with custom parameters."
11+
echo ""
12+
echo "Arguments:"
13+
echo " blur0_n - N parameter for Blur0 module (positive integer)"
14+
echo " blur1_n - N parameter for Blur1 module (positive integer)"
15+
echo " blur_up_n - N parameter for BlurUp module (positive integer)"
16+
echo ""
17+
echo "Examples:"
18+
echo " $0 4 4 4 # Fast simulation with small chunks"
19+
echo " $0 16 16 16 # Default parameters"
20+
echo " $0 1 8 16 # Mixed parameters for testing"
21+
echo ""
22+
echo "Output:"
23+
echo " Prints the generated SystemVerilog testbench to stdout"
24+
exit 1
25+
}
26+
27+
validate_param() {
28+
local param_name="$1"
29+
local param_value="$2"
30+
31+
if ! [[ "$param_value" =~ ^[0-9]+$ ]] || [ "$param_value" -eq 0 ]; then
32+
echo "Error: $param_name must be a positive integer, got: '$param_value'" >&2
33+
exit 1
34+
fi
35+
}
36+
37+
# Check if we have exactly 3 arguments
38+
if [ $# -ne 3 ]; then
39+
echo "Error: Expected exactly 3 arguments, got $#" >&2
40+
echo "" >&2
41+
usage
42+
fi
43+
44+
# Extract and validate parameters
45+
blur0_n="$1"
46+
blur1_n="$2"
47+
blur_up_n="$3"
48+
49+
validate_param "blur0_n" "$blur0_n"
50+
validate_param "blur1_n" "$blur1_n"
51+
validate_param "blur_up_n" "$blur_up_n"
52+
53+
# Check if source file exists
54+
source_file="tests/pyramid_tb.sv"
55+
if [ ! -f "$source_file" ]; then
56+
echo "Error: Source file '$source_file' not found" >&2
57+
echo "Make sure you're running this script from the correct directory" >&2
58+
exit 1
59+
fi
60+
61+
# Generate the testbench by substituting parameters
62+
sed "s/parameter Blur0_N = 16;/parameter Blur0_N = $blur0_n;/" "$source_file" | \
63+
sed "s/parameter Blur1_N = 16;/parameter Blur1_N = $blur1_n;/" | \
64+
sed "s/parameter BlurUp_N = 16;/parameter BlurUp_N = $blur_up_n;/"

apps/guass-pyramid/ready-val/valid-hold.sv

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -71,41 +71,6 @@ assign out = val;
7171

7272
endmodule
7373

74-
// Wrapper for aetherling module that accepts N chunks at a time for a 16x16
75-
/* verilator lint_off UNDRIVEN */
76-
/* verilator lint_off UNUSED */
77-
module AetherlingConv#(
78-
parameter N = 16
79-
) (
80-
input logic clk,
81-
input logic reset,
82-
83-
input logic[N-1:0][7:0] in,
84-
input logic valid_i,
85-
86-
output logic[N-1:0][7:0] out,
87-
output logic valid_o
88-
);
89-
generate
90-
// Increment by two
91-
for (genvar i = 0; i < N; i++) begin : Loop
92-
always_ff @(posedge clk) begin
93-
if (reset) out[i] <= '0;
94-
else out[i] <= in[i] + 2;
95-
end
96-
end
97-
98-
always_ff @(posedge clk) begin
99-
if (reset) valid_o <= '0;
100-
else valid_o <= valid_i;
101-
end
102-
103-
endgenerate
104-
105-
endmodule
106-
/* verilator lint_on UNUSED */
107-
/* verilator lint_on UNDRIVEN */
108-
10974
module Conv2D#(
11075
parameter N = 16
11176
) (

0 commit comments

Comments
 (0)