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

📄 mt46v16m16.vhd

📁 free hardware ip core about sparcv8,a soc cpu in vhdl
💻 VHD
📖 第 1 页 / 共 4 页
字号:
                        REPORT "tWR violation during Precharge"                        SEVERITY WARNING;                END IF;                -- Pipeline for READ                IF CAS_latency_15 = '1' THEN                    A10_precharge  (3) := Addr(10);                    Bank_precharge (3) := Ba;                    Cmnd_precharge (3) := '1';                ELSIF CAS_latency_2 = '1' THEN                    A10_precharge  (4) := Addr(10);                    Bank_precharge (4) := Ba;                    Cmnd_precharge (4) := '1';                ELSIF CAS_latency_25 = '1' THEN                    A10_precharge  (5) := Addr(10);                    Bank_precharge (5) := Ba;                    Cmnd_precharge (5) := '1';                ELSIF CAS_latency_3 = '1' THEN                    A10_precharge  (6) := Addr(10);                    Bank_precharge (6) := Ba;                    Cmnd_precharge (6) := '1';                ELSIF CAS_latency_4 = '1' THEN                    A10_precharge  (8) := Addr(10);                    Bank_precharge (8) := Ba;                    Cmnd_precharge (8) := '1';                END IF;            END IF;            -- Burst Terminate            IF Burst_term = '1' THEN                -- Pipeline for Read                IF CAS_latency_15 = '1' THEN                    Cmnd_bst (3) := '1';                ELSIF CAS_latency_2 = '1' THEN                    Cmnd_bst (4) := '1';                ELSIF CAS_latency_25 = '1' THEN                    Cmnd_bst (5) := '1';                ELSIF CAS_latency_3 = '1' THEN                    Cmnd_bst (6) := '1';                ELSIF CAS_latency_4 = '1' THEN                    Cmnd_bst (8) := '1';                END IF;                -- Terminate Write                ASSERT (Data_in_enable = '0')                    REPORT "It's illegal to Burst Terminate a Write"                    SEVERITY WARNING;                -- Terminate Read with Auto Precharge                ASSERT (Read_precharge (0) = '0' AND Read_precharge (1) = '0' AND                        Read_precharge (2) = '0' AND Read_precharge (3) = '0')                    REPORT "It's illegal to Burst Terminate a Read with Auto Precharge"                    SEVERITY WARNING;            END IF;            -- Read Command            IF Read_enable = '1' THEN                -- CAS Latency Pipeline                IF Cas_latency_15 = '1' THEN                    Read_cmnd (3) := '1';                    Read_bank (3) := Ba;                    Read_cols (3) := Addr (8 DOWNTO 0);                ELSIF Cas_latency_2 = '1' THEN                    Read_cmnd (4) := '1';                    Read_bank (4) := Ba;                    Read_cols (4) := Addr (8 DOWNTO 0);                ELSIF Cas_latency_25 = '1' THEN                    Read_cmnd (5) := '1';                    Read_bank (5) := Ba;                    Read_cols (5) := Addr (8 DOWNTO 0);                ELSIF Cas_latency_3 = '1' THEN                    Read_cmnd (6) := '1';                    Read_bank (6) := Ba;                    Read_cols (6) := Addr (8 DOWNTO 0);                ELSIF Cas_latency_4 = '1' THEN                    Read_cmnd (8) := '1';                    Read_bank (8) := Ba;                    Read_cols (8) := Addr (8 DOWNTO 0);                END IF;                -- Write to Read: Terminate Write Immediately                IF Data_in_enable = '1' THEN                    Data_in_enable := '0';                END IF;                -- Interrupting a Read with Auto Precharge (same bank only)                ASSERT (Read_precharge(CONV_INTEGER(Ba)) = '0')                    REPORT "It's illegal to interrupt a Read with Auto Precharge"                    SEVERITY WARNING;                -- Activate to Read                ASSERT ((Ba = "00" AND Act_b0 = '1') OR                        (Ba = "01" AND Act_b1 = '1') OR                        (Ba = "10" AND Act_b2 = '1') OR                        (Ba = "11" AND Act_b3 = '1'))                    REPORT "Bank is not Activated for Read"                    SEVERITY WARNING;                -- Activate to Read without Auto Precharge                IF Addr (10) = '0' THEN                    ASSERT ((Ba = "00" AND NOW - RCD_chk0 >= tRCD) OR                            (Ba = "01" AND NOW - RCD_chk1 >= tRCD) OR                            (Ba = "10" AND NOW - RCD_chk2 >= tRCD) OR                            (Ba = "11" AND NOW - RCD_chk3 >= tRCD))                        REPORT "tRCD violation during Read"                        SEVERITY WARNING;                END IF;                -- Activate to Read with Auto Precharge                IF Addr (10) = '1' THEN                    ASSERT ((Ba = "00" AND NOW - RAP_chk0 >= tRAP) OR                            (Ba = "01" AND NOW - RAP_chk1 >= tRAP) OR                            (Ba = "10" AND NOW - RAP_chk2 >= tRAP) OR                            (Ba = "11" AND NOW - RAP_chk3 >= tRAP))                        REPORT "tRAP violation during Read"                        SEVERITY WARNING;                END IF;                -- Auto precharge                IF Addr (10) = '1' THEN                    Read_precharge (Conv_INTEGER(Ba)) := '1';                    Count_precharge (Conv_INTEGER(Ba)) := 0;                END IF;                -- DLL Check                IF (DLL_reset = '1') THEN                    ASSERT (DLL_done = '1')                        REPORT "DLL RESET not complete"                        SEVERITY WARNING;                END IF;            END IF;            -- Write Command            IF Write_enable = '1' THEN                -- Pipeline for Write                Write_cmnd (2) := '1';                Write_bank (2) := Ba;                Write_cols (2) := Addr (8 DOWNTO 0);                -- Interrupting a Write with Auto Precharge (same bank only)                ASSERT (Write_precharge(CONV_INTEGER(Ba)) = '0')                    REPORT "It's illegal to interrupt a Write with Auto Precharge"                    SEVERITY WARNING;                -- Activate to Write                ASSERT ((Ba = "00" AND Act_b0 = '1') OR                        (Ba = "01" AND Act_b1 = '1') OR                        (Ba = "10" AND Act_b2 = '1') OR                        (Ba = "11" AND Act_b3 = '1'))                    REPORT "Bank is not Activated for Write"                    SEVERITY WARNING;                -- Activate to Write                ASSERT ((Ba = "00" AND NOW - RCD_chk0 >= tRCD) OR                        (Ba = "01" AND NOW - RCD_chk1 >= tRCD) OR                        (Ba = "10" AND NOW - RCD_chk2 >= tRCD) OR                        (Ba = "11" AND NOW - RCD_chk3 >= tRCD))                    REPORT "tRCD violation during Write"                    SEVERITY WARNING;                -- Auto precharge                IF Addr (10) = '1' THEN                    Write_precharge (Conv_INTEGER(Ba)) := '1';                    Count_precharge (Conv_INTEGER(Ba)) := 0;                END IF;            END IF;        END IF;        IF not file_loaded THEN 		--'	    file_loaded := true;            WHILE NOT endfile(file_load) LOOP                readline(file_load, l);                read(l, ch);                if (ch /= 'S') or (ch /= 's') then                  hexread(l, rectype);                  hexread(l, reclen);		  recaddr := (others => '0');		  case rectype is 		  when "0001" =>                    hexread(l, recaddr(15 downto 0));		  when "0010" =>                    hexread(l, recaddr(23 downto 0));		  when "0011" =>                    hexread(l, recaddr);		  when "0111" =>                    hexread(l, recaddr);--		    if (index = 0) then print("Start address : " & tost(recaddr)); end if;		    next;		  when others => next;		  end case;	 	  case bbits is		  when 64 =>	-- 64-bit bank with four 16-bit DDRs		    recaddr(31 downto 27) := (others => '0');                    hexread(l, recdata);		    Bank_Load := recaddr(26 downto 25);		    Rows_Load := recaddr(24 downto 12);		    Cols_Load := recaddr(11 downto 3);                    Init_mem (Bank_Load, To_Integer(Rows_Load));                    IF Bank_Load = "00" THEN		      for i in 0 to 1 loop                        Bank0 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*64+index*16 to i*64+index*16+15));		      end loop;                    ELSIF Bank_Load = "01" THEN		      for i in 0 to 3 loop                        Bank1 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*64+index*16 to i*64+index*16+15));		      end loop;                    ELSIF Bank_Load = "10" THEN		      for i in 0 to 3 loop                        Bank2 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*64+index*16 to i*64+index*16+15));		      end loop;                    ELSIF Bank_Load = "11" THEN		      for i in 0 to 3 loop                        Bank3 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*64+index*16 to i*64+index*16+15));		      end loop;                    END IF;		  when 32 =>	-- 32-bit bank with two 16-bit DDRs		    recaddr(31 downto 26) := (others => '0');                    hexread(l, recdata);		    Bank_Load := recaddr(25 downto 24);		    Rows_Load := recaddr(23 downto 11);		    Cols_Load := recaddr(10 downto 2);                    Init_mem (Bank_Load, To_Integer(Rows_Load));                    IF Bank_Load = "00" THEN		      for i in 0 to 3 loop                        Bank0 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*32+index*16 to i*32+index*16+15));		      end loop;                    ELSIF Bank_Load = "01" THEN		      for i in 0 to 3 loop                        Bank1 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*32+index*16 to i*32+index*16+15));		      end loop;                    ELSIF Bank_Load = "10" THEN		      for i in 0 to 3 loop                        Bank2 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*32+index*16 to i*32+index*16+15));		      end loop;                    ELSIF Bank_Load = "11" THEN		      for i in 0 to 3 loop                        Bank3 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*32+index*16 to i*32+index*16+15));		      end loop;                    END IF;		  when others =>	-- 16-bit bank with one 16-bit DDR                    hexread(l, recdata);		    recaddr(31 downto 25) := (others => '0');		    Bank_Load := recaddr(24 downto 23);		    Rows_Load := recaddr(22 downto 10);		    Cols_Load := recaddr(9 downto 1);                    Init_mem (Bank_Load, To_Integer(Rows_Load));                    IF Bank_Load = "00" THEN		      for i in 0 to 3 loop                        Bank0 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*16 to i*16+15));                        Bank0 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i+4) := (recdata((i+4)*16 to (i+4)*16+15));		      end loop;                    ELSIF Bank_Load = "01" THEN		      for i in 0 to 3 loop                        Bank1 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*16 to i*16+15));                        Bank1 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i+4) := (recdata((i+4)*16 to (i+4)*16+15));		      end loop;                    ELSIF Bank_Load = "10" THEN		      for i in 0 to 3 loop                        Bank2 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*16 to i*16+15));                        Bank2 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i+4) := (recdata((i+4)*16 to (i+4)*16+15));		      end loop;                    ELSIF Bank_Load = "11" THEN		      for i in 0 to 3 loop                        Bank3 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i) := (recdata(i*16 to i*16+15));                        Bank3 (To_Integer(Rows_Load)) (To_Integer(Cols_Load)+i+4) := (recdata((i+4)*16 to (i+4)*16+15));		      end loop;                    END IF;                  END case;                END IF;            END LOOP;          END IF;        END PROCESS;    --    -- Dqs Receiver    --    dqs_rcvrs : PROCESS        VARIABLE Dm_temp : STD_LOGIC_VECTOR (1 DOWNTO 0);        VARIABLE Dq_temp : STD_LOGIC_VECTOR (data_bits - 1 DOWNTO 0);    BEGIN        WAIT ON Dqs;        -- Latch data at posedge Dqs        IF Dqs'EVENT AND Dqs (1) = '1' AND Dqs (0) = '1' THEN            Dq_temp := Dq;            Dm_temp := Dm;        END IF;        -- Latch data at negedge Dqs        IF Dqs'EVENT AND Dqs (1) = '0' AND Dqs (0) = '0' THEN            Dq_pair <= (Dq & Dq_temp);            Dm_pair <= (Dm & Dm_temp);        END IF;    END PROCESS;    --    -- Setup timing checks    --    Setup_check : PROCESS    BEGIN        WAIT ON Sys_clk;        IF Sys_clk'EVENT AND Sys_clk = '1' THEN            ASSERT(Cke'LAST_EVENT >= tIS)                REPORT "CKE Setup time violation -- tIS"                SEVERITY WARNING;            ASSERT(Cs_n'LAST_EVENT >= tIS)                REPORT "CS# Setup time violation -- tIS"                SEVERITY WARNING;            ASSERT(Cas_n'LAST_EVENT >= tIS)                REPORT "CAS# Setup time violation -- tIS"                SEVERITY WARNING;            ASSERT(Ras_n'LAST_EVENT >= tIS)                REPORT "RAS# Setup time violation -- tIS"                SEVERITY WARNING;            ASSERT(We_n'LAST_EVENT >= tIS)                REPORT "WE# Setup time violation -- tIS"                SEVERITY WARNING;            ASSERT(Addr'LAST_EVENT >= tIS)                REPORT "ADDR Setup time violation -- tIS"                SEVERITY WARNING;            ASSERT(Ba'LAST_EVENT >= tIS)                REPORT "BA Setup time violation -- tIS"                SEVERITY WARNING;        END IF;       END PROCESS;    --    -- Hold timing checks    --    Hold_check : PROCESS    BEGIN        WAIT ON Sys_clk'DELAYED (tIH);        IF Sys_clk'DELAYED (tIH) = '1' THEN            ASSERT(Cke'LAST_EVENT >= tIH)                REPORT "CKE Hold time violation -- tIH"                SEVERITY WARNING;            ASSERT(Cs_n'LAST_EVENT >= tIH)                REPORT "CS# Hold time violation -- tIH"                SEVERITY WARNING;            ASSERT(Cas_n'LAST_EVENT >= tIH)                REPORT "CAS# Hold time violation -- tIH"                SEVERITY WARNING;            ASSERT(Ras_n'LAST_EVENT >= tIH)                REPORT "RAS# Hold time violation -- tIH"                SEVERITY WARNING;            ASSERT(We_n'LAST_EVENT >= tIH)                REPORT "WE# Hold time violation -- tIH"                SEVERITY WARNING;            ASSERT(Addr'LAST_EVENT >= tIH)                REPORT "ADDR Hold time violation -- tIH"                SEVERITY WARNING;            ASSERT(Ba'LAST_EVENT >= tIH)                REPORT "BA Hold time violation -- tIH"                SEVERITY WARNING;        END IF;       END PROCESS;END behave;

⌨️ 快捷键说明

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