Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* Re: [libre-riscv-dev] libre-riscv-dev Digest, Vol 23, Issue 16
From: Jacob Lifshay @ 2020-07-10 22:50 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: Samuel Falvo II
In-Reply-To: <CAPweEDw=fEV4-GHme2cG9LFiZd4UAMXjCfQ+kXWbfj9xwoZ7Yg@mail.gmail.com>

apparently whitequark fixed the dependency issues with nmigen_soc:
https://github.com/nmigen/nmigen-soc/commit/5509bd2aad3012eed09c06f660cb9b60cd2cff95

So, if you install from https://github.com/nmigen/nmigen-soc instead
of PyPI or m-labs it will probably work

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] Failing test case module
From: Luke Kenneth Casson Leighton @ 2020-07-10 22:36 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEz=som98z98DdrStYBPGFAkf3-TUpqfp2-at2NhZ0Fznn0uTg@mail.gmail.com>

On Friday, July 10, 2020, Samuel Falvo II <sam.falvo@gmail.com> wrote:

> I've successfully managed to get my own test case module to fail.
>
> Note: I didn't say test case.  Rather, test case *module*.  The whole .py
> file.


erm... burble? :)


>
> (Don't worry; this is deliberate!  Still getting used to the
> work-flow, and ironing out environmental issues.  Baby steps.)


keep us advised.  this is important, to get the order right.  already we
established that nmigen-soc being installed first is problematic.

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] libre-riscv-dev Digest, Vol 23, Issue 16
From: Luke Kenneth Casson Leighton @ 2020-07-10 22:33 UTC (permalink / raw)
  To: Libre-RISCV General Development, Samuel Falvo II
In-Reply-To: <CAEz=sokZ0B0v8crmtK0=jgHkf9TxSFHoUp29APW-DoyS0Pno1g@mail.gmail.com>

On Friday, July 10, 2020, Samuel Falvo II <sam.falvo@gmail.com> wrote:

>
> I've uninstalled nmigen-soc and nmigen, then made sure to install nmigen
> first, *then* nmigen-soc (both by way of setup.py develop), and it now
> seems to work.  Tests are reporting back OK so far (except for skipped
> tests).  (Update: now I'm getting a ton of other errors, but it's at least
> made progress!)


hurrah.

the main one you want is soc/fu/spr/test/test_pipe_caller.py

oh remember to inspect the Makefile in soc.

you want to run pywriter.py



> Looking at the setup.py files in each, they seem to rely on some serious
> black magic to auto-detect installed versions.  I hate stuff like that.
> Configuration management is precisely where you do *NOT* want black magic
> to occur (IMHO).


i know.

basically they are trying to reinvent debian distro behaviour, without the
same level of coordination and due care and attention... oh, and relying on
HTTPS for "security".

the old version of distutils is now deprecated.  it used to not have this
"intelligence".  you had to make sure everything was installed by hand.  no
dependencies were installed or "randomly searched for off the internet".

dependencies not met? error.  sort it out yourself.

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] spec ambiguity divwe - divwue v3.0B / v3.1B
From: Luke Kenneth Casson Leighton @ 2020-07-10 22:26 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: openpower-hdl-cores
In-Reply-To: <CAPweEDwaJqeEOn8=VnwKxM34AL32DFXErFdVjME395QTdvBDpg@mail.gmail.com>

https://bugs.libre-soc.org/show_bug.cgi?id=323#c6

apologies, another follow-up: regarding the use of "undefined" in the 3.0B
spec.

as was shown historically with the Amdahl 370 clone, full interoperability
even with ostensible "undefined" behaviour is often critical to a
business's decision-making on whether to purchase a product.

in the case of the Amdahl 370 they had to provide a software patch to
emulate *incorrect* IEEE754 behaviour of the 370 because customers had
already written software that worked around or otherwise critically relied
on the IBM 370 hardware, and those customers were in no way prepared to go
to further expense to modify that software.

based on this historical lesson it is of some concern to us that we not
make the same mistake, and therefore refine the answers given to precisely
match the behaviour of IBM POWER9, *not* match "strict minimalist 3.0B
specification requirements".

it turns out that microwatt is likewise following this strategy,
particularly for mul and div.  mulhwu for example returns the 32 LSBs
duplicated *twice* because that is exactly what IBM POWER9 does.

