data/full_repos/permissive/484765019/Scan Chain/scan_testbench.perl.v
1: b'%Error: Cannot find file containing module: Chain,data/full_repos/permissive/484765019\n        ... Looked in:\n             data/full_repos/permissive/484765019/Scan/Chain,data/full_repos/permissive/484765019\n             data/full_repos/permissive/484765019/Scan/Chain,data/full_repos/permissive/484765019.v\n             data/full_repos/permissive/484765019/Scan/Chain,data/full_repos/permissive/484765019.sv\n             Chain,data/full_repos/permissive/484765019\n             Chain,data/full_repos/permissive/484765019.v\n             Chain,data/full_repos/permissive/484765019.sv\n             obj_dir/Chain,data/full_repos/permissive/484765019\n             obj_dir/Chain,data/full_repos/permissive/484765019.v\n             obj_dir/Chain,data/full_repos/permissive/484765019.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/484765019/Scan\n%Error: Cannot find file containing module: Chain/scan_testbench.perl.v\n%Error: Exiting due to 3 error(s)\n'
module tbench();
 

   reg       scan_phi, scan_phi_bar, scan_data_in, scan_load_chip, scan_load_chain;
   wire      scan_data_out;
 



 

 
   PERL begin

   end       
 

 
   task load_chip;
      begin
         `SCAN_DELAY scan_load_chip = 1;
         `SCAN_DELAY scan_load_chip = 0;
      end
   endtask
 
   task load_chain;
      begin
         `SCAN_DELAY scan_load_chain = 1;
         `SCAN_DELAY scan_phi = 1;
         `SCAN_DELAY scan_phi = 0;
         `SCAN_DELAY scan_phi_bar = 1;
         `SCAN_DELAY scan_phi_bar = 0;
         `SCAN_DELAY scan_load_chain = 0;
      end
   endtask
 
   task rotate_chain;
 
      integer i;
 
      reg [`SCAN_CHAIN_LENGTH-1:0] data_in;
      reg [`SCAN_CHAIN_LENGTH-1:0] data_out;
 
      begin
         PERL begin

         end 
 
         for (i = 0; i < `SCAN_CHAIN_LENGTH; i=i+1) begin
            scan_data_in = data_in[0];
            data_out     = {scan_data_out, data_out[`SCAN_CHAIN_LENGTH-1:1]};
            `SCAN_DELAY scan_phi = 1;
            `SCAN_DELAY scan_phi = 0;
            `SCAN_DELAY scan_phi_bar = 1;
            `SCAN_DELAY scan_phi_bar = 0;
            `SCAN_DELAY data_in = data_in >> 1;
         end
 
         PERL begin

         end 
      end
 
   endtask
 



 



 
   PERL begin

   end
 
   scan scan_dut (
             PERL begin

             end
 

                   .scan_phi        (scan_phi),
                   .scan_phi_bar    (scan_phi_bar),
                   .scan_data_in    (scan_data_in),
                   .scan_data_out   (scan_data_out),
                   .scan_load_chip  (scan_load_chip),
                   .scan_load_chain (scan_load_chain)
                   );
 
 



 
   initial begin
 
      $dumpvars(0, tbench);
 
      $display("Starting scan chain test");
 
      scan_phi  = 0;
      scan_phi_bar = 0;
      scan_data_in = 0;
      scan_load_chip = 0;
      scan_load_chain = 0;  
 
      scan_reset = 1'b1;
 
      rotate_chain();      
      load_chip();
 

      if (chip_internal_write_data_1 !== 1'd0 || 
          chip_internal_write_data_2 !== 2'd3 ||
          chip_internal_write_data_3 !== 3'd0 ||
          chip_internal_write_data_array !== 16'hAA55
          ) begin
         $display("RESET TEST FAILED");
         $finish;
      end else begin
        $display("RESET TEST PASSED");
      end
 

      scan_reset = 1'b0;
 
      write_data_1 = 1'd1;
      write_data_2 = 2'd2;
      write_data_3 = 3'd3;
 
      write_data_array_addr = 2'd2;
      write_data_array_data = 4'hB;
 
      rotate_chain();      
      load_chip();
 

      if (chip_internal_write_data_1     !== 1'd1 ||
          chip_internal_write_data_2     !== 2'd2 ||
          chip_internal_write_data_3     !== 3'd3 ||
          chip_internal_write_data_array !== 16'hAB55) begin
         $display("TEST 1 FAILED");
         $display("%d %d %d %h", 
                  chip_internal_write_data_1,
                  chip_internal_write_data_2,
                  chip_internal_write_data_3,
                  chip_internal_write_data_array);
         $finish;
      end else
        $display("TEST 1 PASSED");
 

      chip_internal_read_data_1 = 1'd0;
      chip_internal_read_data_2 = 2'd3;
      chip_internal_read_data_3 = 3'd5;
 
      chip_internal_read_data_array = 16'hABCD;
 

      read_data_array_addr = 2'd1;
 
      rotate_chain();
      load_chain();
      rotate_chain();
 

      if (write_data_1_read         !== 1'd1 ||
          write_data_2_read         !== 2'd2 ||
          write_data_3_read         !== 3'd3 ||
          read_data_1_read          !== 1'd0 ||
          read_data_2_read          !== 2'd3 ||
          read_data_3_read          !== 3'd5 ||
          read_data_array_data_read !== 4'hC) begin
         $display("TEST 2 FAILED");
         $display("%d %d %d %d %d %d %h", 
                  write_data_1_read,
                  write_data_2_read,
                  write_data_3_read,
                  read_data_1_read,
                  read_data_2_read,
                  read_data_3_read,
                  read_data_array_data_read);
         $finish;
      end else
        $display("TEST 2 PASSED");
 
      $finish;
   end
 

 
endmodule
module tbench();

 

   reg       scan_phi, scan_phi_bar, scan_data_in, scan_load_chip, scan_load_chain;
   wire      scan_data_out;
 



 

 
   PERL begin

   end       
 

 
   task load_chip;
      begin
         `SCAN_DELAY scan_load_chip = 1;
         `SCAN_DELAY scan_load_chip = 0;
      end
   endtask
 
   task load_chain;
      begin
         `SCAN_DELAY scan_load_chain = 1;
         `SCAN_DELAY scan_phi = 1;
         `SCAN_DELAY scan_phi = 0;
         `SCAN_DELAY scan_phi_bar = 1;
         `SCAN_DELAY scan_phi_bar = 0;
         `SCAN_DELAY scan_load_chain = 0;
      end
   endtask
 
   task rotate_chain;
 
      integer i;
 
      reg [`SCAN_CHAIN_LENGTH-1:0] data_in;
      reg [`SCAN_CHAIN_LENGTH-1:0] data_out;
 
      begin
         PERL begin

         end 
 
         for (i = 0; i < `SCAN_CHAIN_LENGTH; i=i+1) begin
            scan_data_in = data_in[0];
            data_out     = {scan_data_out, data_out[`SCAN_CHAIN_LENGTH-1:1]};
            `SCAN_DELAY scan_phi = 1;
            `SCAN_DELAY scan_phi = 0;
            `SCAN_DELAY scan_phi_bar = 1;
            `SCAN_DELAY scan_phi_bar = 0;
            `SCAN_DELAY data_in = data_in >> 1;
         end
 
         PERL begin

         end 
      end
 
   endtask
 



 



 
   PERL begin

   end
 
   scan scan_dut (
             PERL begin

             end
 

                   .scan_phi        (scan_phi),
                   .scan_phi_bar    (scan_phi_bar),
                   .scan_data_in    (scan_data_in),
                   .scan_data_out   (scan_data_out),
                   .scan_load_chip  (scan_load_chip),
                   .scan_load_chain (scan_load_chain)
                   );
 
 



 
   initial begin
 
      $dumpvars(0, tbench);
 
      $display("Starting scan chain test");
 
      scan_phi  = 0;
      scan_phi_bar = 0;
      scan_data_in = 0;
      scan_load_chip = 0;
      scan_load_chain = 0;  
 
      scan_reset = 1'b1;
 
      rotate_chain();      
      load_chip();
 

      if (chip_internal_write_data_1 !== 1'd0 || 
          chip_internal_write_data_2 !== 2'd3 ||
          chip_internal_write_data_3 !== 3'd0 ||
          chip_internal_write_data_array !== 16'hAA55
          ) begin
         $display("RESET TEST FAILED");
         $finish;
      end else begin
        $display("RESET TEST PASSED");
      end
 

      scan_reset = 1'b0;
 
      write_data_1 = 1'd1;
      write_data_2 = 2'd2;
      write_data_3 = 3'd3;
 
      write_data_array_addr = 2'd2;
      write_data_array_data = 4'hB;
 
      rotate_chain();      
      load_chip();
 

      if (chip_internal_write_data_1     !== 1'd1 ||
          chip_internal_write_data_2     !== 2'd2 ||
          chip_internal_write_data_3     !== 3'd3 ||
          chip_internal_write_data_array !== 16'hAB55) begin
         $display("TEST 1 FAILED");
         $display("%d %d %d %h", 
                  chip_internal_write_data_1,
                  chip_internal_write_data_2,
                  chip_internal_write_data_3,
                  chip_internal_write_data_array);
         $finish;
      end else
        $display("TEST 1 PASSED");
 

      chip_internal_read_data_1 = 1'd0;
      chip_internal_read_data_2 = 2'd3;
      chip_internal_read_data_3 = 3'd5;
 
      chip_internal_read_data_array = 16'hABCD;
 

      read_data_array_addr = 2'd1;
 
      rotate_chain();
      load_chain();
      rotate_chain();
 

      if (write_data_1_read         !== 1'd1 ||
          write_data_2_read         !== 2'd2 ||
          write_data_3_read         !== 3'd3 ||
          read_data_1_read          !== 1'd0 ||
          read_data_2_read          !== 2'd3 ||
          read_data_3_read          !== 3'd5 ||
          read_data_array_data_read !== 4'hC) begin
         $display("TEST 2 FAILED");
         $display("%d %d %d %d %d %d %h", 
                  write_data_1_read,
                  write_data_2_read,
                  write_data_3_read,
                  read_data_1_read,
                  read_data_2_read,
                  read_data_3_read,
                  read_data_array_data_read);
         $finish;
      end else
        $display("TEST 2 PASSED");
 
      $finish;
   end
 

 
endmodule