Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* [libre-riscv-dev] LD/ST Comp Unit FSM (was: Re: Scoreboard vs Tomasulo)
From: Cesar Strauss @ 2020-05-17  5:24 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDzp3aSyhi-+UOO5Ce_gdUFGjpGqGVZM+GT0qDTLGtpZ-g@mail.gmail.com>

Greetings,

On 05/16/2020 21:53, Luke Kenneth Casson Leighton wrote:
> because POWER9 has in some cases up to *five* incoming registers and
> *three* outgoing registers (in different Regfiles - INT/FP, SPR, CR), we needed
> to split those out into individual lines.  GO-READ1/READ-REQ1,
> GO-READ2/READ-REQ2 etc.
> 
> currently i am struggling with this FSM which implements 3-operand in,
> immediates, 2-operand out *and* manages the address, GO-ST, address
> exceptions and deals with POWER9 LD/ST "Update" mode.
> 
> https://libre-soc.org/3d_gpu/ld_st_comp_unit.jpg
> 
> this i reaaaally need some help with.

I'm willing to lend a hand in this, and/or any other tasks the group
deem appropriate.

Do you have already have any code, unit test and/or testbench for this
module? A timing diagram would also be welcome.

Regarding myself, I do have experience in digital circuit design, and
finite state machines in particular, which I mostly apply to FPGA
programming.

My field of work is in data acquisition and control, for scientific
instruments, at the astrophysics department of a research institute (but
I am an engineer, not an astronomer). I apply microcontrollers and FPGAs
at several research projects. With the rise of single-board computers,
I'm starting to use them as well.

My main attraction to this project is having free firmware and boot
loaders, and also full documentation, freely available and complete, by
principle.

I have read the Charter at https://libre-soc.org/charter/, and agree
with it.

I can use only my free time (weekends and evenings).

Regards,

Cesar

_______________________________________________
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] LD/ST Comp Unit FSM (was: Re: Scoreboard vs Tomasulo)
From: Luke Kenneth Casson Leighton @ 2020-05-17 10:07 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <ec75de0d-6ffb-969f-4250-f8a9ecf120b0@gmail.com>

On Sun, May 17, 2020 at 6:25 AM Cesar Strauss <cestrauss@gmail.com> wrote:

> > https://libre-soc.org/3d_gpu/ld_st_comp_unit.jpg
> >
> > this i reaaaally need some help with.
>
> I'm willing to lend a hand in this, and/or any other tasks the group
> deem appropriate.

that's really appreciated, Cesar.

> Do you have already have any code, unit test and/or testbench for this
> module? A timing diagram would also be welcome.

yes, it's here:
https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/experiment/compldst_multi.py;hb=HEAD

the timing diagram is auto-generated when running that code (as its
own unit test: python3 experiment/compldst_multi.py).  it can be
loaded with "gtkwave".  to save you some time adding 100+ signals to
gtkwave i'm attaching a pre-saved diagram, i even set some pretty
colours in it :)

also a second one for the L0 cache/buffer to which CompLDSTUnit is
connected.  this is run as "python3 experiment/l0_cache.py"

i will raise a bugreport about it as this should be discussed there.

> Regarding myself, I do have experience in digital circuit design, and
> finite state machines in particular, which I mostly apply to FPGA
> programming.
>
> My field of work is in data acquisition and control, for scientific
> instruments, at the astrophysics department of a research institute (but
> I am an engineer, not an astronomer). I apply microcontrollers and FPGAs
> at several research projects. With the rise of single-board computers,
> I'm starting to use them as well.
>
> My main attraction to this project is having free firmware and boot
> loaders, and also full documentation, freely available and complete, by
> principle.

that's really appreciated.

> I have read the Charter at https://libre-soc.org/charter/, and agree
> with it.

thank you Cesar.
_______________________________________________
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] [Bug 318] New: fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 10:08 UTC (permalink / raw)
  To: libre-riscv-dev

