Ankit,
  I have looked into this problem before (trying to do the same thing),
and I think there are a couple options.
1) As I have mentioned before there is no perfect BP flag in Opal, and I
recommended using the Opal trace utility to generate branch traces and
then feeding it back into Opal.  I am not sure if that is currently
an option for Opal, or if it just works for the tester.  I can imagine
someone modifying Opal to read from the branch trace in real time, while
simulating a workload.
2) Carl Mauer (author of Opal) was experimenting with some runahead type
ideas, because Opal has some initial code to construct a control flow
graph.  You can find this code in pseq.C.  Search for flow_inst_t, which
are instructions that are linked together to form a CFG.  However one of
the problems I saw is that in order to construct the CFG one must actually
step Simics, which will conflict with simulating the OoO timing of the
processor.  I haven't figured out a solution to this problem, and maybe
you can figure out how to get this working and post a solution.
3) I am not sure if MAI has some perfect branch prediction options but
maybe one can write a simple MAI module that can hook up to Opal whenever
it sees a branch instruction, and then choose the correct path.
  Regards,
   Luke
On Fri, 8 Jul 2005, Ankit Jalote wrote:
> Hi,
> Thanks for the reply. I will look at the code to figure this out.
> I have one additional question though. I am trying to simulate perfect
> branch prediction in gems. Can you please give me some pointers to do this?
> One way I can think of is by creating the trace and then running the
> created trace through tester. But is there a better way to implement
> perfect prediction?
> Thanks a lot,
> Ankit
>
 
 |