K
Kevin Neilson
I would like to know if it is possible to change the name and number of
ports of the top-level entity in VHDL. Let me introduce this by saying
that I'm normally a Verilog user, I think the answer is probably "no",
and I've searched the archives of this group and Google without finding
a definitive answer. I know that unfortunately this can't be done in
Verilog without the use of `ifdefs, which are awkward.
Let me be more specific: say I want to make a core with an input clk,
an output q, and optional inputs ce and clr. I want the user to be able
to select (via some sort of generics) whether there will be ce or clr
(or both or neither) inputs at the top level; therefore there will be
four possible top-level port lists. Furthermore, I want the top level
ports in the resulting netlist to have the correct names (i.e., "ce" and
"clr"). (I know I could make a single variable-length input named, for
example, "generic_in" and then remap the bits of that to internal
signals called "ce" and "clr", but that's not desirable.)
I am fairly certain I can't employ "generates" within the entity port
list. So is there any way to do this short of using a homemade
preprocessor (e.g., Perl script) to write out the VHDL with the i/o
ports I want?
-Kevin
ports of the top-level entity in VHDL. Let me introduce this by saying
that I'm normally a Verilog user, I think the answer is probably "no",
and I've searched the archives of this group and Google without finding
a definitive answer. I know that unfortunately this can't be done in
Verilog without the use of `ifdefs, which are awkward.
Let me be more specific: say I want to make a core with an input clk,
an output q, and optional inputs ce and clr. I want the user to be able
to select (via some sort of generics) whether there will be ce or clr
(or both or neither) inputs at the top level; therefore there will be
four possible top-level port lists. Furthermore, I want the top level
ports in the resulting netlist to have the correct names (i.e., "ce" and
"clr"). (I know I could make a single variable-length input named, for
example, "generic_in" and then remap the bits of that to internal
signals called "ce" and "clr", but that's not desirable.)
I am fairly certain I can't employ "generates" within the entity port
list. So is there any way to do this short of using a homemade
preprocessor (e.g., Perl script) to write out the VHDL with the i/o
ports I want?
-Kevin