Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* Re: [libre-riscv-dev] daily kan-ban update 19jul2020
From: Yehowshua @ 2020-07-19 22:46 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDyY=RG6WXDiVQNFz7Q+o0zNDDp5LdSR0hKPUVH-FE9Seg@mail.gmail.com>

> 
> in our case that's 17,000 flattened signals.


Well, oMigen won’t flatten out verilog black boxes, but it
will flatten out the dram controller for example.

Which hopefully you don’t need to debug…

Verilator retains the hierarchy of whatever it consumes.
SO you’ll get a hierarchical CPU and flat peripherals.


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 19jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-19 22:21 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20B7B259-F2C5-4B0D-BBE7-5DDF0C09EE96@gatech.edu>

On Sunday, July 19, 2020, Yehowshua <yimmanuel3@gatech.edu> wrote:

> > i have no idea if verilator generates vcd files which would allow
> debugging
> > if there are issues (instructions missing for example)
>
> Verilator does generate VCDs…
> LiteX abstracts that away for you, however,
> I will say that its a pretty painful process
> to run through LiteX generated VCds.
>
> They are flattened as oMigen outputs flat verilog


niice.

in our case that's 17,000 flattened signals.

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] div pipe
From: Luke Kenneth Casson Leighton @ 2020-07-19 22:07 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD5pGGARmbWbD60B1WObECvRArFGak_prEQJ8p3+5H0jpQ@mail.gmail.com>

On Sunday, July 19, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

> On Sun, Jul 19, 2020, 14:12 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> wrote:
>
> > btw jacob i'm aware i did exactly the same thing to the ieee754 div
> pipe! i
> > did try running the div core unit tests, they weren't working.  i didn't
> > understand how to fix them so i proceeded anyway.
>
>
> DivPipeCore broke because you forgot (or didn't know) to account for the
> changing number of fractional bits when you changed the bit width for
> supported={UDivRem}


i was kinda aware of it but didn't know what to do.


>
> I was working on fixing that but gave up since I'm planning on using the
> FSM instead for the oct tapeout, and I'm planning on rewriting the div
> pipeline to add dynamic partitioning and loop-back for the 28nm tapeout, so
> the current div pipe core won't be needed.


about dynamic patitioning: i'd like to talk to whitequark about doing a
context manager that stores the partition mask...

*and provides m.If, m.Else and all other functionality* with literally zero
code changes.

the plan is that the mask-partition-manager would be initialised as:

     with pm.Mask(m, self.i.mask):

code then runs as:

             with m.If(some_partitioned_signal):

the Mask context *CHANGES* the behaviour of m.If, Else, Switch, Case and so
on.

underneath, the new context does all the work "on your behalf".

the actual number of changes should be *absolutely minimal*.  a single
indent to add the "with pm.Mask", the addition of the mask parameter to all
ispec and ospec (which should best come from ctx.op) and a few changes to
the constructor of each Stage.

we _might_ have to declare some parameters as explicitly PartitionedSignal,
plus some things which are single bit "test" (with m.If(foo)) these have to
be multi-bit, of width equal to the mask width.

aside from those changes there should be literally no changes to the actual
"logic" - the actual algorithm - at all

obviously, however, the fact that the data width can drop to 8 bit wide
means that running say 12 pipeline stages, the result will be produced far
earlier.

also any "constants" - assumptions that things will have the top bit set
for example - these need looking into.  i would *like* the Mask context to
even extend down into the behaviour of ArrayProxy so that even slices
(accessing psig[-1] for example) actually returns a special MaskArrayProxy
instead.

this would be fantastic, to be able to dynamically have the code reference
*different* parts of signals depending on how the Mask is set up.

however it would be seriously complex code.

the absolute last thing we need however jacob is a bunch of case statements
testing for different partition widths, all doing exactly the same thing.

one line of current code becomes ten, each almost identical excep different
widths.

that approach would be absolutely disastrous as the code repetition would
result in around a fivefold increase in code, and i can guarantee there
would be cut/paste errors.

in addition the explicit expansion of the code with such mask-based switch
statements would make it unmaintainable.


What we could do is just revert
> the bitwidth changes if we want to have working code anyway.


well, what i did was, if the configuration (initialisation) requests sqrt
or rsqrt the bitwidth is set to the 3x

no reversion should be needed.

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 19jul2020
From: Yehowshua @ 2020-07-19 21:38 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzXUd4dzzEFf1g3ud00rUx_6a_pXngQRouqQFh+-WZizw@mail.gmail.com>

> i have no idea if verilator generates vcd files which would allow debugging
> if there are issues (instructions missing for example)

Verilator does generate VCDs…
LiteX abstracts that away for you, however,
I will say that its a pretty painful process
to run through LiteX generated VCds.

They are flattened as oMigen outputs flat verilog.

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

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

yesterday:

* got alu FSM working example with a CompUnit "manager"

today:

* walked through some examples using cxxsim and encountered some bugs,
under investigation.
* talked with florent from enjoy-digital, he is going to add libre-soc
test_issuer to litex upstream for us.

once compiling test_issuer to run under verilator is possible, we *should*
be able to put together a 16550 uart example from fusesoc pretty quickly.

that will allow running of the full microwatt hello_world binary and, as
long as we can get access to the serial console we will have a first
"proper" demo.

from there running the microwatt micropython binary should also be easy.

i have no idea if verilator generates vcd files which would allow debugging
if there are issues (instructions missing for example)

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] div pipe
From: Jacob Lifshay @ 2020-07-19 21:27 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwEQOb8_ZfxNsz14HEW+HMEc9-uq-awvuj0rtbnp3by9Q@mail.gmail.com>

