📄 orca_io.vhd
字号:
END BLOCK; -------------------- -- behavior section -------------------- VitalBehavior : PROCESS (i_ipd) -- functionality results VARIABLE i_ipd2 : std_ulogic := 'X'; VARIABLE results : std_logic_vector(1 to 1) := (others => 'X'); ALIAS o_zd : std_ulogic IS results(1); -- output glitch detection VARIABLEs VARIABLE o_GlitchData : VitalGlitchDataType; BEGIN ------------------------- -- functionality section ------------------------- i_ipd2 := VitalIDENT (data => i_ipd, resultmap => ('U','X','0','1','H')); o_zd := VitalBUF(i_ipd2); ---------------------- -- path delay section ---------------------- VitalPathDelay01 ( OutSignal => o, OutSignalName => "o", OutTemp => o_zd, Paths => (0 => (i_ipd'last_event, (tpd_i_o), TRUE)), GlitchData => o_GlitchData, Mode => OnDetect, XOn => XOn, MsgOn => MsgOn);END PROCESS;END v;------- cell ifs1p3bx -------LIBRARY ieee;USE ieee.std_logic_1164.all;USE ieee.vital_timing.all;USE ieee.vital_primitives.all;USE work.global.gsrnet;USE work.global.purnet; ENTITY ifs1p3bx IS GENERIC ( gsr : String := "ENABLED"; TimingChecksOn : boolean := TRUE; XOn : boolean := FALSE; MsgOn : boolean := TRUE; InstancePath : string := "ifs1p3bx"; -- propagation delays tpd_sclk_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_pd_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_sp_q : VitalDelayType01 := (0.001 ns, 0.001 ns); -- setup and hold constraints tsetup_d_sclk_noedge_posedge : VitalDelayType := 0.0 ns; thold_d_sclk_noedge_posedge : VitalDelayType := 0.0 ns; tsetup_sp_sclk_noedge_posedge : VitalDelayType := 0.0 ns; thold_sp_sclk_noedge_posedge : VitalDelayType := 0.0 ns; -- input SIGNAL delays tipd_d : VitalDelayType01 := (0.0 ns, 0.0 ns); tipd_sp : VitalDelayType01 := (0.0 ns, 0.0 ns); tipd_sclk : VitalDelayType01 := (0.0 ns, 0.0 ns); tipd_pd : VitalDelayType01 := (0.0 ns, 0.0 ns); -- pulse width constraints tperiod_sclk : VitalDelayType := 0.001 ns; tpw_sclk_posedge : VitalDelayType := 0.001 ns; tpw_sclk_negedge : VitalDelayType := 0.001 ns; tperiod_pd : VitalDelayType := 0.001 ns; tpw_pd_posedge : VitalDelayType := 0.001 ns; tpw_pd_negedge : VitalDelayType := 0.001 ns); PORT ( d : IN std_logic; sp : IN std_logic; sclk : IN std_logic; pd : IN std_logic; q : OUT std_logic); ATTRIBUTE Vital_Level0 OF ifs1p3bx : ENTITY IS TRUE;END ifs1p3bx ; -- architecture body --ARCHITECTURE v OF ifs1p3bx IS ATTRIBUTE Vital_Level0 OF v : ARCHITECTURE IS TRUE; SIGNAL d_ipd : std_logic := '0'; SIGNAL sclk_ipd: std_logic := '0'; SIGNAL sp_ipd : std_logic := '0'; SIGNAL pd_ipd : std_logic := '0'; BEGIN --------------------- -- input path delays --------------------- WireDelay : BLOCK BEGIN VitalWireDelay(d_ipd, d, tipd_d); VitalWireDelay(sclk_ipd, sclk, tipd_sclk); VitalWireDelay(sp_ipd, sp, tipd_sp); VitalWireDelay(pd_ipd, pd, tipd_pd); END BLOCK; -------------------- -- behavior section -------------------- VitalBehavior : PROCESS (d_ipd, sp_ipd, sclk_ipd, pd_ipd, gsrnet, purnet) CONSTANT ff_table : VitalStateTableType (1 to 25, 1 to 7) := ( -- viol pre ce sclk d q qnew ( 'X', '-', '-', '-', '-', '-', 'X' ), -- timing Violation ( '-', '1', '-', '-', '-', '-', '1' ), -- async. preset ( '-', '0', '0', '-', '-', '-', 'S' ), -- clock disabled ( '-', '0', '1', '/', '0', '-', '0' ), -- low d->q on rising sclk ( '-', '0', '1', '/', '1', '-', '1' ), -- high d->q on rising sclk ( '-', '0', '1', '/', 'X', '-', 'X' ), -- clock an x if d is x ( '-', '0', '1', 'A', '0', '0', 'S' ), -- if ce is 1 & sclk edge is (0->x or x->1), and ( '-', '0', '1', 'A', '1', '1', 'S' ), -- d & q are equal, then q remains the same ( '-', '0', '1', 'A', '-', '-', 'X' ), -- otherwise, q becomes x ( '-', '0', 'X', 'R', '0', '0', 'S' ), -- if ce is x on any pssible rising edge of sclk, and ( '-', '0', 'X', 'R', '1', '1', 'S' ), -- d & q are equal, then q remains the same ( '-', '0', 'X', 'R', '-', '-', 'X' ), -- otherwise, q becomes x ( '-', '0', '-', 'F', '-', '-', 'S' ), -- preserve q on any possible falling edge of sclk, or ( '-', '0', '-', 'B', '-', '-', 'S' ), -- a stable 0 or 1 clock, or ( '-', '0', '-', 'X', '-', '-', 'S' ), -- a stable x clock ( '-', 'X', '-', '-', '1', '1', 'S' ), -- when pre=x: preserve q(=1) if d & q are 1 ( '-', 'X', '0', '-', '-', '1', 'S' ), -- also preservce q(=1) if ce=0 & q=1 ( '-', 'X', '0', '-', '-', '-', 'X' ), -- ce=0 & q=(0 or x) => q=x ( '-', 'X', '1', '/', '1', '-', '1' ), -- d=1 on rising sclk => q=1 ( '-', 'X', '1', 'A', '1', '-', 'X' ), -- d=1 & q=(0 or x) on (0->x or x->1) sclk edge => q=x ( '-', 'X', '1', 'R', '-', '-', 'X' ), -- d=(0 or x) on any possible rising edge => q=x ( '-', 'X', 'X', 'R', '-', '-', 'X' ), -- ce=x on any possible rising edge (d q != 1 1) => q=x ( '-', 'X', '-', 'F', '-', '1', 'S' ), -- preserve q (=1) on any possible falling edge of sclk, or ( '-', 'X', '-', 'B', '-', '1', 'S' ), -- a stable 0 or 1 clock, or ( '-', 'X', '-', 'X', '-', '1', 'S' ) ); -- a stable x clock -- timing check results VARIABLE tviol_sclk : X01 := '0'; VARIABLE tviol_d : X01 := '0'; VARIABLE tviol_sp : X01 := '0'; VARIABLE tviol_pd : X01 := '0'; VARIABLE d_sclk_TimingDatash : VitalTimingDataType; VARIABLE sp_sclk_TimingDatash : VitalTimingDataType; VARIABLE periodcheckinfo_sclk : VitalPeriodDataType; VARIABLE periodcheckinfo_pd : VitalPeriodDataType; -- functionality results VARIABLE set_reset : std_logic := '1'; VARIABLE violation : X01 := '0'; VARIABLE prevdata : std_logic_vector (0 to 5) := (others=>'X'); VARIABLE results : std_logic_vector (1 to 1) := "1"; ALIAS q_zd : std_ulogic IS results(1); VARIABLE preset : std_logic := 'X'; VARIABLE tpd_gsr_q : VitalDelayType01 := (0.001 ns, 0.001 ns); VARIABLE tpd_pur_q : VitalDelayType01 := (0.001 ns, 0.001 ns); -- output glitch detection VARIABLEs VARIABLE q_GlitchData : VitalGlitchDataType; BEGIN ------------------------ -- timing check section ------------------------ IF (TimingChecksOn) THEN VitalSetupHoldCheck ( TestSignal => d_ipd, TestSignalName => "d", RefSignal => sclk_ipd, RefSignalName => "sclk", SetupHigh => tsetup_d_sclk_noedge_posedge, SetupLow => tsetup_d_sclk_noedge_posedge, HoldHigh => thold_d_sclk_noedge_posedge, HoldLow => thold_d_sclk_noedge_posedge, CheckEnabled => (set_reset='1' AND pd_ipd='0' AND sp_ipd='1'), RefTransition => '/', MsgOn => MsgOn, XOn => XOn, HeaderMsg => InstancePath, TimingData => d_sclk_timingdatash, Violation => tviol_d, MsgSeverity => warning); VitalSetupHoldCheck ( TestSignal => sp_ipd, TestSignalName => "sp", RefSignal => sclk_ipd, RefSignalName => "sclk", SetupHigh => tsetup_sp_sclk_noedge_posedge, SetupLow => tsetup_sp_sclk_noedge_posedge, HoldHigh => thold_sp_sclk_noedge_posedge, HoldLow => thold_sp_sclk_noedge_posedge, CheckEnabled => (set_reset='1' AND pd_ipd='0'), RefTransition => '/', MsgOn => MsgOn, XOn => XOn, HeaderMsg => InstancePath, TimingData => sp_sclk_timingdatash, Violation => tviol_sp, MsgSeverity => warning); VitalPeriodPulseCheck ( TestSignal => sclk_ipd, TestSignalName => "sclk", Period => tperiod_sclk, PulseWidthHigh => tpw_sclk_posedge, PulseWidthLow => tpw_sclk_negedge, PeriodData => periodcheckinfo_sclk, Violation => tviol_sclk, MsgOn => MsgOn, XOn => XOn, HeaderMsg => InstancePath, CheckEnabled => TRUE, MsgSeverity => warning); VitalPeriodPulseCheck ( TestSignal => pd_ipd, TestSignalName => "pd", Period => tperiod_pd, PulseWidthHigh => tpw_pd_posedge, PulseWidthLow => tpw_pd_negedge, PeriodData => periodcheckinfo_pd, Violation => tviol_pd, MsgOn => MsgOn, XOn => XOn, HeaderMsg => InstancePath, CheckEnabled => TRUE, MsgSeverity => warning); END IF; ----------------------------------- -- functionality section. ----------------------------------- violation := tviol_d or tviol_sp or tviol_sclk; IF (gsr = "DISABLED") THEN set_reset := purnet; ELSE set_reset := purnet AND gsrnet; END IF; preset := VitalOR2 (a => NOT(set_reset), b => pd_ipd); vitalstatetable (statetable => ff_table, datain => (violation, preset, sp_ipd, sclk_ipd, d_ipd), numstates => 1, result => results, previousdatain => prevdata); ----------------------------------- -- path delay section. ----------------------------------- VitalPathDelay01 ( OutSignal => q, OutSignalName => "q", OutTemp => q_zd, Paths => (0 => (inputchangetime => sclk_ipd'last_event, pathdelay => tpd_sclk_q, pathcondition => TRUE), 1 => (sp_ipd'last_event, tpd_sp_q, TRUE), 2 => (pd_ipd'last_event, tpd_pd_q, TRUE), 3 => (gsrnet'last_event, tpd_gsr_q, TRUE), 4 => (purnet'last_event, tpd_pur_q, TRUE)), GlitchData => q_GlitchData, Mode => OnDetect, XOn => XOn, MsgOn => MsgOn);END PROCESS; END v;------- cell ifs1p3dx -------LIBRARY ieee;USE ieee.std_logic_1164.all;USE ieee.vital_timing.all;USE ieee.vital_primitives.all;USE work.global.gsrnet;USE work.global.purnet; ENTITY ifs1p3dx IS GENERIC ( gsr : String := "ENABLED"; TimingChecksOn : boolean := TRUE; XOn : boolean := FALSE; MsgOn : boolean := TRUE; InstancePath : string := "ifs1p3dx"; -- propagation delays tpd_sclk_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_cd_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_sp_q : VitalDelayType01 := (0.001 ns, 0.001 ns); -- setup and hold constraints tsetup_d_sclk_noedge_posedge : VitalDelayType := 0.0 ns; thold_d_sclk_noedge_posedge : VitalDelayType := 0.0 ns; tsetup_sp_sclk_noedge_posedge : VitalDelayType := 0.0 ns; thold_sp_sclk_noedge_posedge : VitalDelayType := 0.0 ns; -- input SIGNAL delays tipd_d : VitalDelayType01 := (0.0 ns, 0.0 ns); tipd_sp : VitalDelayType01 := (0.0 ns, 0.0 ns); tipd_sclk : VitalDelayType01 := (0.0 ns, 0.0 ns); tipd_cd : VitalDelayType01 := (0.0 ns, 0.0 ns); -- pulse width constraints tperiod_sclk : VitalDelayType := 0.001 ns; tpw_sclk_posedge : VitalDelayType := 0.001 ns; tpw_sclk_negedge : VitalDelayType := 0.001 ns; tperiod_cd : VitalDelayType := 0.001 ns; tpw_cd_posedge : VitalDelayType := 0.001 ns; tpw_cd_negedge : VitalDelayType := 0.001 ns); PORT ( d : IN std_logic; sp : IN std_logic; sclk : IN std_logic; cd : IN std_logic; q : OUT std_logic); ATTRIBUTE Vital_Level0 OF ifs1p3dx : ENTITY IS TRUE;END ifs1p3dx ; -- architecture body --ARCHITECTURE v OF ifs1p3dx IS ATTRIBUTE Vital_Level0 OF v : ARCHITECTURE IS TRUE; SIGNAL d_ipd : std_logic := '0'; SIGNAL sclk_ipd : std_logic := '0'; SIGNAL sp_ipd : std_logic := '0'; SIGNAL cd_ipd : std_logic := '0'; BEGIN --------------------- -- input path delays --------------------- WireDelay : BLOCK BEGIN VitalWireDelay(d_ipd, d, tipd_d); VitalWireDelay(sclk_ipd, sclk, tipd_sclk); VitalWireDelay(sp_ipd, sp, tipd_sp); VitalWireDelay(cd_ipd, cd, tipd_cd); END BLOCK; -------------------- -- behavior section -------------------- VitalBehavior : PROCESS (d_ipd, sp_ipd, sclk_ipd, cd_ipd, gsrnet, purnet) CONSTANT ff_table : VitalStateTableType (1 to 25, 1 to 7) := ( -- viol clr ce sclk d q qnew ( 'X', '-', '-', '-', '-', '-', 'X' ), -- timing Violation ( '-', '1', '-', '-', '-', '-', '0' ), -- async. clear ( '-', '0', '0', '-', '-', '-', 'S' ), -- clock disabled ( '-', '0', '1', '/', '0', '-', '0' ), -- low d->q on rising sclk ( '-', '0', '1', '/', '1', '-', '1' ), -- high d->q on rising sclk ( '-', '0', '1', '/', 'X', '-', 'X' ), -- clock an x if d is x ( '-', '0', '1', 'A', '0', '0', 'S' ), -- if ce is 1 & sclk edge is (0->x or x->1), and ( '-', '0', '1', 'A', '1', '1', 'S' ), -- d & q are equal, then q remains the same ( '-', '0', '1', 'A', '-', '-', 'X' ), -- otherwise, q becomes x ( '-', '0', 'X', 'R', '0', '0', 'S' ), -- if ce is x on any pssible rising edge of sclk, and ( '-', '0', 'X', 'R', '1', '1', 'S' ), -- d & q are equal, then q remains the same ( '-', '0', 'X', 'R', '-', '-', 'X' ), -- otherwise, q becomes x ( '-', '0', '-', 'F', '-', '-', 'S' ), -- preserve q on any possible falling edge of sclk, or ( '-', '0', '-', 'B', '-', '-', 'S' ), -- a stable 0 or 1 clock, or ( '-', '0', '-', 'X', '-', '-', 'S' ), -- a stable x clock ( '-', 'X', '-', '-', '0', '0', 'S' ), -- when clr=x: preserve q(=0) if d & q are 0 ( '-', 'X', '0', '-', '-', '0', 'S' ), -- also preservce q(=0) if ce=0 & q=0 ( '-', 'X', '0', '-', '-', '-', 'X' ), -- ce=0 & q=(1 or x) => q=x ( '-', 'X', '1', '/', '0', '-', '0' ), -- d=0 on rising sclk => q=0 ( '-', 'X', '1', 'A', '0', '-', 'X' ), -- d=0 & q=(1 or x) on (0->x or x->1) sclk edge => q=x ( '-', 'X', '1', 'R', '-', '-', 'X' ), -- d=(1 or x) on any possible rising edge => q=x ( '-', 'X', 'X', 'R', '-', '-', 'X' ), -- ce=x on any possible rising edge (d q != 0 0) => q=x ( '-', 'X', '-', 'F', '-', '0', 'S' ), -- preserve q (=0) on any possible falling edge of sclk, or ( '-', 'X', '-', 'B', '-', '0', 'S' ), -- a stable 0 or 1 clock, or ( '-', 'X', '-', 'X', '-', '0', 'S' ) ); -- a stable x clock -- timing check results VARIABLE tviol_sclk : X01 := '0';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -