📄 orca_io.vhd
字号:
InstancePath : string := "ifs1p3jx"; -- propagation delays tpd_sclk_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_sp_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_pd_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_pd_sclk_noedge_posedge : VitalDelayType := 0.0 ns; thold_pd_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 ifs1p3jx : ENTITY IS TRUE;END ifs1p3jx ; -- architecture body --ARCHITECTURE v OF ifs1p3jx 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 35, 1 to 8) := ( -- viol pre spr ce sclk d q qnew ( 'X', '-', '-', '-', '-', '-', '-', 'X' ), -- timing Violation ( '-', '0', '-', '-', '-', '-', '-', '1' ), -- async. preset (active low) ( '-', '1', '0', '0', '-', '-', '-', 'S' ), -- clock disabled ( '-', '1', '1', '-', '/', '-', '-', '1' ), -- spr=1 on rising sclk => q=1 ( '-', '1', '1', '-', 'A', '-', '1', 'S' ), -- preserve q(=1) if spr=1 & sclk is (0->x or x->1) ( '-', '1', '1', '-', 'A', '-', '-', 'X' ), -- q=(0 or x) => q=x ( '-', '1', 'X', '-', 'R', '1', '1', 'S' ), -- preserve q if spr=x & sclk is any possible rising edge ( '-', '1', 'X', '0', 'R', '-', '1', 'S' ), -- & either d & q are 1 or ce=0 & q=1 ( '-', '1', 'X', '-', 'R', '-', '-', 'X' ), -- otherwise => q=x ( '-', '1', '0', '1', '/', '0', '-', '0' ), -- low d->q on rising sclk ( '-', '1', '-', '1', '/', '1', '-', '1' ), -- high d->q on rising sclk ( '-', '1', '0', '1', '/', 'X', '-', 'X' ), -- clock an x if d is x ( '-', '1', '0', '1', 'A', '0', '0', 'S' ), -- if ce is 1 & sclk edge is (0->x or x->1), and ( '-', '1', '0', '1', 'A', '1', '1', 'S' ), -- d & q are equal, then q remains the same ( '-', '1', '0', '1', 'A', '-', '-', 'X' ), -- otherwise, q becomes x ( '-', '1', '0', 'X', 'R', '0', '0', 'S' ), -- if ce is x on any pssible rising edge of sclk, and ( '-', '1', '0', 'X', 'R', '1', '1', 'S' ), -- d & q are equal, then q remains the same ( '-', '1', '0', 'X', 'R', '-', '-', 'X' ), -- otherwise, q becomes x ( '-', '1', '-', '-', 'F', '-', '-', 'S' ), -- preserve q on any possible falling edge of sclk, or ( '-', '1', '-', '-', 'B', '-', '-', 'S' ), -- a stable 0 or 1 clock, or ( '-', '1', '-', '-', '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', '0', '-', '-', '-', 'X' ), -- spr=0 & ce=0 & q=(0 or x) => q=x ( '-', 'X', '1', '-', '/', '-', '-', '1' ), -- spr=1 on rising sclk => q=1 ( '-', 'X', '1', '-', 'A', '-', '1', 'S' ), -- preserve q(=1) if spr=1 & sclk is (0->x or x->1) ( '-', 'X', '1', '-', 'A', '-', '-', 'X' ), -- q=(0 or x) => q=x ( '-', 'X', 'X', '-', 'R', '-', '-', 'X' ), -- spr=x on rising sclk & (d q != 1 1) & (ce q != 0 1) => q=x ( '-', 'X', '-', '1', '/', '1', '-', '1' ), -- d=1 on rising sclk => q=1 ( '-', 'X', '0', '1', 'A', '1', '-', 'X' ), -- d=1 & q=(0 or x) on (0->x or x->1) sclk edge => q=x ( '-', 'X', '0', '1', 'R', '-', '-', 'X' ), -- d=(0 or x) on any possible rising edge => q=x ( '-', 'X', '0', '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_pd : X01 := '0'; VARIABLE tsviol_pd : X01 := '0'; VARIABLE tviol_sp : X01 := '0'; VARIABLE d_sclk_TimingDatash : VitalTimingDataType; VARIABLE pd_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 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 => pd_ipd, TestSignalName => "pd", RefSignal => sclk_ipd, RefSignalName => "sclk", SetupHigh => tsetup_pd_sclk_noedge_posedge, SetupLow => tsetup_pd_sclk_noedge_posedge, HoldHigh => thold_pd_sclk_noedge_posedge, HoldLow => thold_pd_sclk_noedge_posedge, CheckEnabled => (set_reset='1'), RefTransition => '/', MsgOn => MsgOn, XOn => XOn, HeaderMsg => InstancePath, TimingData => pd_sclk_timingdatash, Violation => tsviol_pd, 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'), 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_pd or tviol_sp or tviol_sclk; IF (gsr = "DISABLED") THEN set_reset := purnet; ELSE set_reset := purnet AND gsrnet; END IF; vitalstatetable (statetable => ff_table, datain => (violation, set_reset, pd_ipd, 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 ifs1s1b -------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 ifs1s1b IS GENERIC ( gsr : String := "ENABLED"; TimingChecksOn : boolean := TRUE; XOn : boolean := FALSE; MsgOn : boolean := TRUE; InstancePath : string := "ifs1s1b"; -- propagation delays tpd_sclk_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_d_q : VitalDelayType01 := (0.001 ns, 0.001 ns); tpd_pd_q : VitalDelayType01 := (0.001 ns, 0.001 ns); -- setup and hold constraints tsetup_d_sclk_noedge_negedge : VitalDelayType := 0.0 ns; thold_d_sclk_noedge_negedge : VitalDelayType := 0.0 ns; -- input SIGNAL delays tipd_d : 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; sclk : IN std_logic; pd : IN std_logic; q : OUT std_logic); ATTRIBUTE Vital_Level0 OF ifs1s1b : ENTITY IS TRUE;END ifs1s1b ; -- architecture body --ARCHITECTURE v OF ifs1s1b IS ATTRIBUTE Vital_Level0 OF v : ARCHITECTURE IS TRUE; SIGNAL d_ipd : std_logic := '0'; SIGNAL sclk_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(pd_ipd, pd, tipd_pd); END BLOCK; -------------------- -- behavior section -------------------- VitalBehavior : PROCESS (d_ipd, sclk_ipd, pd_ipd, gsrnet, purnet) CONSTANT latch_table : VitalStateTableType (1 to 6, 1 to 6) := ( -- viol pre sclk d q qnew ( 'X', '-', '-', '-', '-', 'X' ), -- timing violation ( '-', '1', '-', '-', '-', '1' ), -- async. preset ( '-', '0', '0', '-', '-', 'S' ), -- clock low ( '-', '0', '1', '0', '-', '0' ), -- low d->q on rising edge sclk ( '-', '0', '1', '1', '-', '1' ), -- high d->q on rising edge sclk ( '-', '0', '1', 'X', '-', 'X' ) ); -- clock an x if d is x -- timing check results VARIABLE tviol_sclk : X01 := '0'; VARIABLE tviol_d : X01 := '0'; VARIABLE tviol_pd : X01 := '0'; VARIABLE d_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_negedge, SetupLow => tsetup_d_sclk_noedge_negedge, HoldHigh => thold_d_sclk_noedge_negedge, HoldLow => thold_d_sclk_noedge_negedge, CheckEnabled => (set_reset='1' AND pd_ipd='0'), RefTransition => '\', MsgOn => MsgOn, XOn => XOn, HeaderMsg => InstancePath, TimingData => d_sclk_timingdatash, Violation => tviol_d, 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. ---------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -