I am a beginner of Verilog. I am trying to build an N-bit-comparator. But I found no information for any generic map. I know in VHDL I can do generic (N: integer:=4); so that I can modify bits when I want to use this block. If there is anything in Verilog that is similar to generic map in VHDL, it will help save me lots of work.
googled: verilog generic http://www.asic-world.com/verilog/para_modules1.html sufficient explaination for you?
It is called parameter
1 | module Sample #(parameter Width=8) (input wire [Width-1:0] DataIn) |
Instanziated it is like this:
1 | wire [11:0] Data; |
2 | Sample #(.Width(12)) InstanceName (.DataIn( Data )); |
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.