On 6 December 2016 at 21:27, Tim Newsome <t...@sifive.com> wrote:
> I'm hoping that even if we can't agree on how exactly to do debug, we can
> agree on the differences in the proposals. I've been working on a Google doc
> that you might have seen. I'd like other people to contribute, but just
> opening it up to everybody might result in a mess. So I've moved it to
> github where we can track what changes were made, and by who.
>
> The new document lives at
> https://sifive.github.io/debug-mechanism-comparison/
>
> I'd love to hear thoughts, pull requests, and other comments.
Hi Tim, many thanks for writing this up. A few comments/questions:
* Could you elaborate on your comment about how "making the debugger
perform well will require some careful coding" for your spec. What
does debugger 'performance' mean in this context?
* Would it be worth incorporating some basic definitions in to the doc
much like you had in your slides. In addition to the definitions in
your slides, I'd perhaps add 'debug monitor' to the mix
* Does anybody understand the requirements for 'real-time' or low
latency debug? It seems in some use cases, as low latency as possible
is desired. What sort of latency do we see on the SiFive debug
implementation?
* I'm not quite sure where it fits in the document, but it would be
good to bring in clear descriptions of some of the key arguments
presented at the foundation meeting and on the mailing list. Maybe it
integrates somewhere in the comparison, or else a section at the end.
e.g.
* The Direct specification allows a higher degree of abstraction. An
implementer could provide that memory-mapped interface and implement
it by injecting instructions into the core. The counter-argument is
that by specifying the implementation approach, the Instruction spec
allows a more efficient design.
* It strikes me that the Direct approach is probably more amenable to
allowing configuration of a debugger via devicetree or config-string
(or maybe. e.g. suppose you have a design with a vector register file,
describing how to access registers a memory map is something we're
very used to doing and have various schemas to allow. The Instruction
approach would require some schema that allowed instruction templates
to be specified. Doable, but less natural than a simple memory map
If any of the above sounds like the kind of direction you'd like this
document to go in, I'd be happy to contribute pull requests but I
probably won't get a chance until next week (technically I'm on
holiday and probably shouldn't be writing a long email about debug).
* Does anybody understand the requirements for 'real-time' or low
latency debug? It seems in some use cases, as low latency as possible
is desired. What sort of latency do we see on the SiFive debug
implementation?I haven't heard any specific requirements. I suspect they run the gamut from "no impact at all" to "interrupting for 50ms is OK" but I don't know that. In the SiFive debug implementation (0.11 of the spec), the processor will be "halted" for about 100 instructions. They'll be fetched from Debug ROM/RAM, and I'm not sure how slow accessing them is. I haven't measured the impact, or even implemented it since gdb doesn't support the concept of accessing a target while it's running.
* I'm not quite sure where it fits in the document, but it would be
good to bring in clear descriptions of some of the key arguments
presented at the foundation meeting and on the mailing list. Maybe it
integrates somewhere in the comparison, or else a section at the end.
e.g.
* The Direct specification allows a higher degree of abstraction. An
implementer could provide that memory-mapped interface and implement
it by injecting instructions into the core. The counter-argument is
that by specifying the implementation approach, the Instruction spec
allows a more efficient design.I think the way to add that is to add eg. "degree of abstraction" as a metric, and then compare.I'll do that.
* I'm not quite sure where it fits in the document, but it would be
good to bring in clear descriptions of some of the key arguments
presented at the foundation meeting and on the mailing list. Maybe it
integrates somewhere in the comparison, or else a section at the end.
e.g.
* The Direct specification allows a higher degree of abstraction. An
implementer could provide that memory-mapped interface and implement
it by injecting instructions into the core. The counter-argument is
that by specifying the implementation approach, the Instruction spec
allows a more efficient design.I think the way to add that is to add eg. "degree of abstraction" as a metric, and then compare.I'll do that.
--
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/CAGDihembzu%3D8Dx94in%3DVCH6nWsTEoGdzNVhbeav59AW-ixwK_g%40mail.gmail.com.
--
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/CA%2BwH294h0qOOLyENqwpbM1eNzbg_bUpbv7V6UHrcFNHrEaeLNA%40mail.gmail.com.
--
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/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/debug/CAGDihemF-hbTNh9L_JpV95Kp9AkN_pLb%3DB5MurLPnOw2Wif5Eg%40mail.gmail.com.
Dose your proposal (i.e. full feature one) provide a mechanism to disable debug when the hart is running in M-mode? Consider a use case that we only want people to debug applications running in user mode but hardware will disable debug as long as it is running in M-mode, does you proposal support that use case?
ThanksJoe
On Dec 7, 2016, at 5:27 AM, Tim Newsome <t...@sifive.com> wrote:
I'm hoping that even if we can't agree on how exactly to do debug, we can agree on the differences in the proposals. I've been working on a Google doc that you might have seen. I'd like other people to contribute, but just opening it up to everybody might result in a mess. So I've moved it to github where we can track what changes were made, and by who.
The new document lives at https://sifive.github.io/debug-mechanism-comparison/
I'd love to hear thoughts, pull requests, and other comments.
I'd especially like a better summary of what I've labeled the Direct Design. (I'm also happy to change names to whatever makes sense to people, but as was brought up in the meeting lightweight/full-featured didn't really highlight the differences.)
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/CAGDihemF-hbTNh9L_JpV95Kp9AkN_pLb%3DB5MurLPnOw2Wif5Eg%40mail.gmail.com.
ROA LOGICDesign Services and Silicon Proven IPRichard HerveilleManaging DirectorPhone +31 (45) 405 5681Cell +31 (6) 5207 2230
On Dec 7, 2016, at 5:27 AM, Tim Newsome <t...@sifive.com> wrote:
I'm hoping that even if we can't agree on how exactly to do debug, we can agree on the differences in the proposals. I've been working on a Google doc that you might have seen. I'd like other people to contribute, but just opening it up to everybody might result in a mess. So I've moved it to github where we can track what changes were made, and by who.
The new document lives at https://sifive.github.io/debug-mechanism-comparison/
I'd love to hear thoughts, pull requests, and other comments.
I'd especially like a better summary of what I've labeled the Direct Design. (I'm also happy to change names to whatever makes sense to people, but as was brought up in the meeting lightweight/full-featured didn't really highlight the differences.)
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/CAGDihemF-hbTNh9L_JpV95Kp9AkN_pLb%3DB5MurLPnOw2Wif5Eg%40mail.gmail.com.
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
--
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/83AE39D4-5480-42A5-911B-2D998EA7E42D%40nvidia.com.
- I really like having the hart’s Debug Unit being memory mapped. This allows it to be connected to a dedicated Debug Controller [Transport-Module] (point-to-point) or act as another slave on the (system) bus. This allows easily changing/updating the Debug Controller [Transport-Module] or having multiple Debug Controllers. For example imagine an SoC with multiple interfaces. To bring up the SoC a dedicated JTAG Debug Controller can be used. Once that’s up and running switching to a PCIe interface is straightforward. Or even using a 2nd hart/core to debug another one works out of the box.
- The advantage of making the Debug Controller [Transport-Module] a system-bus slave has the advantage that it can be used to access/inspect all slaves on the bus, without using the CPU. This is a big help in bringing up the peripherals while the CPU isn’t behaving nicely (or simple dead, which unfortunately sometimes happens).
I realise that this is then the physical view and doesn’t necessarily represent the view from the CPU. If that’s required, then use the debug monitor (see below).
- I don’t like the idea of having scratch-ram or instruction buffers inside the CPU. But I see and like the flexibility of this approach. Therefore I propose to remove these from (inside) the CPU and use existing memory instead. Now no changes to the CPU’s pipeline are needed at all.
If you want to run a debug session, use the Debug Controller (or any other master which is on the system bus) to load the debug code/debug monitor into RAM. Then make the hart jump to that code when it hits a trigger (either hardware or software breakpoint). Of course if the debug monitor is in ROM, there’s no need to load it first.
If we have a ‘jump-to’-register for each hardware-breakpoint we can have different code per breakpoint (if desired). Thus allowing chained triggers for example.
We still need to define the debug registers and decide whether these live in the CSR space or are dedicated to the Debug Unit. But this should not cause any serious issues.These registers would define hardware breakpoints, provide feature-set to debug SW, determine privilege level which may be debugged, ...With the above proposal we got a simple and clean way of jumping into a Debug Monitor. But how do we get access to the CPU’s internals? With the initial (direct) proposal it’s just a matter of addressing the registers as a RAM (address, RW, data). It’s simple, direct, and low latency. My customers (all embedded microcontroller type applications) really like the simplicity. However I also realise that can get big for multi-hart implementations with 128bit RF/FRF/VRF.Should we have a command/data CSR for handshaked communication? For example the debug software writes ‘read X1’ to the command register. The debug monitor polls this and sees the command, gets X1 and writes its contents into the data register and then clears the command register (signalling command complete). The debug sw polls the command register, sees it cleared, and gets the data?In my initial (Direct) proposal SingleStep meant, stall hart’s instruction fetch. Clear SingleStep bit, continue instruction fetch. I still like it’s simplicity, but I guess single stepping could be handled via the debug monitor in a similar fashion as accessing internal registers. A breakpoint causes a jump to debug monitor. Debug SW issues ‘continue’ command. Debug monitor acknowledges and returns to PC before jump.