https://bugs.libre-soc.org/show_bug.cgi?id=318

            Bug ID: 318
           Summary: fix LDSTCompUnit
           Product: Libre-SOC's first SoC
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: CONFIRMED
          Severity: enhancement
          Priority: ---
         Component: Source Code
          Assignee: lkcl@lkcl.net
          Reporter: lkcl@lkcl.net
                CC: libre-riscv-dev@lists.libre-riscv.org
   NLnet milestone: ---

See section LDST Comp Unit
https://libre-soc.org/3d_gpu/architecture/6600scoreboard/

walk-through videos on how it is supposed to work

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 10:09 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
Created attachment 53
  --> https://bugs.libre-soc.org/attachment.cgi?id=53&action=edit
gtkwave save file for l0 cache/buffer

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 10:10 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
Created attachment 54
  --> https://bugs.libre-soc.org/attachment.cgi?id=54&action=edit
gtkwave save file for ldst comp unit

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 10:31 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #3 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
the "ultimate" success test of this is for experiment/score6600_multi.py
to not go permanently into "busy" mode.

the videos show how LDSTCompUnit is *supposed* to work... but doesn't
quite.

the issue on the current commit is that the address latching is not
occurring - not being transferred through correctly to mem_w_data -
for ST operations.

i *think* it is working fine on LD operations.

you can see in the gtkwave timing diagram that:

* cycle @ 50ns mem_w_en (and so mem_w_data) change
* however cycle @ 40ns *should* have set mem_w_addr to 0x6

this *actually* occurs 4 cycles later for the *second* ST operation!

if you then look at alu_o (further up), you can see it is:

* 0x0002 @ 20ns
* 0x0006 @ 30ns (the required, correct value)
* however ad__rel - the signal that says "address is valid"
  was *one cycle early*

(ad__rel in gtkwave is the name for the object ad.rel, and there is
a "convenience" variable in the python code ad_rel_o which points
to self.ad.rel)

it's nearly there.

notes:

* every req signal (rd.req[0], rd.req[1], rd.req[2], wr.req[0],
  wr.req[1], ad.req and st.req) has a corresponding "go" signal
  (rd.go[0] etc.)

  these are from the data structure created on-the-fly by
  "go_record"

* outgoing request ("req") signals may be held ASSERTed indefinitely until
  such time as their associated "go" signal is ASSERTed for one cycle

* on assertion of the corresponding "go" signal, the associated "req"
  signal **MUST** be de-asserted

this is basically wishbone etc. etc. etc. standard ready_o / valid_i
signalling conventions

in TestLDSTCompUnit, you can see the following line:

        m.d.comb += self.ad.go.eq(self.ad.rel) # link addr-go direct to rel

this is done deliberately because otherwise it becomes necessary to write
a split pair of co-routines in the unit test:

* one that watches ad.rel and sets ad.go for one cycle
* one that watches wr.rel[1] and sets wr.go[1] for one cycle

strictly speaking *all* {sig}.go signals could be made equal to all {sig}.rel
signals, combinatorially, and the code should function perfectly correctly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 10:35 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #4 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
see also
http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2020-May/006782.html

(with thanks to Cesar)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 10:51 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #5 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
one important set of API conventions:

* L0CacheBuffer's operating conventions are that the address must be
  *EXTERNALLY* sustained and held, as must its associated addr_ok
  line.

* this is because otherwise L0CacheBuffer itself has to have an
  address latch

* strictly speaking, LDSTCompUnit does not need an actual latch
  for the address *at all*.

* the reason is because, as you can see from the diagram
  https://libre-soc.org/3d_gpu/ld_st_comp_unit.jpg

  all of the information necessary to "fire" the adder and make
  the address "valid" is *already latched* and will *remain*
  latched until the busy signal is released.

  - op2 is latched
  - the immediate is latched

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 11:02 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #6 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
+++ b/src/soc/experiment/compldst_multi.py
@@ -477,7 +477,7 @@ class LDSTCompUnit(Elaboratable):
         comb += pi.op.eq(self.oper_i)    # op details (not all needed)
         # address
         comb += pi.addr.data.eq(addr_r)           # EA from adder
-        comb += pi.addr.ok.eq(self.ad.go) # "go do address stuff"
+        comb += pi.addr.ok.eq(alu_ok) # "go do address stuff"
         comb += self.addr_exc_o.eq(pi.addr_exc_o) # exception occurred
         comb += addr_ok.eq(self.pi.addr_ok_o)  # no exc, address fine
         # ld - ld gets latched in via lod_l

ok this "fixes" the address issue for ST.  alu_ok is the signal that
indicates the condition that the ALU address is ok to proceed.

however given that alu_valid and alu_ok are *sustained*, this causes
problems on the alu SR Latch which, if using *only* alu_ok to reset it,
would result in the alu_l being permanently held OFF

to fix that i am doing this:

        # alu latch.  use sync-delay between alu_ok and valid to generate pulse
        comb += alu_l.s.eq(reset_i)
        comb += alu_l.r.eq(alu_ok & ~alu_valid & ~rda_any)

alu_ok is one clock cycle behind alu_valid: therefore alu_ok & ~alu_valid
will generate the required one-clock pulse to indicate that the alu latch
can safely capture the address.

(which we noted previously we don't strictly need to do, but hey)

moving on from there, LD is currently bouncing around like mad.  the ld_ok
condition is being raised, which should end the FSM, however it does not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 11:09 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #25 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
        rb64 = Array([Signal(1, reset_less=True, name=f"rb64_{i}") for i in
range(64)])

Cole, this is over the 80-char limit.

this is why i recommended split it into two: setting up a list,
followed by assigning the list to an array.

also, *because* it is assigned to an Array, this code:

        for i in range(64):
            m.d.comb += rb64[i].eq(self.rb[i])

might actually try to generate an Array-assigning method of setting
the 64 elements.  you'll have to check the graphviz

the *possibility* of that occurring is why i recommended it to be done as:

        rb64 = [Signal.... for i in range(64)]
        for i in range(64):
            m.d.comb += rb64[i].eq(self.rb[i])
        rb64 = Array(rb64)

see the difference?  this one is assigning to signals that, oh look,
they happen to be in a python list.

the one that you did, the signals are assigned *via the nmigen Array*.

and the code is violating PEP8 by being over 80 chars in length.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] LD/ST Comp Unit FSM (was: Re: Scoreboard vs Tomasulo)
From: Cesar Strauss @ 2020-05-17 12:59 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDwZzU904jAo9UUn+x4C7GOvvYG+GooSePwBHw96AwtoLg@mail.gmail.com>

Em 05/17/2020 07:07, Luke Kenneth Casson Leighton wrote:
> On Sun, May 17, 2020 at 6:25 AM Cesar Strauss <cestrauss@gmail.com> wrote:
> 
>>> https://libre-soc.org/3d_gpu/ld_st_comp_unit.jpg
>>>
>>> this i reaaaally need some help with.
>>
>> I'm willing to lend a hand in this, and/or any other tasks the group
>> deem appropriate.
> 
> that's really appreciated, Cesar.

I'm glad I can help.

> 
>> Do you have already have any code, unit test and/or testbench for this
>> module? A timing diagram would also be welcome.
> 
> yes, it's here:
> https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/experiment/compldst_multi.py;hb=HEAD
> 
> the timing diagram is auto-generated when running that code (as its
> own unit test: python3 experiment/compldst_multi.py).  it can be
> loaded with "gtkwave".  to save you some time adding 100+ signals to
> gtkwave i'm attaching a pre-saved diagram, i even set some pretty
> colours in it :)
> 
> also a second one for the L0 cache/buffer to which CompLDSTUnit is
> connected.  this is run as "python3 experiment/l0_cache.py"
> 
> i will raise a bugreport about it as this should be discussed there.

I saw it (https://bugs.libre-soc.org/show_bug.cgi?id=318). I'll assign
it to myself then, if you don't mind?

I think I have enough information available, to proceed. I'm beginning
already to have some understanding of the problem at hand.  I'll ask if
I need anything. I'll give feedback as I go on.

I've been following the mailing list for some time, with interest, but
skimming over more technical details. I'll try to become more up to speed.

I did attend an introductory course on Computer Architecture, so I do
have a little background on the subject.

Regards,

Cesar

_______________________________________________
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] LD/ST Comp Unit FSM (was: Re: Scoreboard vs Tomasulo)
From: Luke Kenneth Casson Leighton @ 2020-05-17 13:03 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <12f9f234-b1f6-3624-5a35-b6fa85e84615@gmail.com>

On Sun, May 17, 2020 at 1:59 PM Cesar Strauss <cestrauss@gmail.com> wrote:
>
> Em 05/17/2020 07:07, Luke Kenneth Casson Leighton wrote:
> > On Sun, May 17, 2020 at 6:25 AM Cesar Strauss <cestrauss@gmail.com> wrote:

> I saw it (https://bugs.libre-soc.org/show_bug.cgi?id=318). I'll assign
> it to myself then, if you don't mind?

yes please do.  ahh i *might* have "fixed" it - however this is such
complex code i cannot be truly certain.

transferring to the bugreport.

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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 13:20 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #7 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
On Sun, May 17, 2020 at 1:59 PM Cesar Strauss <cestrauss@gmail.com> wrote:

> I think I have enough information available, to proceed. I'm beginning
> already to have some understanding of the problem at hand.

there are *eight* possible input-combinations that the FSM has to
handle, based on:

* op: LD or ST
* mode: immediate or indexed address-calculation (termed "Effective Address")
* update: EA is to be outputted as a *SECOND* register yes/no

these 8 permutations make the FSM riiiiidiculouslly complicated and
there's really nothing that can be done about it: we need to be
compliant with POWER9 requirements.

* op LD/ST will cause the FSM to ignore operand3 if op == LD.

  this has to include *NOT* requesting operand3 (not setting rd.req[2])

  however because it is a LD, the LD data will be latched from the
  L0CacheBuffer port: thus when that happens, wr.req[0] MUST send out
  a request for the REGFILE write port.  when this is available,
  wr.go[0] will be activated for ONE cycle.

  after that one cycle, wr.req[0] MUST be dropped.

* if op == ST, operand 3 contains the value to be stored, so must be
  rd.req[2]-ested.

  however because it is a ST, there is no LD data to output, and therefore
  wr.req[0] must not be activated.

* immediate-mode will cause the FSM to use the immediate *instead* of
  operand2.

  therefore, in immediate-mode, operand2 must *NOT* be requested
  (rd.req[1] must never be set).

* update=TRUE will cause the FSM to activate wr.req[1] and wait for wr.go[1]
  when wr.go[1] is activated, this indicates to the FSM that the latched
  address (EA) in addr_o is being broadcast onto a REGFILE WRITE port.

  it will get *one* chance to do that (one cycle), and MUST drop wr.req[1]
  on the next cycle: its job is then "done"

  this is *independent* of the logic that manages / monitors the LD/ST
  Port (!)

  why? because the address computation (EA) is an independent parallel
  path from actual LD/ST


it's... just... ridiculously complicated.

at the very least if you can review it, and greatly improve the unit
tests, it would be fantastic.

as i said i *might* have got it working, 10 minutes ago, however the
complexity is so high i am not in the slightest bit confident of that,
nor of the correctness of the unit tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 14:44 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

Cesar Strauss <cestrauss@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cestrauss@gmail.com
           Assignee|lkcl@lkcl.net               |cestrauss@gmail.com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 16:43 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #8 from Cesar Strauss <cestrauss@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #7)
> at the very least if you can review it, and greatly improve the unit
> tests, it would be fantastic.
> 
> as i said i *might* have got it working, 10 minutes ago, however the
> complexity is so high i am not in the slightest bit confident of that,
> nor of the correctness of the unit tests.

Sure, I'll have a look into it.

I'm glad you were able to advance. I was worried this issue might have got you
blocked, for two days already, and turned itself into a time sink.

Regards,

Cesar

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 318] fix LDSTCompUnit
From: bugzilla-daemon @ 2020-05-17 17:06 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-318-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=318

