data/full_repos/permissive/187199324/stannel/Disable_tb.v
 line:103: before: "begin"
1: b'%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:1: Cannot find include file: defaults.vh\n`include "defaults.vh" \n         ^~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/187199324/stannel,data/full_repos/permissive/187199324/defaults.vh\n             data/full_repos/permissive/187199324/stannel,data/full_repos/permissive/187199324/defaults.vh.v\n             data/full_repos/permissive/187199324/stannel,data/full_repos/permissive/187199324/defaults.vh.sv\n             defaults.vh\n             defaults.vh.v\n             defaults.vh.sv\n             obj_dir/defaults.vh\n             obj_dir/defaults.vh.v\n             obj_dir/defaults.vh.sv\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:6: Unsupported: Ignoring delay on this delayed statement.\n  always #1 clk = clk !== 1\'b1;\n         ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:11: Define or directive not defined: \'`ADDRESS_BITS\'\n  localparam addrBits = `ADDRESS_BITS;\n                        ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:11: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n  localparam addrBits = `ADDRESS_BITS;\n                                     ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:12: Define or directive not defined: \'`DATA_BITS\'\n  localparam dataBits = `DATA_BITS;\n                        ^~~~~~~~~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:12: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n  localparam dataBits = `DATA_BITS;\n                                  ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:67: syntax error, unexpected \'@\'\n      @(posedge finished)\n      ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:74: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:84: syntax error, unexpected \'@\'\n      @(posedge finished)\n      ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:94: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:104: syntax error, unexpected \'@\'\n      @(posedge finished)\n      ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:111: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:121: syntax error, unexpected \'@\'\n      @(posedge finished)\n      ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:128: syntax error, unexpected end\n    end\n    ^~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:134: Unsupported or unknown PLI call: $dumpfile\n    $dumpfile("Disable_tb.vcd");\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:135: Unsupported or unknown PLI call: $dumpvars\n    $dumpvars(0, Disable_tb);\n    ^~~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:137: Unsupported: Ignoring delay on this delayed statement.\n    #2 reset <= 1;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:139: Unsupported: Ignoring delay on this delayed statement.\n    #3 disableNoSender;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:140: Unsupported: Ignoring delay on this delayed statement.\n    #2 disableSomeSender;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:141: Unsupported: Ignoring delay on this delayed statement.\n    #2 disableWithSomeMessageAlreadyButNotThisChannel;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:142: Unsupported: Ignoring delay on this delayed statement.\n    #2 disableWithSomeMessageAlready;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/187199324/stannel/Disable_tb.v:144: Unsupported: Ignoring delay on this delayed statement.\n    #2 $finish;\n    ^\n%Error: data/full_repos/permissive/187199324/stannel/Disable_tb.v:145: syntax error, unexpected end\n  end\n  ^~~\n%Error: Cannot continue\n'
module Disable_tb();

  reg clk;
  always #1 clk = clk !== 1'b1;


  parameter romFile = "zeroes.hex";

  localparam addrBits = `ADDRESS_BITS;
  localparam dataBits = `DATA_BITS;

  reg  [addrBits-1:0] address;
  reg  [dataBits-1:0] dataIn;
  wire [dataBits-1:0] dataOut;
  reg                 readWriteMode;

  IceRam #(.addrBits(addrBits), .dataBits(dataBits), .romFile(romFile)) memory (
    .clk          (clk),
    .address      (address),
    .readWriteMode(readWriteMode),
    .dataIn       (dataIn),
    .dataOut      (dataOut)
  );


  reg                reset = 0;
  reg                enabled = 0;
  reg [addrBits-1:0] channel = 0;
  reg [dataBits-1:0] message;
  reg [addrBits-1:0] rxPid;

  reg                finished;
  reg                shouldScheduleSender;
  reg [addrBits-1:0] scheduleTxPid;
  reg                hasDeliveredMessage;
  reg [dataBits-1:0] deliveredMessage;
  reg                rxHadMessageInAlt = 0;
  reg                rxHasMessageInAlt;

  Disable #(.addrBits(addrBits), .dataBits(dataBits)) dis0 (
    .clk                     (clk),
    .reset                   (reset),
    .enabled                 (enabled),
    .finished                (finished),
    .address                 (address),
    .readWriteMode           (readWriteMode),
    .dataOut                 (dataOut),
    .dataIn                  (dataIn),
    .channel                 (channel),
    .rxPid                   (rxPid),
    .shouldScheduleSender    (shouldScheduleSender),
    .scheduleTxPid           (scheduleTxPid),
    .hasDeliveredMessage     (hasDeliveredMessage),
    .deliveredMessage        (deliveredMessage),
    .rxHadMessageInAlt       (rxHadMessageInAlt),
    .rxHasMessageInAlt       (rxHasMessageInAlt)
  );

  task disableNoSender;
    begin
      enabled <= 1;
      channel <= 2;
      rxPid <= 7;
      memory.ram[2] <= 7;
      @(posedge finished)
        begin
          enabled <= 0;
          if (shouldScheduleSender) $error("Shouldn't schedule sender, both should wait");
          if (hasDeliveredMessage) $error("Shouldn't have delivered message");
          if (memory.ram[2] != 0) $error("Didn't clear memory");
        end
    end
  endtask

  task disableSomeSender;
    begin
      enabled <= 1;
      channel <= 8;
      memory.ram[8] = 8;
      memory.ram[9] = 42;
      rxPid <= 3;
      @(posedge finished)
        begin
          enabled <= 0;
          if (!shouldScheduleSender) $error("Sender should be scheduled");
          if (scheduleTxPid != 8) $error("Scheduled tx pid not sending pid");
          if (!hasDeliveredMessage) $error("Doesn't have message");
          if (deliveredMessage != 42) $error("Delivered message not as expected");
          if (memory.ram[8] != 0) $error("Memory not zeroed");
          if (!rxHasMessageInAlt) $error("Should have message in alt");
        end
    end
  endtask

  task disableWithSomeMessageAlreadyButNotThisChannel;
    begin
      enabled <= 1;
      rxHadMessageInAlt <= 1;
      channel <= 10;
      rxPid = 12;
      memory.ram[10] = { 8'b0, rxPid };
      @(posedge finished)
        begin
          enabled <= 0;
          if (shouldScheduleSender) $error("Shouldn't be scheduling a sender");
          if (hasDeliveredMessage) $error("Shouldn't have a delivered message");
          if (memory.ram[channel] != 0) $error("Should have cleared memory (not %h)", memory.ram[channel]);
        end
    end
  endtask

  task disableWithSomeMessageAlready;
    begin
      enabled <= 1;
      rxHadMessageInAlt <= 1;
      channel <= 10;
      rxPid <= 12;
      memory.ram[10] <= 13;
      @(posedge finished)
        begin
          enabled <= 0;
          if (shouldScheduleSender) $error("Shouldn't be scheduling a sender");
          if (hasDeliveredMessage) $error("Shouldn't have a delivered message");
          if (memory.ram[channel] != 13) $error("Shouldn't have cleared memory");
        end
    end
  endtask



   initial begin
    $dumpfile("Disable_tb.vcd");
    $dumpvars(0, Disable_tb);

    #2 reset <= 1;

    #3 disableNoSender;
    #2 disableSomeSender;
    #2 disableWithSomeMessageAlreadyButNotThisChannel;
    #2 disableWithSomeMessageAlready;

    #2 $finish;
  end
endmodule
module Disable_tb();


  reg clk;
  always #1 clk = clk !== 1'b1;


  parameter romFile = "zeroes.hex";

  localparam addrBits = `ADDRESS_BITS;
  localparam dataBits = `DATA_BITS;

  reg  [addrBits-1:0] address;
  reg  [dataBits-1:0] dataIn;
  wire [dataBits-1:0] dataOut;
  reg                 readWriteMode;

  IceRam #(.addrBits(addrBits), .dataBits(dataBits), .romFile(romFile)) memory (
    .clk          (clk),
    .address      (address),
    .readWriteMode(readWriteMode),
    .dataIn       (dataIn),
    .dataOut      (dataOut)
  );


  reg                reset = 0;
  reg                enabled = 0;
  reg [addrBits-1:0] channel = 0;
  reg [dataBits-1:0] message;
  reg [addrBits-1:0] rxPid;

  reg                finished;
  reg                shouldScheduleSender;
  reg [addrBits-1:0] scheduleTxPid;
  reg                hasDeliveredMessage;
  reg [dataBits-1:0] deliveredMessage;
  reg                rxHadMessageInAlt = 0;
  reg                rxHasMessageInAlt;

  Disable #(.addrBits(addrBits), .dataBits(dataBits)) dis0 (
    .clk                     (clk),
    .reset                   (reset),
    .enabled                 (enabled),
    .finished                (finished),
    .address                 (address),
    .readWriteMode           (readWriteMode),
    .dataOut                 (dataOut),
    .dataIn                  (dataIn),
    .channel                 (channel),
    .rxPid                   (rxPid),
    .shouldScheduleSender    (shouldScheduleSender),
    .scheduleTxPid           (scheduleTxPid),
    .hasDeliveredMessage     (hasDeliveredMessage),
    .deliveredMessage        (deliveredMessage),
    .rxHadMessageInAlt       (rxHadMessageInAlt),
    .rxHasMessageInAlt       (rxHasMessageInAlt)
  );

  task disableNoSender;
    begin
      enabled <= 1;
      channel <= 2;
      rxPid <= 7;
      memory.ram[2] <= 7;
      @(posedge finished)
        begin
          enabled <= 0;
          if (shouldScheduleSender) $error("Shouldn't schedule sender, both should wait");
          if (hasDeliveredMessage) $error("Shouldn't have delivered message");
          if (memory.ram[2] != 0) $error("Didn't clear memory");
        end
    end
  endtask

  task disableSomeSender;
    begin
      enabled <= 1;
      channel <= 8;
      memory.ram[8] = 8;
      memory.ram[9] = 42;
      rxPid <= 3;
      @(posedge finished)
        begin
          enabled <= 0;
          if (!shouldScheduleSender) $error("Sender should be scheduled");
          if (scheduleTxPid != 8) $error("Scheduled tx pid not sending pid");
          if (!hasDeliveredMessage) $error("Doesn't have message");
          if (deliveredMessage != 42) $error("Delivered message not as expected");
          if (memory.ram[8] != 0) $error("Memory not zeroed");
          if (!rxHasMessageInAlt) $error("Should have message in alt");
        end
    end
  endtask

  task disableWithSomeMessageAlreadyButNotThisChannel;
    begin
      enabled <= 1;
      rxHadMessageInAlt <= 1;
      channel <= 10;
      rxPid = 12;
      memory.ram[10] = { 8'b0, rxPid };
      @(posedge finished)
        begin
          enabled <= 0;
          if (shouldScheduleSender) $error("Shouldn't be scheduling a sender");
          if (hasDeliveredMessage) $error("Shouldn't have a delivered message");
          if (memory.ram[channel] != 0) $error("Should have cleared memory (not %h)", memory.ram[channel]);
        end
    end
  endtask

  task disableWithSomeMessageAlready;
    begin
      enabled <= 1;
      rxHadMessageInAlt <= 1;
      channel <= 10;
      rxPid <= 12;
      memory.ram[10] <= 13;
      @(posedge finished)
        begin
          enabled <= 0;
          if (shouldScheduleSender) $error("Shouldn't be scheduling a sender");
          if (hasDeliveredMessage) $error("Shouldn't have a delivered message");
          if (memory.ram[channel] != 13) $error("Shouldn't have cleared memory");
        end
    end
  endtask



   initial begin
    $dumpfile("Disable_tb.vcd");
    $dumpvars(0, Disable_tb);

    #2 reset <= 1;

    #3 disableNoSender;
    #2 disableSomeSender;
    #2 disableWithSomeMessageAlreadyButNotThisChannel;
    #2 disableWithSomeMessageAlready;

    #2 $finish;
  end
endmodule