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

📄 km432s2030.vhd

📁 vhdl cod for ram.For sp3e
💻 VHD
📖 第 1 页 / 共 5 页
字号:
                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)(18 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 MemData3(Bank)(Location) = -2 THEN                        DataDrive(3) := (others => 'U');                    ELSIF MemData3(Bank)(Location) = -1 THEN                        DataDrive(3) := (others => 'X');                    ELSE                        DataDrive(3) := to_slv(MemData3(Bank)(Location),8);                    END IF;                    IF MemData2(Bank)(Location) = -2 THEN                        DataDrive(2) := (others => 'U');                    ELSIF MemData2(Bank)(Location) = -1 THEN                        DataDrive(2) := (others => 'X');                    ELSE                        DataDrive(2) := to_slv(MemData2(Bank)(Location),8);                    END IF;                    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                    ASSERT rcdt_out(bank) = '0'                        REPORT InstancePath & partID & BankString &                               ": write command"                               & " received too soon after active."                        SEVERITY SeverityMode;                    ASSERT ((AddressIn(10) = '0') OR (AddressIn(10) = '1'))                        REPORT InstancePath & partID & BankString &                               ": AddressIn(10) = X"                               & " during write 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 (DQM3_nwv = '0') THEN                        IF Violation = '0' THEN                            MemData3(Bank)(Location) :=                                 to_nat(DataIn(31 downto 24));                        ELSE                            MemData3(Bank)(Location) := -1;                        END IF;                    END IF;                    IF (DQM2_nwv = '0') THEN                        IF Violation = '0' THEN                            MemData2(Bank)(Location) :=                                 to_nat(DataIn(23 downto 16));                        ELSE                            MemData2(Bank)(Location) := -1;                        END IF;                    END IF;                    IF (DQM1_nwv = '0') THEN                        IF Violation = '0' THEN                            MemData1(Bank)(Location) :=                                 to_nat(DataIn(15 downto 8));                        ELSE                            MemData1(Bank)(Location) := -1;                        END IF;                    END IF;                    IF (DQM0_nwv = '0') THEN                        IF Violation = '0' THEN                            MemData0(Bank)(Location) :=                                 to_nat(DataIn(7 downto 0));                        ELSE                            MemData0(Bank)(Location) := -1;                        END IF;                    END IF;                    Burst_Cnt(bank) := 1;                    wrt_in <= '1';                    IF (AddressIn(10) = '0') THEN                        statebank(bank) <= write;                    ELSIF (AddressIn(10) = '1') THEN                        statebank(bank) <= write_auto_pre;                    END IF;                    written := true;                ELSIF (cur_bank = bank) OR (command = mrs) THEN                    ASSERT false                        REPORT InstancePath & partID & BankString &                               ": Illegal command "                               & "received in active state."                        SEVERITY SeverityMode;                END IF;            WHEN write =>                IF (command = bst) THEN                    statebank(bank) <= bank_act;                    Burst_Cnt(bank) := 0;                ELSIF (command = read) THEN                  IF (bank = cur_bank) THEN                    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 MemData3(Bank)(Location) = -2 THEN                        DataDrive(3) := (others => 'U');                    ELSIF MemData3(Bank)(Location) = -1 THEN                        DataDrive(3) := (others => 'X');                    ELSE                        DataDrive(3) := to_slv(MemData3(Bank)(Location),8);                    END IF;                    IF MemData2(Bank)(Location) = -2 THEN

⌨️ 快捷键说明

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