Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Verilog Coding Style - how to write best RTL code?

Status
Not open for further replies.

prisnow

Member level 2
Joined
Dec 30, 2001
Messages
42
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
233
For reduing the debug effort,how to write best RTL code?
Thanks
 

xmizi

Member level 1
Joined
Feb 21, 2002
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
218
Well, this is a too big topic. Debugging is inevitable. But several guideline to keep RTL code consistent with netlist is that:

1. Never leave out any signal in sensitivity list in combinational block.
2. Separate combinational block from sequential block;
3. never compare any signal with 'x' or 'z';
4. Be careful about blocking and non-blocking assignment.

During debug, set some monitor signals. It will always help.

Just my two cents.
 

roli

Full Member level 5
Joined
Apr 29, 2001
Messages
246
Helped
9
Reputation
20
Reaction score
9
Trophy points
1,298
Location
'SiliconWafer' Island
Activity points
1,824
For test benches - any style will do - as long as other team members can understand it. Try to use as many notes & symbols (for variables names) as you can.
For synthesys - try to follow Synopsys HDL (Verilog) User Guide.
nLint from Novas (or Debussy) will check your code for Style (and many other pitfalls) - way before actual Synthesis - thus you will save youself a lot of design/re-design efforts/time.

Hope this helps...
 

buzkiller

Member level 4
Joined
Dec 31, 1999
Messages
75
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
602
If you are writing FPGA design, don't even dream about vendor-independent HDL.
You'll be digging your own grave. Actually, there is no good reason to write such HDL.
Nobody is changing FPGA vendor in the middle of project. As for ASIC prototyping, some
parts of ASIC won't be synthesised from HDL
anyway, but taken from a library (memory etc).
Vendor-independent HDL is a mistake usually made by people who come from ASIC.

regards,
Buzkiller.
 

prisnow

Member level 2
Joined
Dec 30, 2001
Messages
42
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
233
Thank all of you.
Good suggestions
 

mutoucanada

Newbie level 6
Joined
Mar 5, 2002
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
111
Be careful with full case and parallel case
 

its_thepip

Member level 2
Joined
Sep 15, 2006
Messages
44
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
1,513
Re: Verilog Coding Style

take care with parralles statements
 

linuxluo

Full Member level 6
Joined
Jul 26, 2002
Messages
331
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
2,514
Re: Verilog Coding Style

hi,
please read the book "reuse methodology manual". it's very useful.
 

gong.kidd

Junior Member level 2
Joined
Oct 24, 2006
Messages
20
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,379
Re: Verilog Coding Style

1.be care of full case
2.Thinking of post design, dont use too many DFFs and wires between modules
 

JaneZhong

Newbie level 5
Joined
May 14, 2006
Messages
8
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,336
Verilog Coding Style

I suppose that you should know the synthesis. When you wirte the RTL , you must understand the circuit of your codes after synthesis.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top