Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* Re: [libre-riscv-dev] go die/cancel signals in fsm
From: Luke Kenneth Casson Leighton @ 2020-07-22  9:51 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD4+-OuvUk7m1s2F4pZZgkgaYL9RP_thL_ntL0QDdtkhfQ@mail.gmail.com>

On Wed, Jul 22, 2020 at 3:01 AM Jacob Lifshay <programmerjake@gmail.com> wrote:
>
> I looked through the vcd generated for soc.simple.test.test_core and
> was unable to locate the signals used to tell the pipeline stages that
> the instruction they are currently operating on is canceled.

that's because we're using SimpleHandshakeRedir rather than
MaskCancellable, and are not going to do cancellation in the 180nm
core unless we get more people, and i can focus in the remaining very
short amount of time on doing absolutely nothing but add in the
Dependency Matrices.

three months is already far too short to even consider doing that, so
it is extremely unlikely to be added.

> This is
> needed to not have to wait 63(!) more clock cycles for a canceled div
> instruction to finish computing before another div instruction can be
> started.

indeed.

ok so i added some code comments explaining what goes into CommonPipeSpec:
https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=71af4fadd8a431079df13fc5812d745c133074be

i'll also update the README...

https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=593c41881b455aeeb19fe98071647d7b4ffca15c

l.

_______________________________________________
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

* Re: [libre-riscv-dev] go die/cancel signals in fsm
From: Luke Kenneth Casson Leighton @ 2020-07-22 12:27 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwpQY8oH33GjV=P=zmXP5uCKUMK3HnEoFEA1snfg32Mtw@mail.gmail.com>

On Wed, Jul 22, 2020 at 10:51 AM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:

> > This is
> > needed to not have to wait 63(!) more clock cycles for a canceled div
> > instruction to finish computing before another div instruction can be
> > started.
>
> indeed.

for now, you can see that issuer.py is a FSM:
https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/simple/issuer.py;hb=HEAD#l124

so there's not going to be any cancellation.  instructions are done
one at a time, total freeze until the instruction is completed.

l.

_______________________________________________
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

* [libre-riscv-dev] system call (sc) LEV "reserved field"
From: Luke Kenneth Casson Leighton @ 2020-07-22 14:22 UTC (permalink / raw)
  To: openpower-hdl-cores; +Cc: Libre-RISCV General Development

hi, we're just reviewing the behaviour needed when LEV != 0, and are
following what microwatt does (which does not have hypervisor support
yet)

https://bugs.libre-soc.org/show_bug.cgi?id=325#c106

so the trail - i am so glad that the PDF has cross-reference linking -
jumps from one section to another and after jumping 5 times we
eventually ascertain the hypothesis that reserved fields, if set,
should raise an "illegal instruction".

however this is so unclear (because of the referral from one section
to another) that i am seeking confirmation.  should we raise an
"illegal instruction" when "LEV > 1" on sc?

secondly, we note that "LEV=1" is for invocation of the hypervisor.
what's not clear to us is - given that we are not implementing
hypervisor - should this be *also* treated as an illegal instruction?
or, should we just leave it to fall through to trap @ addr 0x0c00, and
expect the trap *there* to notice and deal with the situation?

also: if we set the HV bit in MSR (when LEV=1) section 6.5.14 p1077
which refers us back to figure 65 on p1064, will this "break" things?

also: in microwatt, i'm not seeing the remaining bits which appear [to
need to] be set.

https://github.com/antonblanchard/microwatt/blob/master/execute1.vhdl#L479
            ctrl_tmp.msr(MSR_SF) <= '1';
            ctrl_tmp.msr(MSR_EE) <= '0';
            ctrl_tmp.msr(MSR_PR) <= '0';
            ctrl_tmp.msr(MSR_IR) <= '0';
            ctrl_tmp.msr(MSR_DR) <= '0';
            ctrl_tmp.msr(MSR_RI) <= '0';
            ctrl_tmp.msr(MSR_LE) <= '1';

these appear to be correct as defined according to figure 65 (p1063)

however the remaining actions do not seem to be implemented (p1064):

     Bits bit 5, TM, VEC, VSX, PR, FP, and PMM are set to 0.
     The TE field is set to 0b00.
     TM, FP, VEC, VSX, and bit 5 are set to 0.

question: what effect would it have - bear in mind that we are
following microwatt - if we implemented these changes to MSR?  bear in
mind that we ignore most of them at the moment (MSR.LE being one
notable exception), so the question is, in effect: does the Linux
kernel *also* ignore them?

tia,

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

* Re: [libre-riscv-dev] Fwd: [Mesa-dev] [XDC 2020] Virtual conference + Call for Proposals extended 2 weeks more
From: Cole Poirier @ 2020-07-22 22:28 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDxc0HkCNw=RieuXgHOshA3AinkhBjZuFFLBQ6=B9aaMKQ@mail.gmail.com>

On Wed, Jul 22, 2020 at 2:06 AM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
> pretty much - i'm not really able to "switch tasks" without dropping
> significant working knowledge.  if i'm going to write a presentation
> it needs to be done 100% focus, all in one hit, nothing else but that
> for 1-2 days.

Makes sense to me :-) When should we schedule this 1-2 day
presentation 'sprint' (I hate agile terminology but in this case seems
to be accurate) for?

Cole

_______________________________________________
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

* Re: [libre-riscv-dev] daily kan-ban update, 21jul2020
From: Cole Poirier @ 2020-07-22 22:36 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDxkx56pVnq1Znhu=4XWeNc2gTA_AdOi1zhTNO8h8-HDAg@mail.gmail.com>

On Wed, Jul 22, 2020 at 2:09 AM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
> yeah don't put up with that - you should have mentioned it takes that
> long, sooner.

Indeed.. as always...

> use an apt proxy and squid.  "apt-get install
> apt-cacher-ng squid".

I'm using virtualbox because the tricky part I've been tweaking until
it works is the coriolis and alliance-check-toolkit launching the GUI
of the layed out chip.

Will apt caching work given this?

I think I may have just *finally* got the script working correctly!
One more run to confirm. All of the difficulty is coming from my
inexperience with bash scripting, but I've fixed the bugs I introduced
now :)

Cole

_______________________________________________
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

* Re: [libre-riscv-dev] [OpenPOWER-HDL-Cores] system call (sc) LEV "reserved field"
From: Paul Mackerras @ 2020-07-22 22:47 UTC (permalink / raw)
  To: Luke Kenneth Casson Leighton
  Cc: openpower-hdl-cores, Libre-RISCV General Development
In-Reply-To: <CAPweEDzJpX8mDE1QJO6=rPEQfz0jCt+Yi9sS48cE4bXcu8AwcQ@mail.gmail.com>

On Wed, Jul 22, 2020 at 03:22:43PM +0100, Luke Kenneth Casson Leighton wrote:
> hi, we're just reviewing the behaviour needed when LEV != 0, and are
> following what microwatt does (which does not have hypervisor support
> yet)
> 
> https://bugs.libre-soc.org/show_bug.cgi?id=325#c106
> 
> so the trail - i am so glad that the PDF has cross-reference linking -
> jumps from one section to another and after jumping 5 times we
> eventually ascertain the hypothesis that reserved fields, if set,
> should raise an "illegal instruction".

The first sentence of Book I section 1.3.3 says "Reserved fields in
instructions are ignored by the processor."  What led you to confirm
your hypothesis that reserved bits being set should cause an illegal
instruction interrupt?

> however this is so unclear (because of the referral from one section
> to another) that i am seeking confirmation.  should we raise an
> "illegal instruction" when "LEV > 1" on sc?

Section 1.8.2 (Book I) says "any attempt to execute an invalid form of
an instruction will either cause the system illegal instruction
handler to be invoked or yield boundedly undefined results".  Putting
LEV=1 in sc would be an example of an invalid form (on an
implementation without hypervisor mode).  A boundedly undefined result
is one which could be obtained by a sequence of valid instructions,
so in the case of sc 1, making it do what sc 0 does meets the
boundedly undefined results requirement.

> secondly, we note that "LEV=1" is for invocation of the hypervisor.
> what's not clear to us is - given that we are not implementing
> hypervisor - should this be *also* treated as an illegal instruction?
> or, should we just leave it to fall through to trap @ addr 0x0c00, and
> expect the trap *there* to notice and deal with the situation?

That is what I would do.

There is one of the variants of KVM on PPC, called KVM-PR, which runs
the guest entirely in user mode and traps and emulates all privileged
instructions (thus it doesn't need hypervisor mode and can run inside
a guest of another hypervisor).  If you are running a KVM guest inside
that environment and the guest does sc 1, KVM-PR expects that to end
up at the kernel's 0xc00 handler.  So that is one reason to treat sc 1
as sc 0.

> also: if we set the HV bit in MSR (when LEV=1) section 6.5.14 p1077
> which refers us back to figure 65 on p1064, will this "break" things?

Probably not.  Linux does check whether HV=1 at boot time, but I'm
pretty sure that's only on certain processors which it knows to be
HV-capable (either by looking at PVR or the device tree).

> also: in microwatt, i'm not seeing the remaining bits which appear [to
> need to] be set.
> 
> https://github.com/antonblanchard/microwatt/blob/master/execute1.vhdl#L479
>             ctrl_tmp.msr(MSR_SF) <= '1';
>             ctrl_tmp.msr(MSR_EE) <= '0';
>             ctrl_tmp.msr(MSR_PR) <= '0';
>             ctrl_tmp.msr(MSR_IR) <= '0';
>             ctrl_tmp.msr(MSR_DR) <= '0';
>             ctrl_tmp.msr(MSR_RI) <= '0';
>             ctrl_tmp.msr(MSR_LE) <= '1';
> 
> these appear to be correct as defined according to figure 65 (p1063)
> 
> however the remaining actions do not seem to be implemented (p1064):
> 
>      Bits bit 5, TM, VEC, VSX, PR, FP, and PMM are set to 0.
>      The TE field is set to 0b00.
>      TM, FP, VEC, VSX, and bit 5 are set to 0.

Right.  We have a to-do list for architecture compliance.  (We haven't
implemented 32-bit mode or BE mode, for instance.)

> question: what effect would it have - bear in mind that we are
> following microwatt - if we implemented these changes to MSR?  bear in
> mind that we ignore most of them at the moment (MSR.LE being one
> notable exception), so the question is, in effect: does the Linux
> kernel *also* ignore them?

The Linux kernel clearly needs PR to be set to zero and it also
expects FP, VEC, VSX, TM to be cleared.  Setting TE to 0 is necessary
once you implement the trace interrupt, otherwise you could get a
trace interrupt inside your first-level interrupt handlers, which
would be bad.  Similarly if you have floating-point and you don't set
FE0 and FE1 to 0 on an interrupt, there is the chance of taking a
floating-point program interrupt inside a first-level handler.

I'm not sure that all this counts as the Linux kernel "ignoring" the
bits, but in general if you do what the architecture says, the kernel
will be happier than if you don't.

Regards,
Paul.

_______________________________________________
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

* Re: [libre-riscv-dev] Fwd: [Mesa-dev] [XDC 2020] Virtual conference + Call for Proposals extended 2 weeks more
From: Luke Kenneth Casson Leighton @ 2020-07-22 22:59 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEg7hu=b4w+ucgt=4rOEsR6W0405UvWgrSu8W7Q3zfKYrhbg2w@mail.gmail.com>