On Sun, Jul 19, 2020, 14:12 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> btw jacob i'm aware i did exactly the same thing to the ieee754 div pipe! i
> did try running the div core unit tests, they weren't working.  i didn't
> understand how to fix them so i proceeded anyway.


DivPipeCore broke because you forgot (or didn't know) to account for the
changing number of fractional bits when you changed the bit width for
supported={UDivRem}

I was working on fixing that but gave up since I'm planning on using the
FSM instead for the oct tapeout, and I'm planning on rewriting the div
pipeline to add dynamic partitioning and loop-back for the 28nm tapeout, so
the current div pipe core won't be needed. What we could do is just revert
the bitwidth changes if we want to have working code anyway.

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] lots of stuff broken
From: Luke Kenneth Casson Leighton @ 2020-07-19 21:11 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwp0TWopxrXk_LwP_s2eGLVBniMJ3RturCpwzFNhwv3fw@mail.gmail.com>

btw jacob i'm aware i did exactly the same thing to the ieee754 div pipe! i
did try running the div core unit tests, they weren't working.  i didn't
understand how to fix them so i proceeded anyway.  should have kept you
informed, apologies.

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] Which ECP5 FPGA
From: Luke Kenneth Casson Leighton @ 2020-07-19 20:17 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <12E87387-DF10-40A1-B1FF-3CAC88F3D1FA@gatech.edu>

On Sun, Jul 19, 2020 at 9:05 PM Yehowshua <yimmanuel3@gatech.edu> wrote:
>
> > if you recall i got it a few weeks ago when you mentioned that you had
> > access to one.
>
> Great. I remember you said you’d get it. Didn’t know if you did haha
> Were you able to program it?

yehyeh, ran the blinky lights example.  i had to make some changes,
there's some boards that were confused with ecp5 and ecp5g - if one
openocd config does not work use the other one.

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] Which ECP5 FPGA
From: Yehowshua @ 2020-07-19 20:05 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzevhkpCwnZXq6=zanS7UXapauezR=60a2bfiT8fz8JCQ@mail.gmail.com>

> if you recall i got it a few weeks ago when you mentioned that you had
> access to one.

Great. I remember you said you’d get it. Didn’t know if you did haha
Were you able to program it?

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] Which ECP5 FPGA
From: Luke Kenneth Casson Leighton @ 2020-07-19 20:03 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <3D9D0520-9BBC-4A4D-9BF9-C3E3A1E3D4B3@gatech.edu>

On Sunday, July 19, 2020, Yehowshua <yimmanuel3@gatech.edu> wrote:

> I may have missed this, but which ECP5 FPGA are we targeting specifically?
>
> A few good options:
> Versa 5G - pretty expensive but has all the peripherals but HDM


