Open side-bar Menu
 Real Talk

Archive for January 10th, 2013

Ascent Lint Rule of the Month: MIN_ID_LEN

Thursday, January 10th, 2013

Some lint rules point out things that are probably wrong, something missing, or code that may not do what you intended. Others enforce naming and coding rules to make code more clear, consistent, and easier to maintain.  MIN_ID_LEN is in the later group. It checks all names in your design to make sure they are at least as long as the minimum length you specify, and reports when it sees a name that is too short.

How often have we written code like the following:

for (i = 0; i < N; i = i+1) …

This ubiquitous for statement works just as well in Verilog, SystemVerilog, C, and C++.  But consider what happens when the block that follows uses the variable ‘i’ several times, and then sometime later someone needs to search through it to find out what’s happening or to debug some problem.

When I write code for either hardware design or programming, I’ve developed the habit of using at least two characters for identifier names, as in:

for(ii =0; ii < NN; ii++)  …


CST Webinar Series

Internet Business Systems © 2016 Internet Business Systems, Inc.
595 Millich Dr., Suite 216, Campbell, CA 95008
+1 (408)-337-6870 — Contact Us, or visit our other sites:
TechJobsCafe - Technical Jobs and Resumes EDACafe - Electronic Design Automation GISCafe - Geographical Information Services  MCADCafe - Mechanical Design and Engineering ShareCG - Share Computer Graphic (CG) Animation, 3D Art and 3D Models
  Privacy Policy