On Wednesday, July 22, 2020, Cole Poirier <colepoirier@gmail.com> wrote:

>
> Makes sense to me :-) When should we schedule this 1-2 day
> presentation 'sprint' (I hate agile terminology but in this case seems
> to be accurate) for?


when i don't feel pressured that taking that long could jeapordise the
october 2020 deadline.

which if there was even one person helping full time would count.

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

* Re: [libre-riscv-dev] Fwd: [Mesa-dev] [XDC 2020] Virtual conference + Call for Proposals extended 2 weeks more
From: Cole Poirier @ 2020-07-22 23:04 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDyyhTb1z+jB72dgfAZMgrr0K31=eo30JL09MEEj8=V0=g@mail.gmail.com>

On Wed, Jul 22, 2020 at 4:00 PM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> On Wednesday, July 22, 2020, Cole Poirier <colepoirier@gmail.com> wrote:
>
> >
> > Makes sense to me :-) When should we schedule this 1-2 day
> > presentation 'sprint' (I hate agile terminology but in this case seems
> > to be accurate) for?
>
>
> when i don't feel pressured that taking that long could jeapordise the
> october 2020 deadline.
>
> which if there was even one person helping full time would count.

I understand. I'm trying :) Getting back into the swing of things
after being derailed by successive family health scares.

Cole

_______________________________________________
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

* Re: [libre-riscv-dev] system call (sc) LEV "reserved field"
From: Luke Kenneth Casson Leighton @ 2020-07-22 23:41 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: openpower-hdl-cores
In-Reply-To: <20200722224713.GA213782@thinks.paulus.ozlabs.org>

On Wednesday, July 22, 2020, Paul Mackerras <paulus@ozlabs.org> wrote:

> On Wed, Jul 22, 2020 at 03:22:43PM +0100, Luke Kenneth Casson Leighton
> wrote:
> > hi, we're just reviewing the behaviour needed when LEV != 0, and are
> > following what microwatt does (which does not have hypervisor support
> > yet)
> >
> > https://bugs.libre-soc.org/show_bug.cgi?id=325#c106
> >
> > so the trail - i am so glad that the PDF has cross-reference linking -
> > jumps from one section to another and after jumping 5 times we
> > eventually ascertain the hypothesis that reserved fields, if set,
> > should raise an "illegal instruction".
>
> The first sentence of Book I section 1.3.3 says "Reserved fields in
> instructions are ignored by the processor."  What led you to confirm
> your hypothesis that reserved bits being set should cause an illegal
> instruction interrupt?


because i did not expect that behaviour, because doing so (ignoring them)
makes it impossible to trap and emulate.  (it becomes necessary to use JIT
analysis)

so, when some bit is added in the future, an older processor (and the
device it is in) basically has to be thrown into landfill.

if however reserved bits being set cause an exception, the "old" processor
stands a chance of emulating the new behaviour (in software, even if that's
slow), giving it a chance of keeping out of landfill for slightly longer.

however it is not appropriate for all systems to raise exceptions on
reserved bits: the cost of having the detection hardware (a full POWER9
decoder and also illegal/unsupported/reserved SPR detection) can be very
high especially for resource and power constrained silicon or FPGAs.

(example: i know someone - yea, you Sam - who implemented RV64 to comply
with the UNIX RISCV spec rather than the Embedded RISCV spec: the "CSR
detection" just to support all the zeros and illegal CSRs took a whopping
15% of an ICE40 FPGA!)

in RISC-V they get this right, by having two separate Platforms:

* Embedded which is permitted to ignore reserved bits entirely

* UNIX, which definitely is not.

for Embedded, the vendor customises the firmware entirely, and binary
interoperability as well as legacy software support is completely
unimportant.

for UNIXen, interoperability and longterm stability we know very well is
critical.

bottom line if it is correct that on the PowerISA UNIX Platform reserved
bits can be ignored that is cause for some concern, where for Embedded it
would be the other way round: cause for concern if the reserved bits could
*not* be ignored.



> > however this is so unclear (because of the referral from one section
> > to another) that i am seeking confirmation.  should we raise an
> > "illegal instruction" when "LEV > 1" on sc?
>
> Section 1.8.2 (Book I) says "any attempt to execute an invalid form of
> an instruction will either cause the system illegal instruction
> handler to be invoked or yield boundedly undefined results".  Putting
> LEV=1 in sc would be an example of an invalid form (on an
> implementation without hypervisor mode).


ok that helps clarify what that means, thank you.


>   A boundedly undefined result
> is one which could be obtained by a sequence of valid instructions,
> so in the case of sc 1, making it do what sc 0 does meets the
> boundedly undefined results requirement.


ok so that... if i am understanding correctly, means, "you can in fact do
something different and OS software has to detect it and sort it out to
yield expected behaviour"

which, if i am being honest, makes me nervous :)


> > secondly, we note that "LEV=1" is for invocation of the hypervisor.
> > what's not clear to us is - given that we are not implementing
> > hypervisor - should this be *also* treated as an illegal instruction?
> > or, should we just leave it to fall through to trap @ addr 0x0c00, and
> > expect the trap *there* to notice and deal with the situation?
>
> That is what I would do.


ok.  we can do that.


> There is one of the variants of KVM on PPC, called KVM-PR, which runs
> the guest entirely in user mode and traps and emulates all privileged
> instructions (thus it doesn't need hypervisor mode and can run inside
> a guest of another hypervisor).  If you are running a KVM guest inside
> that environment and the guest does sc 1, KVM-PR expects that to end
> up at the kernel's 0xc00 handler.  So that is one reason to treat sc 1
> as sc 0.


