Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode
@ 2020-07-31 14:40 Luke Kenneth Casson Leighton
  2020-08-01 13:55 ` Luke Kenneth Casson Leighton
  0 siblings, 1 reply; 8+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-07-31 14:40 UTC (permalink / raw)
  To: openpower-hdl-cores; +Cc: Libre-RISCV General Development

paul, benjamin, mikey: i have a huge favour to ask of you (or a "howto"
question), given that i never done VHDL programming before.

thank to florent of enjoy-digital's help, libresoc now has connectivity to
litex in simulation, just like in microwatt.  in particular he added a
"Display" option on any wishbone activity requested by (either) core,
allowing me to see what is going on.

i was therefore looking to do cycle-accurate side by side comparisons, spot
the discrepancies, fix the bug and move on to the next one.

this technique has worked extremely well up to now by comparing against
qemu, and against our python simulator.

we would like to be able to add microwatt to that list.

the problem is that microwatt has branch prediction, L1 cacheing and
pipeline latency all of which mean that i am completely guessing about what
caused any given bus read/write.

any kind of side-by-side comparison of log files, looking for the "one
instruction that does something different/wrong" is out of the question.

... *unless*... there is a "mode" for microwatt that is effectively
equivalent to gdb single-step.

we need a way to stop microwatt from doing any kind of overlapping
instructions.  this *may* be possible already through the JTAG/debug
interface, i do not know.

the alternative is some minor modifications that throw in a deliberate 10
to 20 cycle delay in the instruction issue phase.  this would give ample
time to inspect the internal state (regfiles, PC, SPRs, etc) looking for
discrepancies when running the exact same binary.

what would you suggest here? how can we "single-step" microwatt?  clearly
performance is not important: cycle-accurate comparisons is the goal.

with thanks, and understanding that you are busy people,

l.



-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode
  2020-07-31 14:40 [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode Luke Kenneth Casson Leighton
@ 2020-08-01 13:55 ` Luke Kenneth Casson Leighton
  2020-08-03  0:13   ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Herrenschmidt, Benjamin
  0 siblings, 1 reply; 8+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-08-01 13:55 UTC (permalink / raw)
  To: openpower-hdl-cores; +Cc: Libre-RISCV General Development

On Friday, July 31, 2020, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

>
> what would you suggest here? how can we "single-step" microwatt?  clearly
> performance is not important: cycle-accurate comparisons is the goal.
>

i since realised that the DMI interface serves this purpose, and
investigated core_debug.vhdl

with a little bit (or a lot) of futzing about with a FSM i should be able
to run a single instruction then cycle through all of the GPRs, PC and MSR,
dumping them out.

by implementing the same interface in libresoc i can do a cycle by cycle
comparison and find the discrepancies.

it would be particularly useful to be able to get at the SPRs and the CR as
well, this way.

is there a standard for DMI address bus locations?

l



-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] [OpenPOWER-HDL-Cores] microwatt feature request: "switch off all optimisations" mode
  2020-08-01 13:55 ` Luke Kenneth Casson Leighton
@ 2020-08-03  0:13   ` " Herrenschmidt, Benjamin
  2020-08-03  1:00     ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
  0 siblings, 1 reply; 8+ messages in thread
From: Herrenschmidt, Benjamin @ 2020-08-03  0:13 UTC (permalink / raw)
  To: lkcl, openpower-hdl-cores; +Cc: libre-riscv-dev

On Sat, 2020-08-01 at 14:55 +0100, Luke Kenneth Casson Leighton wrote:
> 
> 
> On Friday, July 31, 2020, Luke Kenneth Casson Leighton <lkcl@lkcl.net
> > wrote:
> > what would you suggest here? how can we "single-step" microwatt? 
> > clearly performance is not important: cycle-accurate comparisons is
> > the goal.
> > 
> 
> i since realised that the DMI interface serves this purpose, and
> investigated core_debug.vhdl
>  
> with a little bit (or a lot) of futzing about with a FSM i should be
> able to run a single instruction then cycle through all of the GPRs,
> PC and MSR, dumping them out.
> 
> by implementing the same interface in libresoc i can do a cycle by
> cycle comparison and find the discrepancies.
> 
> it would be particularly useful to be able to get at the SPRs and the
> CR as well, this way.
> 
> is there a standard for DMI address bus locations?

Not really... I just made it all up :-)

Cheers,
Ben.

> l 
> 
> 
> 
> _______________________________________________
> OpenPOWER-HDL-Cores mailing list
> OpenPOWER-HDL-Cores@mailinglist.openpowerfoundation.org
> 
http://lists.mailinglist.openpowerfoundation.org/mailman/listinfo/openpower-hdl-cores
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode
  2020-08-03  0:13   ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Herrenschmidt, Benjamin
@ 2020-08-03  1:00     ` " Luke Kenneth Casson Leighton
  2020-08-03  1:05       ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-08-03  1:00 UTC (permalink / raw)
  To: Herrenschmidt, Benjamin; +Cc: openpower-hdl-cores, libre-riscv-dev

On Monday, August 3, 2020, Herrenschmidt, Benjamin <benh@amazon.com> wrote:

>
> > is there a standard for DMI address bus locations?
>
> Not really... I just made it all up :-)


that's funny, i like it :)

can we collaborate on making some more up, for example adding CR, XER and
the remaining SPRs to the list of registers?

also bear in mind, FP regs may get added (to microwatt).  and that in
libresoc we intend to expand the scalar int and fp regs to 128 entries.

l.



-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] [OpenPOWER-HDL-Cores] microwatt feature request: "switch off all optimisations" mode
  2020-08-03  1:00     ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
@ 2020-08-03  1:05       ` " Benjamin Herrenschmidt
  2020-08-03  1:35         ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
  0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2020-08-03  1:05 UTC (permalink / raw)
  To: Luke Kenneth Casson Leighton; +Cc: openpower-hdl-cores, libre-riscv-dev

