M
Marco Lazar
Guest
Hi,
i want to write a parameterizable module with the least amount
of coding. Below code is what i got and VCS compiles it just fine:
module dummy (
input_a,
input_b,
output_a
);
// parameters
parameter WIDTH_A = 32;
parameter WIDTH_B = 64;
// Interfaces
input [(WIDTH_A-1) : 0] input_a;
input [(WIDTH_B-1) : 0] input_b;
output [(WIDTH_A-1) : 0] output_a;
// do something
...
...
...
endmodule
Still, i don't want to have to declare all the inputs and outputs
in the module declaration and then define them later on. I know in
V2k you can combine these into one statement and put them into the
module declaration part. But how does it work with inputs and outputs
whose width are parameterizable ? So can i do something like this:
module dummy (
parameter WIDTH_A = 32;
parameter WIDTH_B = 64;
// Interfaces
input [(WIDTH_A-1) : 0] input_a;
input [(WIDTH_B-1) : 0] input_b;
output [(WIDTH_A-1) : 0] output_a;
output [(WIDTH_B-1) : 0] output_b;
);
// do something
...
...
...
endmodule
Thanks in advance for your help !!
i want to write a parameterizable module with the least amount
of coding. Below code is what i got and VCS compiles it just fine:
module dummy (
input_a,
input_b,
output_a
);
// parameters
parameter WIDTH_A = 32;
parameter WIDTH_B = 64;
// Interfaces
input [(WIDTH_A-1) : 0] input_a;
input [(WIDTH_B-1) : 0] input_b;
output [(WIDTH_A-1) : 0] output_a;
// do something
...
...
...
endmodule
Still, i don't want to have to declare all the inputs and outputs
in the module declaration and then define them later on. I know in
V2k you can combine these into one statement and put them into the
module declaration part. But how does it work with inputs and outputs
whose width are parameterizable ? So can i do something like this:
module dummy (
parameter WIDTH_A = 32;
parameter WIDTH_B = 64;
// Interfaces
input [(WIDTH_A-1) : 0] input_a;
input [(WIDTH_B-1) : 0] input_b;
output [(WIDTH_A-1) : 0] output_a;
output [(WIDTH_B-1) : 0] output_b;
);
// do something
...
...
...
endmodule
Thanks in advance for your help !!