gem5-users@gem5.org

The gem5 Users mailing list

View all threads

Custom instructions connecting to C++ library

NF
Nick Felker
Fri, Jun 30, 2023 3:47 AM

Hey folks,
I've been working on custom instructions for RISC-V within Gem5 and am able
to manage basic logic. However, I'd like to implement a custom component
that interfaces with these new instructions and I'm having trouble figuring
out where to start. The custom instructions doc
https://www.gem5.org/documentation/general_docs/architecture_support/isa_parser/
doesn't give much information. I can see other types of instructions like
AtomicOps can get called but it's not clear how to extend this to my own
C++ class.

Are there any examples out there? If I have a CustomAdd instruction which
interfaces with a CustomAdder object, how do I connect the decoder.isa
instruction to that logic?
Thanks,
Nick

Hey folks, I've been working on custom instructions for RISC-V within Gem5 and am able to manage basic logic. However, I'd like to implement a custom component that interfaces with these new instructions and I'm having trouble figuring out where to start. The custom instructions doc <https://www.gem5.org/documentation/general_docs/architecture_support/isa_parser/> doesn't give much information. I can see other types of instructions like AtomicOps can get called but it's not clear how to extend this to my own C++ class. Are there any examples out there? If I have a CustomAdd instruction which interfaces with a CustomAdder object, how do I connect the decoder.isa instruction to that logic? Thanks, Nick