sail-riscv icon indicating copy to clipboard operation
sail-riscv copied to clipboard

Added support to recognize hints instruction in the log

Open itsubaidrehman opened this issue 10 months ago • 6 comments

SAIL was unable to recognize hint operations as hints in the log. Added the support so that hints should be recognizable as hints in the log file

itsubaidrehman avatar Jan 21 '25 13:01 itsubaidrehman

This is an interesting case. I am unaware of any tools that would recognize these opcodes, and I'm unclear what the advantage of having the log distinguish them. At some point, these hints will have some (microarchitectural) functionality, at which point there may be a use case, but until then: can you articulate why this is needed?

On Tue, Jan 21, 2025 at 7:19 AM Jessica Clarke @.***> wrote:

@.**** requested changes on this pull request.

These are not the canonical mnemonics. Destinations with x0 are often hints, but for uncompressed instructions they are written the same as the others, unless another extension claims them in which case they have aliases that are used in preference.

— Reply to this email directly, view it on GitHub https://github.com/riscv/sail-riscv/pull/693#pullrequestreview-2564951114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPXVJSC4U7U6HY4Q5YR5VT2LZQORAVCNFSM6AAAAABVSR26Z6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNRUHE2TCMJRGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

allenjbaum avatar Jan 21 '25 15:01 allenjbaum

I assume this was intended just to make the log more informational? But yeah I agree with @jrtc27 - we should probably stick to assembly that actually works.

Timmmm avatar Jan 22 '25 13:01 Timmmm

I talked to someone about this. The intent is to simplify tools (riscv-isac specifically) to look at the log file and be able to easily identify a hint instruction so they can measure coverage of hint ops. There are probably other alternatives. I the CSC meeting today we added (I think) a requirement that there be a standard logging format, and this would affect that decision.

On Wed, Jan 22, 2025 at 5:07 AM Tim Hutt @.***> wrote:

I assume this was intended just to make the log more informational? But yeah I agree with @jrtc27 https://github.com/jrtc27 - we should probably stick to assembly that actually works.

— Reply to this email directly, view it on GitHub https://github.com/riscv/sail-riscv/pull/693#issuecomment-2607203192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPXVJXGN5NFSGE4COM666L2L6JYZAVCNFSM6AAAAABVSR26Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBXGIYDGMJZGI . You are receiving this because you commented.Message ID: @.***>

allenjbaum avatar Jan 22 '25 19:01 allenjbaum

Sounds like your tool needs a (limited) instruction decoder.

jrtc27 avatar Jan 22 '25 19:01 jrtc27

Yeah I think the proper way to solve this is with the planned callback API or machine readable log format. You can extract the instructions opcode and then use a simple decoder to see if is a hint.

If it must be in Sail we could potentially add a second instruction_metadata mapping that maps an ast to information like whether it is a hint, which extension it is from, etc. Might be handy.

Timmmm avatar Jan 22 '25 19:01 Timmmm

That is another option, I agree..

On Wed, Jan 22, 2025 at 11:38 AM Jessica Clarke @.***> wrote:

Sounds like your tool needs a (limited) instruction decoder.

— Reply to this email directly, view it on GitHub https://github.com/riscv/sail-riscv/pull/693#issuecomment-2608109778, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPXVJTA2BSE3JVQMEA5MZD2L7XS5AVCNFSM6AAAAABVSR26Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYGEYDSNZXHA . You are receiving this because you commented.Message ID: @.***>

allenjbaum avatar Jan 22 '25 19:01 allenjbaum

I don't think we're going to do this so I'll close it. Hope that's ok!

Timmmm avatar Aug 20 '25 19:08 Timmmm