data/full_repos/permissive/421030651/src/cpu/csr_alu.sv
1: b'%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:10: Cannot find include file: csr_op.sv\n`include "csr_op.sv" \n         ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/421030651/src/cpu,data/full_repos/permissive/421030651/csr_op.sv\n             data/full_repos/permissive/421030651/src/cpu,data/full_repos/permissive/421030651/csr_op.sv.v\n             data/full_repos/permissive/421030651/src/cpu,data/full_repos/permissive/421030651/csr_op.sv.sv\n             csr_op.sv\n             csr_op.sv.v\n             csr_op.sv.sv\n             obj_dir/csr_op.sv\n             obj_dir/csr_op.sv.v\n             obj_dir/csr_op.sv.sv\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:2: Define or directive not defined: \'`CSR_OP_LEN\'\n    input        [`CSR_OP_LEN-1:0] csr_op,\n                  ^~~~~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:3: Define or directive not defined: \'`XLEN\'\n    input        [      `XLEN-1:0] src1,\n                        ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:4: Define or directive not defined: \'`XLEN\'\n    input        [      `XLEN-1:0] src2,\n                        ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:5: Define or directive not defined: \'`XLEN\'\n    output logic [      `XLEN-1:0] stb,\n                        ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:6: Define or directive not defined: \'`XLEN\'\n    output logic [      `XLEN-1:0] clr,\n                        ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:7: Define or directive not defined: \'`XLEN\'\n    output logic [      `XLEN-1:0] out\n                        ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:13: Define or directive not defined: \'`XLEN\'\n    out = `XLEN\'b0;\n          ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:22: Define or directive not defined: \'`XLEN\'\n    stb = `XLEN\'b0;\n          ^~~~~\n%Error: data/full_repos/permissive/421030651/src/cpu/csr_alu.sv:30: Define or directive not defined: \'`XLEN\'\n    clr = `XLEN\'b0;\n          ^~~~~\n%Error: Exiting due to 10 error(s)\n'
module csr_alu (
    input        [`CSR_OP_LEN-1:0] csr_op,
    input        [      `XLEN-1:0] src1,
    input        [      `XLEN-1:0] src2,
    output logic [      `XLEN-1:0] stb,
    output logic [      `XLEN-1:0] clr,
    output logic [      `XLEN-1:0] out
);

`include "csr_op.sv"

always_comb begin
    out = `XLEN'b0;
    case (csr_op)
        CSR_OP_NONE: out = src2;
        CSR_OP_SET : out = src1 |  src2;
        CSR_OP_CLR : out = src1 & ~src2;
    endcase
end

always_comb begin
    stb = `XLEN'b0;
    case (csr_op)
        CSR_OP_NONE: stb = src2;
        CSR_OP_SET : stb = src2;
    endcase
end

always_comb begin
    clr = `XLEN'b0;
    case (csr_op)
        CSR_OP_NONE: clr = ~src2;
        CSR_OP_CLR : clr =  src2;
    endcase
end

endmodule
module csr_alu (
    input        [`CSR_OP_LEN-1:0] csr_op,
    input        [      `XLEN-1:0] src1,
    input        [      `XLEN-1:0] src2,
    output logic [      `XLEN-1:0] stb,
    output logic [      `XLEN-1:0] clr,
    output logic [      `XLEN-1:0] out
);


`include "csr_op.sv"

always_comb begin
    out = `XLEN'b0;
    case (csr_op)
        CSR_OP_NONE: out = src2;
        CSR_OP_SET : out = src1 |  src2;
        CSR_OP_CLR : out = src1 & ~src2;
    endcase
end

always_comb begin
    stb = `XLEN'b0;
    case (csr_op)
        CSR_OP_NONE: stb = src2;
        CSR_OP_SET : stb = src2;
    endcase
end

always_comb begin
    clr = `XLEN'b0;
    case (csr_op)
        CSR_OP_NONE: clr = ~src2;
        CSR_OP_CLR : clr =  src2;
    endcase
end

endmodule