gem5-users@gem5.org

The gem5 Users mailing list

View all threads

ARM ISA

RG
Rohan G
Tue, Jul 12, 2022 11:43 AM

Hi,

I am just starting to get used to gem5 and I am looking to add an instruction to the ARM isa however, I would like to ask a few question about how the decoding of instructions is done in the arm/isa/decoder.isa file. I understand that either arm.isa or aarch64.isa is used as the base of the decoder depending on whether AARCH64 is 1/0 however, diving deeper into decoder/arm.isa and decoder/AARCH64.isa gets a bit confusing to me. There isn't much in the aarch64.isa file (correct me if I'm wrong) – where does the decoding happen for this? I am looking to add another load/store instruction and when I look at the formats/aarch64.isa, I can see where instructions are decoded in a way. Could you clarify on how the decoder/aarch64.isa translates to the format/aarch64.isa and how I could go about adding a simple load/store instruction?
Thanks
Rohan

Hi, I am just starting to get used to gem5 and I am looking to add an instruction to the ARM isa however, I would like to ask a few question about how the decoding of instructions is done in the arm/isa/decoder.isa file. I understand that either arm.isa or aarch64.isa is used as the base of the decoder depending on whether AARCH64 is 1/0 however, diving deeper into decoder/arm.isa and decoder/AARCH64.isa gets a bit confusing to me. There isn't much in the aarch64.isa file (correct me if I'm wrong) – where does the decoding happen for this? I am looking to add another load/store instruction and when I look at the formats/aarch64.isa, I can see where instructions are decoded in a way. Could you clarify on how the decoder/aarch64.isa translates to the format/aarch64.isa and how I could go about adding a simple load/store instruction? Thanks Rohan
GT
Giacomo Travaglini
Wed, Jul 13, 2022 8:08 AM

Hi Rohan,

decoder/aarch64.isa calls the AArch64 decode block in formats/aarch64.isa:

https://github.com/gem5/gem5/blob/stable/src/arch/arm/isa/formats/aarch64.isa#L3087

So that is the glue between the two files.
To answer your second question, instructions are hierarchically grouped in pools/groups in the Arm architecture and we do the same in gem5. Function names in the formats/aarch64.isa file are loosely following group names in the arch spec.

For example, the “Loads and Stores” group is decoded by the following function in gem5:

https://github.com/gem5/gem5/blob/stable/src/arch/arm/isa/formats/aarch64.isa#L3116

To understand where to place the new load/store instruction you need to know which is the leaf group the load/store instruction is part of

Kind Regards

Giacomo

From: Rohan G rohangandhi7@icloud.com
Date: Tuesday, 12 July 2022 at 12:45
To: gem5-users@gem5.org gem5-users@gem5.org
Subject: [gem5-users] ARM ISA
Hi,

I am just starting to get used to gem5 and I am looking to add an instruction to the ARM isa however, I would like to ask a few question about how the decoding of instructions is done in the arm/isa/decoder.isa file. I understand that either arm.isa or aarch64.isa is used as the base of the decoder depending on whether AARCH64 is 1/0 however, diving deeper into decoder/arm.isa and decoder/AARCH64.isa gets a bit confusing to me. There isn't much in the aarch64.isa file (correct me if I'm wrong) – where does the decoding happen for this? I am looking to add another load/store instruction and when I look at the formats/aarch64.isa, I can see where instructions are decoded in a way. Could you clarify on how the decoder/aarch64.isa translates to the format/aarch64.isa and how I could go about adding a simple load/store instruction?
Thanks
Rohan

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Hi Rohan, decoder/aarch64.isa calls the AArch64 decode block in formats/aarch64.isa: https://github.com/gem5/gem5/blob/stable/src/arch/arm/isa/formats/aarch64.isa#L3087 So that is the glue between the two files. To answer your second question, instructions are hierarchically grouped in pools/groups in the Arm architecture and we do the same in gem5. Function names in the formats/aarch64.isa file are loosely following group names in the arch spec. For example, the “Loads and Stores” group is decoded by the following function in gem5: https://github.com/gem5/gem5/blob/stable/src/arch/arm/isa/formats/aarch64.isa#L3116 To understand where to place the new load/store instruction you need to know which is the leaf group the load/store instruction is part of Kind Regards Giacomo From: Rohan G <rohangandhi7@icloud.com> Date: Tuesday, 12 July 2022 at 12:45 To: gem5-users@gem5.org <gem5-users@gem5.org> Subject: [gem5-users] ARM ISA Hi, I am just starting to get used to gem5 and I am looking to add an instruction to the ARM isa however, I would like to ask a few question about how the decoding of instructions is done in the arm/isa/decoder.isa file. I understand that either arm.isa or aarch64.isa is used as the base of the decoder depending on whether AARCH64 is 1/0 however, diving deeper into decoder/arm.isa and decoder/AARCH64.isa gets a bit confusing to me. There isn't much in the aarch64.isa file (correct me if I'm wrong) – where does the decoding happen for this? I am looking to add another load/store instruction and when I look at the formats/aarch64.isa, I can see where instructions are decoded in a way. Could you clarify on how the decoder/aarch64.isa translates to the format/aarch64.isa and how I could go about adding a simple load/store instruction? Thanks Rohan IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.