----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2254/#review5071 -----------------------------------------------------------
Thanks! Interesting idea to generate a class and then derive from it. Looks reasonable to me. The comment called out below got me to wondering though... why did it already talk about wrapping the enum in a class/struct when the code was using a namespace? I tracked the change down to this massive changeset of Nate's: http://repo.gem5.org/gem5/rev/c94e103c83ad which---without explanation---changed the original code, which used a struct: http://repo.gem5.org/gem5/annotate/9f5df8033a44/src/python/m5/params.py#l569 to this namespace-based code: http://repo.gem5.org/gem5/annotate/c94e103c83ad/src/python/m5/params.py#l652 So why was the change made? Nate? What was wrong with using structs to begin with? Should we just go back to always using structs? If we did, it would simplify the changes you had to make. I'd be happy to play around with this a little myself, though sadly that won't happen all that soon... src/python/m5/params.py <http://reviews.gem5.org/r/2254/#comment4604> note the comment here - Steve Reinhardt On May 1, 2014, 4:12 a.m., Andreas Hansson wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2254/ > ----------------------------------------------------------- > > (Updated May 1, 2014, 4:12 a.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 10204:cf938d8310b3 > --------------------------- > cpu: Add flag name printing to StaticInst > > This patch adds a the member function StaticInst::printFlags to allow all > of an instruction's flags to be printed without using the individual > is... member functions or resorting to exposing the 'flags' vector > > It also replaces the enum definition StaticInst::Flags with a > Python-generated enumeration and adds to the enum generation mechanism > in src/python/m5/params.py to allow Enums to be placed in namespaces > other than Enums or, alternatively, in wrapper structs allowing them to > be inherited by other classes (so populating that class's name-space > with the enumeration element names). > > > Diffs > ----- > > src/cpu/SConscript e40b35147270 > src/cpu/StaticInstFlags.py PRE-CREATION > src/cpu/static_inst.hh e40b35147270 > src/cpu/static_inst.cc e40b35147270 > src/python/m5/params.py e40b35147270 > > Diff: http://reviews.gem5.org/r/2254/diff/ > > > Testing > ------- > > > Thanks, > > Andreas Hansson > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
