* Re: [libre-riscv-dev] Scoreboard vs Tomasulo
From: Luke Kenneth Casson Leighton @ 2020-05-17 0:53 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAEoCstSGxwV88JUHTQmUp=75kHWxSZNSPu==_pxsUYf29ctd9w@mail.gmail.com>
On Sat, May 16, 2020 at 11:45 PM Jeremy Singher <thejsingher@gmail.com> wrote:
>
> I have finally finished parsing Mitch's chapters, and now I see what
> the primary confusion is from. The scoreboard being developed here has
> been referred to in the mailing lists as a "CDC 6600-like" scoreboard,
> while in reality, the final design is far extended far beyond the
> original CDC 6600 implementation.
yes. well... far beyond it in *functionality*, but not that far in
terms of gate
count [caveat: if we were only doing the same 3 regfiles, A B and X.
as we are doing 32x INT, 32x FP, plus SPR regs *and* Condition Regs
all under the control of Dependency Matrices, a direct comparison is unfair]
oh. ah. one definite enhancement: in the diagrams you see in Mitch's
chapters, there is only one GO-READ and only one GO-WRITE. one GO-READ
indicates a desire to request *multiple* Regfile Read ports.
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 would suggest not calling it a
> "CDC 6600-like scoreboard" in the future, instead a "extended
> scoreboard" is more accurate.
appreciated. if you could consider helping change the wiki to reflect this (and
help us to maintain the advantages below) this would be fantastic.
i've used a range of terms - "augmented 6600 scoreboard", and others.
the historic
link and the effective revival of something long-forgotten which was
both elegant
and staggeringly gate-efficient (out of necessity): i don't want to use the word
"political" in any sentence however there is a considerable publicity
"wow factor"
to doing something as surprising as reviving a 55-year-old design.
since interacting with Mitch Alsup last year, you're the first additional person
to actually do any kind of significant analysis: consequently terminology has
not really been discussed... because there wasn't anyone to discuss it with!
> Let me try to compose my thoughts.
> In order for OOO execution to be possible, write data from
> speculatively executed instructions must be buffered, for in the case
> of misspeculation, they must not be allowed to commit into the
> architectural register file.
mis-speculation, LD/ST page-faults, predicated instructions where the operand
that contains the bitmask is in a register that has not been read yet, and even
simple external NMI interrupts: all of these need a means and method of
killing in-flight data, yes.
> In Tomasulo's, speculative write data are held in physically renamed registers.
> In the extended scoreboard scheme, speculative write data are held in
> compute unit latches.
these two effectively having a very low Levenshtein distance, but not quite
zero.
* in Tomasulo, the reason for the explicit renaming is down to the 2D
nature of RS's.
hence the ROB row number needs to be stored in the RS
* in extended-scoreboard, the FU's index / column-number *is* that "name";
with there only *being* a one-to-one path, there is no need for a
name *at all*,
hence why i refer to the CU latches as "nameless registers".
the ROB row number *is* the FU number which *is* the renamed-register-number
and consequently by being one-to-one in every aspect, needs no name.
this aspect of 6600 scoreboards - the complete lack of naming and even the
lack of significance drawn to it even by James Thornton himself in his book,
and certainly in the patents, is why the 6600 is *believed* not to have register
renaming of *any* kind.
ah - one other really critical thing (i will add to the page):
* Tomasulo ROB Row numbers preserve instruction order through sequential
numbering by the actual row number
* 6600 scoreboards preserve instruction order in the FU-FU Matrix with
a NxN bit-level matrix of SR Latches implementing a "linked list" (the
Directed Acyclic Graph) of ordered dependencies, using the *register*
dependencies at the time the instruction is inserted into the *FU-REGS*
Matrix to determine the FU-FU DAG. this has more in common with a
"linked list" data structure, to use software terminology.
this latter aspect is a crucial one that even James Thornton notes is really
*really* complex to explain, yet paradoxically requires an extraordinarily
small number of actual gates to implement.
however understanding the difference between the (binary) ROB Row
numbering (which preserves the DAG of instruction order by way
of binary-addressed instruction ROB Row N+1 being a greater index
than binary-addressed instruction ROB Row N) and this
"functionally-equivalent" linked-list system equally successfully preserving
a DAG but using unary SR Latches to do so, is key to recognising
and appreciating that Tomasulo and Scoreboards *really are* functionally
directly equivalent.
here it should become clear as to another aspect of why multi-issue is
problematic in Tomasulo. where detection of "readiness to commit" in
a single-issue Tomasulo is a simple matter of checking *one* row
"is your result ready, if yes commit it and cyclically increment the pointer
to the ROB row to the next item, ready for test-or-commit on the *next*
cycle", this must be updated to testing of *multiple* row "readiness"
states, which clearly requires a multi-ported SRAM.
this is where "solutions" that i have seen actually stratify the ROB
into 4 (or N) interleaved banks. crossbars are required... it's where
the nightmares begin.
> In Tomasulo's, branch dependency masks are used to drain misspeculated
> instructions.
are these unary-encoded or binary-encoded? by masks i would expect them
to be unary-encoded and thus allow multiple bits to be set, allowing multiple
operations to be cancelled.
if not, and binary masks are used, then each unit must have an arithmetic
comparator, "is my binary index less than or equal to the branch dependency
mask, if less than, then this means i must die".
the Shakti 6600-like (extended) scoreboard system in their E-Class design
uses *binary* numbering, which means that they use that scheme. effectively
the mask is not a mask per se, it is a shortened version of the instruction
sequential number.
BOOM uses unary bit-masks. i think. i had a brief conversation about it
with someone, somewhere, a few months back.
i greatly prefer the unary system. it allows interleaving of multiple
simultaneous
cancellations to *automatically* sort themselves out, by ORing the cancellations
together to produce the mask!
this is an "accidental" side-effect of the Shadow Matrix concept,
described below.
a binary-indexed cancellation system requires a *central resource* to calculate
the lowest-numbered "index", followed by broadcasting that index across the
one (and only one) permitted cancellation datapath.
> In extended scoreboard, the misspeculated instructions drain
> themselves from the system.
ah no. we'll be cancelling them explicitly, via an unary bit-mask,
that is global
and combinatorial in nature, extending right the way through the entirety
of the Function Unit, CompUnits *and* the associated pipelines.
the unary mask is basically a conversion of the *binary* indices of the
CompUnit number on any given Concurrent Computation Unit. 0-3
in this diagram here:
https://libre-soc.org/3d_gpu/architecture/6600scoreboard/600x-concurrent_comp_unit.png
thus in that case the unary cancellation mask would be 4-bit wide.
these are linked directly to - and are equal to - the "GO_DIE" signals in *this*
diagram:
https://libre-soc.org/3d_gpu/shadow.jpg
note in that diagram the existence per cell in the Dependency Matrices of *two*
Shadow Latches.
the first Shadow Latch is for the first Branch Unit to indicate "speculative
execution underway as controlled and directed by Branch Unit 1".
the second Shadow Latch is for the *second* Branch Unit to do likewise.
a third Shadow Latch exists for predicated execution. one bit each of the
predicate register (once read) will be thrown at the "FAILED-3" line if that
bit is zero, and at the "SUCCESS-3" line if that bit is 1. if "failed" is
asserted, then so is the "GO_DIE". that "GO_DIE", being connected to
the cancellation masks, *INSTANTLY* kills not just the register hazard
allocation, it resets the Function Unit to idle *and* kills the partial result
generation actually in the pipeline itself.
if "success" is asserted, the shadow latches are cleared, and "WRITE_REQUEST"
is no longer prevented and prohibited from asserting. the result (if it was
ready), is allowed to proceed "I now request a Regfile Write Port".
if the result
happened not to be ready, then when the result *is* ready it will not
be held up.
a fourth Shadow latch exists for cancellation of operations in the "shadow"
of a LD/ST Unit's page-fault / address exception.
as you can see this requires a trivial number of gates per cell, however
it is *each* exception or cancellation opportunity that requires these Shadows,
on a *per FU basis*, across all *other* FUs.
consequently i designed a "Shadow Matrix" that takes care of that.
> Both schemes can be designed to achieve similar OOO behaviors.
> Thus, one cannot draw a performance conclusion just by seeing which
> scheme is being used.
no. hence why we haven't done that kind of analysis: we're focussing
on implementation.
> Ideally the above text should be uncontroversial, please let me know
> if there is a large misunderstanding here.
nono looks great, really appreciate the insights raised. the missing piece
is the true significance of the role of the Shadow Matrices as being *the*
provision of precise exception capability, speculation, predication, everything.
yes i am aware that without "predication prediction" yes those are two
different words we end up with exactly the same situation as for Branch
Prediction: predicated operations that are issued, cause FUs to become
full / allocated, that are cancelled moments later because the majority
of the predicate register turns out to be full of zeros.
this is *not* a high priority item right now :)
> My opinion is that Tomasulo's is a more elegant and well-proven scheme
> for achieving OOO execution, compared to an extended scoreboard. I
> also argue that the extended scoreboard scheme does not present
> significant power/area advantages compared to Tomasulo's.
Mitch Alsup is better equipped, from 40 years experience at gate-level
design (which he kept and *refined* when working for AMD, hence some
of the blistering withering words to less experienced, less-knowledgeable
people trying to tell him that HDLs were inherently better), to answer this
one.
> Given that
> estimates on power/area tend to be wildly inaccurate, I think we will
> have to wait for power analysis of LibreSoC to get a definitive answer
> to this debate :).
if we have to use DFFs rather than SR NAND, the argument is instantly
won by Tomasulo because we have quite literally a 5-fold increase in
gate count right across the board, in every single Matrix. Shadow,
FU-Regs, FU-FU - the lot. everywhere you see an SR-Latch diagram
(2 gates), instead add 10 gates for a DFF.
for the 180nm ASIC this would jump approximately.... mmm... 10,000 gates
up to 50,000.
we may have to do that. it will suck.
> I deeply apologize if any of my thoughts could be interpreted as
> criticism. I fully support this kind of exploration in OOO design. I
> also apologize if I seem to suggest a change in design, as I
> understand that hardware design is not nearly as flexible as software
> design.
appreciated, Jeremy. if this discussion was taking place 6 to 12 months ago
the "mode" we would be in was radically different. now is "full-bore
time-critical implementation mode", and will be until the other side
of Oct 2020.
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] 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
page: next prev 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