versa ecp5

mouser part number:

842-LE5UM45FVERSAEVN
<http://www.mouser.com/ProductDetail/lattice/lfe5um-45f-versa-evn/?qs=J7VcZjJ3Z9cK61xZC6pcWg%3d%3d&countrycode=GB&currencycode=GBP>
LFE5UM-45F-VERSA-EVN
ECP5 Versa

if you recall i got it a few weeks ago when you mentioned that you had
access to one.

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] Which ECP5 FPGA
From: Yehowshua @ 2020-07-19 19:44 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD4bByz1yrf-ASYU_zLuMq=2+7zNF74r=2ev+S3oM3+fnQ@mail.gmail.com>


> I haven't checked what they provide, but one critical requirement is that
> they have (or we add) enough ram to run Linux -- it's theoretically
> possible to run in a few MB but >128MB is a good idea (>1GB preferred)
> since then that's enough we might be able to run some simple JIT
> compilation tasks as needed for the Vulkan driver.

They each have 128Mb.

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] Which ECP5 FPGA
From: Jacob Lifshay @ 2020-07-19 19:42 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <3D9D0520-9BBC-4A4D-9BF9-C3E3A1E3D4B3@gatech.edu>

On Sun, Jul 19, 2020, 12:31 Yehowshua <yimmanuel3@gatech.edu> wrote:

> I may have missed this, but which ECP5 FPGA are we targeting specifically?
>
> A few good options:
> Versa 5G - pretty expensive but has all the peripherals but HDM
> ULX3S - backordered
> Orange Crab - affordable, no peripherals beyond USB.
>

I haven't checked what they provide, but one critical requirement is that
they have (or we add) enough ram to run Linux -- it's theoretically
possible to run in a few MB but >128MB is a good idea (>1GB preferred)
since then that's enough we might be able to run some simple JIT
compilation tasks as needed for the Vulkan driver.

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

* [libre-riscv-dev] Which ECP5 FPGA
From: Yehowshua @ 2020-07-19 19:30 UTC (permalink / raw)
  To: Libre-RISCV General Development

I may have missed this, but which ECP5 FPGA are we targeting specifically?

A few good options:
Versa 5G - pretty expensive but has all the peripherals but HDM
ULX3S - backordered
Orange Crab - affordable, no peripherals beyond USB.


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 17jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-19 11:13 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD74AW2e1p=9A5AmmD=bzDkBHR77wQ_ZoV1TbczPZ+434A@mail.gmail.com>

On Sun, Jul 19, 2020 at 8:04 AM Jacob Lifshay <programmerjake@gmail.com> wrote:

> > > However, when I try to wire them up in a simple synchronous fsm
> > > (soc.fu.div.test.test_fsm.TestDivState.test_div_state_fsm), it doesn't
> > > seem to work: I think the simulation process I made that checks
> > > outputs is somehow getting desynchronized from the process that
> > > toggles inputs -- I added some extra wires that the check process
> > > toggles.

> I'm specifically using Delay to delay a fraction of a clock cycle after
> each Tick before measuring values, so Settle shouldn't be necessary.

hmm don't know what to suggest, then, other than saying "nuts to the
lot of it" and cookie-cutting microwatt divider.vhdl - into a new
subdirectory :)

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] lots of stuff broken
From: Luke Kenneth Casson Leighton @ 2020-07-19 10:46 UTC (permalink / raw)
  To: Libre-RISCV General Development
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

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 17jul2020
From: Jacob Lifshay @ 2020-07-19  7:04 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzHwb+11h7QZZT+4whBf2cDXvhzK0RgpvwDaROthFA4fA@mail.gmail.com>

On Fri, Jul 17, 2020, 20:37 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Saturday, July 18, 2020, Jacob Lifshay <programmerjake@gmail.com>
> wrote:
>
> > today:
> > started adding fsm div
> > got a test where a whole bunch of the core fsm transition functions
> > are strung together combinatorially to work
> > (soc.fu.div.test.test_fsm.TestDivState.test_div_state_comb), so that
> > means that the soc.fu.div.fsm.DivState* classes all work.
>
>
> nice.
>
>
> >
> > However, when I try to wire them up in a simple synchronous fsm
> > (soc.fu.div.test.test_fsm.TestDivState.test_div_state_fsm), it doesn't
> > seem to work: I think the simulation process I made that checks
> > outputs is somehow getting desynchronized from the process that
> > toggles inputs -- I added some extra wires that the check process
> > toggles.
>
>
> ah.  we learned that even for synchronous signals it can be necessary to
> use Settle().
>
> this usually when a combinatorial block is generated *from* a synchronous
> signal.
>

I'm specifically using Delay to delay a fraction of a clock cycle after
each Tick before measuring values, so Settle shouldn't be necessary.

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] lots of stuff broken
From: Jacob Lifshay @ 2020-07-19  6:55 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDy_OqUdMEbXJ4TSuYunCTYVyd7pboNuDzNBwt7TzW1Rdg@mail.gmail.com>

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.

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.

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

* [libre-riscv-dev] lots of stuff broken
From: Luke Kenneth Casson Leighton @ 2020-07-18 22:18 UTC (permalink / raw)
  To: Libre-RISCV General Development

hiya jacob,

um, the div unit changes is breaking a lot of things that terminates
any possibility of doing work.

i can't run any of the compunit tests, or test_issuer.py (the main
test i use for verifying the core is operational).  could you make
sure in future to run some of the unit tests, and also rather than
make major adjustments to code that's in use in ways that cause
significant failures (only partially changing names of classes from
DIVXXX to DivXXX without doing a global search/replace throughout the
code), put in place migration plans?

for example: if you make major name changes without a global
search/replace, put a temporary variable (commented), "DIVXXX=DivXXX"
with a "TODO: complete transition to new name".

the better strategy would have been to start a new subdirectory with
the new code - or just new filenames
pipe_data_to_be_replaced_once_working.py

regarding DivPipeSpec:

class DivPipeSpec(CommonPipeSpec):
    def __init__(self, id_wid, div_pipe_kind):
        super().__init__(id_wid=id_wid)
        self.div_pipe_kind = div_pipe_kind
        self.core_config = div_pipe_kind.config.core_config

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.

then in compunits.py, different Function Units are declared as follows:

class DivFunctionUnitWhateverType(FunctionUnitBaseSingle):
    fnunit = Function.DIV
    def __init__(self, idx):
        super().__init__(DivPipeSpecWhateverType, DivBasePipe, idx)

class DivFunctionUnitCombType(FunctionUnitBaseSingle):
    fnunit = Function.DIV
    def __init__(self, idx):
        super().__init__(DivPipeSpecCombType, DivBasePipe, idx)

anyway.  i worked out that this is "fixable" by giving DivPipeSpec a
default argument.

l.


compunits/compunits.py:221: UnusedElaboratable:
<soc.fu.compunits.compunits.DivFunctionUnit object at 0x7f0a131a57f0>
created but never used
  self.fus["%s%d" % (name, i)] = kls(i)
