The generated port renaming attributes clock_prefix=, gate_prefix=, and reset_prefix= rename the ports for the clocks, clock gates and resets respectively, in a module by specifying a prefix string to be added to each port name. The prefix is used only when a either a default name or argument-level name is not provided for the port. Without a provided name, the port name is created from the prefix and the argument name. These attributes are associated with a module and are only applied when the synthesize attribute is specified for the module. The default clock, reset and gate will be named just using the prefix names. Default Naming
clock_prefix = CLK gate_prefix= CLK_GATE reset_prefix= RST_N
Attribute Syntax
(* clock_prefix = "clockprefixname", gate_prefix = "gateprefixname", The attributes can also be put on separate lines (* clock_prefix = "clockprefixname" *) BSV Example 1
(* synthesize, clock_prefix = "CK" *)
Generated Verilog 1
module mkMod(CK_clk2, Where CK is the default clock (using the user-supplied prefix), RST_N is the default reset (using the default prefix), and CK_clk2 is the oscillator for the input clk2 (using the user-supplied prefix). If a prefix is specified as the empty string, then no prefix will be used when creating the port names; that is the argument name alone will be used as the name. In this case a name must be provided for the default. BSV Example 2
(* synthesize, clock_prefix = "CK", reset_prefix = "",
Generated Verilog 2
module mkMod(CK_clk2, |
Learning BSV > Attributes >