in our case however the software simulator is based on the spec pseudocode,
and therefore to match that exact same behaviour *we need to modify the
pseudocode*

https://libre-soc.org/openpower/isa/fixedarith/

XO-Form

   - mulhw RT,RA,RB (Rc=0)
   - mulhw. RT,RA,RB (Rc=1)

Pseudo-code:

prod[0:63] <- MULS((RA)[32:63], (RB)[32:63])
RT[32:63] <- prod[0:31]
RT[0:31] <- prod[0:31]  was undefined

this divergence therefore has me slightly concerned.  originally the
intention was to stick exactly to the 3.0B spec mandated pseudocode however
we know the consequences of that [Amdahl example].

my concern is that by modifying and publishing these changes, when other
implementors in future learn of these modifications, and decide that they
also want full binary interoperability with POWER9 for the exact same
reasons, and also want to save time and development costs just like we did,
then instead of using IBM's *official* specification pseudocode (which,
remember, does *not* match the exact behaviour of POWER9, the de-facto
leading implementation), they use the *unofficial* version from *our*
website, instead.

now, if we had not created an autogenerator (a parser and codegenerator)
thus making the unofficial pseudocode hard to use (i.e. useless to all
intents and purposes) this would not really be an issue.

however the time that has been saved by doing so is vast, and it has been
extremely successful, so it is not an option to go backwards by
hand-editing and hand-maintaining the autogenerated output.

nor either would it be reasonable to request (or expect voluntarily) that a
charitably funded software libre project take down code or documentation
published under full audit and transparency requirements of their funding
body (NLNet) as part of NLNet's "Privacy and Enhanced Trust" Programme (
https://nlnet.nl/PET)

i really have no idea what to suggest here.  i am simply laying out the
consequences of the decision to use "undefined", and explaining why we have
to make modifications.

personally in 30 years experience i have found "undefined" to be an issue
in any spec (generally) where it is used and where interoperability is
expected, however that is my personal experience, and there may be
extremely good historical reasons why it is used, in this case, that i am
not aware of.

apologies that this is quite long.

i leave it with you for consideration when time permits, pending the
POWER10 release.

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] Failing test case module
From: Samuel Falvo II @ 2020-07-10 21:49 UTC (permalink / raw)
  To: Libre-RISCV General Development

I've successfully managed to get my own test case module to fail.

Note: I didn't say test case.  Rather, test case *module*.  The whole .py file.

(Don't worry; this is deliberate!  Still getting used to the
work-flow, and ironing out environmental issues.  Baby steps.)

-- 
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] Dumb question time with Sam
From: Luke Kenneth Casson Leighton @ 2020-07-10 21:47 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDypRHb0zSKSe+Lx_NopWjQnJWCi-gpk_qe5TJdo1diqkw@mail.gmail.com>

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

>
>
> On Friday, July 10, 2020, Tobias Platen <libre-soc@platen-software.de>
> wrote:
>
>> I head similar errors one week ago, and I did not yet find a way to
>> resolve those.
>
>
> don't use nmigen 0.1
>

also if you are updating (git pull) it is imperative to re-run setup.py
develop.

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 09jul2020
From: Jacob Lifshay @ 2020-07-10 21:13 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDyKnVDBphETYxknPgUr=A0r691RsJSBUC_-NbPMeJMKaQ@mail.gmail.com>

On Fri, Jul 10, 2020, 13:44 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> here's where the discrepancy exists: i *am* seeing non-zero values for
> top.alu.pipe_start.setup_stage.ra


> that's with everything updated on libre-soc side and with this nmigen
> checkout:
> commit 303ea18cb60567e45a755c6b6289a601f27d46e6 (HEAD -> master,
> origin/master, origin/HEAD)
> Author: Alan Green <alan.green@gmail.com>
> Date:   Tue Jun 23 22:12:02 2020 +1000
>

thanks! now I have a starting point for bisecting nmigen

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] libre-riscv-dev Digest, Vol 23, Issue 16
From: Samuel Falvo II @ 2020-07-10 21:04 UTC (permalink / raw)
  To: Luke Kenneth Casson Leighton; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDwtHRS1W9xanjt8jqf4-Abg=kLBoL3VJJ_DgnaK=hHbiA@mail.gmail.com>

On Fri, Jul 10, 2020 at 1:57 PM Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:
> On Fri, Jul 10, 2020 at 9:47 PM Samuel Falvo II <sam.falvo@gmail.com>
wrote:
> *click*.  that's it.  note "nmigen-soc".  you'll be able to see that
> in nmigen-soc's setup.py.  (btw i cloned nmigen-soc in libre-soc.org
> and *removed* that hard dependency version number.  don't use it
> though because it's a hard fork of nmigen-soc).
>
> you have a version of nmigen-soc installed (in the same virtualenv)
> that DEMANDS nmigen 0.1, and exactly and ONLY nmigen 0.1.

This is a completely unique virtualenv, so it shouldn't have happened.
But, what I suspect happened is I must have accidentally installed
nmigen-soc *first* before installing nmigen proper.

I've noticed (at least for me) that invoking `python setup.py develop` will
not cause an error if there's a dependency issue; `pip install -e .` will
at least issue an easily seen warning.  Running setup.py directly seems to
just make assumptions about its environment.  NOTE: I'm not suggesting one
should just stop using python setup.py develop; rather, if things seem
inexplicably askew, just try pip install -e . ; it seems to have better
diagnostics output.

I've uninstalled nmigen-soc and nmigen, then made sure to install nmigen
first, *then* nmigen-soc (both by way of setup.py develop), and it now
seems to work.  Tests are reporting back OK so far (except for skipped
tests).  (Update: now I'm getting a ton of other errors, but it's at least
made progress!)

Looking at the setup.py files in each, they seem to rely on some serious
black magic to auto-detect installed versions.  I hate stuff like that.
Configuration management is precisely where you do *NOT* want black magic
to occur (IMHO).

-- 
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] libre-riscv-dev Digest, Vol 23, Issue 16
From: Luke Kenneth Casson Leighton @ 2020-07-10 20:56 UTC (permalink / raw)
  To: Libre-RISCV General Development, Samuel Falvo II
In-Reply-To: <CAEz=so=ReFBka1gSPviskcn33gOONtrm4r35tg4JoBKeQo8-MQ@mail.gmail.com>

(cc'ing you direct, sam, as you're on "digest" mode.  if you make sure
to always cc yourself - and ask people at the top to cc you - it will
help people be able to reply to you much quicker, and you also won't
have to mess about cut/pasting the contents of the digest).

On Fri, Jul 10, 2020 at 9:47 PM Samuel Falvo II <sam.falvo@gmail.com> wrote:

> Just for grins, I tried with "cd nmigen && pip uninstall nmigen && pip
> install -e .", and it gave me this result:
>
> ERROR: nmigen-soc 0.0 has requirement nmigen~=0.1.rc1, but you'll have
> nmigen 0.3.dev134+g30e2f91 which is incompatible.

*click*.  that's it.  note "nmigen-soc".  you'll be able to see that
in nmigen-soc's setup.py.  (btw i cloned nmigen-soc in libre-soc.org
and *removed* that hard dependency version number.  don't use it
though because it's a hard fork of nmigen-soc).

you have a version of nmigen-soc installed (in the same virtualenv)
that DEMANDS nmigen 0.1, and exactly and ONLY nmigen 0.1.

you'll need to get rid of "nmigen-soc 0.0"... *BEFORE* you are
"permitted" to install the latest git of nmigen.

it sounds like setup.py has been modified to use pip3 by default.
that is a very worrying development and an extremely bad idea on the
part of the python developers.

samuel if you do actually use virtualenv, then so as to not disrupt
the kestrel and VDC development that you're doing, you might consider
setting up an entirely new virtualenv with a completely different
name.

i mean, it's what virtualenv is supposed to be for: create separate
completely isolated environments.  you might as well use it for that
:)

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] libre-riscv-dev Digest, Vol 23, Issue 16
From: Samuel Falvo II @ 2020-07-10 20:46 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <mailman.1.1594401220.8323.libre-riscv-dev@lists.libre-riscv.org>

On Fri, Jul 10, 2020 at 10:13 AM
<libre-riscv-dev-request@lists.libre-riscv.org> wrote:
> Message: 4
> Date: Fri, 10 Jul 2020 17:10:17 +0100
> From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
>
> this is why i sent you a (private) message containing the git
> repositories to clone, and pointed you at the HDL_workflow.  section
> on nmigen:
>
> mkdir ~/src
> cd !$
> git clone https://github.com/nmigen/nmigen.git
> cd nmigen
> sudo bash
> python3 setup.py develop

