Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to align multiple modules in one file? #10

Open
duskmoon314 opened this issue Mar 20, 2020 · 0 comments
Open

How to align multiple modules in one file? #10

duskmoon314 opened this issue Mar 20, 2020 · 0 comments

Comments

@duskmoon314
Copy link

I have code like this

module sha256_round(
    input [31:0] Kt, Wt,
    input [31:0] a_in, b_in, c_in, d_in, e_in, f_in, g_in, h_in,
    output [31:0] a_out, b_out, c_out, d_out, e_out, f_out, g_out, h_out
);

endmodule

module sha256_s0(
    input wire [31:0] x,
    output wire [31:0] S0
);
endmodule

module sha256_s1(
    input wire [31:0] x,
    output wire [31:0] S1
);
endmodule

module Ch(
    input wire [31:0] x, y, z,
    output wire [31:0] Ch
);
endmodule

module Maj(
    input wire [31:0] x, y, z,
    output wire [31:0] Maj
);
endmodule

after saving, it becomes this

module sha256_round(input [31:0] Kt,
                    Wt,
                    input [31:0] a_in,
                    b_in,
                    c_in,
                    d_in,
                    e_in,
                    f_in,
                    g_in,
                    h_in,
                    output [31:0] a_out,
                    b_out,
                    c_out,
                    d_out,
                    e_out,
                    f_out,
                    g_out,
                    h_out);
endmodule
    
    module sha256_s0(
        input wire [31:0] x,
        output wire [31:0] S0
        );
    endmodule
        
        module sha256_s1(
            input wire [31:0] x,
            output wire [31:0] S1
            );
        endmodule
            
            module Ch(
                input wire [31:0] x, y, z,
                output wire [31:0] Ch
                );
            endmodule
                
                module Maj(
                    input wire [31:0] x, y, z,
                    output wire [31:0] Maj
                    );
                endmodule

I prefer something like this

module A(
    input [31:0] a_in,
                 b_in,
                 c_in
);
endmodule

module B(
);
endmodule

Is it possilbe to get this function now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant