Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Verilog parameters used in port dimensions

Status
Not open for further replies.

wtr

Full Member level 5
Joined
May 1, 2014
Messages
299
Helped
29
Reputation
58
Reaction score
25
Trophy points
1,308
Activity points
4,108
Hello all,

I'm curious about how I can do the following in verilog

Code VHDL - [expand]
1
2
3
4
5
6
entity PARITY is
  generic (N : integer);
  port    (A : in std_ulogic_vector
                  (N-1 downto 0);
         ODD : out std_ulogic);
end PARITY;


I'm aware of parameters. I want to code in verilog 2001 or 2005.
Can I do the following

Code Verilog - [expand]
1
2
3
4
5
module parity (
  input [N-1:0] A,
  output          ODD
);
parameter integer N=8


The reason I'm having doubts is because the N is declared after the use.
The internet just seems to have all the old stuff anyone got a good tutorial for 2001 or 2005 syntax.

Then when instantiated in the module I expect something like the following

Code Verilog - [expand]
1
2
3
4
parity #(.N(16)) UUT(
  .A(my_in_sig),
  .ODD(my_out_sig)
);


Being a vhdl guy it hurts to not instantiate as
module_name module_instance #param #ports

Thanks
Wes
 

  • Like
Reactions: wtr

    wtr

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top