data/full_repos/permissive/105948944/sources/H_Bridge_v3.v
 line:141: before: "."
1: b"%Error: data/full_repos/permissive/105948944/sources/H_Bridge_v3.v:142: Cannot find file containing module: 'PWM_v3'\n    PWM_v3 pwmH_Bridge1(      \n    ^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/105948944/sources,data/full_repos/permissive/105948944/PWM_v3\n             data/full_repos/permissive/105948944/sources,data/full_repos/permissive/105948944/PWM_v3.v\n             data/full_repos/permissive/105948944/sources,data/full_repos/permissive/105948944/PWM_v3.sv\n             PWM_v3\n             PWM_v3.v\n             PWM_v3.sv\n             obj_dir/PWM_v3\n             obj_dir/PWM_v3.v\n             obj_dir/PWM_v3.sv\n%Error: data/full_repos/permissive/105948944/sources/H_Bridge_v3.v:150: Cannot find file containing module: 'PWM_v3'\n     PWM_v3 pwmH_Bridge2(      \n     ^~~~~~\n%Error: data/full_repos/permissive/105948944/sources/H_Bridge_v3.v:158: Cannot find file containing module: 'PWM_v3'\n      PWM_v3 customClock (\n      ^~~~~~\n%Error: data/full_repos/permissive/105948944/sources/H_Bridge_v3.v:164: Cannot find file containing module: 'currentSensing'\n    currentSensing currentSense(\n    ^~~~~~~~~~~~~~\n%Error: Exiting due to 4 error(s)\n"
module H_Bridge_v3(
    input clock,
    input [1:0] currentSensing_in,
    input [3:0] INs_from_decisionMakin,  
    input [2:0] forwardSpeed,
    input [5:0] turningSpeeds,


    input [3:0] movDirec_isTurning_leftRight,
    input [5:0] previousSpeedFromDecisionMaking,
    output [5:0] previousSpeedToDecisionMakin,
    output enA, enB, in1, in2, in3, in4,
    output LED_currentSense_debug,
    output[3:0]  previous_movDirec_isTurning_leftRight_toDecMak
    );
    






    parameter MOVING_FORWARD = 4'b1100;
    parameter TURNING_LEFT = 4'b1110;
    parameter TURNING_RIGHT = 4'b1111;
    parameter STOPPING  =   4'B0100;
    parameter WEIRD_COMBINATIONS  =   4'b1001;
    
    parameter MOVING_REVERSE = 4'b1000;
    parameter TURNING_LEFT_REVERSE = 4'b1011;
    parameter TURNING_RIGHT_REVERSE = 4'b1010;


    reg [3:0] INs_from_decisionMakin_reg;
    reg [3:0] movDirec_isTurning_leftRight_reg;




    
    
    reg [5:0] motorSpeeds_reg;

    reg currentSensing_reg;
    wire currentSensing_wire;
    wire customClock_wire;
  


    always@(posedge customClock_wire) begin
        currentSensing_reg <= 0;
        
        if (currentSensing_wire)
            currentSensing_reg <= 1;
        else
            currentSensing_reg <= 0;
            
                  case(movDirec_isTurning_leftRight)
                    4'b1110 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[5:3];
                        motorSpeeds_reg[5:3] = turningSpeeds[2:0];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1111 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[2:0];
                        motorSpeeds_reg[5:3] = turningSpeeds[5:3];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b0000,
                    4'b0001,
                    4'b0010,
                    4'b0011,
                    4'b0100,
                    4'b0101,
                    4'b0110,
                    4'b0111 : begin
                        motorSpeeds_reg = 6'b000000;
                        INs_from_decisionMakin_reg = 4'b0000;
                    end
                    4'b1100,
                    4'b1101 : begin
                        motorSpeeds_reg = {forwardSpeed,forwardSpeed};
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1000 : begin
                        motorSpeeds_reg = {forwardSpeed,forwardSpeed};
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1001 : begin
                        motorSpeeds_reg = previousSpeedFromDecisionMaking;
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1011 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[5:3];
                        motorSpeeds_reg[5:3] = turningSpeeds[2:0];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    
                    4'b1010 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[2:0];
                        motorSpeeds_reg[5:3] = turningSpeeds[5:3];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    default : begin
                         INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                  endcase                  
            if (currentSensing_reg) begin
                motorSpeeds_reg = 6'b000000;
                INs_from_decisionMakin_reg = 4'b0000;
            end
            else begin
                motorSpeeds_reg = motorSpeeds_reg;
                INs_from_decisionMakin_reg = INs_from_decisionMakin;
            end 
    end
    

    defparam pwmH_Bridge2.PERIOD = 28'd125000;
    PWM_v3 pwmH_Bridge1(      
        .clock(clock),
        .dutyCycle(motorSpeeds_reg[2:0]),
        .PWM_pulse(enA)
     );
    

    defparam pwmH_Bridge2.PERIOD = 28'd125000;  
     PWM_v3 pwmH_Bridge2(
        .clock(clock),
        .dutyCycle(motorSpeeds_reg[5:3]),
        .PWM_pulse(enB)
      );
      
      defparam customClock.PERIOD = 725;
      
      PWM_v3 customClock (
          .clock(clock),
          .dutyCycle(3'b011),
          .PWM_pulse(customClock_wire)
      );
    
    currentSensing currentSense(
        .clock(clock),
        .currentSensA_B(~currentSensing_in),
        .isTurning(movDirec_isTurning_leftRight[1]),
        .currentOverload(currentSensing_wire)

     );

      assign {in4,in3,in2,in1} = INs_from_decisionMakin_reg;
      assign previousSpeedToDecisionMakin = motorSpeeds_reg;
      assign LED_currentSense_debug = currentSensing_reg;
endmodule
module H_Bridge_v3(
    input clock,
    input [1:0] currentSensing_in,
    input [3:0] INs_from_decisionMakin,  
    input [2:0] forwardSpeed,
    input [5:0] turningSpeeds,


    input [3:0] movDirec_isTurning_leftRight,
    input [5:0] previousSpeedFromDecisionMaking,
    output [5:0] previousSpeedToDecisionMakin,
    output enA, enB, in1, in2, in3, in4,
    output LED_currentSense_debug,
    output[3:0]  previous_movDirec_isTurning_leftRight_toDecMak
    );

    






    parameter MOVING_FORWARD = 4'b1100;
    parameter TURNING_LEFT = 4'b1110;
    parameter TURNING_RIGHT = 4'b1111;
    parameter STOPPING  =   4'B0100;
    parameter WEIRD_COMBINATIONS  =   4'b1001;
    
    parameter MOVING_REVERSE = 4'b1000;
    parameter TURNING_LEFT_REVERSE = 4'b1011;
    parameter TURNING_RIGHT_REVERSE = 4'b1010;


    reg [3:0] INs_from_decisionMakin_reg;
    reg [3:0] movDirec_isTurning_leftRight_reg;




    
    
    reg [5:0] motorSpeeds_reg;

    reg currentSensing_reg;
    wire currentSensing_wire;
    wire customClock_wire;
  


    always@(posedge customClock_wire) begin
        currentSensing_reg <= 0;
        
        if (currentSensing_wire)
            currentSensing_reg <= 1;
        else
            currentSensing_reg <= 0;
            
                  case(movDirec_isTurning_leftRight)
                    4'b1110 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[5:3];
                        motorSpeeds_reg[5:3] = turningSpeeds[2:0];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1111 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[2:0];
                        motorSpeeds_reg[5:3] = turningSpeeds[5:3];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b0000,
                    4'b0001,
                    4'b0010,
                    4'b0011,
                    4'b0100,
                    4'b0101,
                    4'b0110,
                    4'b0111 : begin
                        motorSpeeds_reg = 6'b000000;
                        INs_from_decisionMakin_reg = 4'b0000;
                    end
                    4'b1100,
                    4'b1101 : begin
                        motorSpeeds_reg = {forwardSpeed,forwardSpeed};
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1000 : begin
                        motorSpeeds_reg = {forwardSpeed,forwardSpeed};
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1001 : begin
                        motorSpeeds_reg = previousSpeedFromDecisionMaking;
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    4'b1011 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[5:3];
                        motorSpeeds_reg[5:3] = turningSpeeds[2:0];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    
                    4'b1010 : begin
                        motorSpeeds_reg[2:0] = turningSpeeds[2:0];
                        motorSpeeds_reg[5:3] = turningSpeeds[5:3];
                        INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                    default : begin
                         INs_from_decisionMakin_reg = INs_from_decisionMakin;
                    end
                  endcase                  
            if (currentSensing_reg) begin
                motorSpeeds_reg = 6'b000000;
                INs_from_decisionMakin_reg = 4'b0000;
            end
            else begin
                motorSpeeds_reg = motorSpeeds_reg;
                INs_from_decisionMakin_reg = INs_from_decisionMakin;
            end 
    end
    

    defparam pwmH_Bridge2.PERIOD = 28'd125000;
    PWM_v3 pwmH_Bridge1(      
        .clock(clock),
        .dutyCycle(motorSpeeds_reg[2:0]),
        .PWM_pulse(enA)
     );
    

    defparam pwmH_Bridge2.PERIOD = 28'd125000;  
     PWM_v3 pwmH_Bridge2(
        .clock(clock),
        .dutyCycle(motorSpeeds_reg[5:3]),
        .PWM_pulse(enB)
      );
      
      defparam customClock.PERIOD = 725;
      
      PWM_v3 customClock (
          .clock(clock),
          .dutyCycle(3'b011),
          .PWM_pulse(customClock_wire)
      );
    
    currentSensing currentSense(
        .clock(clock),
        .currentSensA_B(~currentSensing_in),
        .isTurning(movDirec_isTurning_leftRight[1]),
        .currentOverload(currentSensing_wire)

     );

      assign {in4,in3,in2,in1} = INs_from_decisionMakin_reg;
      assign previousSpeedToDecisionMakin = motorSpeeds_reg;
      assign LED_currentSense_debug = currentSensing_reg;
endmodule