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.

verilog basic question ???

Status
Not open for further replies.

mohi@608

Member level 4
Joined
Apr 4, 2012
Messages
69
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,719
i have a very simple ques on verilog basic
Code:
module abc(a,b,c);
input a;
input [3:0]b;
output [3:0]c;

Code:
module abc(input a,input [3:0] b, output [3:0] c);

which of the above coding style would be better ??
 

It depends on person to person.
For me First style is comfortable.
 

well which is better from synthesis point of view ???
and i feel second is better as it is reducing the no. of lines of codes...
 
number of lines are reduced in second... synthesis time will be same.
 

well the instantiation would be same for both the styles
Code:
abc k1(a,b,c);
 

For readability purpose, I like second one formatted as below:
Code:
module abc(
       input a,
       input [3:0] b, 
       output [3:0] c
 );
 

The second style, also know as Verilog-2001 or ANSI-C style, is preferred. In this style, each port identifier is only declared once, not two or sometime three times for reg ports.
 
The second one...Fewer lines of code...Does not effect simulation time/synthesis output.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top