-- -- Copyright 1989 by --- -- -- This code is distributed for the purposes of evaluating the -- Waveform And Vector Exchange Specification (WAVES) proposal -- presented to the IEEE by the WAVES Analysis Group. This code -- may not be used for commercial purposes and may not be -- redistributed without permission of the Chairman of the WAVES -- Analysis Group, Mr Robert Hillman. -- -- Address comments or questions to -- Robert Hillman Lee Shombert -- RADC/RBRP Harris Corporation -- Griffis AFB, NY PO Box 94000 MS 16/4010 -- (315) 330-2241 Melbourne, FL 32902 -- (407) 727-6040 -- -- -- TIMESTAMP: 13-DEC-1989 12:48:32.47 -- -- CHANGES: -- 11 DEC 89 L SHOMBERT -- Replaces the directions INPUT and OUTPUT with -- STIMULUS and RESPONSE, respectively. -- -- package body WAVES_STANDARD is -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL -=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- These two ranges are defined here for convenience in the package -- body. -- subtype STA_RNG is STATE range STATE'SUCC(UNKNOWN) to STATE'RIGHT; subtype STR_RNG is STRENGTH range STRENGTH'SUCC(UNKNOWN) to STRENGTH'RIGHT; -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- An internal function that sets a state/strength combination in a -- simple logic value. The old value of the logic value is passed in -- so that settings are cummulative. -- function UPDATE_LOGIC ( NEW_STATE : STATE; NEW_STRENGTH : STRENGTH; FLAG : LOGIC_VALUE_FLAG; OLD_LOGIC : SIMPLE_LOGIC_VALUE ) return SIMPLE_LOGIC_VALUE is variable X : SIMPLE_LOGIC_VALUE := OLD_LOGIC; begin if NEW_STATE = UNKNOWN then for I in STA_RNG loop X := UPDATE_LOGIC(I, NEW_STRENGTH, FLAG, X); end loop; elsif NEW_STRENGTH = UNKNOWN then for J in STR_RNG loop X := UPDATE_LOGIC(NEW_STATE, J, FLAG, X); end loop; elsif NEW_STATE = UNSPECIFIED and NEW_STRENGTH = UNSPECIFIED then null; elsif NEW_STATE = UNSPECIFIED then X.STRENGTH_NO_STATE ( NEW_STRENGTH ) := FLAG; elsif NEW_STRENGTH = UNSPECIFIED then X.STATE_NO_STRENGTH ( NEW_STATE ) := FLAG; else X.STATE_STRENGTH ( NEW_STATE, NEW_STRENGTH ) := FLAG; end if; return X; end UPDATE_LOGIC; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- This function returns a event value in which a single state/strength -- intersection has been filled in. As a special case, STATE and -- STRENGTH can be UNKNOWN, which implies every value in STA_RNG and -- STR_RNG, respectively. -- function EVALUE ( S_DIRECTION : DIRECTION range UNSPECIFIED to RESPONSE; S_STATE : STATE; S_STRENGTH : STRENGTH; S_RELEVANCE : RELEVANCE; RANGE_SPECIFIED : BOOLEAN; RANGE_LOWER : REAL; RANGE_UPPER : REAL ) return EVENT_VALUE is variable FLAG : LOGIC_VALUE_FLAG := (TRUE, (RANGE_SPECIFIED, RANGE_LOWER, RANGE_UPPER)); variable LOGIC : SIMPLE_LOGIC_VALUE; variable DATA : EVENT_VALUE; begin LOGIC := UPDATE_LOGIC(S_STATE, S_STRENGTH, FLAG, LOGIC); LOGIC.LOGIC_RELEVANCE := S_RELEVANCE; DATA.EVENT_DIRECTION := S_DIRECTION; case DATA.EVENT_DIRECTION is when UNSPECIFIED | UNKNOWN => DATA.STIMULUS_LOGIC := LOGIC; DATA.RESPONSE_LOGIC := LOGIC; when STIMULUS => DATA.STIMULUS_LOGIC := LOGIC; when RESPONSE => DATA.RESPONSE_LOGIC := LOGIC; when COMPOUND => null; end case; return DATA; end EVALUE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- The following functions are the public interface to EVALUE. -- function EVALUE ( S_STATE : STATE := UNSPECIFIED; S_STRENGTH : STRENGTH := UNSPECIFIED; S_DIRECTION : DIRECTION range UNSPECIFIED to RESPONSE := UNSPECIFIED; S_RELEVANCE : RELEVANCE := UNSPECIFIED ) return EVENT_VALUE is begin return EVALUE ( S_DIRECTION, S_STATE, S_STRENGTH, S_RELEVANCE, FALSE, 0.0, 0.0 ); end EVALUE; function EVALUE ( S_STATE : STATE; S_STRENGTH : STRENGTH; RANGE_SINGLE : REAL; S_DIRECTION : DIRECTION range UNSPECIFIED to RESPONSE := UNSPECIFIED; S_RELEVANCE : RELEVANCE := UNSPECIFIED ) return EVENT_VALUE is begin return EVALUE ( S_DIRECTION, S_STATE, S_STRENGTH, S_RELEVANCE, TRUE, RANGE_SINGLE, RANGE_SINGLE ); end EVALUE; function EVALUE ( S_STATE : STATE; S_STRENGTH : STRENGTH; RANGE_LOWER : REAL; RANGE_UPPER : REAL; S_DIRECTION : DIRECTION range UNSPECIFIED to RESPONSE := UNSPECIFIED; S_RELEVANCE : RELEVANCE := UNSPECIFIED ) return EVENT_VALUE is begin return EVALUE ( S_DIRECTION, S_STATE, S_STRENGTH, S_RELEVANCE, TRUE, RANGE_LOWER, RANGE_UPPER ); end EVALUE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- PUBLIC =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- This function creates a compound event value out of two event values. -- The stimulus side of the first parameter is selected for the stimulus side of -- the result and the response side of the second parameter is selected for -- the response side of the result. If the first parameter is RESPONSE, then -- the stimulus side of the result is UNSPECIFIED. If the second parameter -- is STIMULUS then the response side of the result is UNSPECIFIED. -- function COMPOUND_EVALUE ( I_NODE : EVENT_VALUE; O_NODE : EVENT_VALUE ) return EVENT_VALUE is variable DATA : EVENT_VALUE; begin DATA.EVENT_DIRECTION := COMPOUND; if I_NODE.EVENT_DIRECTION /= RESPONSE then DATA.STIMULUS_LOGIC := I_NODE.STIMULUS_LOGIC; end if; if O_NODE.EVENT_DIRECTION /= STIMULUS then DATA.RESPONSE_LOGIC := O_NODE.RESPONSE_LOGIC; end if; return DATA; end COMPOUND_EVALUE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- An internal function that merges two strength ranges. The result is -- the envelope of the stimuluss. That is, if both stimuluss are SPECIFIED -- then the result runs from the minimum of the two lower bounds to the -- maximum of the two upper bounds. If only one stimulus is SPECIFIED then -- the result has the same bounds as that of the specified stimulus. If -- neither is SPECIFIED then the result is not specified. -- function ADD_STRENGTH_RANGE ( A : STRENGTH_RANGE; B : STRENGTH_RANGE ) return STRENGTH_RANGE is variable X : STRENGTH_RANGE; begin if A.SPECIFIED and B.SPECIFIED then X.SPECIFIED := TRUE; if A.LOWER_BOUND < B.LOWER_BOUND then X.LOWER_BOUND := A.LOWER_BOUND; else X.LOWER_BOUND := B.LOWER_BOUND; end if; if A.UPPER_BOUND > B.UPPER_BOUND then X.UPPER_BOUND := A.UPPER_BOUND; else X.UPPER_BOUND := B.UPPER_BOUND; end if; return X; elsif A.SPECIFIED then return A; elsif B.SPECIFIED then return B; else return (FALSE, 0.0, 0.0); end if; end ADD_STRENGTH_RANGE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- An internal function that "or"'s two logic value flags. If the -- result of the "or" is an included logic value then the strength -- ranges are merged. -- function ADD_LOGIC_FLAG ( A : LOGIC_VALUE_FLAG; B : LOGIC_VALUE_FLAG ) return LOGIC_VALUE_FLAG is begin if A.INCLUDED and B.INCLUDED then return ( INCLUDED => TRUE, STRENGTH_VALUE => ADD_STRENGTH_RANGE ( A.STRENGTH_VALUE, B.STRENGTH_VALUE ) ); elsif A.INCLUDED then return A; elsif B.INCLUDED then return B; else return ( INCLUDED => FALSE, STRENGTH_VALUE => (FALSE, 0.0, 0.0) ); end if; end ADD_LOGIC_FLAG; -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- An internal function that returns a normalized simple logic value. A -- normalized simple logic value does not have an unspecified state or -- strength INCLUDED if there is a corresponding (state, strength) -- combination INCLUDED. -- function NORMALIZE_SIMPLE_LOGIC ( A : SIMPLE_LOGIC_VALUE ) return SIMPLE_LOGIC_VALUE is variable X : SIMPLE_LOGIC_VALUE := A; begin for I in STA_RNG loop for J in STR_RNG loop if X.STATE_STRENGTH(I, J).INCLUDED then X.STATE_NO_STRENGTH(I).INCLUDED := FALSE; X.STRENGTH_NO_STATE(J).INCLUDED := FALSE; end if; end loop; end loop; return X; end NORMALIZE_SIMPLE_LOGIC; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- An internal function that "or"'s two simple logic blocks together. -- If both paramters have a state/strength combination set, then the -- strength range selected is the envelope of the two strength ranges. -- function ADD_SIMPLE_LOGIC ( A : SIMPLE_LOGIC_VALUE; B : SIMPLE_LOGIC_VALUE ) return SIMPLE_LOGIC_VALUE is variable X : SIMPLE_LOGIC_VALUE; begin for I in STA_RNG loop for J in STR_RNG loop X.STATE_STRENGTH(I, J) := ADD_LOGIC_FLAG ( A.STATE_STRENGTH(I,J), B.STATE_STRENGTH(I,J)); end loop; end loop; for I in STA_RNG loop X.STATE_NO_STRENGTH(I) := ADD_LOGIC_FLAG ( A.STATE_NO_STRENGTH(I), B.STATE_NO_STRENGTH(I)); end loop; for J in STR_RNG loop X.STRENGTH_NO_STATE(J) := ADD_LOGIC_FLAG ( A.STRENGTH_NO_STATE(J), B.STRENGTH_NO_STATE(J)); end loop; if A.LOGIC_RELEVANCE = B.LOGIC_RELEVANCE then X.LOGIC_RELEVANCE := A.LOGIC_RELEVANCE; elsif A.LOGIC_RELEVANCE = UNSPECIFIED then X.LOGIC_RELEVANCE := B.LOGIC_RELEVANCE; elsif B.LOGIC_RELEVANCE = UNSPECIFIED then X.LOGIC_RELEVANCE := A.LOGIC_RELEVANCE; else X.LOGIC_RELEVANCE := UNKNOWN; end if; return NORMALIZE_SIMPLE_LOGIC(X); end ADD_SIMPLE_LOGIC; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- PUBLIC =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- A function that adds ("or"'s) two event values. Every state/strength -- combination set in either stimuluss is set in the response. If the same -- combination is set in both stimuluss then the resultant strength range -- is the envelope of the two stimulus strength ranges. The direction of -- the result is determined as follows: -- if either stimulus is COMPOUND the result is COMPOUND -- if either stimulus is UNSPECIFIED the result is the direction of the -- other stimulus (including the case where both stimuluss are UNSPECIFIED). -- if both stimuluss have the same direction, that is the direction of the -- result. -- otherwise the result has direction UNKNOWN. -- function ADD_EVALUE ( A : EVENT_VALUE; B : EVENT_VALUE ) return EVENT_VALUE is variable X : EVENT_VALUE; begin X.STIMULUS_LOGIC := ADD_SIMPLE_LOGIC ( A.STIMULUS_LOGIC, B.STIMULUS_LOGIC ); X.RESPONSE_LOGIC := ADD_SIMPLE_LOGIC ( A.RESPONSE_LOGIC, B.RESPONSE_LOGIC ); if A.EVENT_DIRECTION = B.EVENT_DIRECTION then X.EVENT_DIRECTION := A.EVENT_DIRECTION; elsif A.EVENT_DIRECTION = COMPOUND or B.EVENT_DIRECTION = COMPOUND then X.EVENT_DIRECTION := COMPOUND; elsif A.EVENT_DIRECTION = UNSPECIFIED then X.EVENT_DIRECTION := UNKNOWN; X.STIMULUS_LOGIC := ADD_SIMPLE_LOGIC ( X.STIMULUS_LOGIC, A.RESPONSE_LOGIC ); X.RESPONSE_LOGIC := ADD_SIMPLE_LOGIC ( X.RESPONSE_LOGIC, A.STIMULUS_LOGIC ); elsif B.EVENT_DIRECTION = UNSPECIFIED then X.EVENT_DIRECTION := UNKNOWN; X.STIMULUS_LOGIC := ADD_SIMPLE_LOGIC ( X.STIMULUS_LOGIC, B.RESPONSE_LOGIC ); X.RESPONSE_LOGIC := ADD_SIMPLE_LOGIC ( X.RESPONSE_LOGIC, B.STIMULUS_LOGIC ); else X.EVENT_DIRECTION := UNKNOWN; end if; return X; end ADD_EVALUE; -- -- A function that removes the event value tuples specified in the -- second operand from those specified in the first operand. -- Considering an event value as a set of tuples, the operation is -- "A and not B". -- function SUBTRACT_EVALUE ( A : EVENT_VALUE; B : EVENT_VALUE ) return EVENT_VALUE is variable X : EVENT_VALUE; begin return A; end SUBTRACT_EVALUE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- An internal function that returns a simple logic value with (state, -- strength) combinations filled in according to the single stimulus. The -- stimulus defines a hypercube. The minimum strength and the minimum -- state set in the stimulus determine one corner of the hypercube. The -- maximum strength and the maximum state set in the stimulus determine -- the other corner. The minimum lower bound used for any strength -- range becomes the lower bound for all strength ranges between the two -- corners and the maximum upper bound used for any strength range -- becomes the upper bound for all strength ranges between the two -- corners. The three arrays STATE_STRENGTH, STATE_NO_STRENGTH, and -- STRENGTH_NO_STATE are filled in separately, however the resulting -- simple logic value is normalized before being returned. -- function LOGIC_RANGE ( A : SIMPLE_LOGIC_VALUE ) return SIMPLE_LOGIC_VALUE is variable STA_MIN : STATE := UNSPECIFIED; variable STA_MAX : STATE := UNSPECIFIED; variable STR_MIN : STRENGTH := UNSPECIFIED; variable STR_MAX : STRENGTH := UNSPECIFIED; variable STR_FLAG : STRENGTH_RANGE; variable X : SIMPLE_LOGIC_VALUE := A; begin for I in STA_RNG loop for J in STR_RNG loop if X.STATE_STRENGTH(I,J).INCLUDED then if STA_MIN = UNSPECIFIED then STA_MIN := I; end if; STA_MAX := I; end if; end loop; end loop; for J in STR_RNG loop for I in STA_RNG loop if X.STATE_STRENGTH(I,J).INCLUDED then if STR_MIN = UNSPECIFIED then STR_MIN := J; end if; STR_MAX := J; STR_FLAG := ADD_STRENGTH_RANGE( STR_FLAG, X.STATE_STRENGTH(I,J).STRENGTH_VALUE); end if; end loop; end loop; if STA_MIN /= UNSPECIFIED and STR_MIN /= UNSPECIFIED then for I in STA_MIN to STA_MAX loop for J in STR_MIN to STR_MAX loop X.STATE_STRENGTH(I,J).INCLUDED := TRUE; X.STATE_STRENGTH(I,J).STRENGTH_VALUE := STR_FLAG; end loop; end loop; end if; STA_MIN := UNSPECIFIED; STR_FLAG := (FALSE, 0.0, 0.0); for I in STA_RNG loop if X.STATE_NO_STRENGTH(I).INCLUDED then if STA_MIN = UNSPECIFIED then STA_MIN := I; end if; STA_MAX := I; STR_FLAG := ADD_STRENGTH_RANGE( STR_FLAG, X.STATE_NO_STRENGTH(I).STRENGTH_VALUE); end if; end loop; if STA_MIN /= UNSPECIFIED then for I in STA_MIN to STA_MAX loop X.STATE_NO_STRENGTH(I).INCLUDED := TRUE; X.STATE_NO_STRENGTH(I).STRENGTH_VALUE := STR_FLAG; end loop; end if; STR_MIN := UNSPECIFIED; STR_FLAG := (FALSE, 0.0, 0.0); for J in STR_RNG loop if X.STRENGTH_NO_STATE(J).INCLUDED then if STR_MIN = UNSPECIFIED then STR_MIN := J; end if; STR_MAX := J; STR_FLAG := ADD_STRENGTH_RANGE( STR_FLAG, X.STRENGTH_NO_STATE(J).STRENGTH_VALUE); end if; end loop; if STR_MIN /= UNSPECIFIED then for J in STR_MIN to STR_MAX loop X.STRENGTH_NO_STATE(J).INCLUDED := TRUE; X.STRENGTH_NO_STATE(J).STRENGTH_VALUE := STR_FLAG; end loop; end if; return NORMALIZE_SIMPLE_LOGIC(X); end LOGIC_RANGE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- PUBLIC =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- A function that returns a event value with state/strength combinations -- filled in according to the two stimuluss. The two stimulus event values -- represent corners of a hypercube. The direction and relevance of the -- result is the same as returned by the addition operation. -- function EVALUE_RANGE ( A : EVENT_VALUE; B : EVENT_VALUE ) return EVENT_VALUE is variable X : EVENT_VALUE := ADD_EVALUE(A, B); begin X.STIMULUS_LOGIC := LOGIC_RANGE(X.STIMULUS_LOGIC); X.RESPONSE_LOGIC := LOGIC_RANGE(X.RESPONSE_LOGIC); return X; end EVALUE_RANGE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL -=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- A procedure that returns -- 1) a Boolean bit string of dimension STA_RNG, with a bit set for -- every STATE that is set in the incoming simple logic value. -- 2) a count of the number of STATEs set -- 3) a Boolean bit string of dimension STR_RNG, with a bit set for -- every STRENGTH that is set in the incoming simple logic value. -- 4) a count of the number of STRENGTHs set -- type STATE_BIT_MASK is array (STA_RNG) of BOOLEAN; type STRENGTH_BIT_MASK is array (STR_RNG) of BOOLEAN; type LOGIC_SETTINGS is record STA_MASK : STATE_BIT_MASK; STA_COUNT : NATURAL; STR_MASK : STRENGTH_BIT_MASK; STR_COUNT : NATURAL; end record; function GET_LOGIC_SETTINGS ( A : in SIMPLE_LOGIC_VALUE ) return LOGIC_SETTINGS is variable STA_COUNT : INTEGER; variable STR_COUNT : INTEGER; variable X : LOGIC_SETTINGS; begin STA_COUNT := 0; for I in STA_RNG loop X.STA_MASK(I) := X.STA_MASK(I) or A.STATE_NO_STRENGTH(I).INCLUDED; for J in STR_RNG LOOP X.STA_MASK(I) := X.STA_MASK(I) or A.STATE_STRENGTH(I,J).INCLUDED; end loop; if X.STA_MASK(I) then STA_COUNT := STA_COUNT + 1; end if; end loop; STR_COUNT := 0; for I in STR_RNG loop X.STR_MASK(I) := X.STR_MASK(I) or A.STRENGTH_NO_STATE(I).INCLUDED; for J in STA_RNG LOOP X.STR_MASK(I) := X.STR_MASK(I) or A.STATE_STRENGTH(J,I).INCLUDED; end loop; if X.STR_MASK(I) then STR_COUNT := STR_COUNT + 1; end if; end loop; return X; end GET_LOGIC_SETTINGS; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- INTERNAL -=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- A function that returns a simple logic value based on the two stimuluss. -- If the left stimulus (A) has any UNSPECIFIED component, that component -- is copied from the right stimulus (B). A simple logic value has an -- unspecified STATE if no STATE is specified in any of the arrays. -- Similarly with STRENGTH. The strength range is not merged, so if A -- has a specified STRENGTH but an UNSPECIFIED strength range, and B has -- a specified strength range, the result has an UNSPECIFIED strength range. -- function MERGE_SIMPLE_LOGIC_VALUE ( A : SIMPLE_LOGIC_VALUE; B : SIMPLE_LOGIC_VALUE ) return SIMPLE_LOGIC_VALUE is variable A_BITS : LOGIC_SETTINGS := GET_LOGIC_SETTINGS(A); variable B_BITS : LOGIC_SETTINGS := GET_LOGIC_SETTINGS(B); variable X : SIMPLE_LOGIC_VALUE := A; begin if A_BITS.STA_COUNT > 0 and A_BITS.STR_COUNT > 0 then return X; elsif A_BITS.STA_COUNT > 0 then for I in STA_RNG loop for J in STR_RNG loop if A_BITS.STA_MASK(I) and B_BITS.STR_MASK(J) then X.STATE_STRENGTH(I,J).INCLUDED := TRUE; X.STATE_STRENGTH(I,J).STRENGTH_VALUE.SPECIFIED := TRUE; end if; end loop; end loop; elsif A_BITS.STR_COUNT > 0 then for I in STA_RNG loop for J in STR_RNG loop if B_BITS.STA_MASK(I) and A_BITS.STR_MASK(J) then X.STATE_STRENGTH(I,J) := A.STRENGTH_NO_STATE(J); end if; end loop; end loop; else X := B; end if; if A.LOGIC_RELEVANCE = UNSPECIFIED then X.LOGIC_RELEVANCE := B.LOGIC_RELEVANCE; end if; return NORMALIZE_SIMPLE_LOGIC(X); end MERGE_SIMPLE_LOGIC_VALUE; -- -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=- PUBLIC =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- -- A function that returns a event value based on the two stimuluss. If -- the left stimulus (A) has any UNSPECIFIED component, that component is -- copied from the right stimulus (B). SIMPLE_LOGIC_VALUES are merged -- separately. A SIMPLE_LOGIC_VALUE has an unspecified STATE if no -- STATE is specified in any of the arrays. Similarly with STRENGTH. -- The strength range is not merged, so if A has a specified STRENGTH -- but an UNSPECIFIED strength range, and B has a specified strength -- range, the result has an UNSPECIFIED strength range. -- function MERGE_EVALUE ( A : EVENT_VALUE; B : EVENT_VALUE ) return EVENT_VALUE is variable X : EVENT_VALUE; begin X.STIMULUS_LOGIC := MERGE_SIMPLE_LOGIC_VALUE ( A.STIMULUS_LOGIC, B.STIMULUS_LOGIC); X.RESPONSE_LOGIC := MERGE_SIMPLE_LOGIC_VALUE ( A.RESPONSE_LOGIC, B.RESPONSE_LOGIC); if A.EVENT_DIRECTION /= UNSPECIFIED then X.EVENT_DIRECTION := A.EVENT_DIRECTION; else X.EVENT_DIRECTION := B.EVENT_DIRECTION; end if; return X; end MERGE_EVALUE; end WAVES_STANDARD;