ahh.  i did wonder :)


>
> > also: if we set the HV bit in MSR (when LEV=1) section 6.5.14 p1077
> > which refers us back to figure 65 on p1064, will this "break" things?
>
> Probably not.  Linux does check whether HV=1 at boot time, but I'm
> pretty sure that's only on certain processors which it knows to be
> HV-capable (either by looking at PVR or the device tree).


ok.  thank you.


>
> > also: in microwatt, i'm not seeing the remaining bits which appear [to
> > need to] be set.
> >
> > https://github.com/antonblanchard/microwatt/blob/
> master/execute1.vhdl#L479
> >             ctrl_tmp.msr(MSR_SF) <= '1';
> >             ctrl_tmp.msr(MSR_EE) <= '0';
> >             ctrl_tmp.msr(MSR_PR) <= '0';
> >             ctrl_tmp.msr(MSR_IR) <= '0';
> >             ctrl_tmp.msr(MSR_DR) <= '0';
> >             ctrl_tmp.msr(MSR_RI) <= '0';
> >             ctrl_tmp.msr(MSR_LE) <= '1';
> >
> > these appear to be correct as defined according to figure 65 (p1063)
> >
> > however the remaining actions do not seem to be implemented (p1064):
> >
> >      Bits bit 5, TM, VEC, VSX, PR, FP, and PMM are set to 0.
> >      The TE field is set to 0b00.
> >      TM, FP, VEC, VSX, and bit 5 are set to 0.
>
> Right.  We have a to-do list for architecture compliance.  (We haven't
> implemented 32-bit mode or BE mode, for instance.)


yeahh although we have 32 bit op modes (using microwatt  decode1.vhdl,
turned into CSV) we have yet to support the MSR 32bit global mode.

LE/BE amazingly seems to work on LibreSOC, it was quite funny having the
trap jump into 0x700 when testing against qemu (running singlestep under
gdb), only to find that qemu traps change the LE bit and of course in qemu
once that's changed gdb can't read registers correctly. sigh.


> > question: what effect would it have - bear in mind that we are
> > following microwatt - if we implemented these changes to MSR?  bear in
> > mind that we ignore most of them at the moment (MSR.LE being one
> > notable exception), so the question is, in effect: does the Linux
> > kernel *also* ignore them?
>
> The Linux kernel clearly needs PR to be set to zero and it also
> expects FP, VEC, VSX, TM to be cleared.  Setting TE to 0 is necessary
> once you implement the trace interrupt, otherwise you could get a
> trace interrupt inside your first-level interrupt handlers, which
> would be bad.


ah :)


>  Similarly if you have floating-point and you don't set
> FE0 and FE1 to 0 on an interrupt, there is the chance of taking a
> floating-point program interrupt inside a first-level handler.


whoops.  ok appreciate the warning.


>
> I'm not sure that all this counts as the Linux kernel "ignoring" the
> bits, but in general if you do what the architecture says, the kernel
> will be happier than if you don't.


ha, that makes sense.

i generally found this out when network reverse-engineering, despite not
understanding at all what i was sending to the client or server :)

thank you Paul

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

* Re: [libre-riscv-dev] daily kan-ban update, 21jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-22 23:43 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEg7hukDUHd_gwfrg-Bzno3vm61t1ya3Y_Gak4zOKV5++z7dpw@mail.gmail.com>

On Wednesday, July 22, 2020, Cole Poirier <colepoirier@gmail.com> wrote:

> On Wed, Jul 22, 2020 at 2:09 AM Luke Kenneth Casson Leighton
> <lkcl@lkcl.net> wrote:
> > yeah don't put up with that - you should have mentioned it takes that
> > long, sooner.
>
> Indeed.. as always...
>
> > use an apt proxy and squid.  "apt-get install
> > apt-cacher-ng squid".
>
> I'm using virtualbox because the tricky part I've been tweaking until
> it works is the coriolis and alliance-check-toolkit launching the GUI
> of the layed out chip.
>
> Will apt caching work given this?


as long as you do not trash the virtualbox, yes.

or if using the cacheing outside, you'll need to set up transparent
proxying.  or, when setting up the image, set a file in /etc/apt/apt.conf.d
to specify the host apt proxy.

google it.


>
> I think I may have just *finally* got the script working correctly!


hurrah

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

* [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Jacob Lifshay @ 2020-07-23  0:13 UTC (permalink / raw)
  To: Libre-RISCV General Development

today:
still working on Div FSM -- I think it's complete (except for not
supporting cancellation), but didn't thoroughly test it yet. In the
process of refactoring test_pipe_caller.py into a easier-to-test shape
and adding parallel test cases for DivPipeCore, FSMDivCore, and
SimOnly, I discovered that for test_divwuo_regression_1 (0xc4e32b68 /
0x32867d69), the pipeline (SimOnly) is giving the correct results
(rt=0x3), it's the ISA simulator code that's messed up
(rt=0xFFFFFFFF).

Luke (or whoever is more familiar with it), I'll let you figure out
how to fix the ISA simulator.

Jacob

_______________________________________________
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

* Re: [libre-riscv-dev] Fwd: [Mesa-dev] [XDC 2020] Virtual conference + Call for Proposals extended 2 weeks more
From: Samuel Falvo II @ 2020-07-23  0:48 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEg7hu=b4w+ucgt=4rOEsR6W0405UvWgrSu8W7Q3zfKYrhbg2w@mail.gmail.com>

On Wed, Jul 22, 2020 at 3:28 PM Cole Poirier <colepoirier@gmail.com> wrote:
> presentation 'sprint' (I hate agile terminology but in this case seems
> to be accurate) for?

Because that would be a war-room situation involving multiple
disciplines, it's technically a "scrum session".  But, I digress.
Sorry, I couldn't resist.  ;)