I don't know if you noticed, but the path name it was looking in was
underneath the libre-soc directory hierarchy, clearly being installed
contemporaneously with the other parts of the system.  That was one of
the first things I checked for.

I've tried uninstalling nmigen, and re-installing it from scratch, and
again it insisted on installing 0.1.

Just for grins, I tried with "cd nmigen && pip uninstall nmigen && pip
install -e .", and it gave me this result:

ERROR: nmigen-soc 0.0 has requirement nmigen~=0.1.rc1, but you'll have
nmigen 0.3.dev134+g30e2f91 which is incompatible.

Looks to me like there's a transitive dependency mismatch, and that is
what's causing the rollback to 0.1.

> 3. no mention of "virtualenv"

I've *ONLY* ever run nmigen in a virtualenv, and have never once had a
problem with it until now.  Something else must be the problem.  I
know it works, as my continued development of my Kestrel-3 and VDC-II
projects depend on it.

> 4. use of python3 setup.py >>>>DEVELOP<<<< *NOT* python3 setup.py >>INSTALL<<

I did this.

-- 
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 09jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-10 20:44 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD5M7rxu5vYfze2nMt88DjnTW2R_OAKGMZX9AbA=Ez3n+A@mail.gmail.com>

On Fri, Jul 10, 2020 at 6:59 PM Jacob Lifshay <programmerjake@gmail.com> wrote:
>
> On Fri, Jul 10, 2020, 10:26 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> wrote:
>
> > On Friday, July 10, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:
> >
> > yes with you now.  sorry took a while.
> >
>
> opened a bug report:
> https://github.com/nmigen/nmigen/issues/429

ok let's double-check it.  this pipe_start: (yosys read_ilang
div_simulator.py; show pipe_start):
https://ftp.libre-soc.org/2020-07-10_21-18.png

the chain is therefore (starting from fu/div/pipeline.py):

* DivBasePipe: pipe_start of type DivStagesStart

* DivStagesStart contains
 -        alu_input = DivMulInputStage(self.pspec)
 -      div_setup = DivSetupStage(self.pspec)
 -      core_setup = DivCoreSetupStage(self.pspec)

* DivMulInputStage has a default submodule name of "input"
* DivSetupStage gives its name as "setup_stage"
* DivCoreSetupStage gives its name as "core_setup_stage"

so because DivStagesStart chains those three together, we can confirm
that the input and output parameters - ra, rb, xer_so - are expected
to be copied through in that order.

this from visual inspection of the image, above, is confirmed.  taking ra (only)

* ra starts from pipe_start on the bottom left, gets named input_ra,
goes into input
* comes out of input as input_ra_42, gets named setup_stage_ra, goes
into setup_stage

so we expect

* gtkwave examination of input's ra to be non-zero
* input's ra$1 (which is the *output* from that module) to be non-zeri
* setup_stage's ra to be non-zero
* setup_stage's ra output to... well... exist.  and it doesn't
(because of the missing patch)

ok.  so in this comment:
https://github.com/nmigen/nmigen/issues/429#issuecomment-656814447

you're finding that ra is zero when (and i can confirm here that it is
non-zero) it's expected to be non-zero.

here's where the discrepancy exists: i *am* seeing non-zero values for
top.alu.pipe_start.setup_stage.ra

that's with everything updated on libre-soc side and with this nmigen checkout:
commit 303ea18cb60567e45a755c6b6289a601f27d46e6 (HEAD -> master,
origin/master, origin/HEAD)
Author: Alan Green <alan.green@gmail.com>
Date:   Tue Jun 23 22:12:02 2020 +1000

i've placed a copy of the div_pipeline.il and div_simulator.vcd here:
https://ftp.libre-soc.org/div_pipeline.tgz

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] Dumb question time with Sam
From: Luke Kenneth Casson Leighton @ 2020-07-10 20:08 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDxwWcbfvA331z0RkOdAfyUaDcGws+=JCF-OoidS6_f9SQ@mail.gmail.com>

also, to both of you: if you've installed nmigen 0.1 globally you
might need to hunt it down and kill it.  python3 -v followed by
"import nmigen" is your friend, there, as it will show exactly where
things are imported from.

if that really doesn't show you the location then use strace, which
tracks every system call.

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] daily kan-ban update 09jul2020
From: Jacob Lifshay @ 2020-07-10 17:59 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDw=tb4pjUTkcdfWuNFc1Qpoc_B6jiVxkUVbQ+v29ikJhg@mail.gmail.com>

