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

📄 mt48lc32m16a2.vhd

📁 vhdl cod for ram.For sp3e
💻 VHD
📖 第 1 页 / 共 5 页
字号:
                                                (BurstCnt(bank));                    END IF;                    Loc := 2*(BaseLoc(bank) + BurstInc(bank));                    MemWrite(Bank);                    BurstCnt(bank) := BurstCnt(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;                BurstCnt(bank) := 0;            ELSIF (command = read) THEN                IF cur_bank = bank THEN                    MemAddr(bank)(9 downto 0):= (others => '0');-- clr old addr                    BurstIncProc(Bank);                    MemAddr(bank)(9 downto Burst_Bits) :=                            AddressIn(9 downto Burst_Bits); --latch col addr                    StartAddr(bank) := BurstInc(bank) mod 8;                    BaseLoc(bank)   := to_nat(MemAddr(bank));                    Loc := 2*(BaseLoc(bank) + BurstInc(bank));                    generate_out(Bank);                    BurstCnt(bank) := 1;                    NextStateAuto(Bank,read);                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)(9 downto 0):= (others => '0');-- clr old addr                    MemAddr(bank)(9 downto Burst_Bits) :=                            AddressIn(9 downto Burst_Bits); --latch col addr                    BurstIncProc(Bank);                    StartAddr(bank) := BurstInc(bank) mod 8;                    BaseLoc(bank) := to_nat(MemAddr(bank));                    Loc := 2*(BaseLoc(bank) + BurstInc(bank));                    MemWrite(Bank);                    BurstCnt(bank) := 1;                    wrt_in <= '1';                    NextStateAuto(Bank,write);                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 (BurstCnt(bank) = BurstLen) THEN                    statebank(bank) <= bank_act;                    BurstCnt(bank) := 0;                    ras_in(bank) <= '1';                ELSE                    IF (Burst = sequential) THEN                        BurstInc(bank):=(BurstInc(bank) + 1) MOD BurstLen;                    ELSE                        BurstInc(bank):= intab(StartAddr(bank))                                                (BurstCnt(bank));                    END IF;                    Loc := 2*(BaseLoc(bank) + BurstInc(bank));                    generate_out(Bank);                    BurstCnt(bank) := BurstCnt(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 (BurstCnt(bank) = BurstLen OR WB = single) THEN                    statebank(bank) <= precharge, idle AFTER tdevice_TRP;                    BurstCnt(bank) := 0;                    ras_in(bank) <= '1';                ELSE                    IF (Burst = sequential) THEN                        BurstInc(bank) := (BurstInc(bank) + 1) MOD BurstLen;                    ELSE                        BurstInc(bank) := intab(StartAddr(bank))                                                (BurstCnt(bank));                    END IF;                    Loc := 2*(BaseLoc(bank) + BurstInc(bank));                    MemWrite(Bank);                    BurstCnt(bank) := BurstCnt(bank) + 1;                    wrt_in <= '1';                END IF;            ELSE                ASSERT false                    REPORT InstancePath & partID & BankString &                            ": Illegal command"                            & " received in write state."                    SEVERITY SeverityMode;            END IF;        WHEN read_auto_pre =>            IF (command = nop) OR (cur_bank /= bank) THEN                IF (BurstCnt(bank) = BurstLen) THEN                    statebank(bank) <= precharge, idle AFTER tdevice_TRP;                    BurstCnt(bank) := 0;                    ras_in(bank) <= '1';                ELSE                    IF (Burst = sequential) THEN                        BurstInc(bank) := (BurstInc(bank) + 1) MOD BurstLen;                    ELSE                        BurstInc(bank) := intab(StartAddr(bank))                                                (BurstCnt(bank));                    END IF;                    Loc := 2*(BaseLoc(bank) + BurstInc(bank));                    generate_out(Bank);                    BurstCnt(bank) := BurstCnt(bank) + 1;                END IF;            ELSIF (command = read) AND (cur_bank /= bank) THEN                statebank(bank) <= precharge, idle AFTER tdevice_TRP;            ELSE                ASSERT false                    REPORT InstancePath & partID & BankString &                            ": Illegal command"                            & " received in read state."                    SEVERITY SeverityMode;            END IF;        WHEN others => null;        END CASE;        END LOOP banks;    -- Check Refresh Status        IF (written = true) THEN            ASSERT Ref_Cnt > 0                REPORT InstancePath & partID &                        ": memory not refreshed (by ref_cnt)"                SEVERITY SeverityMode;        END IF;    END IF;    -- Latency adjustments and DQM read masking    IF (rising_edge(CLKIn)) THEN        IF (rising_edge(CLKIn) AND CKEreg = '1') THEN            DataDrive3 := DataDrive2;            DataDrive2 := DataDrive1;            DataDrive1 := DataDrive;        END IF;        IF (DQML_reg1 = '0') THEN            IF (CAS_Lat = 3) THEN                DataDriveOut(7 downto 0) := DataDrive3(7 downto 0);            ELSE                DataDriveOut(7 downto 0) := DataDrive2(7 downto 0);            END IF;        ELSE            DataDriveOut(7 downto 0) := (others => 'Z');        END IF;        IF (DQMH_reg1 = '0') THEN            IF (CAS_Lat = 3) THEN                DataDriveOut(15 downto 8) := DataDrive3(15 downto 8);            ELSE                DataDriveOut(15 downto 8) := DataDrive2(15 downto 8);            END IF;        ELSE            DataDriveOut(15 downto 8) := (others => 'Z');        END IF;    END IF;    -- The Powering-down State Machine    IF (rising_edge(CLKIn) AND CKEreg = '1' AND CKEIn = '0') THEN        ASSERT (not(Is_X(CSNegIn)))            REPORT InstancePath & partID & ": Unusable value for CSNeg"            SEVERITY SeverityMode;        IF (CSNegIn = '1') THEN            command := nop;        END IF;        CASE statebank(cur_bank) IS            WHEN idle =>                IF (command = nop) THEN                    statebank <= pwrdwn & pwrdwn & pwrdwn & pwrdwn;                END IF;                IF (command = ref) THEN                    statebank <= self_refresh & self_refresh & self_refresh                            & self_refresh;                END IF;            WHEN write =>                    statebank(cur_bank) <= write_suspend;            WHEN read =>                    statebank(cur_bank) <= read_suspend;            WHEN bank_act =>                IF (command = writ) THEN                    statebank(cur_bank) <= write_suspend;                ELSIF (command = read) THEN                    statebank(cur_bank) <= read_suspend;                ELSE                    statebank(cur_bank) <= bank_act_pwrdwn;                END IF;            WHEN others => null;        END CASE;    END IF;    -- The Powering-up State Machine    IF (rising_edge(CLKIn) AND CKEreg = '0' AND CKEIn = '1') THEN        ASSERT (not(Is_X(CSNegIn)))            REPORT InstancePath & partID & ": Unusable value for CSNeg"            SEVERITY SeverityMode;        IF (CSNegIn = '1') THEN            command := nop;        END IF;        CASE statebank(cur_bank) IS            WHEN write_suspend =>                statebank(cur_bank) <= write;            WHEN read_suspend =>                statebank(cur_bank) <= read;            WHEN self_refresh =>                statebank <= idle & idle & idle & idle after tdevice_TRP;                Ref_Cnt := 4096;                ASSERT command = nop                    REPORT InstancePath & partID & ": Illegal command received"                            & " during self_refresh."                    SEVERITY SeverityMode;            WHEN pwrdwn =>                statebank <= idle & idle & idle & idle;            WHEN bank_act_pwrdwn =>                statebank(cur_bank) <= bank_act;            WHEN others => null;        END CASE;    END IF;--------------------------------------------------------------------------------- File Read Section----------------------------------------------------------------------------------  mt48lc32m16a2 memory preload file format                                ----------------------------------------------------------------------------------- / - comment-- @abbbbbbb - <a> stands for memory file bank(from 0 to 3)--           - <bbbbbbb> stands for adddress within file bank (from 0 to depth)-- dd        - <dd> is byte to be written at Mem(a)(bbbbbbb++)--            (bbbbbbb is incremented at every load)-- only first 1-9 columns are loaded. NO empty lines !!!!!!!!!!!!!!!!-------------------------------------------------------------------------------    IF PoweredUp'EVENT and PoweredUp and (mem_file_name /= "none") THEN        Mem := (OTHERS =>(OTHERS => 255));        ind := 0;        WHILE (not ENDFILE (mem_file)) LOOP            READLINE (mem_file, buf);            line := line +1;            IF buf(1) = '#' THEN                NEXT;            ELSIF buf(1) = '@' THEN                file_bank := h(buf(2 to 2));                ind := h(buf(4 to 9));            ELSE                IF (file_bank) <= 3 AND ind<= (2*depth-1) THEN                Mem(file_bank)(ind) := h(buf(1 to 2));                ind := ind + 1;                ELSE                    IF report_err = FALSE THEN                    ASSERT FALSE                    REPORT "Memory file: " & mem_file_name &                            " Address range error at line: "&to_int_Str(line)                    SEVERITY error;                    report_err := TRUE;                    END IF;                END IF;            END IF;        END LOOP;    END IF;    --------------------------------------------------------------------    -- Output Section    --------------------------------------------------------------------    D_zd <= DataDriveOut;    END PROCESS;        ------------------------------------------------------------------------        -- Path Delay Process        ------------------------------------------------------------------------        DataOutBlk : FOR i IN 15 DOWNTO 0 GENERATE            DataOut_Delay : PROCESS (D_zd(i))                VARIABLE D_GlitchData:VitalGlitchDataArrayType(15 Downto 0);            BEGIN                VitalPathDelay01Z (                    OutSignal     => Da

⌨️ 快捷键说明

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