-- 
Samuel A. Falvo II

_______________________________________________
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

* Re: [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Cole Poirier @ 2020-07-23  1:53 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD5AfjdHnHQ4JVh43MDzM-T=FCdCrbtUYVwHecDLUN1ZiQ@mail.gmail.com>

Today:

* Finished coriolis2-chroot setup script, it's tested and works correctly!
* Finished updating the wiki libreriscv/HDL_workflow/coriolis2
documentation to sync it with the coriolis-chroot setup script

I can't push my commit to the libreriscv repo, can you please grant me
access Luke?

Cole

_______________________________________________
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

* Re: [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-23  2:29 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD5AfjdHnHQ4JVh43MDzM-T=FCdCrbtUYVwHecDLUN1ZiQ@mail.gmail.com>

On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

> today:
> still working on Div FSM -- I think it's complete (except for not
> supporting cancellation), but didn't thoroughly test it yet. In the
> process of refactoring test_pipe_caller.py into a easier-to-test shape
> and adding parallel test cases for DivPipeCore, FSMDivCore, and
> SimOnly, I discovered that for test_divwuo_regression_1 (0xc4e32b68 /
> 0x32867d69), the pipeline (SimOnly) is giving the correct results
> (rt=0x3), it's the ISA simulator code that's messed up
> (rt=0xFFFFFFFF).


please raise a bugreport for it.


>
> Luke (or whoever is more familiar with it), I'll let you figure out
> how to fix the ISA simulator.


it's running the pseudocode.  if the pseudocode gives the wrong answer,
that's bad.

what happens when testing the same values in simulator/test_div_dim.py?

hm wait you can't put initial regs into qemu yet.  been meaning to add that.

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

* Re: [libre-riscv-dev] [OpenPOWER-HDL-Cores] system call (sc) LEV "reserved field"
From: Paul Mackerras @ 2020-07-23  3:14 UTC (permalink / raw)
  To: Luke Kenneth Casson Leighton
  Cc: openpower-hdl-cores, Libre-RISCV General Development
In-Reply-To: <CAPweEDxxJqcy4kAcL0+wDYQh9A0KtW3dSi9kMdQ-_YotuRSsQw@mail.gmail.com>

On Thu, Jul 23, 2020 at 12:41:15AM +0100, Luke Kenneth Casson Leighton wrote:
> On Wednesday, July 22, 2020, Paul Mackerras <paulus@ozlabs.org> wrote:
> 
> > On Wed, Jul 22, 2020 at 03:22:43PM +0100, Luke Kenneth Casson Leighton
> > wrote:
> > > hi, we're just reviewing the behaviour needed when LEV != 0, and are
> > > following what microwatt does (which does not have hypervisor support
> > > yet)
> > >
> > > https://bugs.libre-soc.org/show_bug.cgi?id=325#c106
> > >
> > > so the trail - i am so glad that the PDF has cross-reference linking -
> > > jumps from one section to another and after jumping 5 times we
> > > eventually ascertain the hypothesis that reserved fields, if set,
> > > should raise an "illegal instruction".
> >
> > The first sentence of Book I section 1.3.3 says "Reserved fields in
> > instructions are ignored by the processor."  What led you to confirm
> > your hypothesis that reserved bits being set should cause an illegal
> > instruction interrupt?
> 
> 
> because i did not expect that behaviour, because doing so (ignoring them)
> makes it impossible to trap and emulate.  (it becomes necessary to use JIT
> analysis)
> 
> so, when some bit is added in the future, an older processor (and the
> device it is in) basically has to be thrown into landfill.

No, it depends on what the new bits do.  Generally when a previously
reserved field in an existing instruction is defined to have a
meaning, it is done in such a way that the behaviour of old processors
is an acceptable implementation of the instruction for any value of
the new field (though perhaps not the most performant).  Two examples:

1. The sync instruction had a reserved field which later got defined
as the "L" field for the instruction, with L=1 defined as light-weight
sync.  Light-weight sync does less than the normal sync and runs
faster.  Old processors that ignore the L field do the full normal
sync, which is acceptable if you are asking for the light-weight sync.

2. When the mfocrf (move from one CR field) instruction was created,
the architects deliberately used the same major/minor opcode as mfcr
(move from CR) and defined mfocrf in such a way that the mfcr
behaviour would be an acceptable implementation of mfocrf.
Unfortunately it turned out that the hardware designers of the
previous generation processor (which was POWER3) had put in a check
that reserved instruction fields had to be zero, which then meant that
software couldn't just use mfocrf everywhere, but had to be careful
to use mfcr rather than mfocrf on POWER3.

I agree that if a previously reserved field was given a meaning that
completely changed an instruction's behaviour, that would cause real
problems, but the Power ISA architects have not done that.  In cases
where significantly different or new behaviour is needed, a new major
or minor opcode would be assigned.  Undefined opcodes definitely do
cause an illegal instruction interrupt.

> if however reserved bits being set cause an exception, the "old" processor
> stands a chance of emulating the new behaviour (in software, even if that's
> slow), giving it a chance of keeping out of landfill for slightly longer.

The cost here is that you have broken compatibility for older system
software versions that don't understand the reason for the illegal
instruction interrupt.

> however it is not appropriate for all systems to raise exceptions on
> reserved bits: the cost of having the detection hardware (a full POWER9
> decoder and also illegal/unsupported/reserved SPR detection) can be very
> high especially for resource and power constrained silicon or FPGAs.
> 
> (example: i know someone - yea, you Sam - who implemented RV64 to comply
> with the UNIX RISCV spec rather than the Embedded RISCV spec: the "CSR
> detection" just to support all the zeros and illegal CSRs took a whopping
> 15% of an ICE40 FPGA!)
> 
> in RISC-V they get this right, by having two separate Platforms:
> 
> * Embedded which is permitted to ignore reserved bits entirely
> 
> * UNIX, which definitely is not.
> 
> for Embedded, the vendor customises the firmware entirely, and binary
> interoperability as well as legacy software support is completely
> unimportant.
> 
> for UNIXen, interoperability and longterm stability we know very well is
> critical.

Which has been a critical consideration for Power server processors
over the last 25 years, and has been achieved by discipline on how new
things get architected rather than by emulation.

> bottom line if it is correct that on the PowerISA UNIX Platform reserved
> bits can be ignored that is cause for some concern, where for Embedded it
> would be the other way round: cause for concern if the reserved bits could
> *not* be ignored.
> 
> 
> 
> > > however this is so unclear (because of the referral from one section
> > > to another) that i am seeking confirmation.  should we raise an
> > > "illegal instruction" when "LEV > 1" on sc?
> >
> > Section 1.8.2 (Book I) says "any attempt to execute an invalid form of
> > an instruction will either cause the system illegal instruction
> > handler to be invoked or yield boundedly undefined results".  Putting
> > LEV=1 in sc would be an example of an invalid form (on an
> > implementation without hypervisor mode).
> 
> 
> ok that helps clarify what that means, thank you.
> 
> 
> >   A boundedly undefined result
> > is one which could be obtained by a sequence of valid instructions,
> > so in the case of sc 1, making it do what sc 0 does meets the
> > boundedly undefined results requirement.
> 
> 
> ok so that... if i am understanding correctly, means, "you can in fact do
> something different and OS software has to detect it and sort it out to
> yield expected behaviour"
> 
> which, if i am being honest, makes me nervous :)