UnusedElaboratable: Enable tracemalloc to get the object allocation traceback
E
======================================================================
ERROR: run_all (__main__.TestRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "simple/test/test_issuer.py", line 87, in run_all
    m.submodules.issuer = issuer = TestIssuer(pspec)
  File "/home/lkcl/src/libresoc/soc/src/soc/simple/issuer.py", line
39, in __init__
    self.core = core = NonProductionCore(pspec)
  File "/home/lkcl/src/libresoc/soc/src/soc/simple/core.py", line 67,
in __init__
    self.fus = AllFunctionUnits(pspec, pilist=[pi])
  File "/home/lkcl/src/libresoc/soc/src/soc/fu/compunits/compunits.py",
line 221, in __init__
    self.fus["%s%d" % (name, i)] = kls(i)
  File "/home/lkcl/src/libresoc/soc/src/soc/fu/compunits/compunits.py",
line 153, in __init__
    super().__init__(DivPipeSpec, DivBasePipe, idx)
  File "/home/lkcl/src/libresoc/soc/src/soc/fu/compunits/compunits.py",
line 108, in __init__
    pspec = speckls(id_wid=2)                # spec (NNNPipeSpec instance)
TypeError: __init__() missing 1 required positional argument: 'div_pipe_kind'


---
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 17jul2020
From: Luke Kenneth Casson Leighton @ 2020-07-18  3:37 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD4j+1QqJQ54k_6jysjj9ppeQkKyw79sGcaN7EUSnvAUbA@mail.gmail.com>

On Saturday, July 18, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

> today:
> started adding fsm div
> got a test where a whole bunch of the core fsm transition functions
> are strung together combinatorially to work
> (soc.fu.div.test.test_fsm.TestDivState.test_div_state_comb), so that
> means that the soc.fu.div.fsm.DivState* classes all work.


nice.


>
> However, when I try to wire them up in a simple synchronous fsm
> (soc.fu.div.test.test_fsm.TestDivState.test_div_state_fsm), it doesn't
> seem to work: I think the simulation process I made that checks
> outputs is somehow getting desynchronized from the process that
> toggles inputs -- I added some extra wires that the check process
> toggles.


ah.  we learned that even for synchronous signals it can be necessary to
use Settle().

this usually when a combinatorial block is generated *from* a synchronous
signal.


> it appears to me as though the check process is somehow
> delayed an entire divide operation (8 or 9 cycles, since I'm testing
> an 8-bit divider to make it easier).


ah that's a heck of a lot more :)


>
> Will try to fix that after tomorrow
>
> 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

* [libre-riscv-dev] daily kan-ban update 17jul2020
From: Jacob Lifshay @ 2020-07-18  3:27 UTC (permalink / raw)
  To: Libre-RISCV General Development

today:
started adding fsm div
got a test where a whole bunch of the core fsm transition functions
are strung together combinatorially to work
(soc.fu.div.test.test_fsm.TestDivState.test_div_state_comb), so that
means that the soc.fu.div.fsm.DivState* classes all work.

However, when I try to wire them up in a simple synchronous fsm
(soc.fu.div.test.test_fsm.TestDivState.test_div_state_fsm), it doesn't
seem to work: I think the simulation process I made that checks
outputs is somehow getting desynchronized from the process that
toggles inputs -- I added some extra wires that the check process
toggles. it appears to me as though the check process is somehow
delayed an entire divide operation (8 or 9 cycles, since I'm testing
an 8-bit divider to make it easier).

Will try to fix that after tomorrow

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] Signal names for trap pipeline??
From: Luke Kenneth Casson Leighton @ 2020-07-18  2:50 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEz=son5eze0Hy5T_FnGO3gxMBdaAS9vG0TRvjU7-B54dgLprg@mail.gmail.com>

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

> I'm running into an irreconcilable property violations with the formal
> properties for the trap main stage.
>
> I'm noticing that there's repeated references to SRR0 and SRR1
> registers in https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/
> trap/main_stage.py;h=325fb373546673df3ec19a15554e775bcc6fe9a9;hb=HEAD;
> however, after spending about 30 minutes hacking away at what might be
> the cause, I realized after reviewing the graphs in GTKWave that I
> don't see these signals in either the top or the DUT module signals.


you've likely been caught out by the convenience naming here:

https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/trap/pipe_data.py;h=d2de8552a62a55bada4a5e83726c273ef943ac83;hb=HEAD#l15

initiating the instance TrapInputData by now you should know that the
IntegerData base class drops Signals into it according to the regspec.

however in some cases we want better names for things, more closely related
to the context of the actual opcode.

we give them *multiple* convenience namesin some cases.  see branch and
associated proof.

particularly OP_BCREG where the fast reg can be one of three: LR, CTR or
TAR.  i made a table somewhere.

https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/branch/formal/proof_main_stage.py;hb=HEAD

https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/branch/pipe_data.py;hb=HEAD

so yes they don't "exist", they are same Signal different names and when
created Signal.name was set and that's what goes into gtkwave.

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] Markdown on the wiki?
From: Luke Kenneth Casson Leighton @ 2020-07-18  2:39 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEz=son7=jtCP-XsJOR15e65zy4dSe93OmjZc-YhV8B8KeNMYA@mail.gmail.com>

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

>
> I can appreciate why people say that being "retired" is exhausting.  ;)


