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

📄 km416s4030.vhd

📁 vhdl cod for ram.For sp3e
💻 VHD
📖 第 1 页 / 共 5 页
字号:
            ELSE                chip_en := false;            END IF;        END IF;    END IF;    IF (rising_edge(CLKIn) AND CKEreg = '1' AND to_X01(CSNegIn) = '0') THEN        ASSERT (not(Is_X(DQMLIn)))            REPORT InstancePath & partID & ": Unusable value for DQML"            SEVERITY SeverityMode;        ASSERT (not(Is_X(DQMUIn)))            REPORT InstancePath & partID & ": Unusable value for DQMU"            SEVERITY SeverityMode;        ASSERT (not(Is_X(WENegIn)))            REPORT InstancePath & partID & ": Unusable value for WENeg"            SEVERITY SeverityMode;        ASSERT (not(Is_X(RASNegIn)))            REPORT InstancePath & partID & ": Unusable value for RASNeg"            SEVERITY SeverityMode;        ASSERT (not(Is_X(CASNegIn)))            REPORT InstancePath & partID & ": Unusable value for CASNeg"            SEVERITY SeverityMode;        -- Command Decode        IF ((RASNegIn = '1') AND (CASNegIn = '1') AND (WENegIn = '1')) THEN            command := nop;        ELSIF ((RASNegIn = '0') AND (CASNegIn = '1') AND (WENegIn = '1')) THEN            command := act;        ELSIF ((RASNegIn = '1') AND (CASNegIn = '0') AND (WENegIn = '1')) THEN            command := read;        ELSIF ((RASNegIn = '1') AND (CASNegIn = '0') AND (WENegIn = '0')) THEN            command := writ;        ELSIF ((RASNegIn = '1') AND (CASNegIn = '1') AND (WENegIn = '0')) THEN            command := bst;        ELSIF ((RASNegIn = '0') AND (CASNegIn = '1') AND (WENegIn = '0')) THEN            command := pre;        ELSIF ((RASNegIn = '0') AND (CASNegIn = '0') AND (WENegIn = '1')) THEN            command := ref;        ELSIF ((RASNegIn = '0') AND (CASNegIn = '0') AND (WENegIn = '0')) THEN            command := mrs;        END IF;        -- PowerUp Check        IF (NOT(PoweredUp) AND command /= nop) THEN            ASSERT false                REPORT InstancePath & partID & ": Incorrect power up. Command"                      & " issued before power up complete."                SEVERITY SeverityMode;        END IF;        -- Bank Decode        CASE BAIn IS            WHEN "00" => cur_bank := 0; BankString := " Bank-0 ";            WHEN "01" => cur_bank := 1; BankString := " Bank-1 ";            WHEN "10" => cur_bank := 2; BankString := " Bank-2 ";            WHEN "11" => cur_bank := 3; BankString := " Bank-3 ";            WHEN others =>                ASSERT false                    REPORT InstancePath & partID & ": Could not decode bank"                           & " selection - results may be incorrect."                    SEVERITY SeverityMode;        END CASE;    END IF;    -- The Big State Machine    IF (rising_edge(CLKIn) AND CKEreg = '1') THEN        ASSERT (not(Is_X(CSNegIn)))            REPORT InstancePath & partID & ": Unusable value for CSNeg"            SEVERITY SeverityMode;        IF (CSNegIn = '1') THEN            command := nop;        END IF;        -- DQM pipeline        DQMU_reg2 := DQMU_reg1;        DQML_reg2 := DQML_reg1;        DQMU_reg1 := DQMU_reg0;        DQML_reg1 := DQML_reg0;        DQMU_reg0 := DQMUIn;        DQML_reg0 := DQMLIn;        -- by default data drive is Z, might get over written in one        -- of the passes below        DataDrive(1) := (OTHERS => 'Z');        DataDrive(0) := (OTHERS => 'Z');        banks : FOR bank IN 0 TO hi_bank LOOP        CASE statebank(bank) IS            WHEN pwron =>                 ASSERT (DQMLIn = '1' AND DQMUIn = '1')                    REPORT InstancePath & partID & BankString                            &": DQMs must be held high"                           & " during initialization."                    SEVERITY SeverityMode;                IF (PoweredUp = false) THEN                    ASSERT (command = nop)                        REPORT InstancePath & partID & BankString                               &": Only NOPs allowed"                               & " during power up."                        SEVERITY SeverityMode;                    DataDrive(0) := "ZZZZZZZZ";                    DataDrive(1) := "ZZZZZZZZ";                ELSIF (command = pre) AND ((cur_bank = bank) OR (AddressIn(10) = '1'))                                                 THEN                    statebank(bank) <= precharge, idle AFTER tdevice_TRP;                END IF;            WHEN precharge =>                IF cur_bank = bank THEN                    -- It is only an error if this bank is selected                    ASSERT (command = nop OR command = pre)                        REPORT InstancePath & partID & BankString                               &": Illegal command received"                               & " during precharge."                        SEVERITY SeverityMode;                END IF;            WHEN idle =>                IF (command = nop OR command = bst OR command = pre) OR                                 (cur_bank /= bank) THEN                    null;                ELSIF (command = mrs) THEN                    IF (statebank = idle & idle & idle & idle) THEN                        ModeReg := AddressIn;                        statebank <= mode_set & mode_set & mode_set & mode_set;                    END IF;                ELSIF (command = ref) THEN                    IF (statebank = idle & idle & idle & idle) THEN                        IF (CKEIn = '1') THEN                            statebank(bank) <= auto_refresh, idle                                  AFTER tdevice_TRCAR;                        ELSE                            statebank(bank) <= self_refresh;                        END IF;                    END IF;                ELSIF (command = act) THEN                    statebank(bank) <= bank_act;                    ras_in(bank)  <= '1', '0' AFTER 70 ns;                    rct_in  <= '1', '0' AFTER 1 ns;                    rcdt_in(bank) <= '1', '0' AFTER 1 ns;                    MemAddr(bank)(19 downto 8) := AddressIn;  -- latch row addr                ELSE  -- IF cur_bank = bank THEN                    ASSERT false                        REPORT InstancePath & partID & ": Illegal command"                               & " received in idle state."                        SEVERITY SeverityMode;                END IF;            WHEN mode_set =>                statebank <= idle & idle & idle & idle;                ASSERT (ModeReg(7) = '0' AND ModeReg(8) ='0')                    REPORT InstancePath & partID & BankString                           &": Illegal operating mode set."                    SEVERITY SeverityMode;                ASSERT command = nop                    REPORT InstancePath & partID & BankString                           & ": Illegal command received during mode_set."                    SEVERITY SeverityMode;                -- read burst length                IF (ModeReg(2 downto 0) = "000") THEN                    Burst_Length := 1;                    Burst_Bits := 0;                ELSIF (ModeReg(2 downto 0) = "001") THEN                    Burst_Length := 2;                    Burst_Bits := 1;                ELSIF (ModeReg(2 downto 0) = "010") THEN                    Burst_Length := 4;                    Burst_Bits := 2;                ELSIF (ModeReg(2 downto 0) = "011") THEN                    Burst_Length := 8;                    Burst_Bits := 3;                ELSIF (ModeReg(2 downto 0) = "111") THEN                    Burst_Length := 256;                    Burst_Bits := 7;                ELSE                    ASSERT false                        REPORT InstancePath & partID & BankString                               &": Invalid burst length specified."                        SEVERITY SeverityMode;                END IF;                -- read burst type                IF (ModeReg(3) = '0') THEN                    Burst := sequential;                ELSIF (ModeReg(3) = '1') THEN                    Burst := interleave;                ELSE                    ASSERT false                        REPORT InstancePath & partID & BankString                               &": Invalid burst type specified."                        SEVERITY SeverityMode;                END IF;                -- read CAS latency                IF (ModeReg(6 downto 4) = "010") THEN                    CAS_Lat <= 2;                ELSIF (ModeReg(6 downto 4) = "011") THEN                    CAS_Lat <= 3;                ELSE                    ASSERT false                    REPORT InstancePath & partID & BankString &                        ": CAS Latency set incorrecty "                    SEVERITY SeverityMode;                END IF;                -- read write burst mode                IF (ModeReg(9) = '0') THEN                    WB := programmed;                ELSIF (ModeReg(9) = '1') THEN                    WB := single;                ELSE                    ASSERT false                        REPORT InstancePath & partID & BankString &                               ": Invalid burst type specified."                        SEVERITY SeverityMode;                END IF;            WHEN auto_refresh =>                IF (Ref_Cnt < 4096) THEN                    Ref_Cnt := Ref_Cnt + 1;                END IF;                ASSERT command = nop                    REPORT InstancePath & partID & BankString &                           ": Illegal command received during auto_refresh."                    SEVERITY SeverityMode;            WHEN bank_act =>                IF (command = pre) AND ((cur_bank = bank) OR (AddressIn(10) = '1'))                                               THEN                    ASSERT ras_out(bank) = '1'                        REPORT InstancePath & partID & BankString &                               ": precharge command"                               & " does not meet tRAS time."                        SEVERITY SeverityMode;                        statebank(bank) <= precharge, idle AFTER tdevice_TRP;                ELSIF (command = nop OR command = bst) OR (cur_bank /= bank) THEN                    null;                ELSIF (command = read) THEN                    ASSERT rcdt_out(bank) = '0'                        REPORT InstancePath & partID & BankString &                               ": read command received too soon after active."                        SEVERITY SeverityMode;                    ASSERT ((AddressIn(10) = '0') OR (AddressIn(10) = '1'))                        REPORT InstancePath & partID & BankString &                               ": AddressIn(10) = X"                               & " during read command. Next state unknown."                        SEVERITY SeverityMode;                    MemAddr(bank)(7 downto 0) := (others => '0');                                                             -- clr old addr                    MemAddr(bank)(7 downto Burst_Bits) :=                              AddressIn(7 downto Burst_Bits); --latch col addr                    IF (Burst_Bits > 0) THEN                        Burst_Inc(bank) :=                                 to_nat(AddressIn(Burst_Bits-1 downto 0));                    END IF;                    StartAddr(bank) := Burst_Inc(bank) mod 8;                    BaseLoc(bank) := to_nat(MemAddr(bank));                    Location := BaseLoc(bank) + Burst_Inc(bank);                    IF MemData1(Bank)(Location) = -2 THEN                        DataDrive(1) := (others => 'U');                    ELSIF MemData1(Bank)(Location) = -1 THEN                        DataDrive(1) := (others => 'X');                    ELSE                        DataDrive(1) := to_slv(MemData1(Bank)(Location),8);                    END IF;                    IF MemData0(Bank)(Location) = -2 THEN                        DataDrive(0) := (others => 'U');                    ELSIF MemData0(Bank)(Location) = -1 THEN                        DataDrive(0) := (others => 'X');                    ELSE                        DataDrive(0) := to_slv(MemData0(Bank)(Location),8);                    END IF;                    Burst_Cnt(bank) := 1;                    IF (AddressIn(10) = '0') THEN                        statebank(bank) <= read;                    ELSIF (AddressIn(10) = '1') THEN                        statebank(bank) <= read_auto_pre;                    END IF;                ELSIF (command = writ) THEN

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -