📄 mmuconfig.vhd
字号:
------------------------------------------------------------------------------ This file is a part of the LEON VHDL model-- Copyright (C) 2003 Gaisler Research, all rights reserved---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2 of the License, or (at your option) any later version.---- See the file COPYING.LGPL for the full details of the license.------------------------------------------------------------------------------ Konrad Eisele<eiselekd@web.de> ,2002 library ieee;use ieee.std_logic_1164.all;use work.target.all;use work.device.all;use work.config.all;package mmuconfig isconstant M_CTX_SZ : integer := 8;constant MMUCTX_BITS : integer := M_CTX_SZ * mmu_config.enable;constant M_EN : boolean := (mmu_config.enable = 1); -- enable mmuconstant M_EN_DIAG : boolean := mmu_config.tlb_diag; --enable ASI diagnostic accessconstant M_TLB_TYPE : mmu_tlb_type := mmu_config.tlb_type; -- eather split or combinedconstant TLB_REP : mmu_tlb_rep := mmu_config.tlb_rep;constant M_ENT_I : integer range 2 to 64 := mmu_config.itlbnum; -- icache tlb entries: numberconstant M_ENT_ILOG : integer := log2(M_ENT_I); -- icache tlb entries: address bitsconstant M_ENT_D : integer range 2 to 64 := mmu_config.dtlbnum; -- dcache tlb entries: numberconstant M_ENT_DLOG : integer := log2(M_ENT_D); -- dcache tlb entries: address bitsconstant M_ENT_C : integer range 2 to 64 := M_ENT_I; -- i/dcache tlb entries: numberconstant M_ENT_CLOG : integer := M_ENT_ILOG; -- i/dcache tlb entries: address bitsconstant M_ENT_MAX : integer := 64;constant XM_ENT_MAX_LOG : integer := log2(M_ENT_MAX);constant M_ENT_MAX_LOG : integer := XM_ENT_MAX_LOG;type mmu_idcache is (id_icache, id_dcache);-- ##############################################################-- 1.0 virtual address [sparc V8: p.243,Appx.H,Figure H-4] -- +--------+--------+--------+---------------+-- a) | INDEX1 | INDEX2 | INDEX3 | OFFSET | -- +--------+--------+--------+---------------+-- 31 24 23 18 17 12 11 0constant VA_I1_SZ : integer := 8;constant VA_I2_SZ : integer := 6;constant VA_I3_SZ : integer := 6;constant VA_I_SZ : integer := VA_I1_SZ+VA_I2_SZ+VA_I3_SZ;constant VA_I_MAX : integer := 8;constant VA_I1_U : integer := 31;constant VA_I1_D : integer := 32-VA_I1_SZ;constant VA_I2_U : integer := 31-VA_I1_SZ;constant VA_I2_D : integer := 32-VA_I1_SZ-VA_I2_SZ;constant VA_I3_U : integer := 31-VA_I1_SZ-VA_I2_SZ;constant VA_I3_D : integer := 32-VA_I_SZ;constant VA_I_U : integer := 31;constant VA_I_D : integer := 32-VA_I_SZ;constant VA_OFF_U : integer := 31-VA_I_SZ;constant VA_OFF_D : integer := 0;constant VA_OFFCTX_U : integer := 31;constant VA_OFFCTX_D : integer := 0;constant VA_OFFREG_U : integer := 31-VA_I1_SZ;constant VA_OFFREG_D : integer := 0;constant VA_OFFSEG_U : integer := 31-VA_I1_SZ-VA_I2_SZ;constant VA_OFFSEG_D : integer := 0;constant VA_OFFPAG_U : integer := 31-VA_I_SZ;constant VA_OFFPAG_D : integer := 0;-- ##############################################################-- 2.0 PAGE TABE DESCRIPTOR (PTD) [sparc V8: p.247,Appx.H,Figure H-7] -- -- +-------------------------------------------------+---+---+ -- | Page Table Pointer (PTP) | 0 | 0 | -- +-------------------------------------------------+---+---+ -- 31 2 1 0 ---- 2.1 PAGE TABE ENTRY (PTE) [sparc V8: p.247,Appx.H,Figure H-8]-- -- +-----------------------------+---+---+---+-----------+---+-- |Physical Page Number (PPN) | C | M | R | ACC | ET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -