J
John Apostol
Guest
Is there a means in Verilog to create a generic function that can be
reused in the same manner as a parameterized module? e.g. for modules
we have
module xyz_generic (a,b,...);
parameter SIZE = 32;
input [SIZE-1:0] a;
....
endmodule
module top (...);
....
xyz_generic #(.SIZE(16)) xyz_16 ( .a(...), ...);
xyz_generic #(.SIZE(64)) xyz_64 ( ...);
Simularly can I somehow define a function e.g.
function [SIZE-1:0] abc_generic;
input [SIZE-1:0] a;
input [SIZE-1:0] b;
....
abc_generic = ...
endfunction
?
Thanks
reused in the same manner as a parameterized module? e.g. for modules
we have
module xyz_generic (a,b,...);
parameter SIZE = 32;
input [SIZE-1:0] a;
....
endmodule
module top (...);
....
xyz_generic #(.SIZE(16)) xyz_16 ( .a(...), ...);
xyz_generic #(.SIZE(64)) xyz_64 ( ...);
Simularly can I somehow define a function e.g.
function [SIZE-1:0] abc_generic;
input [SIZE-1:0] a;
input [SIZE-1:0] b;
....
abc_generic = ...
endfunction
?
Thanks