On Fri, Jul 10, 2020, 10:26 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Friday, July 10, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:
>
> yes with you now.  sorry took a while.
>

opened a bug report:
https://github.com/nmigen/nmigen/issues/429

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 09jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-10 17:25 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD53q-mmBUcGR-fH+vpiztfe18Cv7s15qO8wcfp60_Z+ng@mail.gmail.com>

On Friday, July 10, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

>
> yes, I know and expected that. I'll repeat myself until you get that I was
> looking at the ra and rb *inputs* in *this stage* as well as the previous
> stage. those *inputs at the beginning of the pipeline* were zero.


ok am with you.  that's very odd, because when i added those lines the
correct expected values propagated down the whole thing.

sorry had to narrow down by being able to say what it wasn't :)

there is actually a word for this in vedic epistemology (advaita vedanta)
which is "knowledge by difference".  the discrepancy in a comparison *is*
new knowledge.

took a couple of rounds to get there though :)


>
>
> plus, given that the break in the pipeline has been
> > identified i don't believe it necessary to raise the bugreport.
> >
>
> it *is* necessary to report (unless fixed meanwhile), since you got
> distracted by the wrong thing and completely missed that the signals that
> shouldn't have been zero since they *are* connected to the pipeline inputs
> -- those signals *are* zero in the vcd file.


yes with you now.  sorry took a while.

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] Dumb question time with Sam
From: Luke Kenneth Casson Leighton @ 2020-07-10 17:19 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20200710185449.f2e491414b7a678d21ef5cbf@platen-software.de>

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

> I head similar errors one week ago, and I did not yet find a way to
> resolve those.


don't use nmigen 0.1

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 09jul2020
From: Jacob Lifshay @ 2020-07-10 17:13 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDz+goTBVQX==8N6dSzdE-xgxR-49efy5ofSK634UZLN1A@mail.gmail.com>

On Fri, Jul 10, 2020, 05:33 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Fri, Jul 10, 2020 at 10:54 AM Jacob Lifshay <programmerjake@gmail.com>
> wrote:
>
> > I checked quite a few signals that I know are critical for calculating
> the
> > correct result, such as the ra and rb signals in the *setup* stage, and
> the
> > dividend, divisor_radicand, and operation of DivPipeCore.
>
> so let's track that with the yosys graphvis (show setup).  i can see
> ra going in to dividend_neg and abs_dividend (this is visually, not
> looking at the code), and i can see rb going in to divisor_neg and
> abs_dor (i shortened the name abs_divisor).
>
> however what i *don't* see is ra or rb going into *output* signals
> from the setup stage.
>

yes, I know and expected that. I'll repeat myself until you get that I was
looking at the ra and rb *inputs* in *this stage* as well as the previous
stage. those *inputs at the beginning of the pipeline* were zero.

at no point is either ra or rb in being copied into ra or rb *out*.
> there's no self.o.rb.eq(self.i.rb)
>
> basically what i'm pointing out is that there may not be a bug in nmigen
> at all.
>
> > true, but they're thrown away after where I checked. I looked through the
> > whole list of signals and I think all signals named ra and rb including
> > variants like ra$3 were 0 everywhere.
>
> yes, because once the chain is broken (and it looks like it's broken
> in DivSetupStage) that's it, zeros will obviously get propagated from
> that point onwards in the pipeline.
>
> adding this, the signals are no longer zero, right the way throughout
> the entire pipe_N_to_N chain:
>

we don't actually want to do that because it's 128 extra wires.  those
> have to go.  there's currently something like.... 600 wires being
> passed between each stage right now.
>

completely agreed.

>
> > > there's nothing wrong with the simulation / pipeline: it's the
> > > calculation of overflow.  it's real simple to check: delete these
> > > lines
> > >
> >
> > yeah, i got that. I was trying to get a working vcd trace so I could
> follow
> > the overflow computation, which is split between the setup stage and the
> > output stage.
>
> i've found it necessary to have *all* the files open on-screen (jobs |
> grep vi | wc --> 48 *in one terminal*), have the yosys graphviz open
> on a second virtual desktop (full screen, 3840x2160), the vcd trace
> open in 1/3 of the screen, *and* do print statements from the
> simulation.
>
> the combination - reinforcement of information from multiple sources -
> gives the picture in a way that a single tool flat-out cannot.
>
>
> > If you have time, you could try to build a more minimal reproducer for
> > whitequark,
>
> that would take longer than it would to turn the microwatt FSM into
> nmigen.



