data/full_repos/permissive/464389943/verilog/rtl/pwm_blink_mode.v
1: b"%Error: data/full_repos/permissive/464389943/verilog/rtl/pwm_blink_mode.v:42: Cannot find file containing module: 'pwm_standard_mode'\n  pwm_standard_mode #(\n  ^~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/464389943/verilog/rtl,data/full_repos/permissive/464389943/pwm_standard_mode\n             data/full_repos/permissive/464389943/verilog/rtl,data/full_repos/permissive/464389943/pwm_standard_mode.v\n             data/full_repos/permissive/464389943/verilog/rtl,data/full_repos/permissive/464389943/pwm_standard_mode.sv\n             pwm_standard_mode\n             pwm_standard_mode.v\n             pwm_standard_mode.sv\n             obj_dir/pwm_standard_mode\n             obj_dir/pwm_standard_mode.v\n             obj_dir/pwm_standard_mode.sv\n%Error: Exiting due to 1 error(s)\n"
module pwm_blink_mode #(
  parameter Resolution = 16
) (
  input                        clk_i,
  input                        rst_ni,
  input       [Resolution-1:0] threshold_counter_1,
  input       [Resolution-1:0] threshold_counter_2,
  input       [Resolution-1:0] period_counter_1,
  input       [Resolution-1:0] period_counter_2,
  input       [Resolution-1:0] step,
  input       [Resolution-1:0] switch_counter,
  output                       pwm_signal
);

  reg                  output_reg;
  reg [Resolution-1:0] counter;
  reg [Resolution-1:0] threshold_counter;
  reg [Resolution-1:0] period_counter;
  
  pwm_standard_mode #(
    .Resolution(Resolution)
  ) standard_mode_pwm (
    .clk_i              (clk_i),
    .rst_ni             (rst_ni),
    .threshold_counter  (threshold_counter),
    .period_counter     (period_counter),
    .step               (step),
    .pwm_signal         (pwm_signal)
  );
  
  always @(posedge clk_i) begin
    if (rst_ni == 0) begin
      counter           <= 0;
      threshold_counter <= 0;
      period_counter    <= 0;
    end else begin
      if (counter < switch_counter) begin
        counter           <= counter + 1;
        threshold_counter <= threshold_counter_1;
        period_counter    <= period_counter_1;
      end else if (counter >= switch_counter && counter < 2 * switch_counter) begin
        counter           <= counter + 1;
        threshold_counter <= threshold_counter_2;
        period_counter    <= period_counter_2;
      end else begin
        counter           <= 0;
        threshold_counter <= 0;
        period_counter    <= 0;     
      end
    end
        
        
  end
    
  
endmodule
module pwm_blink_mode #(
  parameter Resolution = 16
) (
  input                        clk_i,
  input                        rst_ni,
  input       [Resolution-1:0] threshold_counter_1,
  input       [Resolution-1:0] threshold_counter_2,
  input       [Resolution-1:0] period_counter_1,
  input       [Resolution-1:0] period_counter_2,
  input       [Resolution-1:0] step,
  input       [Resolution-1:0] switch_counter,
  output                       pwm_signal
);


  reg                  output_reg;
  reg [Resolution-1:0] counter;
  reg [Resolution-1:0] threshold_counter;
  reg [Resolution-1:0] period_counter;
  
  pwm_standard_mode #(
    .Resolution(Resolution)
  ) standard_mode_pwm (
    .clk_i              (clk_i),
    .rst_ni             (rst_ni),
    .threshold_counter  (threshold_counter),
    .period_counter     (period_counter),
    .step               (step),
    .pwm_signal         (pwm_signal)
  );
  
  always @(posedge clk_i) begin
    if (rst_ni == 0) begin
      counter           <= 0;
      threshold_counter <= 0;
      period_counter    <= 0;
    end else begin
      if (counter < switch_counter) begin
        counter           <= counter + 1;
        threshold_counter <= threshold_counter_1;
        period_counter    <= period_counter_1;
      end else if (counter >= switch_counter && counter < 2 * switch_counter) begin
        counter           <= counter + 1;
        threshold_counter <= threshold_counter_2;
        period_counter    <= period_counter_2;
      end else begin
        counter           <= 0;
        threshold_counter <= 0;
        period_counter    <= 0;     
      end
    end
        
        
  end
    
  
endmodule