Generate mamping for verilog HDL

Status
Not open for further replies.

rajavel.rv

Member level 3
Joined
Dec 1, 2010
Messages
66
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Pondichéry, Puducherry, India, India
Activity points
1,685
Generic mamping for verilog HDL

Hi, how can am a passing a separate constant value to my verilog module in my top level of coding; if am using VHDL means i can use this syntax;

VHDL;
example;

entity entity_name is
generic (
K_CONSTANT : integer := 6
);
port (
);

if am port mapping this code means am using this syntax;

c1 : entity_name
generic map( K_CONSTANT => 5)
port map (

);

how can am use this type of syntax in verilog hdl; please send the syntax of verilog hdl;;;;

Regards
rajavel.rv
 

In verilog you can pass parameters in this way...
Code:
module module_name #( parameter k_constant=6)
           ( input ,
              output ports);

module_name #(.k_constant(5)) c1
              (.in(in_port),
               .out(out_port...);
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…