Hi Gus, I would do this by adding new instructions to the ISA so you have complete control over how the instructions interact with the pipeline. Unfortunately, there isn't a lot of documentation on modifying ISAs. One place to look is part II of gem5 101 (http://www.gem5.org/Gem5_101). You should be able to find some unused opcodes in x86 and add your new instructions using those opcodes.
The biggest upside to implementing your own instructions is that it is realistic. If you were to implement your idea in hardware, you would likely do it with an ISA extension, for instance. If you have any specific questions about how the ISA specification works feel free to ask here. Gabe did most of the initial work on x86 and has been quite active lately, so he'll probably be able to help. Cheers, Jason On Wed, Dec 27, 2017 at 10:44 AM Gus Smith <[email protected]> wrote: > Hello all. Currently, I am working on setting up the gem5 simulation for a > project whose goal is to create a "modified"/"upgraded" cache, which is > extended to perform more than just reads and writes. > > The first step in this project is the addition of an instruction that will > perform one of these new operations in our upgraded cache. We are > specifically trying to measure the change in total cycle latency between a > system which uses this upgraded cache and a baseline system which doesn't. > We can already compile a piece of source code into two different binaries: > a baseline version (with standard x86 instructions) and a version which > replaces certain operations with cache operations -- I now need to > implement the new instructions in the simulator. > > *My question is this: should we add our instruction using a > pseudo-instruction, or via ISA extension?* > > I have done my own research on the question, and found two primary > resources that touch on the difference between the two: > This Master's thesis > <http://scholarworks.umass.edu/cgi/viewcontent.cgi?article=1262&context=masters_theses_2> > touches > on the difference in section 1.2. > Gedare's great blog post > <http://gedare-csphd.blogspot.com/2013/02/add-pseudo-instruction-to-gem5.html> > about > adding a pseudo-instruction. > This is what I've gathered: > > - Pseudo-instructions are easier to add. > - Pseudo-instructions are non-speculative and atomic, which means the > pipeline is flushed when one of these instructions are found. This means > that a program with a significant amount of pseudo-instructions will not > have realistic cycle count statistics -- having realistic cycle count > statistics is important to us. > - ISA extension is much less documented (I can't find much on it, > though the linked thesis may have all the information I need.) > - ISA extension may be much harder to get right. > > I am leaning towards ISA extension, but wanted to pose the question to the > community, as I feel I'm moving into uncharted territory. Feel free to also > share experiences in related projects -- i.e., is there anything I should > watch out for, or is there, perhaps, an easier way to do this? > > Some more details about the planned simulation environment: > > - x86 > - Doing standard fs.py full-system simulation with the Linux images on > the wiki > > Thanks all! > _______________________________________________ > 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
