From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Libre-RISCV General Development <libre-riscv-dev@lists.libre-riscv.org>
Subject: Re: [libre-riscv-dev] lots of stuff broken
Date: Sun, 19 Jul 2020 11:46:49 +0100
Message-ID: <CAPweEDwp0TWopxrXk_LwP_s2eGLVBniMJ3RturCpwzFNhwv3fw@mail.gmail.com> (raw)
In-Reply-To: <CAC2bXD6VgyGeGcKpCG8QXiPWEBt2Ozy=kVMa8OEtBhCS=MGrow@mail.gmail.com>
On Sun, Jul 19, 2020 at 7:55 AM Jacob Lifshay <programmerjake@gmail.com> wrote:
>
> On Sat, Jul 18, 2020, 15:19 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> wrote:
>
> > hiya jacob,
> >
> > um, the div unit changes is breaking a lot of things that terminates
> > any possibility of doing work.
> >
>
> sorry, I incorrectly assumed you weren't currently using it due to the
> large size of the current div pipeline.
whilst the simulation is slow (and when uploading to an ecp5 is
possible it will take longer) it still allows me - everyone not just
me - to run the unit tests. and to add new ones.
with those Div unit tests in place, this will be how it becomes
possible for you, jacob, to side-step to the new Div unit and have
confidence that it will work, because the unit tests pass.
in that way it is "safe" for you to work - in parallel - without
psychological pressure of being a significant block to progress.
with a "working" Div unit it is also possible to move further on to
other tests such as the "hello_world" test, micropython, and many
more.
if the code is not working it is therefore a real serious critical
blocker that prevents and prohibits *all* work and all testing that
critically relies on having support for any "div" operations.
> it's not designed for having extra parameters. if you need two
> > different kinds, then that means having two differerent DivPipeSpec
> > classes: one for the Comb work, one for the Sync work.
> >
>
> ah, ok. I was assuming the constructor would be able to be called directly,
> allowing easily adding an extra parameter, instead of through some generic
> multi-level abstraction.
parameters (pspec) are typically for reconfiguring things in the
pipeline. width of bus. number of stages.
the key (only allowed) parameter "id_wid" is for the ReservationStation width.
it *is* possible to do dynamic merging - dynamic construction of
mix-in classes: DynamicPipe is a meta-class that... well... you can
read up on it at the links in the source code:
https://git.libre-soc.org/?p=nmutil.git;a=blob;f=src/nmutil/dynamicpipe.py;hb=HEAD
DynamicPipe allows us to "mix in" alternative pipeline base classes
(SimpleHandshakeRedir, MaskCancellable) without a total rewrite and
without having dozens if not hundreds of special mix-in classes or,
worse, large-scale deployment of "redirector" classes with functions
whose sole purpose is to call identical functions of a sub-object,
with the exact same API.
however the experience of deploying and using that type of
meta-programming comes with a warning: the actual construction (and in
particular correct calling of __init__) is... fraught. it's one of
the only legitimate places where you would use the 3-argument version
of the python "type" function (to literally dynamically construct a
class, on-the-fly).
the same technique *could* be deployed here - place the DivPipeKind
into the pspec:
pspec.div_pipe_type = DivPipeKind.SimOnly.config() # or something
however i would seriously not recommend it.
i think what's there, now - the fact that there is a default argument
- is "good enough".
class DivPipeSpec(CommonPipeSpec):
- def __init__(self, id_wid, div_pipe_kind):
+ def __init__(self, id_wid, div_pipe_kind=None):
+ if div_pipe_kind is None:
+ div_pipe_kind = DivPipeKind.DivPipeCore
that default argument can be "flipped over" when you are confident
that the Div FSM works, and passes all unit tests.
those btw are:
* fu/div/test/test_pipe_caller.py
* fu/compunit/test/test_div_compunit.py (or, it should be... *sigh* -
it needs writing)
* simple/test/test_core.py
* simple/test/test_issuer.py by adding the unit tests imported from
div test_pipe_caller.py
the way that those work are:
* test_pipe_caller.py simply tests the actual pipeline.
* test_div_compunit.py tests whether the pipeline correctly interacts
with its "Manager" - a CompAluMulti instance
* test_core.py tests whether the pipeline correctly interacts with
register files through its "Manager"
* test_issuer.py tests whether the pipeline correctly responds to
actual instructions as issued from actual Instruction memory.
i tend not to run test_core.py any more because it's kinda served its
purpose: test_issuer.py sort-of supercedes it (and is just as big).
at the *very minimum* you should be running the div
test_pipe_caller.py (and not modifying it, except to add new unit
tests) and test_issuer.py after uncommenting the div tests.
l.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
next prev parent reply index
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-18 22:18 Luke Kenneth Casson Leighton
2020-07-19 6:55 ` Jacob Lifshay
2020-07-19 10:46 ` Luke Kenneth Casson Leighton [this message]
2020-07-19 21:11 ` Luke Kenneth Casson Leighton
2020-07-19 21:27 ` [libre-riscv-dev] div pipe Jacob Lifshay
2020-07-19 22:07 ` Luke Kenneth Casson Leighton
2020-07-20 0:32 ` Jacob Lifshay
2020-07-20 1:38 ` Luke Kenneth Casson Leighton
2020-07-20 2:06 ` Jacob Lifshay
2020-07-20 2:13 ` Luke Kenneth Casson Leighton
2020-07-20 3:21 ` Jacob Lifshay
2020-07-20 10:31 ` Luke Kenneth Casson Leighton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPweEDwp0TWopxrXk_LwP_s2eGLVBniMJ3RturCpwzFNhwv3fw@mail.gmail.com \
--to=lkcl@lkcl.net \
--cc=libre-riscv-dev@lists.libre-riscv.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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