On Mon, 2020-08-03 at 02:00 +0100, Luke Kenneth Casson Leighton wrote:
> 
> 
> On Monday, August 3, 2020, Herrenschmidt, Benjamin <benh@amazon.com>
> wrote:
> > > is there a standard for DMI address bus locations?
> > 
> > Not really... I just made it all up :-)
> 
> that's funny, i like it :)
> 
> can we collaborate on making some more up, for example adding CR, XER
> and the remaining SPRs to the list of registers?

Sure. Patches welcome ;-) Also check out Paul's WIP branches, he also
occasionally add stuff.

> also bear in mind, FP regs may get added (to microwatt).  and that in
> libresoc we intend to expand the scalar int and fp regs to 128
> entries.

Paul has some of that in his FPU work already.

Cheers,
Ben.



_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode
  2020-08-03  1:05       ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Benjamin Herrenschmidt
@ 2020-08-03  1:35         ` " Luke Kenneth Casson Leighton
  2020-08-03  1:39           ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Herrenschmidt, Benjamin
  0 siblings, 1 reply; 8+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-08-03  1:35 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: openpower-hdl-cores

On Monday, August 3, 2020, Benjamin Herrenschmidt <benh@kernel.crashing.org>
wrote:

> On Mon, 2020-08-03 at 02:00 +0100, Luke Kenneth Casson Leighton wrote:
> >
> >
> > On Monday, August 3, 2020, Herrenschmidt, Benjamin <benh@amazon.com>
> > wrote:
> > > > is there a standard for DMI address bus locations?
> > >
> > > Not really... I just made it all up :-)
> >
> > that's funny, i like it :)
> >
> > can we collaborate on making some more up, for example adding CR, XER
> > and the remaining SPRs to the list of registers?
>
> Sure. Patches welcome ;-)


ah i was thinking more along the lines of agreeing a spec that suits both
teams, even if the definitions are reserved for later implementation.

(btw we've an october tapeout deadline and i am not yet a vhdl developer).

by agreeing a set of registers, future teams with their own implementation
will want to save development effort and conform to the same spec.


Also check out Paul's WIP branches, he also
> occasionally add stuff.


willdo.



>
> > also bear in mind, FP regs may get added (to microwatt).  and that in
> > libresoc we intend to expand the scalar int and fp regs to 128
> > entries.
>
> Paul has some of that in his FPU work already.


ah excellent.




-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] [OpenPOWER-HDL-Cores] microwatt feature request: "switch off all optimisations" mode
  2020-08-03  1:35         ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
@ 2020-08-03  1:39           ` " Herrenschmidt, Benjamin
  2020-08-03  2:38             ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
  0 siblings, 1 reply; 8+ messages in thread
From: Herrenschmidt, Benjamin @ 2020-08-03  1:39 UTC (permalink / raw)
  To: lkcl, libre-riscv-dev; +Cc: openpower-hdl-cores

On Mon, 2020-08-03 at 02:35 +0100, Luke Kenneth Casson Leighton wrote:
> 
> ah i was thinking more along the lines of agreeing a spec that suits
> both teams, even if the definitions are reserved for later
> implementation.

That's fine, the patch could be adding a debug-regs-spec.txt :-)

(Or we could use a .h as a spec, and use it in mw_debug)

Cheers,
Ben.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode
  2020-08-03  1:39           ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Herrenschmidt, Benjamin
@ 2020-08-03  2:38             ` " Luke Kenneth Casson Leighton
  0 siblings, 0 replies; 8+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-08-03  2:38 UTC (permalink / raw)
  To: Herrenschmidt, Benjamin; +Cc: openpower-hdl-cores, libre-riscv-dev

On Monday, August 3, 2020, Herrenschmidt, Benjamin <benh@amazon.com> wrote:

> On Mon, 2020-08-03 at 02:35 +0100, Luke Kenneth Casson Leighton wrote:
> >
> > ah i was thinking more along the lines of agreeing a spec that suits
> > both teams, even if the definitions are reserved for later
> > implementation.
>
> That's fine, the patch could be adding a debug-regs-spec.txt :-)


that works :)


>
> (Or we could use a .h as a spec, and use it in mw_debug)


understood.

l.



-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31 14:40 [libre-riscv-dev] microwatt feature request: "switch off all optimisations" mode Luke Kenneth Casson Leighton
2020-08-01 13:55 ` Luke Kenneth Casson Leighton
2020-08-03  0:13   ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Herrenschmidt, Benjamin
2020-08-03  1:00     ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
2020-08-03  1:05       ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Benjamin Herrenschmidt
2020-08-03  1:35         ` [libre-riscv-dev] " Luke Kenneth Casson Leighton
2020-08-03  1:39           ` [libre-riscv-dev] [OpenPOWER-HDL-Cores] " Herrenschmidt, Benjamin
2020-08-03  2:38             ` [libre-riscv-dev] " Luke Kenneth Casson Leighton

Libre RISC-V Mailing list Archives (accessible via public-inbox)

Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git