Hello, the lsq_unit, as long as other basic parts in the pipeline (i.e., fetch, decode etc) are generally defined as template classes as you said. The equivalent *.c files instantiate the object by calling with a specific argument, in this case with the "O3CPUImpl" argument. These .c files are the ones that include the necessary header files and are given as source for compilation in the SConscript file, for instance in the one in the o3 folder, when it comes to the o3 model. Hope it helps.
Regards, -- Kleovoulos Kalaitzidis Doctorant - Équipe PACAP Centre de recherche INRIA Rennes - Bretagne Atlantique Bâtiment 12E, Bureau E321, Campus de Beaulieu, 35042 Rennes Cedex, France > From: "yuan" <[email protected]> > To: "gem5 users mailing list" <[email protected]> > Sent: Tuesday, July 16, 2019 10:59:46 PM > Subject: [gem5-users] questions about template policies in O3CPU > Hi, all, > I am trying to understand the O3CPU code. But I find that the template policy > is > heavily used in O3CPU and I am quiet confused about this part. Like the load > store queue, the lsq_unit.hh file has all the class declaration of lsq_unit, > but in the lsq_unit.cc file, there is only one statement “template class > LSQUnit<O3CPUImpl>;”. My understanding is that all the functions in > lsq_unint.hh are actually defined/implemented in lsq_unit_impl.hh files. The > O3CPUImpl is actually defined in impl.hh file. But what the lsq_unit.cc file > is > actually doing? And what is the design model behind this template usage? Does > anyone know about this part. Thanks so much. > Best regards. > Yuan > Sent from [ https://go.microsoft.com/fwlink/?LinkId=550986 | Mail ] for > Windows > 10 > _______________________________________________ > 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