There is of course a quality of implementation question here - this
isn't really a licence for hardware designers to do any crazy thing
they want.  I think it would be impossibly unwieldy for the
architecture to try to define in black-letter law what constitutes
"reasonable" vs. "crazy" behaviour for the undefined cases.  By saying
"boundedly" undefined they are at least saying that there must be no
way to escape privilege boundaries by exploiting undefined behaviour.
Beyond that it's up to the hardware designers to do something
sensible.

Regards,
Paul.

_______________________________________________
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

* Re: [libre-riscv-dev] system call (sc) LEV "reserved field"
From: Luke Kenneth Casson Leighton @ 2020-07-23  4:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: openpower-hdl-cores, Libre-RISCV General Development
In-Reply-To: <bc0527a82b8a777486388ab6084ce364db4c278c.camel@kernel.crashing.org>

hi benjamin, welcome, and thank you for your insights.

On Thursday, July 23, 2020, Benjamin Herrenschmidt <benh@kernel.crashing.org>
wrote:

> On Thu, 2020-07-23 at 00:41 +0100, Luke Kenneth Casson Leighton wrote:
>
> > so, when some bit is added in the future, an older processor (and the
> > device it is in) basically has to be thrown into landfill.
>
> Depends, it goes both ways. For example, this is what allowed the
> addition of lwsync without throwing older processors into the landfill
> because it would automatically "escalate" to a full sync on processors
> that didn't implement it


ah.   on first glance this seems ok.


> (or should have... FSL did screw that up on
> some cores).


oh whoops :)

what i have observed (again this is from RISCV), for instructions that can
be "safely ignored" are of a "hint" type.

the RISCV Fence instructions also fell into this category.  being
optimisations, less complex implementations could completely ignore them.

however in the example that you give - lwsync - i take it that this is a
"less costly" cache/sync flush type instruction than the one that it was
added to?

i.e. old sync is a "superset" of lwsync?

this is very interesting to me, because i have made a longterm study of
"how to develop stable specifications", and it is the first time in 25
years that i have encountered a counterexample to the practice of
disallowing "reserved behaviour".

the "normal" way in "reserved is illegal" specifications, would be that
lwsync would raise an illegal instruction on a processor that did not
support it, the author of the trap would know that the extra bit did not
matter, the trap would call the alternative sync instruction, and return
from the trap.

i do not know the full story about what FSL is: without knowing the details
i suspect that a trap *could* have sorted things out, there, *if* the older
processor was required to raise "illegal instruction"

but because the bit is ignored, there is no way that can be done.

so whilst on the face of it, lwsync *sounds* like a counterexample, instead
(caveat, i do not know what FSL is), it seems more to support the case
*for* use of reserved bits raising illegal instructions [on UNIX platforms]

where of course this would become problematic is if lwsync (or other future
added instruction) was part of a tight, performance-critical loop.  a trap
and emulate in the middle of that would severely degrade older processor
performance.  there is nothing that can be done about that.


