home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!ames!data.nas.nasa.gov!taligent!apple!veritas!amdcad!dvorak.amd.com!dvorak!marvin
- From: marvin@dvorak.amd.com (Dean Marvin)
- Newsgroups: comp.lang.vhdl
- Subject: Re: VHDL Problem - Procedures & Processes
- Message-ID: <1992Aug28.181028.11411@dvorak.amd.com>
- Date: 28 Aug 92 18:10:28 GMT
- References: <1992Aug25.172750.11830@babbage.ece.uc.edu> <DLB.92Aug27103946@fanny.wash.inmet.com>
- Sender: usenet@dvorak.amd.com (Usenet News)
- Reply-To: marvin@amd.com (Dean Marvin)
- Followup-To: comp.lang.vhdl
- Distribution: usa
- Organization: Advanced Micro Devices
- Lines: 64
-
- In article <1992Aug25.172750.11830@babbage.ece.uc.edu>
- pmamtora@pumpkin.ece.uc.edu (Paddy Mamtora) writes:
-
- 2. In a procedure, can you assign to signals that are declared
- to be ports of the entity ? ( without declaring any
- formal parameters for the signals in the procedure declaration)
-
- In article <DLB.92Aug27103946@fanny.wash.inmet.com>
- dlb@hudson.wash.inmet.com (Dave Barton) replies:
-
- > Sure. The procedure must have visibility over the port; i.e., it must
- > be declared in the entity or an architecture of the entity that
- > declares the formal port. A procedure in a package does not qualify.
-
- I don't agree. Any procedure declared in the architecture declaration
- region may be called by any process in the architecture. If multiple
- processes call the same procedure that generates a signal assignment,
- then the signal value is not deterministic (a definite no no in the
- philosophy of VHDL).
-
- As a counter example:
-
- ENTITY proc IS
- PORT (
- a : out bit
- );
- END proc;
-
- ARCHITECTURE behav OF proc IS
-
- PROCEDURE assign_a (val : bit) IS
- BEGIN
- a <= val;
- END assign_a;
-
- BEGIN
-
- pa : PROCESS
- BEGIN
- assign_a('0');
- wait;
- END PROCESS pa;
-
- pb : PROCESS
- BEGIN
- assign_a('1');
- wait;
- END PROCESS pb;
-
- END behav;
-
- If this were allowed, depending on the order in which the processes were
- elaborated, the value scheduled to port a could be different. Your
- compiler should flag this as an error and disallow the assignment.
-
- It is possible to assign a signal if the procedure doing the assignment
- is declared within the declarative region of a specific process. In that case
- there is no ambiguity.
-
- For a resolved signal... we could argue about whether or not the above
- example should be allowed. My compiler says no.
-
- Dean.
- marvin@amd.com
-