Can one declare more than one signal on one line?

M

Merciadri Luca

-----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-----
 
J

Jonathan Bromley

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;

?
 
M

Merciadri Luca

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

Jonathan Bromley said:
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-----
 
A

Andy

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;

?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top