--- Comment #9 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cesar Strauss from comment #8)

> Sure, I'll have a look into it.

appreciated.

> I'm glad you were able to advance. I was worried this issue might have got
> you blocked, for two days already,

about 20 so far.  in addition to around 20 days analysis prior to that.
and about a month last year on an earlier version.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 17:19 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #26 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Cole Poirier from comment #21)
> Yeah.. I have the feeling that I'm wading into quite strange waters here :)
> 
> > I'd be happy to help with formal proofs when you're ready.
> 
> Thanks again Michael, I'm looking forward to working with you and learning
> from your knowledge and experience. I have a prior obligation, so I'll have
> to push writing the unit test until tomorrow. But, for my own understanding,
> once I have the unit test is working, would it be wiser to search for
> optimization opportunities, for example from Claire Wolf's bitmanip code, or
> to write the formal proof? I'm guessing that the formal proof is specific to
> the function's implementation and thus I should wait to write the formal
> proof until the function is optimized but I am not sure.
> 

Cole, I added a skeleton proof module for bperm.py here
https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/logical/formal/proof_bperm.py;h=da198940f75b3868ca864f1d75c6e99c55b1f073;hb=HEAD
with a bunch of comments on how to finish the formal proof. Take a look when
you get around to it, and let me know if you have problems.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-17 17:37 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-313-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=313

--- Comment #20 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
michael is this correct?

            # Yes, the CTR only counts 32 bits
            ctr = Signal(64, reset_less=True)
            comb += ctr.eq(self.i.ctr - 1)

that's 64-bit for ctr, and the input self.i.ctr is also 64-bit

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-17 18:11 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-313-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=313

--- Comment #21 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
    if (mode_is_64bit) then M <- 0
    else M <- 32

answer's "no".  32-bit in 32-bit mode, 64-bit in 64-bit mode

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 18:53 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #27 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #25)
>         rb64 = Array([Signal(1, reset_less=True, name=f"rb64_{i}") for i in
> range(64)])
> 
> Cole, this is over the 80-char limit.
> 
> this is why i recommended split it into two: setting up a list,
> followed by assigning the list to an array.
> 
> also, *because* it is assigned to an Array, this code:
> 
>         for i in range(64):
>             m.d.comb += rb64[i].eq(self.rb[i])
> 
> might actually try to generate an Array-assigning method of setting
> the 64 elements.  you'll have to check the graphviz
> 
> the *possibility* of that occurring is why i recommended it to be done as:
> 
>         rb64 = [Signal.... for i in range(64)]
>         for i in range(64):
>             m.d.comb += rb64[i].eq(self.rb[i])
>         rb64 = Array(rb64)
> 
> see the difference?  this one is assigning to signals that, oh look,
> they happen to be in a python list.
> 
> the one that you did, the signals are assigned *via the nmigen Array*.
> 
> and the code is violating PEP8 by being over 80 chars in length.