> if however reserved bits being set cause an exception, the "old"
> > processor stands a chance of emulating the new behaviour (in
> > software, even if that's slow), giving it a chance of keeping out of
> > landfill for slightly longer.
>
> Which is why powerpc tends not to "add bits" to instructions unless
> ignoring them is a safe fallback.


as we can see above, the example that was given  shows that this is a
problematic approach.

it *sounds* safe to "downgrade" an instruction that does more work (more
syncing) to one that does less, however this is a pretty unique case.

i would say that PowerISA "should have had" space for such downgrading
already planned in advance, except, ruefully and regretfully, such is not
possible or practical (changing the past) and pragmatically we have to work
with how things are, now.

use of "hints" would not help here either unless they were a macro-op fused
type of hint.

wait... that would work.

a sequence as follows:

* hint instruction "next instruction is to be lwsync"
* old sync instruction

older processors would:

* ignore the hint
* execute the old sync instruction as-is, safely doing more work than
necessary.

newer processors would macro-op fuse the two into an lwsync.

of course now with prefixes in POWER10 / v3.1, prefixes could do the same
job without running out of hint space very rapidly.

and Opcode 1 is of course "illegal instruction", and could be used
extensively for "instruction upgrading"

this would work really well, leaving hint macro-op fusion for those very
special cases similar to lwsync where "behaviour downgrading" is needed.

hint macro-op fusion would also work really well in performance critical
loops, too.


> > bottom line if it is correct that on the PowerISA UNIX Platform
> > reserved bits can be ignored that is cause for some concern, where
> > for Embedded it would be the other way round: cause for concern if
> > the reserved bits could *not* be ignored.
>
> Do you have more specific concerns here ?


sorry, Benjamin, i apologise for saying this: the question appears to be
implying, very subtly, that you've not taken on board what i've said. if
you had summarised what i wrote, in your own words, i would have a clear
indicator that you'd heard me. if that is a misinterpretation i apologise.

the specific concern *is* that reserved bits do not cause illegal
instructions to be raised on the UNIX Platform, because without that in
place, UNIX platform longterm seamless upgradeability and interoperability
between vendors across all their product ranges over time is simply not
possible.

i have not spelled it out explicitly, seeking instead to use logical
reasoning rather than make categorical statements, but this is actually a
really serious problem.


IE. Actual examples where
> this has been cause of breakage in the past ?


with PowerISA having only a few implementors, even though i am new to
PowerISA i do not expect there to be many such examples, simply because as
i said, for he "Embedded" class processors (Motorola's 32 bit range, and
even the Quorl 64 bit range can be said to be targetted at the "Embedded"
market of Networking and Routing), these will not encounter this as a
problem (because of the customised firmware that they run).

it is only the *UNIX* Platform where this matters.

that leaves, realistically, only the IBM POWER range.  and when there is
only one vendor, interoperability with other vendors is not important when
there aren't any other vendors!

however if PowerISA expands (as we know it would like to), and this is not
changed, i *guarantee* that when more implementors are involved there will
be problems, here.

in other words the approach of ignoring reserved bits has only worked (for
the past 20 years?) because IBM, realistically, is the only (non-Embedded)
implementor of UNIX Platform processors.


> LE/BE amazingly seems to work on LibreSOC, it was quite funny having
> > the trap jump into 0x700 when testing against qemu (running
> > singlestep under gdb), only to find that qemu traps change the LE bit
> > and of course in qemu once that's changed gdb can't read registers
> > correctly. sigh.
>
> It can if you manually change endian in gdb no ?


this (for a geek) is why it is amusing, because we did exactly that.

during setup, i call the machine-interface "set endian" command depending
on whether the program being executed is LE or BE.

breakpoints are set on 0x700 and end of program.

all good so far

then the trap occurs, and the MSR changes at the trap breakpoint.

when we read the PC it is 0x0070000000000000 not 0x700

when we read the MSR it is *also* byte reversed.

so there is no way to read the MSR and determine from the bits returned if
the bits need to be reversed because the bits that tell you you should
reverse the bits are already reversed.

doh :)

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

* Re: [libre-riscv-dev] system call (sc) LEV "reserved field"
From: Luke Kenneth Casson Leighton @ 2020-07-23  4:20 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: openpower-hdl-cores
In-Reply-To: <20200723031450.GB213782@thinks.paulus.ozlabs.org>

On Thursday, July 23, 2020, Paul Mackerras <paulus@ozlabs.org> wrote:

>
>
> No, it depends on what the new bits do.


hi paul, bit of crossover (replying to ben), v. late here (early) will
catch up tomorrow.

best,

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

