data/full_repos/permissive/172995952/src/score_counter.v
1: b"%Error: data/full_repos/permissive/172995952/src/score_counter.v:68: Cannot find file containing module: 'Multiplexer_4way'\n    Multiplexer_4way Mux4(\n    ^~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/172995952/src,data/full_repos/permissive/172995952/Multiplexer_4way\n             data/full_repos/permissive/172995952/src,data/full_repos/permissive/172995952/Multiplexer_4way.v\n             data/full_repos/permissive/172995952/src,data/full_repos/permissive/172995952/Multiplexer_4way.sv\n             Multiplexer_4way\n             Multiplexer_4way.v\n             Multiplexer_4way.sv\n             obj_dir/Multiplexer_4way\n             obj_dir/Multiplexer_4way.v\n             obj_dir/Multiplexer_4way.sv\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:78: Cannot find file containing module: 'Generic_counter'\n    Generic_counter # (.COUNTER_WIDTH(17),\n    ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:90: Cannot find file containing module: 'Generic_counter'\n   Generic_counter # (.COUNTER_WIDTH(2),\n   ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:101: Cannot find file containing module: 'Generic_counter'\n   Generic_counter # (.COUNTER_WIDTH(2),\n   ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:115: Cannot find file containing module: 'Generic_counter'\n   Generic_counter # (.COUNTER_WIDTH(4),\n   ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:129: Cannot find file containing module: 'Generic_counter'\n   Generic_counter # (.COUNTER_WIDTH(4),\n   ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:142: Cannot find file containing module: 'decode_world'\n    decode_world Seg7(\n    ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:162: Cannot find file containing module: 'Generic_counter'\n    Generic_counter # (.COUNTER_WIDTH(28),\n    ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:174: Cannot find file containing module: 'Generic_counter'\n    Generic_counter # (.COUNTER_WIDTH(4),\n    ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/172995952/src/score_counter.v:187: Cannot find file containing module: 'Generic_counter'\n    Generic_counter # (.COUNTER_WIDTH(4),\n    ^~~~~~~~~~~~~~~\n%Error: Exiting due to 10 error(s)\n"
module Score_counter(
    input CLK,
    input RESET,
    input TARGET_REACHED,
    input Timed_Mode,
    input [1:0] MSM_STATE,
    output [3:0] SEG_SELECT_OUT,
    output [7:0] DEC_OUT,
    output reg LOST,
    output reg SCORE_WIN,
    output reg WIN
    );
    
    parameter timer = 6;
    
    wire [4:0] DecCountAndDOT0;
    wire [4:0] DecCountAndDOT1;
    wire [4:0] DecCountAndDOT2;
    wire [4:0] DecCountAndDOT3;
    
    
    wire [3:0] DecCount0;
    wire [3:0] DecCount1;
    wire [3:0] DecCount2;
    wire [3:0] DecCount3;
    
    wire Bit17TriggOut;
    wire [1:0] StrobeCount;
    
    wire TRIG1;
    wire TRIG_2;
    wire OneSec;
    
    wire [4:0] MuxOut;
    wire HalfCount; 
    
    reg STOP;
    
 
    

    assign DecCountAndDOT2 = {1'b1, DecCount2};
    assign DecCountAndDOT3 = {1'b1, DecCount3};
    assign DecCountAndDOT0 = {1'b1, DecCount0};
    assign DecCountAndDOT1 = {1'b1, DecCount1};
    
    

    Multiplexer_4way Mux4(
            .CONTROL(StrobeCount),
            .IN0(DecCountAndDOT0),
            .IN1(DecCountAndDOT1),
            .IN2(DecCountAndDOT2),
            .IN3(DecCountAndDOT3),
            .OUT(MuxOut)
            );
    

    Generic_counter # (.COUNTER_WIDTH(17),
                       .COUNTER_MAX(99999)
                       )   
                       DispRefresh(
                       .CLK(CLK),
                       .RESET(1'b0),
                       .ENABLE_IN(1'b1),
                       .TRIG_OUT(Bit17TriggOut)
                       );
   


   Generic_counter # (.COUNTER_WIDTH(2),
                      .COUNTER_MAX(3)
                      )                 
                       StrobeCounter(
                       .CLK(CLK),
                       .RESET(1'b0),
                       .ENABLE_IN(Bit17TriggOut),
                       .COUNT(StrobeCount)
                      );
                      

   Generic_counter # (.COUNTER_WIDTH(2),
                      .COUNTER_MAX(1)
                      )                 
                      HalfCounter(
                      .CLK(CLK),
                      .RESET(1'b0),
                      .ENABLE_IN(1'b1),  
                      .TRIG_OUT(HalfCount)
                                            );                   
   




   Generic_counter # (.COUNTER_WIDTH(4),
                       .COUNTER_MAX(9)
                      ) 
                     SecDecimal(
                     .CLK(CLK),
                     .RESET(RESET),
                     .ENABLE_IN(TARGET_REACHED && HalfCount),
                     .TRIG_OUT(TRIG1),
                     .COUNT(DecCount1)
                     );
                     


                     
   Generic_counter # (.COUNTER_WIDTH(4),
                      .COUNTER_MAX(1)
                      ) 
                      FirstDecimal(
                      .CLK(CLK),
                      .RESET(RESET),
                      .ENABLE_IN(TRIG1),
                      .COUNT(DecCount0)
                      );
                      
   


    decode_world Seg7(
                  .SEG_SELECT_IN(StrobeCount),
                  .BIN_IN(MuxOut[3:0]),
                  .DOT_IN(MuxOut[4]),
                  .SEG_SELECT_OUT(SEG_SELECT_OUT),
                  .HEX_OUT(DEC_OUT)
               );
    

    always@(posedge CLK) begin
        if (DecCount0 == 1)
            SCORE_WIN <= 1;
        else 
            SCORE_WIN <= 0;
    end    
               


    

    Generic_counter # (.COUNTER_WIDTH(28),
                           .COUNTER_MAX(99999999)
                           )   
                           OneSecond(
                           .CLK(CLK),
                           .RESET(RESET),
                           .ENABLE_IN(Timed_Mode && ~STOP && MSM_STATE == 2'd1),
                           .TRIG_OUT(OneSec)
                           );
    

    
    Generic_counter # (.COUNTER_WIDTH(4),
                       .COUNTER_MAX(9)
                      )                 
                       Seconds(
                      .CLK(CLK),
                      .RESET(RESET),
                      .ENABLE_IN(OneSec && Timed_Mode),
                      .TRIG_OUT(TRIG_2),
                      .COUNT(DecCount3)
                      );
          


    Generic_counter # (.COUNTER_WIDTH(4),
                       .COUNTER_MAX(9)
                      ) 
                     DecSeconds(
                     .CLK(CLK),
                     .RESET(RESET),
                     .ENABLE_IN(TRIG_2),

                     .COUNT(DecCount2)
                     );   
          



    always@(posedge CLK) begin
        if (DecCount2 == timer && DecCount0 == 0) begin
        LOST <= 1; 
        WIN <= 0;
        STOP = 1;
        end
        else if(DecCount2 < timer && DecCount0 == 1) begin
        WIN <= 1;
        LOST <= 0;
        STOP <= 1;
        end




        if (Timed_Mode && MSM_STATE == 2'd1)
            STOP <= 0;
        else if (Timed_Mode == 0 && MSM_STATE == 2'd1)
            STOP <= 1;
        else if (Timed_Mode == 0)
            STOP <= 1;

        if (RESET) begin
        LOST <= 0;
        WIN <= 0;
        STOP <= 1;
        end
    end       
               
endmodule
module Score_counter(
    input CLK,
    input RESET,
    input TARGET_REACHED,
    input Timed_Mode,
    input [1:0] MSM_STATE,
    output [3:0] SEG_SELECT_OUT,
    output [7:0] DEC_OUT,
    output reg LOST,
    output reg SCORE_WIN,
    output reg WIN
    );

    
    parameter timer = 6;
    
    wire [4:0] DecCountAndDOT0;
    wire [4:0] DecCountAndDOT1;
    wire [4:0] DecCountAndDOT2;
    wire [4:0] DecCountAndDOT3;
    
    
    wire [3:0] DecCount0;
    wire [3:0] DecCount1;
    wire [3:0] DecCount2;
    wire [3:0] DecCount3;
    
    wire Bit17TriggOut;
    wire [1:0] StrobeCount;
    
    wire TRIG1;
    wire TRIG_2;
    wire OneSec;
    
    wire [4:0] MuxOut;
    wire HalfCount; 
    
    reg STOP;
    
 
    

    assign DecCountAndDOT2 = {1'b1, DecCount2};
    assign DecCountAndDOT3 = {1'b1, DecCount3};
    assign DecCountAndDOT0 = {1'b1, DecCount0};
    assign DecCountAndDOT1 = {1'b1, DecCount1};
    
    

    Multiplexer_4way Mux4(
            .CONTROL(StrobeCount),
            .IN0(DecCountAndDOT0),
            .IN1(DecCountAndDOT1),
            .IN2(DecCountAndDOT2),
            .IN3(DecCountAndDOT3),
            .OUT(MuxOut)
            );
    

    Generic_counter # (.COUNTER_WIDTH(17),
                       .COUNTER_MAX(99999)
                       )   
                       DispRefresh(
                       .CLK(CLK),
                       .RESET(1'b0),
                       .ENABLE_IN(1'b1),
                       .TRIG_OUT(Bit17TriggOut)
                       );
   


   Generic_counter # (.COUNTER_WIDTH(2),
                      .COUNTER_MAX(3)
                      )                 
                       StrobeCounter(
                       .CLK(CLK),
                       .RESET(1'b0),
                       .ENABLE_IN(Bit17TriggOut),
                       .COUNT(StrobeCount)
                      );
                      

   Generic_counter # (.COUNTER_WIDTH(2),
                      .COUNTER_MAX(1)
                      )                 
                      HalfCounter(
                      .CLK(CLK),
                      .RESET(1'b0),
                      .ENABLE_IN(1'b1),  
                      .TRIG_OUT(HalfCount)
                                            );                   
   




   Generic_counter # (.COUNTER_WIDTH(4),
                       .COUNTER_MAX(9)
                      ) 
                     SecDecimal(
                     .CLK(CLK),
                     .RESET(RESET),
                     .ENABLE_IN(TARGET_REACHED && HalfCount),
                     .TRIG_OUT(TRIG1),
                     .COUNT(DecCount1)
                     );
                     


                     
   Generic_counter # (.COUNTER_WIDTH(4),
                      .COUNTER_MAX(1)
                      ) 
                      FirstDecimal(
                      .CLK(CLK),
                      .RESET(RESET),
                      .ENABLE_IN(TRIG1),
                      .COUNT(DecCount0)
                      );
                      
   


    decode_world Seg7(
                  .SEG_SELECT_IN(StrobeCount),
                  .BIN_IN(MuxOut[3:0]),
                  .DOT_IN(MuxOut[4]),
                  .SEG_SELECT_OUT(SEG_SELECT_OUT),
                  .HEX_OUT(DEC_OUT)
               );
    

    always@(posedge CLK) begin
        if (DecCount0 == 1)
            SCORE_WIN <= 1;
        else 
            SCORE_WIN <= 0;
    end    
               


    

    Generic_counter # (.COUNTER_WIDTH(28),
                           .COUNTER_MAX(99999999)
                           )   
                           OneSecond(
                           .CLK(CLK),
                           .RESET(RESET),
                           .ENABLE_IN(Timed_Mode && ~STOP && MSM_STATE == 2'd1),
                           .TRIG_OUT(OneSec)
                           );
    

    
    Generic_counter # (.COUNTER_WIDTH(4),
                       .COUNTER_MAX(9)
                      )                 
                       Seconds(
                      .CLK(CLK),
                      .RESET(RESET),
                      .ENABLE_IN(OneSec && Timed_Mode),
                      .TRIG_OUT(TRIG_2),
                      .COUNT(DecCount3)
                      );
          


    Generic_counter # (.COUNTER_WIDTH(4),
                       .COUNTER_MAX(9)
                      ) 
                     DecSeconds(
                     .CLK(CLK),
                     .RESET(RESET),
                     .ENABLE_IN(TRIG_2),

                     .COUNT(DecCount2)
                     );   
          



    always@(posedge CLK) begin
        if (DecCount2 == timer && DecCount0 == 0) begin
        LOST <= 1; 
        WIN <= 0;
        STOP = 1;
        end
        else if(DecCount2 < timer && DecCount0 == 1) begin
        WIN <= 1;
        LOST <= 0;
        STOP <= 1;
        end




        if (Timed_Mode && MSM_STATE == 2'd1)
            STOP <= 0;
        else if (Timed_Mode == 0 && MSM_STATE == 2'd1)
            STOP <= 1;
        else if (Timed_Mode == 0)
            STOP <= 1;

        if (RESET) begin
        LOST <= 0;
        WIN <= 0;
        STOP <= 1;
        end
    end       
               
endmodule