📄 cy7c1334.vhd
字号:
MsgOn => MsgOn, Violation => Pviol_CLK, HeaderMsg => InstancePath & PartID, CheckEnabled => (CKENIn ='0') ); Violation := Pviol_CLK OR Tviol_DatAIn_CLK OR Tviol_DatBIn_CLK OR Tviol_DatCIn_CLK OR Tviol_DatDIn_CLK OR Tviol_AddressIn_CLK OR Tviol_RIn_CLK OR Tviol_CE2In_CLK OR Tviol_CE2NegIn_CLK OR Tviol_CE1NegIn_CLK OR Tviol_ADVIn_CLK OR Tviol_CKENIn_CLK OR Tviol_BWAN_CLK OR Tviol_BWBN_CLK OR Tviol_BWCN_CLK OR Tviol_BWDN_CLK; ASSERT Violation = '0' REPORT InstancePath & partID & ": simulation may be" & " inaccurate due to timing violations" SEVERITY SeverityMode; END IF; -- Timing Check Section -------------------------------------------------------------------- -- Functional Section -------------------------------------------------------------------- IF (rising_edge(CLKIn) AND CKENIn = '0') THEN ASSERT (not(Is_X(BWDNIn))) REPORT InstancePath & partID & ": Unusable value for BWDN" SEVERITY SeverityMode; ASSERT (not(Is_X(BWCNIn))) REPORT InstancePath & partID & ": Unusable value for BWCN" SEVERITY SeverityMode; ASSERT (not(Is_X(BWBNIn))) REPORT InstancePath & partID & ": Unusable value for BWBN" SEVERITY SeverityMode; ASSERT (not(Is_X(BWANIn))) REPORT InstancePath & partID & ": Unusable value for BWAN" SEVERITY SeverityMode; ASSERT (not(Is_X(RIn))) REPORT InstancePath & partID & ": Unusable value for R" SEVERITY SeverityMode; ASSERT (not(Is_X(ADVIn))) REPORT InstancePath & partID & ": Unusable value for ADV" SEVERITY SeverityMode; ASSERT (not(Is_X(CE2In))) REPORT InstancePath & partID & ": Unusable value for CE2" SEVERITY SeverityMode; ASSERT (not(Is_X(CE1NegIn))) REPORT InstancePath & partID & ": Unusable value for CE1Neg" SEVERITY SeverityMode; ASSERT (not(Is_X(CE2NegIn))) REPORT InstancePath & partID & ": Unusable value for CE2Neg" SEVERITY SeverityMode; -- Command Decode IF ((ADVIn = '0') AND (CE1NegIn = '1' OR CE2NegIn = '1' OR CE2In = '0')) THEN command := ds; ELSIF (CE1NegIn = '0' AND CE2NegIn = '0' AND CE2In = '1' AND ADVIn = '0') THEN IF (RIn = '1') THEN command := read; ELSE command := write; END IF; ELSIF (ADVIn = '1') AND (CE1NegIn = '0' AND CE2NegIn = '0' AND CE2In = '1') THEN command := burst; ELSE ASSERT false REPORT InstancePath & partID & ": Could not decode " & "command." SEVERITY SeverityMode; END IF; IF (OENegIn = '0') THEN D_zd <= (others => 'Z'), OBuf1 AFTER 1 ns; ELSE D_zd <= (others => 'Z'); END IF; wr3 := wr2; wr2 := wr1; wr1 := false; IF (wr3) THEN IF (BWA2 = '0') THEN MemDataA(MemAddr1) := to_nat(DatAIn); END IF; IF (BWB2 = '0') THEN MemDataB(MemAddr1) := to_nat(DatBIn); END IF; IF (BWC2 = '0') THEN MemDataC(MemAddr1) := to_nat(DatCIn); END IF; IF (BWD2 = '0') THEN MemDataD(MemAddr1) := to_nat(DatDIn); END IF; END IF; MemAddr1 := MemAddr; -- The State Machine CASE state IS WHEN desel => CASE command IS WHEN ds => OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => OBuf1 := (others => 'Z'); END CASE; WHEN begin_rd => Burst_Cnt := 0; CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => state <= burst_rd; Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); END CASE; WHEN begin_wr => BWA2 := BWA1; BWB2 := BWB1; BWC2 := BWC1; BWD2 := BWD1; Burst_Cnt := 0; CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => state <= burst_wr; Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; END CASE; WHEN burst_rd => CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); END CASE; WHEN burst_wr => CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1(7 downto 0) := to_slv(MemDataA(MemAddr),8); OBuf1(15 downto 8) := to_slv(MemDataB(MemAddr),8); OBuf1(23 downto 16) := to_slv(MemDataC(MemAddr),8); OBuf1(31 downto 24) := to_slv(MemDataD(MemAddr),8); WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; END CASE; END CASE; END IF; IF (OENegIn = '1') THEN D_zd <= (others => 'Z'); END IF; END PROCESS; ------------------------------------------------------------------------ -- Path Delay Process ------------------------------------------------------------------------ DataOutBlk : FOR i IN 31 DOWNTO 0 GENERATE DataOut_Delay : PROCESS (D_zd(i)) VARIABLE D_GlitchData:VitalGlitchDataArrayType(31 Downto 0); BEGIN VitalPathDelay01Z ( OutSignal => DataOut(i), OutSignalName => "Data", OutTemp => D_zd(i), Mode => VitalTransport, GlitchData => D_GlitchData(i), Paths => ( 1 => (InputChangeTime => CLKIn'LAST_EVENT, PathDelay => tpd_CLK_DQA0, PathCondition => OENegIn = '0'), 2 => (InputChangeTime => OENegIn'LAST_EVENT, PathDelay => tpd_OENeg_DQA0, PathCondition => true) ) ); END PROCESS; END GENERATE; END BLOCK;END vhdl_behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -