data/full_repos/permissive/418819021/lab-07/alu.v
1: b'%Error: data/full_repos/permissive/418819021/lab-07/alu.v:4: Cannot find include file: defines.vh\n`include "defines.vh" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/418819021/lab-07,data/full_repos/permissive/418819021/defines.vh\n             data/full_repos/permissive/418819021/lab-07,data/full_repos/permissive/418819021/defines.vh.v\n             data/full_repos/permissive/418819021/lab-07,data/full_repos/permissive/418819021/defines.vh.sv\n             defines.vh\n             defines.vh.v\n             defines.vh.sv\n             obj_dir/defines.vh\n             obj_dir/defines.vh.v\n             obj_dir/defines.vh.sv\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:6: Define or directive not defined: \'`OPSEL_COUNT\'\n    input  wire     [`OPSEL_COUNT-1:0] opsel    ,\n                     ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:25: Define or directive not defined: \'`OPSEL_ADD\'\n                `OPSEL_ADD :\n                ^~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:25: syntax error, unexpected \':\', expecting endcase\n                `OPSEL_ADD :\n                           ^\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:28: Define or directive not defined: \'`FLAGS_C\'\n                        {flags_out[`FLAGS_C], out} = rd + rr + {8\'d0, cin_en & flags_in[`FLAGS_C]};\n                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:28: Define or directive not defined: \'`FLAGS_C\'\n                        {flags_out[`FLAGS_C], out} = rd + rr + {8\'d0, cin_en & flags_in[`FLAGS_C]};\n                                                                                        ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:30: Define or directive not defined: \'`FLAGS_C\'\n                        out                 = rd + rr + {7\'d0, cin_en & flags_in[`FLAGS_C]};\n                                                                                 ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:31: Define or directive not defined: \'`FLAGS_C\'\n                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];\n                                  ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:31: Define or directive not defined: \'`FLAGS_C\'\n                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];\n                                                       ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:33: Define or directive not defined: \'`FLAGS_V\'\n                    flags_out[`FLAGS_V] = (rd[7] == 1 && rr[7] == 1 && out[7] == 0) ||\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:35: Define or directive not defined: \'`FLAGS_Z\'\n                    flags_out[`FLAGS_Z] = (out == 0);\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:36: Define or directive not defined: \'`FLAGS_N\'\n                    flags_out[`FLAGS_N] = out[7];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:37: Define or directive not defined: \'`FLAGS_S\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:37: Define or directive not defined: \'`FLAGS_N\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                                                    ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:37: Define or directive not defined: \'`FLAGS_V\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                                                                          ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:38: Define or directive not defined: \'`FLAGS_H\'\n                    flags_out[`FLAGS_H] = (rd[3] == 1 && rr[3] == 1 && out[3] == 0) ||\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:40: Define or directive not defined: \'`FLAGS_T\'\n                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:40: Define or directive not defined: \'`FLAGS_T\'\n                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];\n                                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:41: Define or directive not defined: \'`FLAGS_I\'\n                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:41: Define or directive not defined: \'`FLAGS_I\'\n                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];\n                                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:44: Define or directive not defined: \'`OPSEL_SUB\'\n                `OPSEL_SUB :\n                ^~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:47: Define or directive not defined: \'`FLAGS_C\'\n                        {flags_out[`FLAGS_C], out} = rd - rr - {8\'d0, cin_en & flags_in[`FLAGS_C]};\n                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:47: Define or directive not defined: \'`FLAGS_C\'\n                        {flags_out[`FLAGS_C], out} = rd - rr - {8\'d0, cin_en & flags_in[`FLAGS_C]};\n                                                                                        ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:49: Define or directive not defined: \'`FLAGS_C\'\n                        out                 = rd - rr - {7\'d0, cin_en & flags_in[`FLAGS_C]};\n                                                                                 ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:50: Define or directive not defined: \'`FLAGS_C\'\n                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];\n                                  ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:50: Define or directive not defined: \'`FLAGS_C\'\n                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];\n                                                       ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:52: Define or directive not defined: \'`FLAGS_V\'\n                    flags_out[`FLAGS_V] = (rd[7] == 1 && rr[7] == 1 && out[7] == 0) ||\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:54: Define or directive not defined: \'`FLAGS_Z\'\n                    flags_out[`FLAGS_Z] = (out == 0);\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:55: Define or directive not defined: \'`FLAGS_N\'\n                    flags_out[`FLAGS_N] = out[7];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:56: Define or directive not defined: \'`FLAGS_S\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:56: Define or directive not defined: \'`FLAGS_N\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                                                    ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:56: Define or directive not defined: \'`FLAGS_V\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                                                                          ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:57: Define or directive not defined: \'`FLAGS_H\'\n                    flags_out[`FLAGS_H] = (rd[3] == 1 && rr[3] == 1 && out[3] == 0) ||\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:59: Define or directive not defined: \'`FLAGS_T\'\n                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:59: Define or directive not defined: \'`FLAGS_T\'\n                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];\n                                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:60: Define or directive not defined: \'`FLAGS_I\'\n                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:60: Define or directive not defined: \'`FLAGS_I\'\n                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];\n                                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:63: Define or directive not defined: \'`OPSEL_AND\'\n                `OPSEL_AND :\n                ^~~~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:66: Define or directive not defined: \'`FLAGS_V\'\n                    flags_out[`FLAGS_V] = 0;\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:67: Define or directive not defined: \'`FLAGS_Z\'\n                    flags_out[`FLAGS_Z] = (out == 0);\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:68: Define or directive not defined: \'`FLAGS_N\'\n                    flags_out[`FLAGS_N] = out[7];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:69: Define or directive not defined: \'`FLAGS_S\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:69: Define or directive not defined: \'`FLAGS_N\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                                                    ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:69: Define or directive not defined: \'`FLAGS_V\'\n                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];\n                                                                          ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:70: Define or directive not defined: \'`FLAGS_H\'\n                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:70: Define or directive not defined: \'`FLAGS_H\'\n                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];\n                                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:71: Define or directive not defined: \'`FLAGS_C\'\n                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:71: Define or directive not defined: \'`FLAGS_C\'\n                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];\n                                                   ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:72: Define or directive not defined: \'`FLAGS_T\'\n                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];\n                              ^~~~~~~~\n%Error: data/full_repos/permissive/418819021/lab-07/alu.v:72: Define or directive not defined: \'`FLAGS_T\'\n                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];\n                                                   ^~~~~~~~\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module alu #(parameter DATA_WIDTH = 8) (
    input  wire     [`OPSEL_COUNT-1:0] opsel    ,
    input  wire                        enable   ,
    input  wire     [  DATA_WIDTH-1:0] rd       ,
    input  wire     [  DATA_WIDTH-1:0] rr       ,
    output      reg [  DATA_WIDTH-1:0] out      ,
    input  wire     [  DATA_WIDTH-1:0] flags_in ,
    output      reg [  DATA_WIDTH-1:0] flags_out,
    input  wire                        cin_en   ,
    input  wire                        cout_en
);


    always @* begin
        if (enable)
            case (opsel)

                `OPSEL_ADD :
                begin
                    if (cout_en) begin
                        {flags_out[`FLAGS_C], out} = rd + rr + {8'd0, cin_en & flags_in[`FLAGS_C]};
                    end else begin
                        out                 = rd + rr + {7'd0, cin_en & flags_in[`FLAGS_C]};
                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    end
                    flags_out[`FLAGS_V] = (rd[7] == 1 && rr[7] == 1 && out[7] == 0) ||
                        (rd[7] == 0 && rr[7] == 0 && out[7] == 1);
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = (rd[3] == 1 && rr[3] == 1 && out[3] == 0) ||
                        (rd[3] == 0 && rr[3] == 0 && out[3] == 1);
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_SUB :
                begin
                    if (cout_en) begin
                        {flags_out[`FLAGS_C], out} = rd - rr - {8'd0, cin_en & flags_in[`FLAGS_C]};
                    end else begin
                        out                 = rd - rr - {7'd0, cin_en & flags_in[`FLAGS_C]};
                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    end
                    flags_out[`FLAGS_V] = (rd[7] == 1 && rr[7] == 1 && out[7] == 0) ||
                        (rd[7] == 0 && rr[7] == 0 && out[7] == 1);
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = (rd[3] == 1 && rr[3] == 1 && out[3] == 0) ||
                        (rd[3] == 0 && rr[3] == 0 && out[3] == 1);
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_AND :
                begin
                    out                 = rd & rr;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_XOR :
                begin
                    out                 = rd ^ rr;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_OR :
                begin
                    out                 = rd | rr;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_NEG :
                begin
                    out                 = ~rd;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_NONE : begin
                    out       = rr;
                    flags_out = flags_in;
                end


                default :
                    begin
                        out       = {DATA_WIDTH{1'bx}};
                        flags_out = flags_in;
                    end
            endcase
        elsebegin
            out       = {DATA_WIDTH{1'bx}};
            flags_out = flags_in;
        end
    end

endmodule
module alu #(parameter DATA_WIDTH = 8) (
    input  wire     [`OPSEL_COUNT-1:0] opsel    ,
    input  wire                        enable   ,
    input  wire     [  DATA_WIDTH-1:0] rd       ,
    input  wire     [  DATA_WIDTH-1:0] rr       ,
    output      reg [  DATA_WIDTH-1:0] out      ,
    input  wire     [  DATA_WIDTH-1:0] flags_in ,
    output      reg [  DATA_WIDTH-1:0] flags_out,
    input  wire                        cin_en   ,
    input  wire                        cout_en
);



    always @* begin
        if (enable)
            case (opsel)

                `OPSEL_ADD :
                begin
                    if (cout_en) begin
                        {flags_out[`FLAGS_C], out} = rd + rr + {8'd0, cin_en & flags_in[`FLAGS_C]};
                    end else begin
                        out                 = rd + rr + {7'd0, cin_en & flags_in[`FLAGS_C]};
                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    end
                    flags_out[`FLAGS_V] = (rd[7] == 1 && rr[7] == 1 && out[7] == 0) ||
                        (rd[7] == 0 && rr[7] == 0 && out[7] == 1);
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = (rd[3] == 1 && rr[3] == 1 && out[3] == 0) ||
                        (rd[3] == 0 && rr[3] == 0 && out[3] == 1);
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_SUB :
                begin
                    if (cout_en) begin
                        {flags_out[`FLAGS_C], out} = rd - rr - {8'd0, cin_en & flags_in[`FLAGS_C]};
                    end else begin
                        out                 = rd - rr - {7'd0, cin_en & flags_in[`FLAGS_C]};
                        flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    end
                    flags_out[`FLAGS_V] = (rd[7] == 1 && rr[7] == 1 && out[7] == 0) ||
                        (rd[7] == 0 && rr[7] == 0 && out[7] == 1);
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = (rd[3] == 1 && rr[3] == 1 && out[3] == 0) ||
                        (rd[3] == 0 && rr[3] == 0 && out[3] == 1);
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_AND :
                begin
                    out                 = rd & rr;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_XOR :
                begin
                    out                 = rd ^ rr;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_OR :
                begin
                    out                 = rd | rr;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_NEG :
                begin
                    out                 = ~rd;
                    flags_out[`FLAGS_V] = 0;
                    flags_out[`FLAGS_Z] = (out == 0);
                    flags_out[`FLAGS_N] = out[7];
                    flags_out[`FLAGS_S] = flags_out[`FLAGS_N] ^ flags_out[`FLAGS_V];
                    flags_out[`FLAGS_H] = flags_in[`FLAGS_H];
                    flags_out[`FLAGS_C] = flags_in[`FLAGS_C];
                    flags_out[`FLAGS_T] = flags_in[`FLAGS_T];
                    flags_out[`FLAGS_I] = flags_in[`FLAGS_I];
                end

                `OPSEL_NONE : begin
                    out       = rr;
                    flags_out = flags_in;
                end


                default :
                    begin
                        out       = {DATA_WIDTH{1'bx}};
                        flags_out = flags_in;
                    end
            endcase
        elsebegin
            out       = {DATA_WIDTH{1'bx}};
            flags_out = flags_in;
        end
    end

endmodule