VHDL Issue Number: 0182 Classification: Language Definition Problem Language Version: VHDL-87 Summary: VPI Issue 6 -- Assigning NULL to signals Related Issues: 0159 Relevant LRM Sections: 8.3.1 9.5 Key Words and Phrases: NULL, signal, assignment, disconnection, time multiplexing. Current Status: ISAC-Approved 1076-1993 Disposition: Bugs Fixed, Enhancements Outstanding (No ISAC Issues) Disposition Rationale: Non-ISAC issues outstanding. Superseded By: N/A ----------------------- Date Submitted: 1991/03/15 Author of Submission: J. R. Armstrong Author's Affiliation: Virginia Polytechnic Institute and State University Author's Post Address: Bradley Department of Electrical Engineering Virginia Polytechnic Institute and State University Blacksburg, VA 24061 Author's Phone Number: (703) 231-4723 Author's Fax Number: Author's Net Address: JRA@VTVM1.CC.VT.EDU ----------------------- Date Analyzed: 1991/11/22 Author of Analysis: Oz Levia Revision Number: $Revision: 1.11 $ Date Last Revised: $Date: 1995/08/04 01:45:13 $ Description of Problem ---------------------- The LRM is contradictory in the case of an assign- ment which assigns the value null. The LRM requires that the assignment statement which assigns the null value should be inside a guarded block, yet also specifies that such a statement is a sequential statement. Test File: ch08/s03/s01/08010101.vhd and ch08/s03/s1/02030101.vhd Comment: This is the problem of "Time Multiplexing With Processes" that J. R. Armstrong has previously described to the VASG. One would like to be able to replace the "process inside a block" form in the above mentioned test with: process(S1) begin if S1 = '1' then X <= '1'; else X <= null, null; end if; end process; and have the assignment of null to X disconnect the process' driver from the resolution function. --##83108111248FF***********************************************************- ** -- --+ File: [SUITE.CH08.S03.S1]08010101.vhd -- --+ Copyright: (c) 1989 by Virginia Tech. All rights reserved. -- --+ LRM_Version: IEEE Std. 1076-1987 -- --+ Subsets: All -- --+ Description: -- --+ Test_point - (080310_080101) "For a signal assignment, for the -- purposes of marking transactions, any two successive null transactions -- in a projected output waveform are considered to have the same value -- component." -- --+ Test_objective (1) - Test that any two successive null assignments -- have the same value components. -- --+ References: None -- --+ Instructions: None -- --+ Keywords: entity, process, null. -- --+ Test_Results: Expect_Success: Output_Checked. -- --+ Test_Type: Locally Static Semantic -- --+ History: Created KSC/VTech 11-10-89 -- Corrected CHC/VTech 5-4-90 -- Corrected CHC/VTech 5-7-90 -- --+ Comments: This test case should be referred to the VASG since the -- LRM is contradictory in the case of a null assignment. The LRM -- requires that the null assignment should be inside a guarded block -- and also specifies that such an assignment is a sequential statement. -- --**************************************************************************- ** package TSL is type MVL is ('0', '1', 'Z'); type TVECT is array (INTEGER RANGE <>) of MVL; function BUSFUNC(INPUT: TVECT) return MVL; subtype TS1 is BUSFUNC MVL; type TSV is array (INTEGER RANGE <>) of TS1; subtype WORD is TSV(1 downto 0); end TSL; package body TSL is function BUSFUNC(INPUT: TVECT) return MVL is variable RESOLVED_VALUE: MVL := 'Z'; begin for I in INPUT'RANGE loop if INPUT(I) /= 'Z' then RESOLVED_VALUE := INPUT(I); exit; end if; end loop; return RESOLVED_VALUE; end BUSFUNC; end TSL; use WORK.TSL.all; entity test is end; architecture t1 of test is signal S1 : BIT; signal X : BUSFUNC MVL bus; begin S1 <= transport '1' after 5 ns, '0' after 15 ns; A : block(S1 = '1') begin process(GUARD) begin if GUARD then X <= '1'; else X <= null, null after 1 ns; end if; end process; end block A; end t1; -- ##83102311248FF************************************************************ -- --+ File: [SUITE.CH08.S03.S1]02030101.vhd -- --+ Copyright: (c) 1989 by Virginia Tech. All rights reserved. -- --+ LRM_Version: IEEE Std. 1076-1987 -- --+ Subsets: All -- --+ Description: -- --+ Test_point - (080310_020301) "A waveform element which consists -- of the reserved word null and a after clause(optional) is used -- to specify that the driver of the signal is to be turned off, so -- that it stops contributing to the value of the target." -- --+ Test_objective (1) - Test if the driver of the signal of the -- signal is turned off when the waveform element consists of the -- reserved word null and an optional after clause. -- --+ References: None -- --+ Instructions: None -- --+ Keywords: entity, process, null. -- --+ Test_Results: Expect_Success: Output_Checked. -- --+ Test_Type: Locally Static Semantic -- --+ History: Created KSC/VTech 11-10-89 -- Corrected CHC/VTech 5-4-90 -- --+ Comments: This test case should be referred to the VASG since the -- LRM is contradictory in the case of a null assignment. The LRM -- requires that the null assignment should be inside a guarded block -- and also specifies that such an assignment is a sequential statement. -- --**************************************************************************- ** package TSL is type MVL is ('0', '1', 'Z'); type TVECT is array (INTEGER RANGE <>) of MVL; function BUSFUNC(INPUT: TVECT) return MVL; subtype TS1 is BUSFUNC MVL; type TSV is array (INTEGER RANGE <>) of TS1; subtype WORD is TSV(1 downto 0); end TSL; package body TSL is function BUSFUNC(INPUT: TVECT) return MVL is variable RESOLVED_VALUE: MVL := 'Z'; begin for I in INPUT'RANGE loop if INPUT(I) /= 'Z' then RESOLVED_VALUE := INPUT(I); exit; end if; end loop; return RESOLVED_VALUE; end BUSFUNC; end TSL; use WORK.TSL.all; entity test is end; architecture t1 of test is signal S1 : BIT; signal X : BUSFUNC MVL bus; begin S1 <= transport '1' after 5 ns, '0' after 15 ns; A : block(S1 = '1') begin process(GUARD) begin if GUARD then X <= '1'; else X <= null; end if; end process; end block A; end t1; Proposed Resolution ------------------- TBD VASG-ISAC Analysis & Rationale ------------------------------ Much confusion exist in this area. This is because the term "guard(ed)" is used to refer to more then one concept and also because the semantics and specifications of guarded signal assignment are distributed. The relevant terms are: 1). GUARDED block: A block which has a guard expression after the reserved word guard. Example: c : block(clk = '1') Such a block has an implicit declaration of a signal named GUARD. Such signal is assigned the expression in the guard expression. 2). GUARDED signal: a signal which is of kind BUS or REGISTER. Example: signal s1 : bit bus; Such signal has specific semantics relating to the way it is updated (LRM 2.4) 3). A GUARDED target: a target which is composed of guarded signal. 4). A Disconnection specification: Specify what is the time, after a GUARD signal changes it's value to false, on which the driver of a particular signal is to be disconnected. A disconnection is achieved by a NULL transaction and is allowed only for guarded signals. Example: disconnect all: bit after 1 ns; Each guarded signal has one applicable disconnection specification. If no explicit disconnection specification exist an implicit specification apply (...after 0 ns). 5). Disconnection statement: an assignment of NULL to a signal. Allowed only for guarded target. 6). GUARDED signal assignment: a conditional/selected signal assignment using the reserved word GUARDED. A guarded signal assignment is under the control of a guard signal. Each such assignment has the semantics of an equivalent process, the semantics are also related to the property of the target! The following relation exist: (LRM 9.5) Concurrent | | Signal | | Assignment | Target | Equivalent Process ================================================================ GUARDED | GUARDED | if Guard then | | signal_transform | | else | | disconnection_statements | | end if; ---------------------------------------------------------------- GUARDED | NOT GUARDED | if Guard then | | signal_transform | | end if; ---------------------------------------------------------------- NOT GUARDED | GUARDED | ERORR!! ---------------------------------------------------------------- NOT GUARDED | NOT GUARDED | signal_transform ---------------------------------------------------------------- The ISAC does not see any reason to conclude, based on the definitions above, that disconnection statements are allowed in guarded blocks alone. In fact, disconnection statements (assigning NULL) are allowed providing the target is guarded. If the target is not guarded, it is an error (LRM 8.3.1.) Also, note that the first example in this IR is in error since the waveform is not ascending in time. VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- No changes are need in relation to the original issue the IR has raised. The assumption that disconnection statements must be inside a guarded block is incorrect. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- We debated the appropriateness of allowing disconnection statements (<= NULL) to apply to a non-guarded signal. What is required, is for people to do time multiplexing. This is a problem in VHDL-87 since you have to use guarded signals and you get more then you need (i.e. they are subject to a guard signal, and may have memory). Often in models, enumeration types are used with one enumeration literal designated as the "not effecting" value. Combined with a resolution function, this value can achieve the effect of disconnection. Our recommendation is for the next revision of the language to allow the use of disconnection statements to non-guard signals. The semantics of such assignment will be similar as for guarded signal (of kind BUS), it will delete the driver from the array parameter to the resolution function.