Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Instruction Run and Memory Requests dump #58

Closed
tv-reddy opened this issue Nov 6, 2019 · 6 comments
Closed

Support for Instruction Run and Memory Requests dump #58

tv-reddy opened this issue Nov 6, 2019 · 6 comments

Comments

@tv-reddy
Copy link

tv-reddy commented Nov 6, 2019

It would be great if RARS could support dumping of memory access and instruction traces during run-time so that, these traces can used to generate statistics for branch behaviour, instruction mixing and to design caches. We are using RARS for teaching RISCV programming in an introductory computer architecture class. Please let us know if this issue can be fixed. Thank you very much.

@jowens
Copy link
Contributor

jowens commented Nov 6, 2019

Hi @TheThirdOne, I'm the instructor of this course. We had great success with RARS in our first project. What we're hoping to do for the next one is to be able to just dump two things into a file:

  • All the instructions that were actually executed, in whatever form is most convenient
  • All the memory addresses that were touched, again in whatever form is most convenient
    Is this an easy fix / is it any sort of possibility?

It would certainly allow some interesting analyses with RARS. Thanks for this nice tool. We've enjoyed teaching with it.

@TheThirdOne
Copy link
Owner

I'm glad RARS has been useful to you.

In case you are not aware, there are integrated tools for interactively exploring branch prediction and cache behavior. They can be accessed from the tools dropdown.

How this might be implemented

As a tool:If you are looking to have a way of getting that data out from the GUI, my recommendation would be to make a tool which can gather the information during execution and then on press of a button output to a file. It shouldn't be very hard as there are several existing tools you could use as examples.

Through the simulator api:If you want to make this work automatically the best solution I can think of is using the API to single step through a program and record the information you need.

I'm not sure how big a feature it would be, but if I could make tools run from the command line, I think that would be an ideal way to add this functionality for the command line.

Internally: Currently, I don't think there is an easy way to track the information you want internally. The backstepping stack would be the only system that could be rigged to give a log after the fact.Another possible way of getting tracing information is to use the Observer interface, but I have been trying to remove it as much as possible.

My role in implementing this

I don't plan to implement the actual logging/tracing behavior because I don't know exactly what is needed and I don't think my experience with the internals of RARS is really needed to do so.

I am open to adding features to help make this functionality work well for you. I plan to look into the tool on command line interface. However, it may take a little time to get around to it as I have been working on floating point stuff recently.

I suggest that you look into implementing your desired functionality as a tool. All of the included tools can be found in this directory. In particular, I would suggest looking at InstructionCounter, MemoryReferenceVisualization and BHTSimulation.

For implementing this using the API, you can look at Test and Launch as examples for how to use it. And the main interface can be found here.

If you have trouble figuring out how to write a tool or use the API, please ask questions because they are currently not well documented and documenting them has been on my TODO list.

@TheThirdOne
Copy link
Owner

I noticed there is now a fork and an implemented tool. Does that tool now suit your needs? If it does, please close this issue.

@jowens
Copy link
Contributor

jowens commented Dec 19, 2019

Do you want the tool? It dumps every instruction, every instruction address, and every data address to a file.

@TheThirdOne
Copy link
Owner

@jowens, if you think other people would find the tool useful, then I think it should be included back into the main branch so others can find it easily. Open a PR if you want to include the tool in RARS.

@jowens
Copy link
Contributor

jowens commented Dec 19, 2019

Done (#68). This is literally my first piece of Java ever; kindly keep that in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants