Class BHTSimGUI

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class BHTSimGUI extends JPanel
Represents the GUI of the BHT Simulator Tool.

The GUI consists mainly of four parts:

  • A configuration panel to select the number of entries and the history size.
  • A information panel that displays the most recent branch instruction including its address and BHT index.
  • A table representing the BHT with all entries and their internal state and statistics.
  • A log panel that summarizes the predictions in a textual form.
Author:
Ingo Kofler (ingo.kofler@itec.uni-klu.ac.at)
See Also:
  • Field Details

    • COLOR_PREPREDICTION

      public static final Color COLOR_PREPREDICTION
      Constant for the color that highlights the current BHT entry.
    • COLOR_PREDICTION_CORRECT

      public static final Color COLOR_PREDICTION_CORRECT
      Constant for the color to signal a correct prediction.
    • COLOR_PREDICTION_INCORRECT

      public static final Color COLOR_PREDICTION_INCORRECT
      Constant for the color to signal a misprediction.
    • TAKE_BRANCH_STRING

      public static final String TAKE_BRANCH_STRING
      Constant for the String representing "take the branch."
      See Also:
    • NOT_TAKE_BRANCH_STRING

      public static final String NOT_TAKE_BRANCH_STRING
      Constant for the String representing "do not take the branch."
      See Also:
  • Constructor Details

    • BHTSimGUI

      public BHTSimGUI()
      Creates the GUI components of the BHT Simulator The GUI is a subclass of JPanel which is integrated in the GUI of the MARS tool.
  • Method Details

    • getEntryCountComboBox

      public JComboBox<Integer> getEntryCountComboBox()
      Returns the combo box for selecting the number of BHT entries.
      Returns:
      The reference to the combo box.
    • getHistorySizeComboBox

      public JComboBox<Integer> getHistorySizeComboBox()
      Returns the combo box for selecting the size of the BHT history.
      Returns:
      The reference to the combo box.
    • getInitialValueComboBox

      public JComboBox<String> getInitialValueComboBox()
      Returns the combo box for selecting the initial value of the BHT
      Returns:
      The reference to the combo box.
    • getTable

      public JTable getTable()
      Returns the table representing the BHT.
      Returns:
      The reference to the table.
    • getLogTextField

      public JTextArea getLogTextField()
      Returns the text area for logging purposes.
      Returns:
      The reference to the text area.
    • getInstructionTextField

      public JTextField getInstructionTextField()
      Returns the text field for displaying the most recent branch instruction.
      Returns:
      The reference to the text field.
    • getInstructionAddressTextField

      public JTextField getInstructionAddressTextField()
      Returns the text field for displaying the address of the most recent branch instruction.
      Returns:
      The reference to the text field.
    • getInstructionIndexTextField

      public JTextField getInstructionIndexTextField()
      Returns the text field for displaying the corresponding index into the BHT.
      Returns:
      The reference to the text field.