plus, given that the break in the pipeline has been
> identified i don't believe it necessary to raise the bugreport.
>

it *is* necessary to report (unless fixed meanwhile), since you got
distracted by the wrong thing and completely missed that the signals that
shouldn't have been zero since they *are* connected to the pipeline inputs
-- those signals *are* zero in the vcd file.

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] spec ambiguity divwe - divwue v3.0B / v3.1B
From: Luke Kenneth Casson Leighton @ 2020-07-10 17:06 UTC (permalink / raw)
  To: Jacob Lifshay, Libre-RISCV General Development; +Cc: openpower-hdl-cores
In-Reply-To: <CAPweEDwzjjgFmwXFFznY5D_NaqY-K1gSfagRb-rPPNaM4rSTNg@mail.gmail.com>

continuing on this same subject, we have progress on part-resolving the
overflow on divw* and have moved on to divuw*

this is where another spanner in the pseudocode works was discovered.

divw* text (including divwe) says that the integers shall be treated as
signed.

divuw* text says unsigned.

unfortunately the actual behaviour of the divide operator "/" is
*different* for certain identical values.

here is the implementation of a signed trunc div:

x = abs(n)
y = abs(d)
result = y FLOORDIV x
if sign(n) == sign(d) return result
return -result

which works perfectly well for unsigned input as long as the top bit of
either n or d is zero.

the bottom line is that to properly represent the operations in the
pseudocode, a signed div operator needs to be introduced.

(likewise for mod *and mul*)

without these operators the implementor - every implementor - is forced to
read the words rather than rely on the accuracy of the pseudocode.

as we have seen in at least one instance (the sail power implementation
which was derived directly from the IBM XML variant of the spec using a
code generator) that simply does not happen because people trust the
pseudocode to be unambiguous.

unfortunately with there being no discernment between div-signed operator
or div-unsigned, mistakes are being made.

there is actually precedent for postfixing "u" on operators in the spec,
and after some thought that is what i would advocate in this case:

* /u to discern div-unsigned from / for div-signed
* likewise for multiply
* likewise for mod.

more when i am happy with the quantity of unit tests covering a large
enough range of values on all operations.

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] Dumb question time with Sam
From: Tobias Platen @ 2020-07-10 16:54 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDxwWcbfvA331z0RkOdAfyUaDcGws+=JCF-OoidS6_f9SQ@mail.gmail.com>

I head similar errors one week ago, and I did not yet find a way to resolve those.

_______________________________________________
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] Dumb question time with Sam
From: Luke Kenneth Casson Leighton @ 2020-07-10 16:10 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEz=sokHWn3uFgomWRLXUDwmtO7dKXcj0rvi1yxSe5zN7YFKUg@mail.gmail.com>

On Fri, Jul 10, 2020 at 4:58 PM Samuel Falvo II <sam.falvo@gmail.com> wrote:
>
> I'm attempting to run "make test" with the soc.git repo,

yyeah that will get you into a world of pain :)  i'm doing my best to
keep the unit tests up-to-date however there's simply too much for
only one full-time person to do.


> and it's just not
> working.  I suspect I managed to botch my environment configuration
> somehow.  This is the first occurrence of an error; there may be others,
> but this is far and above the most prominent error I see in the output:
>
> Failure: ImportError (cannot import name 'Settle' from 'nmigen.back.pysim'
> (/home/kc5tja/git/libre-soc/env3/lib/python3.8/site-packages/nmigen-0.1-py3.8.egg/nmigen/back/pysim.py))

0.1.  that's out-of-date.  we specifically work with the git versions,
not with old releases.  the HDL_workflow instructions - and the
dev-setup scripts - would contain that exact version (and command to
install it), if we were using it.

this is why i sent you a (private) message containing the git
repositories to clone, and pointed you at the HDL_workflow.  section
on nmigen:

mkdir ~/src
cd !$
git clone https://github.com/nmigen/nmigen.git
cd nmigen
sudo bash
python3 setup.py develop
ctrl-d

notice several things:

1. glt clone development version
2. no mention of "pip3"
3. no mention of "virtualenv"
4. use of python3 setup.py >>>>DEVELOP<<<< *NOT* python3 setup.py >>INSTALL<<

