data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v
1: b'%Error: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:31: Unsupported or unknown PLI call: $monitor\n   $monitor("time=%4t op=%4b in1=%16b in2=%16b carry=%1b out=%16b carry_out=%1b", $time, opcode, in1, in2, carry, out, carry_out);\n   ^~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:37: Unsupported: Ignoring delay on this delayed statement.\n      #10 opcode=i;\n      ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:39: Unsupported: Ignoring delay on this delayed statement.\n      #10 carry = 1;\n      ^\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:47: Unsupported: Ignoring delay on this delayed statement.\n       #10;\n       ^\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:51: Unsupported: Ignoring delay on this delayed statement.\n       #10;\n       ^\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:55: Unsupported: Ignoring delay on this delayed statement.\n       #10;\n       ^\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:59: Unsupported: Ignoring delay on this delayed statement.\n       #10;\n       ^\n%Warning-STMTDLY: data/full_repos/permissive/420726213/verilog/dv/tb/alu_tb.v:62: Unsupported: Ignoring delay on this delayed statement.\n   #10 $stop;\n   ^\n%Error: Exiting due to 1 error(s), 7 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module alu_tb();

parameter DATA_WIDTH = 16;

reg [3:0] opcode;
reg [DATA_WIDTH-1:0] in1;
reg [DATA_WIDTH-1:0] in2;
reg carry;
wire [DATA_WIDTH-1:0] out;
wire carry_out;

alu #(
   .DATA_WIDTH(DATA_WIDTH)
) alu_dut (
   .opcode(opcode),
   .in1(in1),
   .in2(in2),
   .carry(carry),
   .out(out),
   .carry_out(carry_out)
);

integer i;

initial begin
   $monitor("time=%4t op=%4b in1=%16b in2=%16b carry=%1b out=%16b carry_out=%1b", $time, opcode, in1, in2, carry, out, carry_out);

   in1 = 16'b0011001100110011;

   in2 = 16'b101;
   for (i=0; i<16; i=i+1) begin
      #10 opcode=i;
          carry = 0;
      #10 carry = 1;
   end

   opcode = 15;
   in2 = 0;
   carry = 1;
   for (i=0; i<18; i=i+1) begin
       in1 = i;
       #10;
   end
   for (i=17; i>=0; i=i-1) begin
       in1 = ~i & {1'b0, {(15){1'b1}}};
       #10;
   end
   for (i=0; i<18; i=i+1) begin
       in1 = i | {1'b1, {(15){1'b0}}};
       #10;
   end
   for (i=17; i>=0; i=i-1) begin
       in1 = ~i;
       #10;
   end

   #10 $stop;
end

endmodule
module alu_tb();


parameter DATA_WIDTH = 16;

reg [3:0] opcode;
reg [DATA_WIDTH-1:0] in1;
reg [DATA_WIDTH-1:0] in2;
reg carry;
wire [DATA_WIDTH-1:0] out;
wire carry_out;

alu #(
   .DATA_WIDTH(DATA_WIDTH)
) alu_dut (
   .opcode(opcode),
   .in1(in1),
   .in2(in2),
   .carry(carry),
   .out(out),
   .carry_out(carry_out)
);

integer i;

initial begin
   $monitor("time=%4t op=%4b in1=%16b in2=%16b carry=%1b out=%16b carry_out=%1b", $time, opcode, in1, in2, carry, out, carry_out);

   in1 = 16'b0011001100110011;

   in2 = 16'b101;
   for (i=0; i<16; i=i+1) begin
      #10 opcode=i;
          carry = 0;
      #10 carry = 1;
   end

   opcode = 15;
   in2 = 0;
   carry = 1;
   for (i=0; i<18; i=i+1) begin
       in1 = i;
       #10;
   end
   for (i=17; i>=0; i=i-1) begin
       in1 = ~i & {1'b0, {(15){1'b1}}};
       #10;
   end
   for (i=0; i<18; i=i+1) begin
       in1 = i | {1'b1, {(15){1'b0}}};
       #10;
   end
   for (i=17; i>=0; i=i-1) begin
       in1 = ~i;
       #10;
   end

   #10 $stop;
end

endmodule