[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [f-cpu] HDL coding rules
hi,
Etienne LABARRE wrote:
> On Tue, Jul 30, 2002 at 01:58:29PM +0200, Just an Illusion wrote:
> > Hi,
<snip>
> > I have an other one (coding style) :
> >
> > Defined each value of eu_inc_mode by a constant, and use them into the
> > case structure. Something like :
> > ...
> > architecture simple of eu_inc is
> > ...
> > constant C_EU_INC_MODE_NEG : natural := "000"
> > constant C_EU_INC_MODE_DEC : natural := "001"
> > constant C_EU_INC_MODE_INC : natural := "010"
> > constant C_EU_INC_MODE_ABS : natural := "011"
> > constant C_EU_INC_MODE_LSB0 : natural := "100"
> > constant C_EU_INC_MODE_LSB1 : natural := "101"
> > ...
<snip>
> >
> > Now, if you want change the eu_inc_mode coding values, you need modify
> > it only in one place.
> >
> > See the coding rule I have use to immediatly link (when read) the
> > constant value with the content of eu_inc_mode.
>
> Ok, il will modify my code. I don't wait the document had written :-)
If possible, make a separate VHDL file for these constant, or better :
add them to the f-cpu_config.vhdl.in file !
This way, the same constant will have the same value in all langages.
This will help during the maintainance.
> Etienne
WHYGEE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu in the body. http://f-cpu.seul.org/