LOOKING FOR XILINX FPGA BOARDS

Verilog Course Team is now authorized distributor for Digilent-Xilinx FPGA Boards, For more details visit www.verilogcourseteam.com/products or Contact @ +91 9894220795.

Wednesday, July 23, 2008

Verilog Coding Guidelines -Part 2

2. STYLE

2.1 Page width: 75 characters

Considering the limited page width supported in many terminals and printers, restrict the maximum line length to 75 characters. For reuse macros reduce this number to 72 to comply with RMM.

2.2 No tabs

Do not use tabs for indentation. Tab settings are different in different environments and hence can spoil the indentation in some setup.

2.3 Port ordering

Arrange the port list and declarations in a cause and effect order. Group the list/declaration on the basis of functionality rather than port direction etc. Specify the reset and clock signals at the top of the list.

2.4 One statement per line

Limit the number of HDL statements per line to one. Do not include multiple statements, separated by semicolon, in the same line. This will improve readability and will make it is easy to process the code using scripts and utilities.

2.5 One declaration per line

Limit the number of port, wire or reg declaration per line to one. Do not include multiple declarations, separated by commas, in the same line. This will make it easy to comment, add, or delete the declared objects.

Example:

Wrong way:
input trdy_n, stop_n;

Right way:
input trdy_n;
input stop_n;

No comments:

DISCLAIMER

Verilog Course Team does not warrant or assume any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed. No warranty of any kind, implied, expressed or statutory, including to fitness for a particular purpose and freedom from computer virus, is given with respect to the contents of this blog or its hyper links to other Internet resources. Reference in this blog to any specific commercial products, processes, or services, or the use of any trade, firm or corporation name is for the information, and does not constitute endorsement, recommendation, or favoring.