They're not glued to files, but objects. The type field in the Python objects 
connects them to C++ objects.

Ali



On Apr 21, 2012, at 3:52 AM, Anirudh Sivaraman wrote:

> I am posting this to both the user and the dev list since I don't know
> where this falls.
> 
> I read here (http://www.m5sim.org/Simulation_Scripts_Explained) that
> the Python classes are usually in the same src folders as the C++
> classes. But what exactly is the glue that binds them together ? I see
> Ethernet.py inside src/dev . Inside Ethernet.py, I see definitions for
> Python classes EtherTap and EtherLink which are used in simulation
> scripts. But how exactly are these glued to ethertap.cc and
> etherlink.cc ? I can't seem to make that connection.
> 
> Also, I am not sure what is going on, but inside the C++ code, the
> class EtherLink takes two interfaces as attributes both of which are
> of type "Interface". The class EtherTap on the other hand, takes one
> interface as an attribute which is of type "EtherInt". From the C++
> code, it looks like EtherInt is a super class of Interface, so if I
> pass an Interface object, it should work as an EtherInt object as
> well. With this in mind, I tried doing :
> 
> self.drivesys.ethertap.interface=self.testsys.tsunami.ethernet.interface
> in the Python code in FSConfig.py
> 
> because the same self.testsys.tsunami.ethernet.interface is used as an
> interface for etherlink in the example. But this just gives me a
> warning "warn: error looking up port interface on object
> testsys.tsunami.ethernet" and things don't work as expected.
> 
> Any clarification would greatly help.
> 
> Anirudh
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> 

_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to