data/full_repos/permissive/459421171/Pipelined/execute_new.v
1: b'%Warning-LITENDIAN: data/full_repos/permissive/459421171/Pipelined/execute_new.v:416: Little bit endian vector: MSB < LSB of bit range: 0:63\ninput[0:63] x,y;\n     ^\n                    ... Use "/* verilator lint_off LITENDIAN */" and lint_on around source to disable this message.\n%Warning-LITENDIAN: data/full_repos/permissive/459421171/Pipelined/execute_new.v:417: Little bit endian vector: MSB < LSB of bit range: 0:63\noutput[0:63]z;\n      ^\n%Error: Exiting due to 2 warning(s)\n'
module execute(clk,icode,ifun,valA,valB,valC,cnd,e_dstE,valE,cc,rA,rB);

input  clk;
input [3:0] icode;
input [3:0] ifun,rA,rB;
input  signed [63:0] valA;
input  signed [63:0] valB;
input signed [63:0] valC;


output reg signed  [63:0] valE;
output reg cnd;
output reg [2:0] cc;
output reg [3:0] e_dstE;

reg [3:0] icd;
reg signed [63:0] x;
reg signed [63:0] y;
reg [1:0]  control;
wire signed [63:0] z;
wire zf;
wire sf;
wire of;

reg not_input;
reg or_input1;
reg or_input2;
reg xor_input1;
reg xor_input2;

wire not_output;
wire or_output;
wire xor_output;
 

ALU_final alu(icd,x,y,control,z,zf,sf,of);
always @(z)
    valE=z;
always @(zf,sf,of)
    begin
        cc[0]=zf;
        cc[1]=sf;
        cc[2]=of;
    end




not notgate(not_output,not_input);
or  orgate(or_output,or_input1,or_input2);
xor xor_gate(xor_output,xor_input1,xor_input2);




