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

📄 k4s161622d.vhd

📁 vhdl cod for ram.For sp3e
💻 VHD
📖 第 1 页 / 共 5 页
字号:
                    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 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;                  ELSE                    statebank(bank) <= bank_act;                  END IF;                ELSIF (command = writ) THEN                  IF cur_bank = 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 (UDQM_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 (LDQM_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) = '1') THEN                        statebank(bank) <= write_auto_pre;                    END IF;                  ELSE                    statebank(bank) <= bank_act;                  END IF;                ELSIF (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;                    ASSERT (LDQM_nwv = '1' AND UDQM_nwv = '1')                        REPORT InstancePath & partID & BankString &                               ": DQMs should be"                               & " held high, data is lost."                        SEVERITY SeverityMode;                        statebank(bank) <= precharge, idle AFTER tdevice_TRP;                ELSIF (command = nop) OR (cur_bank /= bank) THEN                    IF (Burst_Cnt(bank) = Burst_Length OR WB = single) THEN                        statebank(bank) <= bank_act;                        Burst_Cnt(bank) := 0;                        ras_in(bank) <= '1';                    ELSE                        IF (Burst = sequential) THEN                            Burst_Inc(bank) := (Burst_Inc(bank) + 1) MOD                                                Burst_Length;                        ELSE                            Burst_Inc(bank) := intab(StartAddr(bank))                                                    (Burst_Cnt(bank));                        END IF;                        Location := BaseLoc(bank) + Burst_Inc(bank);                       IF (UDQM_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 (LDQM_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) := Burst_Cnt(bank) + 1;                        wrt_in <= '1';                    END IF;                ELSIF cur_bank = bank THEN                    ASSERT false                        REPORT InstancePath & partID & ": Illegal command"                               & " received in write state."                        SEVERITY SeverityMode;                END IF;            WHEN read =>                IF (command = bst) THEN                    statebank(bank) <= bank_act;                    Burst_Cnt(bank) := 0;                ELSIF (command = read) THEN                  IF cur_bank = 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 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;                  ELSE                    statebank(bank) <= bank_act;                  END IF;                ELSIF (command = writ) THEN                  IF cur_bank = bank 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 (UDQM_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 (LDQM_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;                  ELSE                    statebank(bank) <= bank_act;                  END IF;                ELSIF (command = pre) AND ((cur_bank = bank) OR                        (AddressIn(10) = '1')) THEN                    statebank(bank) <= precharge, idle AFTER tdevice_TRP;                    ASSERT ras_out(bank) = '1'                        REPORT InstancePath & partID & BankString &                           ": precharge command"                               & " does not meet tRAS time."                        SEVERITY SeverityMode;                ELSIF (command = nop) OR (cur_bank /= bank) THEN                    IF (Burst_Cnt(bank) = Burst_Length) THEN                        statebank(bank) <= bank_act;                        Burst_Cnt(bank) := 0;                        ras_in(bank) <= '1';                    ELSE                        IF (Burst = sequential) THEN                            Burst_Inc(bank) := (Burst_Inc(bank) + 1) MOD                                                Burst_Length;                        ELSE                            Burst_Inc(bank) := intab(StartAddr(bank))                                                    (Burst_Cnt(bank));                        END IF;                        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) := Burst_Cnt(bank) + 1;                    END IF;                ELSIF cur_bank = bank THEN                    ASSERT false                        REPORT InstancePath & partID & BankString &                               ": Illegal command"                               & " received in read state."                        SEVERITY SeverityMode;                END IF;            WHEN write_auto_pre =>                IF (command = nop) OR (cur_bank /= bank) THEN                    IF (Burst_Cnt(bank) = Burst_Length OR WB = single) THEN                        statebank(bank) <= precharge, idle AFTER tdevice_TRP;                        Burst_Cnt(bank) := 0;                        ras_in(bank) 

⌨️ 快捷键说明

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