D
David Rogoff
Guest
I'm not sure how to do this. I have a module with a port whose width
is set by a parameter. In v95, you'd do this:
// ---------------------
// file a
module a (zz);
`include "myparameters.v"
input [MYWIDTH-1:0] zz;
endmodule
// ----------------
Now, I know you can use parameters in ports like this:
// ---------------------
// file a
module a #(parameter MYWIDTH=5) (zz);
input [MYWIDTH-1:0] zz;
endmodule
// ----------------
But this parameter is defined in the module port list. Is this legal?
// ---------------------
// file a
module a #(
`include "myparameters.v"
) (zz);
input [MYWIDTH-1:0] zz;
endmodule
// ----------------
It's easy if I used a macro instead of a parmaeter since those can be
defined outside a module. How about defining the parameters in a
dummy module and used a hierarchical reference? Would this be
synthesizable? Packages? Other ideas?
Thanks,
David
is set by a parameter. In v95, you'd do this:
// ---------------------
// file a
module a (zz);
`include "myparameters.v"
input [MYWIDTH-1:0] zz;
endmodule
// ----------------
Now, I know you can use parameters in ports like this:
// ---------------------
// file a
module a #(parameter MYWIDTH=5) (zz);
input [MYWIDTH-1:0] zz;
endmodule
// ----------------
But this parameter is defined in the module port list. Is this legal?
// ---------------------
// file a
module a #(
`include "myparameters.v"
) (zz);
input [MYWIDTH-1:0] zz;
endmodule
// ----------------
It's easy if I used a macro instead of a parmaeter since those can be
defined outside a module. How about defining the parameters in a
dummy module and used a hierarchical reference? Would this be
synthesizable? Packages? Other ideas?
Thanks,
David