⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcm63z818.vhd

📁 vhdl cod for ram.For sp3e
💻 VHD
📖 第 1 页 / 共 4 页
字号:
    --------------------------------------------------------------------    -- Functional Section    --------------------------------------------------------------------    IF (rising_edge(CLKIn) AND CKENIn = '0') THEN        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;        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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                    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;                        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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                    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;                        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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                 END CASE;            WHEN begin_wr =>                BWA2 := BWA1;                BWB2 := BWB1;                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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                    WHEN write =>                        state <= begin_wr;                        MemAddr := to_nat(AddressIn);                        startaddr := MemAddr;                        OBuf1 := (others => 'Z');                        BWA1 := BWANIn;                        BWB1 := BWBNIn;                        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;                        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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                    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;                        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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                 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(8 downto 0) := to_slv(MemDataA(MemAddr),9);                        OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9);                    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;                        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;                        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 17 DOWNTO 0 GENERATE            DataOut_Delay : PROCESS (D_zd(i))                VARIABLE D_GlitchData:VitalGlitchDataArrayType(17 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 + -