Can one declare more than one signal on one line?

M

Merciadri Luca

Guest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Can one write, e.g. in an architecture environment,

==
signal a, b, c: integer range 0 to 10
==
?

Thanks.
- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
- --

The greatest good you can do for another is not just share your riches, but reveal to him his own. (Benjamin Disraeli)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAkzOh3sACgkQM0LLzLt8MhwBeQCdG6OQUJ9WEQ0qWiK1Tc7xWcmi
nDIAmgKXt0pKcvlopEda63aZwlLD17wq
=ztLG
-----END PGP SIGNATURE-----
 
On Nov 1, 9:25 am, Merciadri Luca wrote:

Can one write, e.g. in an architecture environment,

=> signal a, b, c: integer range 0 to 10
=> ?
Yes, but wouldn't it be kinder to your readers
and reviewers if you write

subtype my_range is integer range 0 to 10;
signal a : my_range;
signal b : my_range;
signal c : my_range;

?
--
Jonathan Bromley
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan Bromley <spam@oxfordbromley.plus.com> writes:

On Nov 1, 9:25 am, Merciadri Luca wrote:

Can one write, e.g. in an architecture environment,

==
signal a, b, c: integer range 0 to 10
==
?

Yes, but wouldn't it be kinder to your readers
and reviewers if you write

subtype my_range is integer range 0 to 10;
signal a : my_range;
signal b : my_range;
signal c : my_range;
Yes, exactly. Thanks for the tip.

- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
- --

When making your choices in life, do not forget to live. (Samuel Johnson)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAkzOwaYACgkQM0LLzLt8MhwGDwCfZW9qH/2HdGWjfCihl7jd4zCb
cpEAnjlzeuw53rvYk/g6aXFOW3T4kYgd
=mM/K
-----END PGP SIGNATURE-----
 
On Nov 1, 7:13 am, Jonathan Bromley <s...@oxfordbromley.plus.com>
wrote:
On Nov 1, 9:25 am, Merciadri Luca wrote:

Can one write, e.g. in an architecture environment,

=> > signal a, b, c: integer range 0 to 10
=> > ?

Yes, but wouldn't it be kinder to your readers
and reviewers if you write

subtype my_range is integer range 0 to 10;
signal a : my_range;
signal b : my_range;
signal c : my_range;

?
--
Jonathan Bromley
Kindness to readers/reviewers is often not quite so simple.

If each signal declaration were followed by a comment about what the
signal was for (as I often do), I would whole-heartedly agree with
separate declarations.

If I'm trying to get the point across that all three are the same
type, that is communicated most effectively if they are declared in
the same statement. Of course, that does not mean that I would declare
all of my std_logic (or boolean) signals with one statement either.

For example, I very rarely use a dual-process (combinatorial &
clocked) representation, but when I do, I prefer to declare the
combinatorial and register signals in the same statement (with an end-
of-line comment that defines the data held by both, the names will
identify which is the reg).

Andy
 

Welcome to EDABoard.com

Sponsor

Back
Top