* Re: [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-23  9:40 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwNs=hhEWEL0LKi23BORTLhGRUFwH=CXOXtcH6tdNJLGQ@mail.gmail.com>

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

>
>
> On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com>
> wrote:
>
>>
>> SimOnly, I discovered that for test_divwuo_regression_1 (0xc4e32b68 /
>> 0x32867d69), the pipeline (SimOnly) is giving the correct results
>> (rt=0x3), it's the ISA simulator code that's messed up
>> (rt=0xFFFFFFFF).
>
>
> please raise a bugreport for it.
>

saw it, thank you for doing that.

these look great btw


https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=78096b62db0345846cca70ab2f75f9c3519006c4


-- 
---
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

* [libre-riscv-dev] daily kan-ban update 23jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-23 12:50 UTC (permalink / raw)
  To: Libre-RISCV General Development

tasks:

https://bugs.libre-soc.org/showdependencytree.cgi?maxdepth=1&id=383&hide_resolved=1

yestersday:

* went through trap review with samuel.  lots of improvements and bugs fixed
* talked with florian about litex integration. got "compile" but vcd is
problematic

today:

* found that running vcd2fst "fixes" gtkwave problem, allowing debugging of
LibreSOC under verilator litex sim
* started investigating 32/64 bit wishbone mismatch in litex sim

so this is a big deal: getting litex sim working is a first step to being
able to connect to a UART, which in turn will allow running the
"helloworld" and other microwatt examples properly.

next on the list will be adding support for counter SORs, then XICS and
then possibly a RADIX MMU, at which point we can run a linux kernel.

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

* Re: [libre-riscv-dev] daily kan-ban update 23jul2020
From: Yehowshua @ 2020-07-23 12:52 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwf_psXU_-e8tu_KQSw2sZFzSX_9xLHA1=nCGUZcyx2-A@mail.gmail.com>

> * found that running vcd2fst "fixes" gtkwave problem, allowing debugging of
> LibreSOC under verilator litex sim

This is good news.

Yehowshua

_______________________________________________
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

* Re: [libre-riscv-dev] daily kan-ban update 23jul2020
From: Tobias Platen @ 2020-07-23 16:30 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <46B0D1EC-C552-47D1-85F3-54DCA44FBEA3@gatech.edu>

On Thu, 23 Jul 2020 08:52:59 -0400
Yehowshua <yimmanuel3@gatech.edu> wrote:

> > * found that running vcd2fst "fixes" gtkwave problem, allowing debugging of
> > LibreSOC under verilator litex sim
> 
> This is good news.
> 
> Yehowshua
> 
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev@lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

Yesterday I've had a deeper look into the LDSTCompUnit.

-- 
Tobias Platen <libre-soc[at]platen-software[dot]de>

_______________________________________________
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

* Re: [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Jacob Lifshay @ 2020-07-23 16:31 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwbTi4N62TR14LyWF_PS0pqZjJRGubaFVOEkLLsBtceig@mail.gmail.com>

On Thu, Jul 23, 2020, 02:40 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Thursday, July 23, 2020, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> wrote:
>
> >
> >
> > On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com>
> > wrote:
> >
> >>
> >> SimOnly, I discovered that for test_divwuo_regression_1 (0xc4e32b68 /
> >> 0x32867d69), the pipeline (SimOnly) is giving the correct results
> >> (rt=0x3), it's the ISA simulator code that's messed up
> >> (rt=0xFFFFFFFF).
> >
> >
> > please raise a bugreport for it.
> >
>
> saw it, thank you for doing that.
>
> these look great btw
>
>
>
> https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=78096b62db0345846cca70ab2f75f9c3519006c4


Thanks! I used the same list of test values as in
power-instruction-analyzer.

Jacob
_______________________________________________
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

* Re: [libre-riscv-dev] daily kan-ban update 23jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-23 16:37 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20200723183029.a53f362a75a6702392efa5fe@platen-software.de>

On Thursday, July 23, 2020, Tobias Platen <libre-soc@platen-software.de>
wrote:

>
>
> Yesterday I've had a deeper look into the LDSTCompUnit.


it's quite involved, a lot of steps, isn't it?

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

* Re: [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-23 16:42 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD71j6QJ309ttahw0xzX5iUhhfZfP4e-O8CuBQNLjb3FNA@mail.gmail.com>

On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

> On Thu, Jul 23, 2020, 02:40 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> wrote:
>
> > On Thursday, July 23, 2020, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> > wrote:
> >
> > >
> > >
> > > On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com>
> > > wrote:
> > >
> > >>
> > >> SimOnly, I discovered that for test_divwuo_regression_1 (0xc4e32b68 /
> > >> 0x32867d69), the pipeline (SimOnly) is giving the correct results
> > >> (rt=0x3), it's the ISA simulator code that's messed up
> > >> (rt=0xFFFFFFFF).
> > >
> > >
> > > please raise a bugreport for it.
> > >
> >
> > saw it, thank you for doing that.
> >
> > these look great btw
> >
> >
> >
> > https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=
> 78096b62db0345846cca70ab2f75f9c3519006c4
>
>
> Thanks! I used the same list of test values as in
> power-instruction-analyzer.


i wondered if, like in the ieee754fp tests, if some random values could be
added, too.

also, some exponentially scaled numbers.

two random uniform distributed numbers for div, the answer pretty much
averages out to 1 which is of course a fairly useless test.

by doing this you get a much better distribution suited to testing divide
full range:

x = random(1,32)
return random(0,1<<x)

l.




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


-- 
---
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

* Re: [libre-riscv-dev] daily kan-ban update, 22jul2020
From: Jacob Lifshay @ 2020-07-23 17:06 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzsho_Jemrm03UG1UmwxtjnGx5+G47JBbGSVgH4DLc3TQ@mail.gmail.com>

On Thu, Jul 23, 2020, 09:42 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com>
> wrote:
>
> > On Thu, Jul 23, 2020, 02:40 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> > wrote:
> >
> > > On Thursday, July 23, 2020, Luke Kenneth Casson Leighton <
> lkcl@lkcl.net>
> > > wrote:
> > >
> > > >
> > > >
> > > > On Thursday, July 23, 2020, Jacob Lifshay <programmerjake@gmail.com>
> > > > wrote:
> > > >
> > > >>
> > > >> SimOnly, I discovered that for test_divwuo_regression_1 (0xc4e32b68
> /
> > > >> 0x32867d69), the pipeline (SimOnly) is giving the correct results
> > > >> (rt=0x3), it's the ISA simulator code that's messed up
> > > >> (rt=0xFFFFFFFF).
> > > >
> > > >
> > > > please raise a bugreport for it.
> > > >
> > >
> > > saw it, thank you for doing that.
> > >
> > > these look great btw
> > >
> > >
> > >
> > > https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=
> > 78096b62db0345846cca70ab2f75f9c3519006c4
> >
> >
> > Thanks! I used the same list of test values as in
> > power-instruction-analyzer.
>
>
> i wondered if, like in the ieee754fp tests, if some random values could be
> added, too.
>

I specifically want the test cases to be reproducible for
power-instruction-analyzer, since the test results generated on a POWER9
cpu are checked into the repo for those who don't have a POWER9.

for soc, we can copy the test case generation logic from DivPipeCore's
tests in ieee754fpu since that covers waaay more cases (nicely
exponentially distributed too) but is also deterministic. it covers the
cases:
for all 0 <= a < 2^8 and 0 <= b < 64:
the case a << b if b < 64 - 8
and the case ~(a << b) if b < 64 - 8
and the case (1 << b) - 1
and the case ~((1 << b) - 1)

It might use a different value than 8 -- icr.

this covers all the corner cases I can think of, which random testing has a
very small chance of ever hitting (small enough that you'd need every
person on the planet to all run the test on the order of a billion times
each to hit the case once).

Jacob
_______________________________________________
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

page:   latest

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