I encountered a small bug where a m5.drain(test_sys) that was  
triggered by a m5_switchcpu call that occurs within a workload (rather  
than as part of a script) produced the following error:

Traceback (most recent call last): File "<string>", line 1, in  
<module> File "/net/uf21/cws3k/m5-stable/src/python/m5/main.py", line  
373, in main exec filecode in scope File "/uf21/cws3k/m5/configs/ 
3dstacking/3dstacking.py", line 548, in <module> m5.drain(test_sys)  
File "/net/uf21/cws3k/m5-stable/src/python/m5/simulate.py", line 123,  
in drain drain_event.setCount(unready_objects) AttributeError: 'Event'  
object has no attribute 'setCount'

Looking at the createCountedDrain function, it was only returning an  
Event, which does not expose a setCount method to Python.

        - Clint

On Oct 27, 2008, at 7:49 PM, Clint Smullen wrote:

> # HG changeset patch
> # User Clint Smullen <[EMAIL PROTECTED]>
> # Date 1225151161 14400
> # Node ID e376c3efb9f80f93ba3534341b83cff56f483485
> # Parent  6b707147a89ce576643b0f29b41c76017ea9e651
> imported patch drainevent_fix
>
> diff --git a/src/python/swig/pyevent.cc b/src/python/swig/pyevent.cc
> --- a/src/python/swig/pyevent.cc
> +++ b/src/python/swig/pyevent.cc
> @@ -67,7 +67,7 @@
>     }
> }
>
> -Event *
> +CountedDrainEvent *
> createCountedDrain()
> {
>     return new CountedDrainEvent();
> diff --git a/src/python/swig/pyevent.hh b/src/python/swig/pyevent.hh
> --- a/src/python/swig/pyevent.hh
> +++ b/src/python/swig/pyevent.hh
> @@ -46,7 +46,7 @@
>     virtual void process();
> };
>
> -Event *createCountedDrain();
> +CountedDrainEvent *createCountedDrain();
> void cleanupCountedDrain(Event *counted_drain);
>
> #endif // __PYTHON_SWIG_PYEVENT_HH__

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to