📄 vital_timing.vhdl
字号:
--------------------------------------------------------------------------------- Title : Standard VITAL TIMING Package-- : $Revision: 597 $-- :-- Library : This package shall be compiled into a library-- : symbolically named IEEE.-- :-- Developers : IEEE DASC Timing Working Group (TWG), PAR 1076.4-- :-- Purpose : This packages defines standard types, attributes, constants,-- : functions and procedures for use in developing ASIC models.-- :-- Known Errors : -- :-- Note : No declarations or definitions shall be included in,-- : or excluded from this package. The "package declaration"-- : defines the objects (types, subtypes, constants, functions,-- : procedures ... etc.) that can be used by a user. The package-- : body shall be considered the formal definition of the-- : semantics of this package. Tool developers may choose to-- : implement the package body in the most efficient manner-- : available to them.-- -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Acknowledgments:-- This code was originally developed under the "VHDL Initiative Toward ASIC-- Libraries" (VITAL), an industry sponsored initiative. Technical-- Director: William Billowitch, VHDL Technology Group; U.S. Coordinator:-- Steve Schultz; Steering Committee Members: Victor Berman, Cadence Design-- Systems; Oz Levia, Synopsys Inc.; Ray Ryan, Ryan & Ryan; Herman van Beek,-- Texas Instruments; Victor Martin, Hewlett-Packard Company.-- -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Modification History :-- ------------------------------------------------------------------------------ Version No:|Auth:| Mod.Date:| Changes Made:-- v95.0 A | | 06/02/95 | Initial ballot draft 1995-- v95.1 | | 08/31/95 | #203 - Timing violations at time 0-- #204 - Output mapping prior to glitch detection -- ---------------------------------------------------------------------------- LIBRARY IEEE;USE IEEE.Std_Logic_1164.ALL;PACKAGE VITAL_Timing IS TYPE VitalTransitionType IS ( tr01, tr10, tr0z, trz1, tr1z, trz0, tr0X, trx1, tr1x, trx0, trxz, trzx); SUBTYPE VitalDelayType IS TIME; TYPE VitalDelayType01 IS ARRAY (VitalTransitionType RANGE tr01 to tr10) OF TIME; TYPE VitalDelayType01Z IS ARRAY (VitalTransitionType RANGE tr01 to trz0) OF TIME; TYPE VitalDelayType01ZX IS ARRAY (VitalTransitionType RANGE tr01 to trzx) OF TIME; TYPE VitalDelayArrayType IS ARRAY (NATURAL RANGE <>) OF VitalDelayType; TYPE VitalDelayArrayType01 IS ARRAY (NATURAL RANGE <>) OF VitalDelayType01; TYPE VitalDelayArrayType01Z IS ARRAY (NATURAL RANGE <>) OF VitalDelayType01Z; TYPE VitalDelayArrayType01ZX IS ARRAY (NATURAL RANGE <>) OF VitalDelayType01ZX; -- ---------------------------------------------------------------------- -- ********************************************************************** -- ---------------------------------------------------------------------- CONSTANT VitalZeroDelay : VitalDelayType := 0 ns; CONSTANT VitalZeroDelay01 : VitalDelayType01 := ( 0 ns, 0 ns ); CONSTANT VitalZeroDelay01Z : VitalDelayType01Z := ( OTHERS => 0 ns ); CONSTANT VitalZeroDelay01ZX : VitalDelayType01ZX := ( OTHERS => 0 ns ); --------------------------------------------------------------------------- -- examples of usage: --------------------------------------------------------------------------- -- tpd_CLK_Q : VitalDelayType := 5 ns; -- tpd_CLK_Q : VitalDelayType01 := (tr01 => 2 ns, tr10 => 3 ns); -- tpd_CLK_Q : VitalDelayType01Z := ( 1 ns, 2 ns, 3 ns, 4 ns, 5 ns, 6 ns ); -- tpd_CLK_Q : VitalDelayArrayType(0 to 1) -- := (0 => 5 ns, 1 => 6 ns); -- tpd_CLK_Q : VitalDelayArrayType01(0 to 1) -- := (0 => (tr01 => 2 ns, tr10 => 3 ns), -- 1 => (tr01 => 2 ns, tr10 => 3 ns)); -- tpd_CLK_Q : VitalDelayArrayType01Z(0 to 1) -- := (0 => ( 1 ns, 2 ns, 3 ns, 4 ns, 5 ns, 6 ns ), -- 1 => ( 1 ns, 2 ns, 3 ns, 4 ns, 5 ns, 6 ns )); --------------------------------------------------------------------------- -- TRUE if the model is LEVEL0 | LEVEL1 compliant ATTRIBUTE VITAL_Level0 : BOOLEAN; ATTRIBUTE VITAL_Level1 : BOOLEAN; SUBTYPE std_logic_vector2 IS std_logic_vector(1 DOWNTO 0); SUBTYPE std_logic_vector3 IS std_logic_vector(2 DOWNTO 0); SUBTYPE std_logic_vector4 IS std_logic_vector(3 DOWNTO 0); SUBTYPE std_logic_vector8 IS std_logic_vector(7 DOWNTO 0); -- Types for strength mapping of outputs TYPE VitalOutputMapType IS ARRAY ( std_ulogic ) OF std_ulogic; TYPE VitalResultMapType IS ARRAY ( UX01 ) OF std_ulogic; TYPE VitalResultZMapType IS ARRAY ( UX01Z ) OF std_ulogic; CONSTANT VitalDefaultOutputMap : VitalOutputMapType := "UX01ZWLH-"; CONSTANT VitalDefaultResultMap : VitalResultMapType := ( 'U', 'X', '0', '1' ); CONSTANT VitalDefaultResultZMap : VitalResultZMapType := ( 'U', 'X', '0', '1', 'Z' ); -- Types for fields of VitalTimingDataType TYPE VitalTimeArrayT IS ARRAY (INTEGER RANGE <>) OF TIME; TYPE VitalTimeArrayPT IS ACCESS VitalTimeArrayT; TYPE VitalBoolArrayT IS ARRAY (INTEGER RANGE <>) OF BOOLEAN; TYPE VitalBoolArrayPT IS ACCESS VitalBoolArrayT; TYPE VitalLogicArrayPT IS ACCESS std_logic_vector; TYPE VitalTimingDataType IS RECORD NotFirstFlag : BOOLEAN; RefLast : X01; RefTime : TIME; HoldEn : BOOLEAN; TestLast : std_ulogic; TestTime : TIME; SetupEn : BOOLEAN; TestLastA : VitalLogicArrayPT; TestTimeA : VitalTimeArrayPT; HoldEnA : VitalBoolArrayPT; SetupEnA : VitalBoolArrayPT; END RECORD; FUNCTION VitalTimingDataInit RETURN VitalTimingDataType; -- type for internal data of VitalPeriodPulseCheck TYPE VitalPeriodDataType IS RECORD Last : X01; Rise : TIME; Fall : TIME; NotFirstFlag : BOOLEAN; END RECORD; CONSTANT VitalPeriodDataInit : VitalPeriodDataType := ('X', 0 ns, 0 ns, FALSE ); -- Type for specifying the kind of Glitch handling to use TYPE VitalGlitchKindType IS (OnEvent, OnDetect, VitalInertial, VitalTransport); TYPE VitalGlitchDataType IS RECORD SchedTime : TIME; GlitchTime : TIME; SchedValue : std_ulogic; LastValue : std_ulogic; END RECORD; TYPE VitalGlitchDataArrayType IS ARRAY (NATURAL RANGE <>) OF VitalGlitchDataType; -- PathTypes: for handling simple PathDelay info TYPE VitalPathType IS RECORD InputChangeTime : TIME; -- timestamp for path input signal PathDelay : VitalDelayType; -- delay for this path PathCondition : BOOLEAN; -- path sensitize condition END RECORD; TYPE VitalPath01Type IS RECORD InputChangeTime : TIME; -- timestamp for path input signal PathDelay : VitalDelayType01; -- delay for this path PathCondition : BOOLEAN; -- path sensitize condition END RECORD; TYPE VitalPath01ZType IS RECORD InputChangeTime : TIME; -- timestamp for path input signal PathDelay : VitalDelayType01Z;-- delay for this path PathCondition : BOOLEAN; -- path sensitize condition END RECORD; -- For representing multiple paths to an output TYPE VitalPathArrayType IS ARRAY (NATURAL RANGE <> ) OF VitalPathType; TYPE VitalPathArray01Type IS ARRAY (NATURAL RANGE <> ) OF VitalPath01Type; TYPE VitalPathArray01ZType IS ARRAY (NATURAL RANGE <> ) OF VitalPath01ZType; TYPE VitalTableSymbolType IS ( '/', -- 0 -> 1 '\', -- 1 -> 0 'P', -- Union of '/' and '^' (any edge to 1) 'N', -- Union of '\' and 'v' (any edge to 0) 'r', -- 0 -> X 'f', -- 1 -> X 'p', -- Union of '/' and 'r' (any edge from 0) 'n', -- Union of '\' and 'f' (any edge from 1) 'R', -- Union of '^' and 'p' (any possible rising edge) 'F', -- Union of 'v' and 'n' (any possible falling edge) '^', -- X -> 1 'v', -- X -> 0 'E', -- Union of 'v' and '^' (any edge from X) 'A', -- Union of 'r' and '^' (rising edge to or from 'X') 'D', -- Union of 'f' and 'v' (falling edge to or from 'X') '*', -- Union of 'R' and 'F' (any edge) 'X', -- Unknown level '0', -- low level '1', -- high level '-', -- don't care 'B', -- 0 or 1 'Z', -- High Impedance 'S' -- steady value ); SUBTYPE VitalEdgeSymbolType IS VitalTableSymbolType RANGE '/' TO '*'; -- ------------------------------------------------------------------------ -- -- Function Name: VitalExtendToFillDelay -- -- Description: A six element array of delay values of type -- VitalDelayType01Z is returned when a 1, 2 or 6 -- element array is given. This function will convert -- VitalDelayType and VitalDelayType01 delay values into -- a VitalDelayType01Z type following these rules: -- -- When a VitalDelayType is passed, all six transition -- values are assigned the input value. When a -- VitalDelayType01 is passed, the 01 transitions are -- assigned to the 01, 0Z and Z1 transitions and the 10 -- transitions are assigned to 10, 1Z and Z0 transition -- values. When a VitalDelayType01Z is passed, the values
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -