Hi all, I want to implement some new instructions on gem5 (ARM) and I've been taking a look at the .isa files as they seem to be the place where one defines how new instruction works.
The decoding part is straightforward to understand, until the point it returns a new instruction (yea, I know this is 2% of the whole thing). Then I have to create/implement the given instruction in the other .isa files. A first instruction I'm looking forward to implementing is to read N bytes (up to a maximum) from a memory address, into a new, custom register I also want to create. This new "hidden" register will hold the N bytes, waiting for further CPU instructions (also to be implemented) that will process them. Any suggestions on how to create this specific register? Would I have to create a new operand for it (src/arch/arm/isa/operands.isa)? I would like to avoid replicating the implementation of the GPRs, as it seems to take a lot of work. I just want one buffer whose state is kept across multiple instructions, until I overwrite it again. Also, would I have to add it on each CPU model I want the instruction to work, or this can be solved just in the .isa files? Also, let's say I manage to create this buffer/register. Could the multiple bytes load be done with some inspiration in other instructions, e.g. Load64Execute? For example, repeat the code Load64Execute code/template, but with multiple calls to readMemAtomicLE(xc, traceData, EA, Mem, memAccessFlags) until the amount of bytes I want is read. Is that a reasonable idea? Would the isa parser generate code and make sure that multiple memory requests are issued to acquire all this data? Or do I have to manage it? Any help is appreciated. I've read the docs (https://www.gem5.org/documentation/general_docs/architecture_support/isa_parser/) but I'm still struggling to understand the pipeline to implement a new instruction (all examples I could find are instructions like a = b + c using already existing template methods and solved with one line in the .isa files ...). Thank you in advance, Pedro _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s