Package mars.tools

Class CacheSimulator

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Observer, Accessible, RootPaneContainer, WindowConstants, MarsTool

public class CacheSimulator extends AbstractMarsToolAndApplication
A data cache simulator. It can be run either as a stand-alone Java application having access to the mars package, or through MARS as an item in its Tools menu. It makes maximum use of methods inherited from its abstract superclass AbstractMarsToolOrApp.

Version 1.2 fixes a bug in the hit/miss animator under full or N-way set associative. It was animating the block of initial access (first block of set). Now it animates the block of final access (where address found or stored). Also added log display to GUI (previously System.out).

Version:
1.0: 16-18 October 2006, 1.1: 7 November 2006, 1.2: 23 December 2010
Author:
Pete Sanderson
See Also:
Serialized Form
  • Constructor Details

    • CacheSimulator

      public CacheSimulator(String title, String heading)
      Simple constructor, likely used to run a stand-alone cache simulator.
      Parameters:
      title - String containing title for title bar
      heading - String containing text for heading shown in upper part of window.
    • CacheSimulator

      public CacheSimulator()
      Simple constructor, likely used by the MARS Tools menu mechanism
  • Method Details

    • main

      public static void main(String[] args)
      Main provided for pure stand-alone use. Recommended stand-alone use is to write a driver program that instantiates a CacheSimulator object then invokes its go() method. "stand-alone" means it is not invoked from the MARS Tools menu. "Pure" means there is no driver program to invoke the Cache Simulator.
    • getName

      public String getName()
      Required MarsTool method to return Tool name.
      Specified by:
      getName in interface MarsTool
      Specified by:
      getName in class AbstractMarsToolAndApplication
      Returns:
      Tool name. MARS will display this in menu item.