cornell-brg / pydgin

A (Py)thon (D)SL for (G)enerating (In)struction set simulators.
BSD 3-Clause "New" or "Revised" License
165 stars 29 forks source link

potentially wrong jit hints #37

Open cfbolz opened 8 years ago

cfbolz commented 8 years ago

when discussing with @snim2 it occurred to me that the can_enter_jit hint is potentially placed wrong: there must be no code at all between can_enter_jit and jit_merge_point, but in sim.py there is the if s.running condition of the while loop in between:

https://github.com/cornell-brg/pydgin/blob/master/pydgin/sim.py#L145

So it should be restructured to something like this:

    while True:

      jitdriver.jit_merge_point(
        pc        = s.fetch_pc(),
        max_insts = max_insts,
        state     = s,
        sim       = self,
)
      if not s.running:
        break