Currently, there's a mechanism called "guards" which are used to include or
exclude source files based on what the files are going to be used for. I
won't explain how they work in detail, because even though the explanation
is fairly short, I'm never quite sure I've used it right or have a good
mental model of what's going on.

What I'd like to do is to move to a mechanism I'll call "groups" which is
for the same purpose, but with different semantics. When no group is
specified, a Source will go into a "default" group. There's an "all" group
which holds all Source files no matter what group they go with. Other than
that, a Source can specify what groups it might want to go into. For
instance, gem5's c++ main could go in a group "gem5 main". Then when
building gem5, you'd build a program with all the sources in the default
group, and all the sources in "gem5 main". There could be a source
iterator/generator (like there is now with guards) which makes it easy to
get at those lists. For instance, you could have something like
sources("gem5 main", "default") which would iterator through all the
Sources belonging to those groups.

There's currently a name collision between this idea and the groups of
files which get linked together for the partial linking support, so I'd
probably want to rename the later to keep things from getting confusing.

I think this will be fairly easy to implement at least for the code in the
main gem5 repository, but I wanted to solicit opinions before I went and
did it. What do you think?

Gabe
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to