data/full_repos/permissive/205673649/ALU/ALU_toplevel.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b"%Error: data/full_repos/permissive/205673649/ALU/ALU_toplevel.v:75: Cannot find file containing module: 'ALU'\nALU\n^~~\n        ... Looked in:\n             data/full_repos/permissive/205673649/ALU,data/full_repos/permissive/205673649/ALU\n             data/full_repos/permissive/205673649/ALU,data/full_repos/permissive/205673649/ALU.v\n             data/full_repos/permissive/205673649/ALU,data/full_repos/permissive/205673649/ALU.sv\n             ALU\n             ALU.v\n             ALU.sv\n             obj_dir/ALU\n             obj_dir/ALU.v\n             obj_dir/ALU.sv\n%Error: Exiting due to 1 error(s)\n"
module ALU_toplevel(
    clk,
    sw,
    btnL,
    btnC,
    btnR,
    led
);


parameter NB_DATA              = `NB_DATA;
parameter NB_OPERADOR          = `NB_OPERADOR;


input [NB_DATA-1:0] sw;
input clk;
input btnL;
input btnC;
input btnR;
output [NB_DATA-1:0] led;


reg [NB_DATA-1 : 0] dato_a;
reg [NB_DATA-1 : 0] dato_b;
reg [NB_OPERADOR-1 : 0] operador;

always @(posedge clk)
begin
    if(btnL==1'b1)
    begin
        dato_a<=sw;
    end
    else if(btnC==1'b1)
    begin
        dato_b<=sw;
    end
    else if(btnR==1'b1)
    begin
        operador<=sw[NB_OPERADOR-1 : 0];
    end
    else
    begin
        dato_a<=dato_a;
        dato_b<=dato_b;
        operador<=operador;
    end
end


ALU
#(`NB_DATA,`NB_OPERADOR)
u_ALU
(.i_dato_a(dato_a),
 .i_dato_b(dato_b),
 .i_operador(operador),
 .o_resultado(led)
);



endmodule
module ALU_toplevel(
    clk,
    sw,
    btnL,
    btnC,
    btnR,
    led
);



parameter NB_DATA              = `NB_DATA;
parameter NB_OPERADOR          = `NB_OPERADOR;


input [NB_DATA-1:0] sw;
input clk;
input btnL;
input btnC;
input btnR;
output [NB_DATA-1:0] led;


reg [NB_DATA-1 : 0] dato_a;
reg [NB_DATA-1 : 0] dato_b;
reg [NB_OPERADOR-1 : 0] operador;

always @(posedge clk)
begin
    if(btnL==1'b1)
    begin
        dato_a<=sw;
    end
    else if(btnC==1'b1)
    begin
        dato_b<=sw;
    end
    else if(btnR==1'b1)
    begin
        operador<=sw[NB_OPERADOR-1 : 0];
    end
    else
    begin
        dato_a<=dato_a;
        dato_b<=dato_b;
        operador<=operador;
    end
end


ALU
#(`NB_DATA,`NB_OPERADOR)
u_ALU
(.i_dato_a(dato_a),
 .i_dato_b(dato_b),
 .i_operador(operador),
 .o_resultado(led)
);



endmodule