Files
EMARS/docs/mars/tools/BHTableModel.html
T
adolphenom 0da1c5dcca Source code of MARS Assembler
First commit of the 4.5 version (latest version available)
2014-12-21 12:49:28 +01:00

516 lines
29 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_33) on Tue Aug 20 12:20:32 EDT 2013 -->
<TITLE>
BHTableModel
</TITLE>
<META NAME="date" CONTENT="2013-08-20">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BHTableModel";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../mars/tools/AbstractMarsToolAndApplication.EnterKeyListener.html" title="class in mars.tools"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../mars/tools/BHTEntry.html" title="class in mars.tools"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?mars/tools/BHTableModel.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="BHTableModel.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.swing.table.AbstractTableModel">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
mars.tools</FONT>
<BR>
Class BHTableModel</H2>
<PRE>
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true" title="class or interface in javax.swing.table">javax.swing.table.AbstractTableModel</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>mars.tools.BHTableModel</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/TableModel.html?is-external=true" title="class or interface in javax.swing.table">TableModel</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>BHTableModel</B><DT>extends <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true" title="class or interface in javax.swing.table">AbstractTableModel</A></DL>
</PRE>
<P>
Simulates the actual functionality of a Branch History Table (BHT).
<p>
The BHT consists of a number of BHT entries which are used to perform branch prediction.
The entries of the BHT are stored as a Vector of BHTEntry objects.
The number of entries is configurable but has to be a power of 2.
The history kept by each BHT entry is also configurable during run-time.
A change of the configuration however causes a complete reset of the BHT.
<p>
The typical interaction is as follows:
<ul>
<li>Construction of a BHT with a certain number of entries with a given history size.</li>
<li>When encountering a branch instruction the index of the relevant BHT entry is calculated via the <A HREF="../../mars/tools/BHTableModel.html#getIdxForAddress(int)"><CODE>getIdxForAddress(int)</CODE></A> method.</li>
<li>The current prediction of the BHT entry at the calculated index is obtained via the <A HREF="../../mars/tools/BHTableModel.html#getPredictionAtIdx(int)"><CODE>getPredictionAtIdx(int)</CODE></A> method.</li>
<li>After detecting if the branch was really taken or not, this feedback is provided to the BHT by the <A HREF="../../mars/tools/BHTableModel.html#updatePredictionAtIdx(int, boolean)"><CODE>updatePredictionAtIdx(int, boolean)</CODE></A> method.</li>
</ul>
<p>
Additionally it serves as TableModel that can be directly used to render the state of the BHT in a JTable.
Feedback provided to the BHT causes a change of the internal state and a repaint of the table(s) associated to this model.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>ingo.kofler@itec.uni-klu.ac.at</DD>
<DT><B>See Also:</B><DD><A HREF="../../serialized-form.html#mars.tools.BHTableModel">Serialized Form</A></DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_javax.swing.table.AbstractTableModel"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class javax.swing.table.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true" title="class or interface in javax.swing.table">AbstractTableModel</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#listenerList" title="class or interface in javax.swing.table">listenerList</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#BHTableModel(int, int, boolean)">BHTableModel</A></B>(int&nbsp;numEntries,
int&nbsp;historySize,
boolean&nbsp;initVal)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new BHT with given number of entries and history size.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getColumnClass(int)">getColumnClass</A></B>(int&nbsp;i)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the class/type of the i-th column of the table.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getColumnCount()">getColumnCount</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of columns.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getColumnName(int)">getColumnName</A></B>(int&nbsp;i)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of the i-th column of the table.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getIdxForAddress(int)">getIdxForAddress</A></B>(int&nbsp;address)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index into the BHT for a given branch instruction address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getPredictionAtIdx(int)">getPredictionAtIdx</A></B>(int&nbsp;index)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieve the prediction for the i-th BHT entry.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getRowCount()">getRowCount</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of entries of the BHT.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#getValueAt(int, int)">getValueAt</A></B>(int&nbsp;row,
int&nbsp;col)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the value of the cell at the given row and column
Required by the TableModel interface.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#initBHT(int, int, boolean)">initBHT</A></B>(int&nbsp;numEntries,
int&nbsp;historySize,
boolean&nbsp;initVal)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the BHT with the given size and history.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/tools/BHTableModel.html#updatePredictionAtIdx(int, boolean)">updatePredictionAtIdx</A></B>(int&nbsp;index,
boolean&nbsp;branchTaken)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Updates the BHT entry with the outcome of the branch instruction.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.swing.table.AbstractTableModel"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class javax.swing.table.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true" title="class or interface in javax.swing.table">AbstractTableModel</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#addTableModelListener(javax.swing.event.TableModelListener)" title="class or interface in javax.swing.table">addTableModelListener</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#findColumn(java.lang.String)" title="class or interface in javax.swing.table">findColumn</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableCellUpdated(int, int)" title="class or interface in javax.swing.table">fireTableCellUpdated</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableChanged(javax.swing.event.TableModelEvent)" title="class or interface in javax.swing.table">fireTableChanged</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableDataChanged()" title="class or interface in javax.swing.table">fireTableDataChanged</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableRowsDeleted(int, int)" title="class or interface in javax.swing.table">fireTableRowsDeleted</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableRowsInserted(int, int)" title="class or interface in javax.swing.table">fireTableRowsInserted</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableRowsUpdated(int, int)" title="class or interface in javax.swing.table">fireTableRowsUpdated</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#fireTableStructureChanged()" title="class or interface in javax.swing.table">fireTableStructureChanged</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#getListeners(java.lang.Class)" title="class or interface in javax.swing.table">getListeners</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#getTableModelListeners()" title="class or interface in javax.swing.table">getTableModelListeners</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#isCellEditable(int, int)" title="class or interface in javax.swing.table">isCellEditable</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#removeTableModelListener(javax.swing.event.TableModelListener)" title="class or interface in javax.swing.table">removeTableModelListener</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#setValueAt(java.lang.Object, int, int)" title="class or interface in javax.swing.table">setValueAt</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="BHTableModel(int, int, boolean)"><!-- --></A><H3>
BHTableModel</H3>
<PRE>
public <B>BHTableModel</B>(int&nbsp;numEntries,
int&nbsp;historySize,
boolean&nbsp;initVal)</PRE>
<DL>
<DD>Constructs a new BHT with given number of entries and history size.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>numEntries</CODE> - number of entries in the BHT<DD><CODE>historySize</CODE> - size of the history (in bits/number of past branches)</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getColumnName(int)"><!-- --></A><H3>
getColumnName</H3>
<PRE>
public <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getColumnName</B>(int&nbsp;i)</PRE>
<DL>
<DD>Returns the name of the i-th column of the table.
Required by the TableModel interface.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/TableModel.html?is-external=true#getColumnName(int)" title="class or interface in javax.swing.table">getColumnName</A></CODE> in interface <CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/TableModel.html?is-external=true" title="class or interface in javax.swing.table">TableModel</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#getColumnName(int)" title="class or interface in javax.swing.table">getColumnName</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true" title="class or interface in javax.swing.table">AbstractTableModel</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - the index of the column
<DT><B>Returns:</B><DD>name of the i-th column</DL>
</DD>
</DL>
<HR>
<A NAME="getColumnClass(int)"><!-- --></A><H3>
getColumnClass</H3>
<PRE>
public <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> <B>getColumnClass</B>(int&nbsp;i)</PRE>
<DL>
<DD>Returns the class/type of the i-th column of the table.
Required by the TableModel interface.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/TableModel.html?is-external=true#getColumnClass(int)" title="class or interface in javax.swing.table">getColumnClass</A></CODE> in interface <CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/TableModel.html?is-external=true" title="class or interface in javax.swing.table">TableModel</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true#getColumnClass(int)" title="class or interface in javax.swing.table">getColumnClass</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html?is-external=true" title="class or interface in javax.swing.table">AbstractTableModel</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - the index of the column
<DT><B>Returns:</B><DD>class representing the type of the i-th column</DL>
</DD>
</DL>
<HR>
<A NAME="getColumnCount()"><!-- --></A><H3>
getColumnCount</H3>
<PRE>
public int <B>getColumnCount</B>()</PRE>
<DL>
<DD>Returns the number of columns.
Required by the TableModel interface.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>currently the constant 6</DL>
</DD>
</DL>
<HR>
<A NAME="getRowCount()"><!-- --></A><H3>
getRowCount</H3>
<PRE>
public int <B>getRowCount</B>()</PRE>
<DL>
<DD>Returns the number of entries of the BHT.
Required by the TableModel interface.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>number of rows / entries of the BHT</DL>
</DD>
</DL>
<HR>
<A NAME="getValueAt(int, int)"><!-- --></A><H3>
getValueAt</H3>
<PRE>
public <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>getValueAt</B>(int&nbsp;row,
int&nbsp;col)</PRE>
<DL>
<DD>Returns the value of the cell at the given row and column
Required by the TableModel interface.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>row</CODE> - the row index<DD><CODE>col</CODE> - the column index
<DT><B>Returns:</B><DD>the value of the cell</DL>
</DD>
</DL>
<HR>
<A NAME="initBHT(int, int, boolean)"><!-- --></A><H3>
initBHT</H3>
<PRE>
public void <B>initBHT</B>(int&nbsp;numEntries,
int&nbsp;historySize,
boolean&nbsp;initVal)</PRE>
<DL>
<DD>Initializes the BHT with the given size and history.
All previous data like the BHT entries' history and statistics will get lost.
A refresh of the table that use this BHT as model will be triggered.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>numEntries</CODE> - number of entries in the BHT (has to be a power of 2)<DD><CODE>historySize</CODE> - size of the history to consider<DD><CODE>initVal</CODE> - initial value for each entry (true means take branch, false do not take branch)</DL>
</DD>
</DL>
<HR>
<A NAME="getIdxForAddress(int)"><!-- --></A><H3>
getIdxForAddress</H3>
<PRE>
public int <B>getIdxForAddress</B>(int&nbsp;address)</PRE>
<DL>
<DD>Returns the index into the BHT for a given branch instruction address.
A simple direct mapping is used.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>address</CODE> - the address of the branch instruction
<DT><B>Returns:</B><DD>the index into the BHT</DL>
</DD>
</DL>
<HR>
<A NAME="getPredictionAtIdx(int)"><!-- --></A><H3>
getPredictionAtIdx</H3>
<PRE>
public boolean <B>getPredictionAtIdx</B>(int&nbsp;index)</PRE>
<DL>
<DD>Retrieve the prediction for the i-th BHT entry.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the entry in the BHT
<DT><B>Returns:</B><DD>the prediction to take (true) or do not take (false) the branch</DL>
</DD>
</DL>
<HR>
<A NAME="updatePredictionAtIdx(int, boolean)"><!-- --></A><H3>
updatePredictionAtIdx</H3>
<PRE>
public void <B>updatePredictionAtIdx</B>(int&nbsp;index,
boolean&nbsp;branchTaken)</PRE>
<DL>
<DD>Updates the BHT entry with the outcome of the branch instruction.
This causes a change in the model and signals to update the connected table(s).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the entry in the BHT<DD><CODE>branchTaken</CODE> - </DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../mars/tools/AbstractMarsToolAndApplication.EnterKeyListener.html" title="class in mars.tools"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../mars/tools/BHTEntry.html" title="class in mars.tools"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?mars/tools/BHTableModel.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="BHTableModel.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.swing.table.AbstractTableModel">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>