data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/knns_td/taxicab_distance.v
1: b"%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/knns_td/taxicab_distance.v:3: Unsupported: SystemVerilog 2005 reserved word not implemented: 'dist'\n output [N+1:0] dist\n                ^~~~\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/knns_td/taxicab_distance.v:4: syntax error, unexpected ')', expecting IDENTIFIER or '[' or do or final\n);\n^\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/knns_td/taxicab_distance.v:11: syntax error, unexpected IDENTIFIER\nSUB_1 #(.N(N)) diff_x12 (.A(x1), .B(x2), .D(dist_x12));\n^~~~~\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/knns_td/taxicab_distance.v:24: Unsupported: SystemVerilog 2005 reserved word not implemented: 'dist'\nADD #(.N(N+1))t_d (.A(dist_xabs), .B(dist_yabs), .CI(1'b0), .S(dist[N:0]), .CO(dist[N+1]));\n                                                               ^~~~\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/knns_td/taxicab_distance.v:24: Unsupported: SystemVerilog 2005 reserved word not implemented: 'dist'\nADD #(.N(N+1))t_d (.A(dist_xabs), .B(dist_yabs), .CI(1'b0), .S(dist[N:0]), .CO(dist[N+1]));\n                                                                               ^~~~\n%Error: Exiting due to 5 error(s)\n        ... See the manual and https://verilator.org for more assistance.\n"
module taxicab_distance #(parameter N = 32)(
	input [N-1:0] x1, y1, x2, y2,
	output [N+1:0] dist
);

wire signed [N:0] dist_x12, dist_x21, dist_xabs, dist_y12, dist_y21, dist_yabs;



SUB_1 #(.N(N)) diff_x12 (.A(x1), .B(x2), .D(dist_x12));
SUB_1 #(.N(N)) diff_x21 (.A(x2), .B(x1), .D(dist_x21));

MUX #(.N(N+1)) abs_x (.A(dist_x12), .B(dist_x21), .S(dist_x12[N]), .O(dist_xabs));



SUB_1 #(.N(N)) diff_y12 (.A(y1), .B(y2), .D(dist_y12));
SUB_1 #(.N(N)) diff_y21 (.A(y2), .B(y1), .D(dist_y21));

MUX #(.N(N+1)) abs_y (.A(dist_y12), .B(dist_y21), .S(dist_y12[N]), .O(dist_yabs));

ADD #(.N(N+1))t_d (.A(dist_xabs), .B(dist_yabs), .CI(1'b0), .S(dist[N:0]), .CO(dist[N+1]));

endmodule
module taxicab_distance #(parameter N = 32)(
	input [N-1:0] x1, y1, x2, y2,
	output [N+1:0] dist
);


wire signed [N:0] dist_x12, dist_x21, dist_xabs, dist_y12, dist_y21, dist_yabs;



SUB_1 #(.N(N)) diff_x12 (.A(x1), .B(x2), .D(dist_x12));
SUB_1 #(.N(N)) diff_x21 (.A(x2), .B(x1), .D(dist_x21));

MUX #(.N(N+1)) abs_x (.A(dist_x12), .B(dist_x21), .S(dist_x12[N]), .O(dist_xabs));



SUB_1 #(.N(N)) diff_y12 (.A(y1), .B(y2), .D(dist_y12));
SUB_1 #(.N(N)) diff_y21 (.A(y2), .B(y1), .D(dist_y21));

MUX #(.N(N+1)) abs_y (.A(dist_y12), .B(dist_y21), .S(dist_y12[N]), .O(dist_yabs));

ADD #(.N(N+1))t_d (.A(dist_xabs), .B(dist_yabs), .CI(1'b0), .S(dist[N:0]), .CO(dist[N+1]));

endmodule