Thanks for catching this error Luke. I have made the modification you
recommended, and run autopep8 on the file to ensure proper conformance to
formatting rules. I'm still learning how to read yosys dot diagrams, but it
does appear that this modification changes the graph, so it is possible that
array-assigning methods were being generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 18:56 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #28 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Michael Nolan from comment #26)
> (In reply to Cole Poirier from comment #21)
> > Yeah.. I have the feeling that I'm wading into quite strange waters here :)
> > 
> > > I'd be happy to help with formal proofs when you're ready.
> > 
> > Thanks again Michael, I'm looking forward to working with you and learning
> > from your knowledge and experience. I have a prior obligation, so I'll have
> > to push writing the unit test until tomorrow. But, for my own understanding,
> > once I have the unit test is working, would it be wiser to search for
> > optimization opportunities, for example from Claire Wolf's bitmanip code, or
> > to write the formal proof? I'm guessing that the formal proof is specific to
> > the function's implementation and thus I should wait to write the formal
> > proof until the function is optimized but I am not sure.
> > 
> 
> Cole, I added a skeleton proof module for bperm.py here
> https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/logical/formal/
> proof_bperm.py;h=da198940f75b3868ca864f1d75c6e99c55b1f073;hb=HEAD with a
> bunch of comments on how to finish the formal proof. Take a look when you
> get around to it, and let me know if you have problems.

Thank you! Thank you! Thank you! This is honestly unbelievable Michael, I am so
grateful for your very generous help. I'm going over the proof skeleton now,
about to start working on the second proof assertion that you've given me a
very good starting point for. I'll be sure to let you know once I have
something... or if I have a significant problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-17 19:17 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-313-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=313

--- Comment #22 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #21)
>     if (mode_is_64bit) then M <- 0
>     else M <- 32
> 
> answer's "no".  32-bit in 32-bit mode, 64-bit in 64-bit mode

Oops. I thought I had seen somewhere that that wasn't the case when I wrote the
comment, but decided to double check and forgot to delete the comment.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 21:03 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #29 from Cole Poirier <colepoirier@gmail.com> ---
Hi Michael, is there an argument that needs to be passed in order to run the
formal proof, or a config.sby file? I'm currently trying 'python3
proof_bperm.py' which gives me an error about a missing file... I'm pulling my
hair out trying to figure out which file it's looking for.

```
E.
======================================================================
ERROR: test_formal (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "proof_bperm.py", line 112, in test_formal
    self.assertFormal(module, mode="bmc", depth=2)
  File "/home/colepoirier/src/nmigen/nmigen/test/utils.py", line 100, in
assertFormal
    stdin=subprocess.PIPE, stdout=subprocess.PIPE) as proc:
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '': ''

----------------------------------------------------------------------
Ran 2 tests in 0.479s

FAILED (errors=1)
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 21:28 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #30 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Cole Poirier from comment #29)
> Hi Michael, is there an argument that needs to be passed in order to run the
> formal proof, or a config.sby file? I'm currently trying 'python3
> proof_bperm.py' which gives me an error about a missing file... I'm pulling
> my hair out trying to figure out which file it's looking for.
> 
> ```
> E.
> ======================================================================
> ERROR: test_formal (__main__.TestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "proof_bperm.py", line 112, in test_formal
>     self.assertFormal(module, mode="bmc", depth=2)
>   File "/home/colepoirier/src/nmigen/nmigen/test/utils.py", line 100, in
> assertFormal
>     stdin=subprocess.PIPE, stdout=subprocess.PIPE) as proc:
>   File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
>     restore_signals, start_new_session)
>   File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
>     raise child_exception_type(errno_num, err_msg, err_filename)
> FileNotFoundError: [Errno 2] No such file or directory: '': ''
> 
> ----------------------------------------------------------------------
> Ran 2 tests in 0.479s
> 
> FAILED (errors=1)
> ```

Nope, no arguments needed. I ran into this error a while ago, it's something to
do with symbiyosys not finding a file. I'm not sure how it got fixed though, as
it seemed to resolve itself. Are you using the latest nmigen, installed from
the git repo?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-17 22:19 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

https://bugs.libre-soc.org/show_bug.cgi?id=316

--- Comment #31 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
try running a different formal test that is known to already work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
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