Before running the below command you must edit deps.py at machop/mase_components/deps.py and replace line 63 with this "conv/convolution": ["conv", "linear", "common", "fixed_arithmetic", "cast"], The effect of this is to add the cast directories so it can find the fixed rounding module.
/workspace/machop/mase_cocotb/runner.py:9: UserWarning: Python runners and associated APIs are an experimental feature and subject to change.
from cocotb.runner import get_runner, get_results
%Warning-SELRANGE: /workspace/machop/mase_components/linear/rtl/fixed_linear.sv:188:37: Selection index out of range: 2 outside 1:0
: ... note: In instance 'convolution.fl_instance'
188 | .data_out (data_out_0[i])
| ^
/workspace/machop/mase_components/conv/rtl/convolution.sv:178:1: ... note: In file included from 'convolution.sv'
... For warning description see https://verilator.org/warn/SELRANGE?v=5.020
... Use "/* verilator lint_off SELRANGE */" and lint_on around source to disable this message.
%Warning-SELRANGE: /workspace/machop/mase_components/linear/rtl/fixed_linear.sv:188:37: Selection index out of range: 3 outside 1:0
: ... note: In instance 'convolution.fl_instance'
188 | .data_out (data_out_0[i])
| ^
/workspace/machop/mase_components/conv/rtl/convolution.sv:178:1: ... note: In file included from 'convolution.sv'
%Error: /workspace/machop/mase_components/conv/rtl/convolution.sv:180:15: Slices of arrays in assignments have different unpacked dimensions, 16 versus 8
: ... note: In instance 'convolution'
180 | .weight(ib_weight),
| ^~~~~~~~~
%Error: /workspace/machop/mase_components/linear/rtl/fixed_linear.sv:167:19: Slices of arrays in assignments have different unpacked dimensions, 4 versus 2
: ... note: In instance 'convolution.fl_instance'
167 | .data_in (bias),
| ^~~~
/workspace/machop/mase_components/conv/rtl/convolution.sv:178:1: ... note: In file included from 'convolution.sv'
-Info: Command Line disabled gate optimization with -fno-gate. This may cause ordering problems.
%Error: Exiting due to 2 error(s)
x = tensor([[[[247, 240, 22],
[240, 8, 238],
[233, 234, 211],
[243, 212, 253]],
[[252, 27, 222],
[ 0, 226, 7],
[ 25, 26, 246],
[ 92, 181, 254]]]], dtype=torch.int32)
weight = Parameter containing:
tensor([[[[-0.0022, 0.1549],
[-0.2376, -0.2124],
[-0.1112, 0.0774]],
[[-0.0057, 0.2289],
[-0.0256, 0.0764],
[-0.0872, -0.0567]]],
[[[-0.2758, -0.1912],
[-0.1190, 0.0107],
[ 0.1141, 0.1732]],
[[-0.1957, -0.1257],
[ 0.1049, 0.2397],
[-0.0594, 0.2160]]],
[[[-0.0465, 0.0305],
[ 0.2614, -0.2678],
[-0.1817, -0.0731]],
[[-0.1125, 0.2494],
[-0.1871, -0.1329],
[-0.2017, -0.2704]]],
[[[-0.1685, 0.2481],
[ 0.1288, 0.1399],
[ 0.0152, -0.1480]],
[[ 0.0488, -0.2695],
[-0.2086, -0.1488],
[ 0.1821, 0.1693]]]], requires_grad=True)
bias = Parameter containing:
tensor([-0.1280, -0.0104, 0.1846, 0.2870], requires_grad=True)
weight = tensor([[[[ 0, 1],
[254, 254],
[255, 1]],
[[ 0, 2],
[ 0, 1],
[255, 0]]],
[[[254, 254],
[255, 0],
[ 1, 1]],
[[254, 255],
[ 1, 2],
[ 0, 2]]],
[[[ 0, 0],
[ 2, 254],
[255, 255]],
[[255, 2],
[255, 255],
[254, 254]]],
[[[255, 2],
[ 1, 1],
[ 0, 255]],
[[ 0, 254],
[254, 255],
[ 1, 1]]]], dtype=torch.int32)
bias = tensor([255, 0, 1, 2], dtype=torch.int32)
tensor([[[[63, 0],
[63, 59],
[ 9, 1]],
[[63, 60],
[ 3, 55],
[13, 4]],
[[ 2, 1],
[ 0, 1],
[ 0, 61]],
[[ 1, 63],
[ 2, 16],
[52, 5]]]], dtype=torch.int32)
/workspace/machop/mase_components/conv/test/build/convolution
##########################################
#### TEST 0 : {'DATA_WIDTH': 8, 'DATA_FRAC_WIDTH': 3, 'W_WIDTH': 8, 'W_FRAC_WIDTH': 3, 'BIAS_WIDTH': 8, 'BIAS_FRAC_WIDTH': 3, 'OUT_WIDTH': 6, 'OUT_FRAC_WIDTH': 2, 'IN_X': 3, 'IN_Y': 4, 'IN_C': 2, 'KERNEL_X': 2, 'KERNEL_Y': 3, 'OUT_C': 4, 'UNROLL_OUT_C': 2, 'UNROLL_IN_C': 2, 'UNROLL_KERNEL_OUT': 4, 'SLIDING_NUM': 6, 'STRIDE': 2, 'PADDING_Y': 2, 'PADDING_X': 1}
##########################################
INFO: Running command perl /usr/local/bin/verilator -cc --exe -Mdir /workspace/machop/mase_components/conv/test/build/convolution/test_0 -DCOCOTB_SIM=1 --top-module convolution --vpi --public-flat-rw --prefix Vtop -o convolution -LDFLAGS '-Wl,-rpath,/usr/local/lib/python3.11/dist-packages/cocotb/libs -L/usr/local/lib/python3.11/dist-packages/cocotb/libs -lcocotbvpi_verilator' -Wno-GENUNNAMED -Wno-WIDTHEXPAND -Wno-WIDTHTRUNC -Wno-UNOPTFLAT -prof-c --stats --trace -O0 -build-jobs 8 -Wno-fatal -Wno-lint -Wno-style -I/workspace/machop/mase_components/conv/rtl -I/workspace/machop/mase_components/linear/rtl -I/workspace/machop/mase_components/common/rtl -I/workspace/machop/mase_components/fixed_arithmetic/rtl -I/workspace/machop/mase_components/cast/rtl -GDATA_WIDTH=8 -GDATA_FRAC_WIDTH=3 -GW_WIDTH=8 -GW_FRAC_WIDTH=3 -GBIAS_WIDTH=8 -GBIAS_FRAC_WIDTH=3 -GOUT_WIDTH=6 -GOUT_FRAC_WIDTH=2 -GIN_X=3 -GIN_Y=4 -GIN_C=2 -GKERNEL_X=2 -GKERNEL_Y=3 -GOUT_C=4 -GUNROLL_OUT_C=2 -GUNROLL_IN_C=2 -GUNROLL_KERNEL_OUT=4 -GSLIDING_NUM=6 -GSTRIDE=2 -GPADDING_Y=2 -GPADDING_X=1 /usr/local/lib/python3.11/dist-packages/cocotb/share/lib/verilator/verilator.cpp /workspace/machop/mase_components/conv/rtl/convolution.sv in directory /workspace/machop/mase_components/conv/test/build/convolution/test_0
Process 'perl' terminated with error 1