if you absolutely insist on using pip3, the same effect as python3
setup.py develop can i believe be achieved with something like "pip3
install ." (notice and observe that the fullstop there is not a
sentence fullstop, it is part of the command and represents the
current working directory).

i really do not like pip3 due to the security implications (no GPG
signing of packages, no web of trust, pypi.org website becomes a
high-priority phishing and hacking target *yes this has actually
happened*) as it results in arbitrary untrusted code download and
execution.

anyway.

yes.

use latest clone, not v0.1.  it's guaranteed not to work.

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] Dumb question time with Sam
From: Samuel Falvo II @ 2020-07-10 15:58 UTC (permalink / raw)
  To: Libre-RISCV General Development

I'm attempting to run "make test" with the soc.git repo, and it's just not
working.  I suspect I managed to botch my environment configuration
somehow.  This is the first occurrence of an error; there may be others,
but this is far and above the most prominent error I see in the output:

Failure: ImportError (cannot import name 'Settle' from 'nmigen.back.pysim'
(/home/kc5tja/git/libre-soc/env3/lib/python3.8/site-packages/nmigen-0.1-py3.8.egg/nmigen/back/pysim.py))
... ERROR

The nmigen in question was just downloaded last night.  Can anyone else
confirm this is a legit issue with either my setup, with nmigen, or
otherwise know how to work around this?

Thanks.

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

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

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

yesterday:

* lots of debugging of overflow conditions and general hilarity
forgetting that the div pipeline is, in fact, a pipeline.

today:

