[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[oc] Re: coding conventions



I've been lurking on this issue up to now, but I'm going to say my piece -
though it sounds like most of you won't go for it.

Here's what I use:
  Port names begin with a Capital letter, and are generally kept as short as
possible.
I can't stand the idea of a xxxxAAAAnnnnn naming convention.  I hate long
names.  They really make the code look ugly and provide very little
information that a few well placed comments can't provide.  Give the signal
a moniker that is understandable, and follow it with a description after the
signal declaration:
	signal DCas : std_logic;	-- Dram Column Address Strobe.

  Internal signal and variables begin with a lower case letter.  If it is a
registered signal, I append it with a "_q".  If it is a falling edge clocked
signal, it is appended with a "_qf".  Negative logic signals are appended
with "_n".  Tri-state signals are with "_z".  Combinations of the previous
are often used.  Types get an "_t".  
	signal cas_qfn : std_logic;  -- Falling edge clocked CAS*.

  As far as keeping track of what module a signal comes from, I just make
that
clear as a comment after the port mapping in the component instantiation:
   dram_m : drc	
   port map (
      Adrs => Adrs;    -- From adrs_mux
      DCas => DCas;  -- To control
	
Anyway, my 2 cents.

- WoodyJ