data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v
1: b'%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:1: Cannot find include file: definitions.v\n`include "definitions.v" \n         ^~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/129155059/06-fsm,data/full_repos/permissive/129155059/definitions.v\n             data/full_repos/permissive/129155059/06-fsm,data/full_repos/permissive/129155059/definitions.v.v\n             data/full_repos/permissive/129155059/06-fsm,data/full_repos/permissive/129155059/definitions.v.sv\n             definitions.v\n             definitions.v.v\n             definitions.v.sv\n             obj_dir/definitions.v\n             obj_dir/definitions.v.v\n             obj_dir/definitions.v.sv\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:15: Define or directive not defined: \'`IDLE\'\n    if (~reset) estado <= `IDLE;\n                          ^~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:15: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    if (~reset) estado <= `IDLE;\n                               ^\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:25: Define or directive not defined: \'`IDLE\'\n      `IDLE: begin\n      ^~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:25: syntax error, unexpected \':\', expecting endcase\n      `IDLE: begin\n           ^\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:27: Define or directive not defined: \'`IDLE\'\n          prox_estado = `IDLE;\n                        ^~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:30: syntax error, unexpected else\n        end else if (go_down) begin\n            ^~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:31: Define or directive not defined: \'`GOING_DOWN\'\n          prox_estado = `GOING_DOWN;\n                        ^~~~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:35: Define or directive not defined: \'`GOING_UP\'\n          prox_estado = `GOING_UP;\n                        ^~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:41: Define or directive not defined: \'`GOING_UP\'\n      `GOING_UP: begin\n      ^~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:43: Define or directive not defined: \'`IDLE\'\n          prox_estado = `IDLE;\n                        ^~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:47: Define or directive not defined: \'`AT_TOP\'\n          prox_estado = `AT_TOP;\n                        ^~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:53: Define or directive not defined: \'`AT_TOP\'\n      `AT_TOP: begin\n      ^~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:55: Define or directive not defined: \'`AT_TOP\'\n          prox_estado = `AT_TOP;\n                        ^~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:59: Define or directive not defined: \'`GOING_DOWN\'\n          prox_estado = `GOING_DOWN;\n                        ^~~~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:65: Define or directive not defined: \'`GOING_DOWN\'\n      `GOING_DOWN: begin\n      ^~~~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:67: Define or directive not defined: \'`IDLE\'\n          prox_estado = `IDLE;\n                        ^~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:71: Define or directive not defined: \'`AT_BOTTOM\'\n          prox_estado = `AT_BOTTOM;\n                        ^~~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:77: Define or directive not defined: \'`AT_BOTTOM\'\n      `AT_BOTTOM: begin\n      ^~~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:79: Define or directive not defined: \'`AT_BOTTOM\'\n          prox_estado = `AT_BOTTOM;\n                        ^~~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:83: Define or directive not defined: \'`GOING_UP\'\n          prox_estado = `GOING_UP;\n                        ^~~~~~~~~\n%Error: data/full_repos/permissive/129155059/06-fsm/ascensor_cond.v:90: Define or directive not defined: \'`IDLE\'\n        prox_estado = `IDLE;\n                      ^~~~~\n%Error: Cannot continue\n'
module ascensor_cond( input       CLK,
                      input       go_down,
                      input       go_up,
                      input       halt,
                      input       reset,
                      output reg  top_lim,
                      output reg  bott_lim,
                      output reg [4:0] estado,
                      output reg [4:0] prox_estado
                      );

  always @(posedge CLK) begin
    if (~reset) estado <= `IDLE;
    else  estado <= prox_estado;
  end

  always @(*) begin
    top_lim = 1'b0;
    bott_lim = 1'b0;
    prox_estado = estado;
    case (estado)

      `IDLE: begin
        if (halt) begin
          prox_estado = `IDLE;
          top_lim = top_lim;
          bott_lim = bott_lim;
        end else if (go_down) begin
          prox_estado = `GOING_DOWN;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end else if (go_up) begin
          prox_estado = `GOING_UP;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end
      end

      `GOING_UP: begin
        if (halt) begin
          prox_estado = `IDLE;
          top_lim = 1'b0;
          bott_lim = 1'b1;
        end else begin
          prox_estado = `AT_TOP;
          top_lim = 1'b1;
          bott_lim = 1'b0;
        end
      end

      `AT_TOP: begin
        if (go_up) begin
          prox_estado = `AT_TOP;
          top_lim = 1'b1;
          bott_lim = 1'b0;
        end else if (go_down) begin
          prox_estado = `GOING_DOWN;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end
      end

      `GOING_DOWN: begin
        if (halt) begin
          prox_estado = `IDLE;
          top_lim = 1'b1;
          bott_lim = 1'b0;
        end else begin
          prox_estado = `AT_BOTTOM;
          top_lim = 1'b0;
          bott_lim = 1'b1;
        end
      end

      `AT_BOTTOM: begin
        if (go_down) begin
          prox_estado = `AT_BOTTOM;
          top_lim = 1'b0;
          bott_lim = 1'b1;
        end else if (go_up) begin
          prox_estado = `GOING_UP;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end
      end

      default: begin
        prox_estado = `IDLE;
        top_lim = 1'b0;
        bott_lim = 1'b0;
      end

    endcase

  end

endmodule
module ascensor_cond( input       CLK,
                      input       go_down,
                      input       go_up,
                      input       halt,
                      input       reset,
                      output reg  top_lim,
                      output reg  bott_lim,
                      output reg [4:0] estado,
                      output reg [4:0] prox_estado
                      );


  always @(posedge CLK) begin
    if (~reset) estado <= `IDLE;
    else  estado <= prox_estado;
  end

  always @(*) begin
    top_lim = 1'b0;
    bott_lim = 1'b0;
    prox_estado = estado;
    case (estado)

      `IDLE: begin
        if (halt) begin
          prox_estado = `IDLE;
          top_lim = top_lim;
          bott_lim = bott_lim;
        end else if (go_down) begin
          prox_estado = `GOING_DOWN;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end else if (go_up) begin
          prox_estado = `GOING_UP;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end
      end

      `GOING_UP: begin
        if (halt) begin
          prox_estado = `IDLE;
          top_lim = 1'b0;
          bott_lim = 1'b1;
        end else begin
          prox_estado = `AT_TOP;
          top_lim = 1'b1;
          bott_lim = 1'b0;
        end
      end

      `AT_TOP: begin
        if (go_up) begin
          prox_estado = `AT_TOP;
          top_lim = 1'b1;
          bott_lim = 1'b0;
        end else if (go_down) begin
          prox_estado = `GOING_DOWN;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end
      end

      `GOING_DOWN: begin
        if (halt) begin
          prox_estado = `IDLE;
          top_lim = 1'b1;
          bott_lim = 1'b0;
        end else begin
          prox_estado = `AT_BOTTOM;
          top_lim = 1'b0;
          bott_lim = 1'b1;
        end
      end

      `AT_BOTTOM: begin
        if (go_down) begin
          prox_estado = `AT_BOTTOM;
          top_lim = 1'b0;
          bott_lim = 1'b1;
        end else if (go_up) begin
          prox_estado = `GOING_UP;
          top_lim = 1'b0;
          bott_lim = 1'b0;
        end
      end

      default: begin
        prox_estado = `IDLE;
        top_lim = 1'b0;
        bott_lim = 1'b0;
      end

    endcase

  end

endmodule