MEM: Move port creation to the memory object(s) construction
Review Request #1047 - Created Feb. 14, 2012 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
MEM: Move port creation to the memory object(s) construction This patch moves all port creation from the getPort method to be consistently done in the MemObject's constructor. This is possible thanks to the Swig interface passing the length of the vector ports. Previously there was a mix of: 1) creating the ports as members (at object construction time) and using getPort for the name resolution, or 2) dynamically creating the ports in the getPort call. This is now uniform. Furthermore, objects that would not be complete without a port have these ports as members rather than having pointers to dynamically allocated ports. This patch also enables an elaboration-time enumeration of all the ports in the system which can be used to determine the masterId.
util/regress all passing (disregarding t1000 and eio)
Ship It!
Ship It!
Looks fine, comments below are minor/optional.
-
src/cpu/testers/directedtest/RubyDirectedTester.cc (Diff revision 1) -
Is this cast really necessary? Looks like ports.size() should be a size_t. I'm curious what error/warning we get if we leave it out...
-
src/mem/bus.cc (Diff revision 1) -
Does it make more sense to just maintain two separate vectors, one for masters and one for slaves? It'd require more extensive changes to the rest of the bus code, but it might actually clean it up a bit... maybe you're already doing this in some future patch I haven't seen yet.