always @(*)
    begin
        if(clk==1)
            begin
            cnd=0;

            if(icode==4'b0010)
                begin
                    x=valA;
                    y=valB;
                    icd=icode;
                    control=2'b00;

                    if(ifun==4'b0000)
                    begin
                        cnd=1;
                    end

                    else if(ifun==4'b0001)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            or_input1=xor_output;
                            or_input2=cc[0];
                            if(or_output)
                                begin
                                    cnd=1;
                                end 
                        end

                    else if(ifun==4'b0010)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            if(xor_output)
                                begin
                                    cnd=1;
                                end    
                        end  

                    else if(ifun==4'b0011)
                        begin

                            if(cc[0])
                                begin
                                    cnd=1;
                                end
                        end         

                    else if(ifun==4'b0100)
                        begin

                            not_input=cc[0];
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end

                    else if(ifun==4'b0101)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end            

                    else if(ifun==4'b0110)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    not_input=cc[0];
                                    if(not_output)
                                        begin
                                            cnd=1;
                                        end    
                                end
                        end
                end 

            else if(icode==4'b0011)
                begin
                    x=valC;
                    y=64'b0;
                    icd=icode;
                    control=2'b00;
                   
                end

            else if(icode==4'b0100)
                begin
                icd=icode;
                    x=valC;
                    y=valB;
                    control=2'b00;
                    
                end

            else if(icode==4'b0101)
                begin
                    icd=icode;
                    x=valC;
                    y=valB;
                    
                end

            else if(icode==4'b0110)
                begin
                    x=valA;
                    y=valB;
                    icd=icode;
                    control=2'b00;

                    if(ifun==4'b0000)
                        begin
                            control=2'b00;
                        end

                    else if(ifun==4'b0001)
                        begin
                            control=2'b01;
                        end 

                    else if(ifun==4'b0010)
                        begin
                            control=2'b10;
                        end 

                    else if(ifun==4'b0011)
                        begin
                            control=2'b11;
                        end     
                                  
                    
                end

             else if(icode==4'b1000) 
                 begin
                    x=-64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
                  
                 end

            else if(icode==4'b1001)
                begin
                    x=64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
               
                end

            else if(icode==4'b1010)
                begin
                    x=-64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
       
                end

            else if(icode==4'b1011)
                begin
                    x=64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
            
                end    
       

            else if(icode==4'b0111)
                begin

                    if(ifun==4'b0000)
                    begin
                        cnd=1;
                    end

                    else if(ifun==4'b0001)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            or_input1=xor_output;
                            or_input2=cc[0];
                            if(or_output)
                                begin
                                    cnd=1;
                                end 
                        end

                    else if(ifun==4'b0010)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            if(xor_output)
                                begin
                                    cnd=1;
                                end    
                        end  

                    else if(ifun==4'b0011)
                        begin

                            if(cc[0])
                                begin
                                    cnd=1;
                                end
                        end         

                    else if(ifun==4'b0100)
                        begin

                            not_input=cc[0];
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end

                    else if(ifun==4'b0101)
                        begin

                            xor_input1=cc[0];
                            xor_input2=cc[1];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end            

                    else if(ifun==4'b0110)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    not_input=cc[0];
                                    if(not_output)
                                        begin
                                            cnd=1;
                                        end    
                                end
                        end  
                end    
            end
            
            e_dstE = rB;
        
    end
endmodule
module execute(clk,icode,ifun,valA,valB,valC,cnd,e_dstE,valE,cc,rA,rB);


input  clk;
input [3:0] icode;
input [3:0] ifun,rA,rB;
input  signed [63:0] valA;
input  signed [63:0] valB;
input signed [63:0] valC;


output reg signed  [63:0] valE;
output reg cnd;
output reg [2:0] cc;
output reg [3:0] e_dstE;

reg [3:0] icd;
reg signed [63:0] x;
reg signed [63:0] y;
reg [1:0]  control;
wire signed [63:0] z;
wire zf;
wire sf;
wire of;

reg not_input;
reg or_input1;
reg or_input2;
reg xor_input1;
reg xor_input2;

wire not_output;
wire or_output;
wire xor_output;
 

ALU_final alu(icd,x,y,control,z,zf,sf,of);
always @(z)
    valE=z;
always @(zf,sf,of)
    begin
        cc[0]=zf;
        cc[1]=sf;
        cc[2]=of;
    end




not notgate(not_output,not_input);
or  orgate(or_output,or_input1,or_input2);
xor xor_gate(xor_output,xor_input1,xor_input2);




always @(*)
    begin
        if(clk==1)
            begin
            cnd=0;

            if(icode==4'b0010)
                begin
                    x=valA;
                    y=valB;
                    icd=icode;
                    control=2'b00;

                    if(ifun==4'b0000)
                    begin
                        cnd=1;
                    end

                    else if(ifun==4'b0001)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            or_input1=xor_output;
                            or_input2=cc[0];
                            if(or_output)
                                begin
                                    cnd=1;
                                end 
                        end

                    else if(ifun==4'b0010)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            if(xor_output)
                                begin
                                    cnd=1;
                                end    
                        end  

                    else if(ifun==4'b0011)
                        begin

                            if(cc[0])
                                begin
                                    cnd=1;
                                end
                        end         

                    else if(ifun==4'b0100)
                        begin

                            not_input=cc[0];
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end

                    else if(ifun==4'b0101)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end            

                    else if(ifun==4'b0110)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    not_input=cc[0];
                                    if(not_output)
                                        begin
                                            cnd=1;
                                        end    
                                end
                        end
                end 

            else if(icode==4'b0011)
                begin
                    x=valC;
                    y=64'b0;
                    icd=icode;
                    control=2'b00;
                   
                end

            else if(icode==4'b0100)
                begin
                icd=icode;
                    x=valC;
                    y=valB;
                    control=2'b00;
                    
                end

            else if(icode==4'b0101)
                begin
                    icd=icode;
                    x=valC;
                    y=valB;
                    
                end

            else if(icode==4'b0110)
                begin
                    x=valA;
                    y=valB;
                    icd=icode;
                    control=2'b00;

                    if(ifun==4'b0000)
                        begin
                            control=2'b00;
                        end

                    else if(ifun==4'b0001)
                        begin
                            control=2'b01;
                        end 

                    else if(ifun==4'b0010)
                        begin
                            control=2'b10;
                        end 

                    else if(ifun==4'b0011)
                        begin
                            control=2'b11;
                        end     
                                  
                    
                end

             else if(icode==4'b1000) 
                 begin
                    x=-64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
                  
                 end

            else if(icode==4'b1001)
                begin
                    x=64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
               
                end

            else if(icode==4'b1010)
                begin
                    x=-64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
       
                end

            else if(icode==4'b1011)
                begin
                    x=64'b1;
                    y=valB;
                    icd=icode;
                    control=2'b00;
            
                end    
       

            else if(icode==4'b0111)
                begin

                    if(ifun==4'b0000)
                    begin
                        cnd=1;
                    end

                    else if(ifun==4'b0001)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            or_input1=xor_output;
                            or_input2=cc[0];
                            if(or_output)
                                begin
                                    cnd=1;
                                end 
                        end

                    else if(ifun==4'b0010)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            if(xor_output)
                                begin
                                    cnd=1;
                                end    
                        end  

                    else if(ifun==4'b0011)
                        begin

                            if(cc[0])
                                begin
                                    cnd=1;
                                end
                        end         

                    else if(ifun==4'b0100)
                        begin

                            not_input=cc[0];
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end

                    else if(ifun==4'b0101)
                        begin

                            xor_input1=cc[0];
                            xor_input2=cc[1];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    cnd=1;
                                end
                        end            

                    else if(ifun==4'b0110)
                        begin

                            xor_input1=cc[1];
                            xor_input2=cc[2];
                            not_input=xor_output;
                            if(not_output)
                                begin
                                    not_input=cc[0];
                                    if(not_output)
                                        begin
                                            cnd=1;
                                        end    
                                end
                        end  
                end    
            end
            
            e_dstE = rB;
        
    end
endmodule