data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm/pwm_tester.v
1: b"%Error: data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm/pwm_tester.v:11: Cannot find file containing module: 'debouncer'\ndebouncer d1(.CLK (CLK), .switch_input (faster_button), .trans_up (s_up));\n^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm,data/full_repos/permissive/198548420/debouncer\n             data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm,data/full_repos/permissive/198548420/debouncer.v\n             data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm,data/full_repos/permissive/198548420/debouncer.sv\n             debouncer\n             debouncer.v\n             debouncer.sv\n             obj_dir/debouncer\n             obj_dir/debouncer.v\n             obj_dir/debouncer.sv\n%Error: data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm/pwm_tester.v:12: Cannot find file containing module: 'debouncer'\ndebouncer d2(.CLK (CLK), .switch_input (slower_button), .trans_up (s_dn));\n^~~~~~~~~\n%Error: data/full_repos/permissive/198548420/nexys4ddr/ch07_pwm/pwm_tester.v:16: Cannot find file containing module: 'pwm'\npwm p(.pwm_clk (prescaler[7]), .duty (duty), .PWM_led (PWM_led), .PWM_pin(JA1), .PWM_CLK_pin(JB1));\n^~~\n%Error: Exiting due to 3 error(s)\n"
module pwm_tester(
    input CLK,
    input faster_button,
    input slower_button,
    output PWM_led,
    output JA1,
    output JB1
    );

wire s_up, s_dn;
debouncer d1(.CLK (CLK), .switch_input (faster_button), .trans_up (s_up));
debouncer d2(.CLK (CLK), .switch_input (slower_button), .trans_up (s_dn));

reg [8:0] duty = 0;
reg [7:0] prescaler = 0;
pwm p(.pwm_clk (prescaler[7]), .duty (duty), .PWM_led (PWM_led), .PWM_pin(JA1), .PWM_CLK_pin(JB1));

always @(posedge CLK)
begin
  prescaler <= prescaler + 1;
  if (s_up)
  begin
    duty <= duty + 5;
  end
  if (s_dn)
  begin
    duty <= duty - 5;
  end  
end

endmodule
module pwm_tester(
    input CLK,
    input faster_button,
    input slower_button,
    output PWM_led,
    output JA1,
    output JB1
    );


wire s_up, s_dn;
debouncer d1(.CLK (CLK), .switch_input (faster_button), .trans_up (s_up));
debouncer d2(.CLK (CLK), .switch_input (slower_button), .trans_up (s_dn));

reg [8:0] duty = 0;
reg [7:0] prescaler = 0;
pwm p(.pwm_clk (prescaler[7]), .duty (duty), .PWM_led (PWM_led), .PWM_pin(JA1), .PWM_CLK_pin(JB1));

always @(posedge CLK)
begin
  prescaler <= prescaler + 1;
  if (s_up)
  begin
    duty <= duty + 5;
  end
  if (s_dn)
  begin
    duty <= duty - 5;
  end  
end

endmodule