This is definitely underspecified. I don’t think opcode matching has really been tested in spike, so I wouldn’t take it as an authority.
The core problem is that we have to specify some bits for the remainder on RV32 when setting an opcode trigger for a compressed instruction. The same problem exists on RV64 for all instructions. The interface doesn’t support ignoring bits (short of using a second trigger to add a mask, which seems pretty wasteful for this common case). We could extend with 0, but I’m worried that adding 0 to a compressed instruction might match a valid 32-bit instruction. Safest seems to be to say that the high bits must be filled in with c.nop
instructions (16’h1). How does that sound?
Tim
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+unsubscribe@groups.riscv.org.
To post to this group, send email to de...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/debug/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/debug/0fea5c0e-640f-4702-bff7-ba0ea0db1ae3%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+unsubscribe@groups.riscv.org.
To post to this group, send email to de...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/debug/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/debug/3e1180b2-388a-498c-9e16-66cad153e49e%40groups.riscv.org.
My take on opcode triggers is to have a match value along with a mask value. The value and mask are combined to allow triggering on categories of opcodes, not just strictly on one value. It also then supports 16-bit opcodes of compressed instructions - the user sets up two triggers: the first one has the opcode value in [31:16] and a mask of 0x0000FFFF (0 means care, 1 means don't care) and the second trigger with the opcode value in [15:0] and a mask of 0xFFFF0000.
--- Bruce
-----Original Message-----
From: Mark Hill <mark....@gmail.com>
Sent: Sunday, July 8, 2018 1:38 PM
To: RISC-V Debug Group <de...@groups.riscv.org>
Subject: Re: [debug] Triggers on instruction opcdes
Thanks for the reply. I don’t think there is an issue with false hits on 32bit opcodes because they all have bits[1:0]=3 and all 16-bit opcodes have bits[1:0]!=3. So the operation could be specified as only checking bits [31:16] if bits[1:0] of tdata2=3, or alternatively, zero extended without risking a false match.
There’s also the related issue of matches on sub-word loads and stores (signed and unsigned) which it would be good to clarify.
Mark
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+unsubscribe@groups.riscv.org.
I think I prefer your first proposal Tim. It’s neat and regular and I don’t think you need to worry too much about legacy yet. I’m more concerned about eliminating ambiguity in the spec to avoid future implementations diverging and complicating the development and maintenance of shared tools.
Mark
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+unsubscribe@groups.riscv.org.
To post to this group, send email to de...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/debug/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/debug/6b361cba-caf1-48ff-9fb2-7451341c4082%40groups.riscv.org.
0: The action for this trigger will be taken just be-
fore the instruction that triggered it is executed,
but after all preceding instructions are are com-
mitted.
...
Data load triggers with timing of 0 will result in
the same load happening again when the debugger
lets the hart run.
Hi Tim,The spec says that these “will result in the same load happening again when the debugger lets the hart run”. Does that mean that the gpr will have also been updated prior to entry to debugger, or is the result of the first load thrown away and gpr is only updated at restart.
Mark
The general solution involves adding an access size to match triggers.Currently mcontrol has 6 bits set aside for action, which is more than needed. (5 actions are defined.) We could easily take 2 bits from the action field, and use them to encode access size of 8, 16, 32, or 48 bits. (Instructions can be 48 bits.) Sizes greater than 32 can only happen on harts with XLEN at least 64. In that case the mcontrol register has 32 unused bits. We can take 2 more of those, to also encode sizes 64, 80, 96, 112, 128.A different way of encoding this, is to take just 1 bit from mcontrol. If that bit is 0, then the size is MXLEN. If the bit is 1, then the size is less than MXLEN, and the actual size is encoded in the top bits of tdata2. This has the benefit that it's completely backwards compatible, but is a more convoluted encoding.What do you think?Tim
On Sun, Jul 8, 2018 at 1:38 PM, Mark Hill <mark....@gmail.com> wrote:
Thanks for the reply. I don’t think there is an issue with false hits on 32bit opcodes because they all have bits[1:0]=3 and all 16-bit opcodes have bits[1:0]!=3. So the operation could be specified as only checking bits [31:16] if bits[1:0] of tdata2=3, or alternatively, zero extended without risking a false match.
There’s also the related issue of matches on sub-word loads and stores (signed and unsigned) which it would be good to clarify.
Mark
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+un...@groups.riscv.org.
To post to this group, send email to de...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/debug/.