* more investigating div pipeline.  decided i'd had enough with it.
* moved on to resolving why fu/compunit/test/*.py were not working,
turned out i'd missed an argument that sets bigendian now as an
argument.

there is still a huge series of changes needed (affecting over 50
files) to be able to do little/big-endian switching.  it does not help
that the meaning of the switch is *reversed* in all the code at the
moment.  this probably explains why i was horribly confused when doing
LD/ST.

we can't run the microwatt unit tests until this is resolved, because
they are all compiled little-endian.

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 09jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-10 12:33 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD7yK_pJkNTicyOV3jhwR-Wv+yQFw49sKqeBifR1tYC4-Q@mail.gmail.com>

On Fri, Jul 10, 2020 at 10:54 AM Jacob Lifshay <programmerjake@gmail.com> wrote:

> I checked quite a few signals that I know are critical for calculating the
> correct result, such as the ra and rb signals in the *setup* stage, and the
> dividend, divisor_radicand, and operation of DivPipeCore.

so let's track that with the yosys graphvis (show setup).  i can see
ra going in to dividend_neg and abs_dividend (this is visually, not
looking at the code), and i can see rb going in to divisor_neg and
abs_dor (i shortened the name abs_divisor).

however what i *don't* see is ra or rb going into *output* signals
from the setup stage.

now let's look at DivSetupStage (in fu/div/setup_stage.py) and sure enough:

        comb = m.d.comb
        # convenience variables
        op, a, b = self.i.ctx.op, self.i.a, self.i.b
        ...
        ...

        ###### sticky overflow and context, both pass-through #####

        comb += self.o.xer_so.eq(self.i.xer_so)
        comb += self.o.ctx.eq(self.i.ctx)

        return m

at no point is either ra or rb in being copied into ra or rb *out*.
there's no self.o.rb.eq(self.i.rb)

basically what i'm pointing out is that there may not be a bug in nmigen at all.

> true, but they're thrown away after where I checked. I looked through the
> whole list of signals and I think all signals named ra and rb including
> variants like ra$3 were 0 everywhere.

yes, because once the chain is broken (and it looks like it's broken
in DivSetupStage) that's it, zeros will obviously get propagated from
that point onwards in the pipeline.

adding this, the signals are no longer zero, right the way throughout
the entire pipe_N_to_N chain:

diff --git a/src/soc/fu/div/setup_stage.py b/src/soc/fu/div/setup_stage.py
index 25daa201..8975416f 100644
--- a/src/soc/fu/div/setup_stage.py
+++ b/src/soc/fu/div/setup_stage.py
@@ -81,6 +81,9 @@ class DivSetupStage(PipeModBase):

         ###### sticky overflow and context, both pass-through #####

+        comb += self.o.ra.eq(self.i.ra)
+        comb += self.o.rb.eq(self.i.rb)
+
         comb += self.o.xer_so.eq(self.i.xer_so)
         comb += self.o.ctx.eq(self.i.ctx)

we don't actually want to do that because it's 128 extra wires.  those
have to go.  there's currently something like.... 600 wires being
passed between each stage right now.

> > there's nothing wrong with the simulation / pipeline: it's the
> > calculation of overflow.  it's real simple to check: delete these
> > lines
> >
>
> yeah, i got that. I was trying to get a working vcd trace so I could follow
> the overflow computation, which is split between the setup stage and the
> output stage.

i've found it necessary to have *all* the files open on-screen (jobs |
grep vi | wc --> 48 *in one terminal*), have the yosys graphviz open
on a second virtual desktop (full screen, 3840x2160), the vcd trace
open in 1/3 of the screen, *and* do print statements from the
simulation.

the combination - reinforcement of information from multiple sources -
gives the picture in a way that a single tool flat-out cannot.


> If you have time, you could try to build a more minimal reproducer for
> whitequark,

that would take longer than it would to turn the microwatt FSM into
nmigen.  plus, given that the break in the pipeline has been
identified i don't believe it necessary to raise the bugreport.


> since what we have is waay too complicated to be that useful
> for finding the bug in nmigen. if it helps any, I'll put the git revs I am
> on:
> nmigen : 30e2f91176edcd1c8766c2cb11f413b9c77936b9
> ieee754fpu : 610b4a381e70f45f5684cc281398ce77fb5441fa
> nmutil : 3853df675a1e1db24950945f66b076266a7da409
> soc : caceb716e9417ed8731ef08b7b260a4c077186b2
>
> meanwhile, I'll be sleeping for a while.

:)

when you're awake can you make a decision as to whether to investigate
this further or whether to go straight to doing the FSM.

i *strongly recommend* converting divider.vhdl with no actual
"thought".  no cleverness, no "reinvent from scratch".  literally do a
line-for-line conversion of the file.

this because reproduction of all the edge cases - as we're discovering
- is simply too problematic.

microwatt on the other hand has been developed by people with *TWENTY
FIVE YEARS* continuous experience working with the PowerISA in
different forms.  the hardware RTL level was literally the last
remaining area where they didn't have any experience at all.

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] first version of test issuer is functional
From: Luke Kenneth Casson Leighton @ 2020-06-17 16:49 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzYoEkX8PSh+7gkU4qF5-b9afgrjHS1onsxg+iJV4qnVw@mail.gmail.com>

On Wed, Jun 17, 2020 at 12:30 PM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:

> to be able to run programs in a loop (and have them verified) it is
> necessary to first to go back to the qemu-simulator comparator
> (test_sim.py), add the capability to the *Simulator* (ISACaller) to be
> able to read instructions from a memory area, and then finally come
> back to the hardware and do the same thing.

amazingly, the following loop test in the simulator actually worked:
https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/simulator/test_sim.py;h=95d5c75ff0b2761ae4845f2e3fd1c8e036442e03;hb=HEAD#l217

(well done michael for making that possible!)

i'm just tidying up the simulator a bit, getting it to use an
instruction "memory".

then the next bit will be getting the hardware to "listen" to the PC,
executing that same loop unit test.

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] Introduction
From: Cole Poirier @ 2020-06-17 16:14 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20200617091726.0671a80717460dee744a14b6@gmx.com>


> On Jun 16, 2020, at 11:16 PM, Lauri Kasanen <cand@gmx.com> wrote:
> 
> How is the browser compatibility of what it generates? E.g. if it uses
> some feature X that needs Chrome Y or FF unstable, and doesn't work in
> FF LTS or other older browsers.

As far as I am aware it doesn’t require any other features than JavaScript being enabled in the browser, but I will be running compatibility checks as I develop the app.
Definitely a concern worth reviewing.

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

* [libre-riscv-dev] daily kan-ban update 17jun2020
From: Luke Kenneth Casson Leighton @ 2020-06-17 13:41 UTC (permalink / raw)
  To: Libre-RISCV General Development

yesterday:

* created an initial test instruction memory SRAM
* got a unit test running that reads from it

today:

* get the simulator (ISACaller) to read its instructions from a simulated memory

btw alain is getting 5.0.6 bugzilla running on apache2 via a proxy
redirect so that the REST API works, and we can actually finally
actually have a kan-ban board to look at.

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

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