Ejemplo n.º 1
0
        public void SetSettings(CachePreferences cachePreferences)
        {
            InstructionCachePreferences cp = mInstructionCacheSummary ? cachePreferences.InstructionCachePreferences : cachePreferences.DataCachePreferences;

            if (!cp.Enabled)
            {
                gbSummary.Enabled = false;
                return;
            }
            lblCacheSize.Text = (cp.NumberBlocks * cp.BlockSize).ToString() + " Bytes";
            lblBlockSize.Text = cp.BlockSize.ToString() + " Bytes";
            lblNumBlocks.Text = cp.NumberBlocks.ToString();

            if (cp.NumberBlocks == 1)
            {
                lblAssociativity.Text = "Fully Associative";
            }
            else if (cp.NumberBlocks == cp.BlocksPerSet)
            {
                lblAssociativity.Text = "Direct Mapped";
            }
            else
            {
                lblAssociativity.Text = string.Format("{0} way", cp.BlocksPerSet);
            }

            lblReplacement.Text = cp.ReplaceStrategy.ToString();

            if (!mInstructionCacheSummary)
            {
                DataCachePreferences dcp = cachePreferences.DataCachePreferences;
                lblAllocate.Text = dcp.AllocatePolicy.ToString();
                lblWrite.Text    = dcp.WritePolicy.ToString();
            }
        }//SetSettings
Ejemplo n.º 2
0
        private void Summary()
        {
            CachePreferences cachePreferences = this.CachePreferences;

            this.cacheSummary1.SetSettings(cachePreferences);
            this.cacheSummary2.SetSettings(cachePreferences);
        }
Ejemplo n.º 3
0
        public CacheWizard(CachePreferences cachePreferences)
        {
            InitializeComponent();

            mCachePreferences = cachePreferences;

            rbUnifiedYes.Checked = mCachePreferences.UnifiedCache;
            rbUnifiedNo.Checked  = !mCachePreferences.UnifiedCache;

            {
                InstructionCachePreferences icp = mCachePreferences.InstructionCachePreferences;
                rbICacheEnableYes.Checked = icp.Enabled;
                rbICacheEnableNo.Checked  = !icp.Enabled;

                instructionCacheSize.Set(icp.BlockSize, icp.NumberBlocks);
                instructionAssociativity.Set(icp.NumberBlocks, icp.BlocksPerSet);
                instructionReplacementStrategy.ReplaceStrategyType = icp.ReplaceStrategy;
            }

            {
                DataCachePreferences dcp = mCachePreferences.DataCachePreferences;
                rbDCacheEnableYes.Checked = dcp.Enabled;
                rbDCacheEnableNo.Checked  = !dcp.Enabled;

                dataCacheSize.Set(dcp.BlockSize, dcp.NumberBlocks);
                dataAssociativity.Set(dcp.NumberBlocks, dcp.BlocksPerSet);
                dataReplacementStrategy.ReplaceStrategyType = dcp.ReplaceStrategy;

                writePolicy.WritePolicyType       = dcp.WritePolicy;
                allocatePolicy.AllocatePolicyType = dcp.AllocatePolicy;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Invoke the cache settings wizard.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCacheWizard_Click(object sender, EventArgs e)
 {
     using (ARMSim.Preferences.PreferencesForm.Wizard.CacheWizard cacheWizard =
                new ARMSim.Preferences.PreferencesForm.Wizard.CacheWizard(mCachePreferences))
     {
         if (cacheWizard.ShowDialog() == DialogResult.OK)
         {
             mCachePreferences = cacheWizard.CachePreferences;
             this.Cache_Load(null, null);
         }
     }
 }
Ejemplo n.º 5
0
        }//ResetCache

        /// <summary>
        /// Define the caches according to the cache preferences.
        /// </summary>
        /// <param name="preferences"></param>
        public void DefineCache(CachePreferences preferences)
        {
            mL1DataCache = new Cache.DataCache(mMemoryBlock, preferences.DataCachePreferences);
            if (preferences.UnifiedCache)
            {
                mL1InstructionCache = mL1DataCache;
            }
            else
            {
                mL1InstructionCache = new Cache.L1Cache(mMemoryBlock, preferences.InstructionCachePreferences);
            }
        }//DefineCache
Ejemplo n.º 6
0
 public ARMCache(CachePreferences cachePreferences) : this()
 {
     mCachePreferences = cachePreferences;
 }