my aunt kicked my uncle out, told him to go back to work when he retired.
he was too annoying :)


> Yeah, and I'm getting a lot of ideas for my future KCP53000
> refinements as well.  In *theory*, it should be possible to use the
> exact same combinatorial building blocks in a single-issue design as
> it would in a pipelined, multi-issue design;


precisely.  increase the number of pipelines, increase the register ports
and data bandwidth and aside from deoendency tracking that's pretty much it.


>
> only the wiring between
> the blocks would need to be handled differently.


i originally designed a way to use the same blocks for FSMs as well as
pipelines.  it was difficult to maintain, unfortunately.

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] Signal names for trap pipeline??
From: Samuel Falvo II @ 2020-07-18  2:09 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEz=son5eze0Hy5T_FnGO3gxMBdaAS9vG0TRvjU7-B54dgLprg@mail.gmail.com>

On Fri, Jul 17, 2020 at 5:58 PM Samuel Falvo II <sam.falvo@gmail.com> wrote:
> I'm running into an irreconcilable property violations with the formal
> properties for the trap main stage.

Please disregard; I just spotted the convenience assignments in the
TrapInputData class.  Egg, meet face.

-- 
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] Markdown on the wiki?
From: Samuel Falvo II @ 2020-07-18  1:19 UTC (permalink / raw)
  To: Luke Kenneth Casson Leighton; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDzGVLfLJ4Cf1qsEQMBrgm_NYXT09YadkdgKUkJD_CW=tQ@mail.gmail.com>

Sorry; just getting to this email now.  You'd think that being
unemployed would give you loads of time.  And, maybe it does, but only
after you clear your queue of other honey-dos and deliverables that's
queued up for others over time.  Uugh.

I can appreciate why people say that being "retired" is exhausting.  ;)


On Wed, Jul 15, 2020 at 10:13 AM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
> i updated the page you started, a bit more, this morning. you should be getting the impression now as to why i described this pipeline as dead simple to start from, because the code itself in spr main_stage.py really does not actually do very much.

Thanks; I'll take a read later this evening.

> no regfile reading, no decisions, no instruction decoding: nothing.  its *sole* job is to process its inputs and create some outputs.  it doesn't even know which registers that data actually comes from or goes to because *that is not its responsibility*.

Yeah, and I'm getting a lot of ideas for my future KCP53000
refinements as well.  In *theory*, it should be possible to use the
exact same combinatorial building blocks in a single-issue design as
it would in a pipelined, multi-issue design; only the wiring between
the blocks would need to be handled differently.  (Of course, theory
and reality are only theoretically related; still, I can see how this
would significantly *ease* the prospect of re-architecting the design
if ever became necessary.)

And if the libresoc becomes affordably available for me to hack with,
maybe I can design a CPU card around it for the Kestrel-3.  (Of
course, I'll need to migrate all the code currently running in M-mode
to U-mode first.)

-- 
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] Signal names for trap pipeline??
From: Samuel Falvo II @ 2020-07-18  0:58 UTC (permalink / raw)
  To: Libre-RISCV General Development

I'm running into an irreconcilable property violations with the formal
properties for the trap main stage.

I'm noticing that there's repeated references to SRR0 and SRR1
registers in https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/trap/main_stage.py;h=325fb373546673df3ec19a15554e775bcc6fe9a9;hb=HEAD;
however, after spending about 30 minutes hacking away at what might be
the cause, I realized after reviewing the graphs in GTKWave that I
don't see these signals in either the top or the DUT module signals.

Looking in https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/trap/pipe_data.py;h=d2de8552a62a55bada4a5e83726c273ef943ac83;hb=HEAD
seems to confirm my suspicion that neither srr0 nor srr1 actually
exist; they are (confusingly) called fast1 and fast2.  Double-checking
GTKWave's signal lists confirms that fast1 and fast2 exist.

Can anyone please advise on how to proceed?  I see several ways of
resolving this going forward, but I need input from others:

1.  Rename fast1 and fast2 to srr0 and srr1, or,
2.  Keep fast1/fast2 and rebind them to srr0/srr1 in the main_stage.py
and prove_main_stage.py files, or,
3.  ...?

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

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