Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* Re: [libre-riscv-dev] daily kan-ban update 18may2020
From: Staf Verhaegen @ 2020-05-19 12:30 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDyF42ND9xF=Rat1yv2+M1+VtrX1bgRSrMJbAyaThcjfnw@mail.gmail.com>

[-- Attachment #1.1: Type: text/plain, Size: 2490 bytes --]

Luke Kenneth Casson Leighton schreef op ma 18-05-2020 om 12:45 [+0100]:
> * and had a fascinating conversation thanks to yehowshua and jeremy(also welcome!), which resulted in this(https://libre-soc.org/3d_gpu/architecture/tomasulo_transformation/).

If I understand this correct the big architectural difference between extended scoreboarding and Tomasulo is that in the former the register content is stored in a central register file and for the latter it is distributed over several 'reservation stations'. In order to scale to for example multi-issue you need to go to higher order nRmW register files for scoreboarding and for Tomasulo you increase the number of reservation stations together with a more complex tracker of the register tagging/aliasing.
So some 2 cents from me.
From physical implementation point of view the central high order nRmW register file and scoreboard does worry me. Higher order nRmW register files will become power and area hungry compared to multiple lower order reservation stations.
I have seen numbers of a few tens of functional units in your design. I think it will become also a nightmare to connect and route all the input and outputs of all the functional units to the central register file and scoreboard. So at first sight, from physical implementation point for smaller nodes, the Tomasulo algorithm seems more scalable than extended scoreboarding. I indicated before that in smaller nodes power consumption and delay is mainly determined by the length of the interconnects and not by the input load of the logic gates itself; in 180nm it will be more fifty/fifty. As Jeremy indicated this is next to the power consumption in the register files and cache which scales with the total bit count of the block and the nRmW order of the block.
Also the travialness of a big fan-in NOR or NAND gate may be deceptive, these gates are not feasible and will be synthesized to trees of NAND/NOR gates. In that respect a high fan-in NOR/NAND can have similar time/power consumption than a seemingly more complex case of if statement. In zero order, for single output block, delay and power is determined by the number of inputs independent of the complexity of the RTL/HDL code. In first order one has to account that NAND/NOR logic is more efficient than XOR/XNOR logic but for bigger trees this difference is less pronounced as XOR/XNOR trees will be synthesized to more efficient trees using AOI (and-or-invert) cells.

greets,
Staf.



[-- Attachment #2: Type: text/plain, Size: 177 bytes --]

_______________________________________________
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 19may2020
From: Luke Kenneth Casson Leighton @ 2020-05-19 12:36 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwRS5yHWa=qnyZhCe5tux6Q=9KiXvxg5M_x21=GZ5tnaw@mail.gmail.com>

On Tuesday, May 19, 2020, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

except, i can't complete the diagram because i am blocked waiting for Jacob
> to do the DIV and MUL pipelines, which we have found highlights clearly
> what regs are needed in ways that a cursory examination does not reveal.
>

after doing some preliminary checks we also have a block on the reg
allocation task for a TRAP pipeline.

i think what i will do is, morph CompALUUnit to use a Record.

Cesar, CompLDSTUnit also will need converting to use a Record.

this because when grouping the CompUnits together it is a lot easier to do
so using arrays of Records.

however if i do CompALU first you will get an idea of what it will look
like and so are not surprised by code changes.

i will create "dummy" variables in the classes so that it does not require
massive code changes.

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] Tomasulo and Scoreboards
From: Luke Kenneth Casson Leighton @ 2020-05-19 13:47 UTC (permalink / raw)
  To: Libre-RISCV General Development

On Tuesday, May 19, 2020, Staf Verhaegen <staf@fibraservi.eu> wrote:

> Luke Kenneth Casson Leighton schreef op ma 18-05-2020 om 12:45 [+0100]:
> > * and had a fascinating conversation thanks to yehowshua and jeremy(also
> welcome!), which resulted in this(https://libre-soc.org/3d_
> gpu/architecture/tomasulo_transformation/).
>
> If I understand this correct the big architectural difference between
> extended scoreboarding and Tomasulo is that in the former the register
> content is stored in a central register file and for the latter it is
> distributed over several 'reservation stations'.


not quite. this is the number one misunderstanding about Scoreboards, due
to the Academic exclusive focus on the Q Tables.  it is similar to
focussing on the ROB and concluding that Tomasulo equals ROB therefore
Tomasulo is incompetent and incomplete, incapable of Out of Order execution.

 the reality is very different: there is actually no functional difference.

* both have central register files
* both have "in flight" distributed "storage" that hold results not yet
committed to the regfile.

the difference is:

* Tomasulo identified in-flight as "being a problem", gave a name to the
concept ("register renaming") and used CAMs in the form of Reservation
Stations to explicitly "house" this distributed in-flight data.

* Seymour Cray and James Thornton simply got on with it, coming up with an
in-flight solution where there *was* no need to give the in-flight data
"names".  they were just "Computation Unit operand latch/registers".

because they did not see it as an actual "problem", there was nothing to
"talk about".  it is only through retrospective anslysis that we find that
they solved the "problem".

what i can tell you is:

* those latches in the Computation Unit *are* Reservation Station latches
* a CAM is *NOT* needed
* they *are* 1R1W and DFFs are perfectly adequate to cover them
* centralising them is NOT needed and it would be severely detrimental to
try to do so.



> In order to scale to for example multi-issue you need to go to higher
> order nRmW register files for scoreboarding


this is necessary for Tomasulo as well.  i am referring to the INT Regfile,
not to the (misunderstood) inflight data latches local to RSes /
Computation Units.


>
> and for Tomasulo you increase the number of reservation stations


likewise you increase the number of Computation Units because doing so
increases inflight opportunity.


>
>  together with a more complex tracker of the register tagging/aliasing.


in Tomasulo, yes.  it quickly becomes a nightmare, at the RS CAMs, the CDB,
the ROB - in fact everything to do with the entire Tomasulo algorithm.

for Scoreboards, no.  the exact same logic, by encoding all Function Unit
and Register Numbers in UNARY not bibary, is autonatically and inherently
multi-issue capable BY DESIGN.

almost zero extra logic is required to make Unary (bitvector) Scoreboards
multi issue.



> So some 2 cents from me.
> From physical implementation point of view the central high order nRmW
> register file and scoreboard does worry me.


due to the (very common) misunderstanding, given that there is no
centralised scoreboard regfile, given that the inflight data you (and all
Academic literature misleadingly states) is distributed not centralised,
this concern is moot.

we will use standard DFFs to store the in-flight data, as an absolutely
standard "latch/register", at the CompUnit. this has been implemented over
a year ago and has been working for over a year.


> Higher order nRmW register files will become power and area hungry
> compared to multiple lower order reservation stations.
> I have seen numbers of a few tens of functional units in your design. I
> think it will become also a nightmare to connect and route all the input
> and outputs of all the functional units to the central register file and
> scoreboard.


i am going over this now.  the different regfiles (Condition, INT, SPR,
XER) are separate and so from a SRAM porting perspective all need 1W (with
the exception of LDST Update which can be timesliced)

the maximum number of read ports for any one Regfile SRAM is 3.  4 would be
nice.

so we only need 4R1W which is doable.

when it comes to multi issue this is where the stratification ODD-EVEN
Regfile numbering comes into play, and we *still* only need 4R1W.


>  So at first sight, from physical implementation point for smaller nodes,
> the Tomasulo algorithm seems more scalable than extended scoreboarding.


it definitely isn't.

to get multi issue in Tomasulo you need multiple Common Data Buses,
otherwise it becomes even more a bottleneck than it already is. assuming 4
issue, to achieve this the ROB needs to be made a multi ported (4R4W) SRAM,
and, worse, the ReservationStation CAMs now also need to be 4R4W.

plus some other nightmare aspects.


>  I indicated before that in smaller nodes power consumption and delay is
> mainly determined by the length of the interconnects and not by the input
> load of the logic gates itself; in 180nm it will be more fifty/fifty.


ah, appreciated the insight

with the Computation Units latches being distributed, not centralised,
these latches capture the operands close to the point where they will be
fed into the pipelines.

i plan to have the pipelines "double back" on themselves, placing the
result *back* where the Computation Unit may latch the result, easily, then
wait for the Regfile Common Data Bus dedicated to writing to the regfile.

these Broadcast Buses are an unavoidable necessity and will need careful
design and layout, and buffers to ensure they can be driven at speed.

both Tomasulo and Scoreboards require these large fanout / fanin Broadcast
Regfile Buses.

except that in Scoreboards, READ is completely separate from WRITE.
therefore, READ is fanout ONLY and WRITE is fanin ONLY.

this makes a crucial difference because the Tomasulo CDB is a single path
READ *AND* WRITE contended global resource.

single for delivery of *ALL* inflight data.

 As Jeremy indicated this is next to the power consumption in the register
> files and cache which scales with the total bit count of the block and the
> nRmW order of the block.


4R1W.


> Also the travialness of a big fan-in NOR or NAND gate may be deceptive,
> these gates are not feasible and will be synthesized to trees of NAND/NOR
> gates.


perfect.  as expected.  diagrams in Mitch's book chapters show this being
done, especially on the 32 reg vectors.



>
>  In that respect a high fan-in NOR/NAND can have similar time/power
> consumption than a seemingly more complex case of if statement. In zero
> order, for single output block, delay and power is determined by the number
> of inputs independent of the complexity of the RTL/HDL code. In first order
> one has to account that NAND/NOR logic is more efficient than XOR/XNOR
> logic but for bigger trees this difference is less pronounced as XOR/XNOR
> trees will be synthesized to more efficient trees using AOI (and-or-invert)
> cells.


appreciate the insights, Staf.

to summarise, then:

* we have some continuous misunderstandings from the Academic literature
which people continue to believe, and need to be stomped on whenever they
occur.  nicely.
* we have some big NOR/NAND gates (32 in) which create a cascade.  these
are expected.
* DFFs are used at the decentralised Computation Units to store
decentralised inflight data
* Centralised 4R1W Regfiles store centralised register data.
* Unidirectional Broadcast Buses transfer data between Comp Units and
Regfiles.

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] [Bug 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-05-19 14:11 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>

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

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
* twi TO,RA,SI
* tw TO,RA,RB

    a <- EXTS((RA)[32:63])
    b <- EXTS((RB)[32:63])
    if (a < b) & TO[0] then TRAP
    if (a > b) & TO[1] then TRAP
    if (a = b) & TO[2] then TRAP
    if (a <u b) & TO[3] then TRAP
    if (a >u b) & TO[4] then TRAP

Special Registers Altered:

    None

so, here, inputs are:

* RA
* RB (or imm)
* MSR (where does this come from?)

logic is identical to CMP


outputs are:

* NIA
* SRR1 (SPR)

see
https://github.com/antonblanchard/microwatt/blob/master/execute1.vhdl

irq_nia <= (to_unsigned(16#700#, 64));
srr1 <= msr_copy(ctrl.msr);
-- set bit 46 to say trap occurred
srr1(63 - 46) <= '1';


this one although it smells like a Branch it actually seems to smell more like
a MicroCoded double op, a combination of OP_CMP and OP_BR.

i am reluctant to suggest we do microcoding for this design right now

-- 
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-19 14:40 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 #48 from Michael Nolan <mtnolan2640@gmail.com> ---
Cole, since your module passes your formal proof, I think it might be a good
idea to try hooking it up to the logical pipeline, and adding a test for it.

To hook it up, you're going to want to open up logical/main_stage.py and take a
look at what's there for OP_CNTZ. You're going to want to do something similar
to that for OP_BPERM using your Bpermd module.

To add a test for bperm, you'll want to open up
logical/test/test_pipe_caller.py and duplicate the function `test_cmpb`. You'd
then want to modify this copy to have a different name, execute the bpermd
instruction instead of cmpb, and possibly have different data for registers 1
and 2. Again, happy to help if you get stuck

-- 
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-05-19 14:57 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>

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

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
this code in microwatt execute1.vdhl tends to suggest that two SPRs need to be
outputted from TRAP:

* SRR0 (containing the PC *after* the trap is to return - NIA)
* SRR1 (containing the new MSR)

note they are also using a FSM, writing out the two registers SRR0 and SRR1
across
2 clock cycles.

    ctrl_tmp.irq_state <= WRITE_SRR0;
    exception := '0';
        illegal := '0';
        exception_nextpc := '0';
        v.e.exc_write_enable := '0';
        v.e.exc_write_reg := fast_spr_num(SPR_SRR0);
        v.e.exc_write_data := e_in.nia;

    if ctrl.irq_state = WRITE_SRR1 then
        v.e.exc_write_reg := fast_spr_num(SPR_SRR1);
        v.e.exc_write_data := ctrl.srr1;
            v.e.exc_write_enable := '1';
            ctrl_tmp.msr(MSR_SF) <= '1';
            ctrl_tmp.msr(MSR_EE) <= '0';
            ctrl_tmp.msr(MSR_PR) <= '0';
            ctrl_tmp.msr(MSR_IR) <= '0';
            ctrl_tmp.msr(MSR_DR) <= '0';
            ctrl_tmp.msr(MSR_RI) <= '0';
            ctrl_tmp.msr(MSR_LE) <= '1';
        f_out.redirect <= '1';
        f_out.redirect_nia <= ctrl.irq_nia;
        v.e.valid := e_in.valid;

-- 
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] Tomasulo and Scoreboards
From: Luke Kenneth Casson Leighton @ 2020-05-19 15:18 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDx6dn2i1YcUYX3DqH1Z29BmGOSt15-LEGEMykrwZipziw@mail.gmail.com>

Staf, Jeremy, et al, i've updated the page further so that in
particular the fact that the CompUnit latches are distributed and are
directly equivalent to distributed RS rows is made clear, with a table
at the bottom:

https://libre-soc.org/3d_gpu/architecture/tomasulo_transformation/

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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-05-19 15:49 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>

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

--- Comment #3 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
section 7.5.9 covers TRAP, and shows that yes:

* SRR0 is set to "PC following trap"
* SRR1 contains the *old* MSR (sorry, not the new MSR)
* MSR is updated to meet the conditions of the trap

-- 
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 312] Formal Correctness Proof for CountZero needed (basically PriorityEncoder)
From: bugzilla-daemon @ 2020-05-19 16:30 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-312-13@https.bugs.libre-soc.org/>

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

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
this is now definitely a formal proof for PriorityEncoder because countzero.py
is not used, replaced by use of nmutil.clz.  however, nmutil.clz *is*
PriorityEncoder.

-- 
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 326] New: nmutil.clz to be retired (removed) because it is identical to PriorityEncoder
From: bugzilla-daemon @ 2020-05-19 16:33 UTC (permalink / raw)
  To: libre-riscv-dev

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

            Bug ID: 326
           Summary: nmutil.clz to be retired (removed) because it is
                    identical to PriorityEncoder
           Product: Libre-SOC's first SoC
           Version: unspecified
          Hardware: PC
                OS: Mac OS
            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: ---

i do not know how nmutil.clz came to be written: it is functionally identical
in absolutely every respect to PriorityEncoder, which is a pre-existing
standard function in nmigen.

nmutil.clz therefore needs to be retired, to be replaced by PriorityEncoder.
we do however need a formal proof of PriorityEncoder

-- 
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 326] nmutil.clz to be retired (removed) because it is identical to PriorityEncoder
From: bugzilla-daemon @ 2020-05-19 16:33 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-326-13@https.bugs.libre-soc.org/>

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

Luke Kenneth Casson Leighton <lkcl@lkcl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.libre-soc.org/
                   |                            |show_bug.cgi?id=312

-- 
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 312] Formal Correctness Proof for CountZero needed (basically PriorityEncoder)
From: bugzilla-daemon @ 2020-05-19 16:33 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-312-13@https.bugs.libre-soc.org/>

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

Luke Kenneth Casson Leighton <lkcl@lkcl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.libre-soc.org/
                   |                            |show_bug.cgi?id=326

-- 
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 326] nmutil.clz to be retired (removed) because it is identical to PriorityEncoder
From: bugzilla-daemon @ 2020-05-19 16:33 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-326-13@https.bugs.libre-soc.org/>

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

Luke Kenneth Casson Leighton <lkcl@lkcl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|lkcl@lkcl.net               |mtnolan2640@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

* Re: [libre-riscv-dev] daily kan-ban update 19may2020
From: Cesar Strauss @ 2020-05-19 16:38 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDy_BOjYKNiTqBhvXXTqymFyinfJyeyC80JLoQRVyZw2tw@mail.gmail.com>

Em 19/05/2020 09:36, Luke Kenneth Casson Leighton escreveu:
> i think what i will do is, morph CompALUUnit to use a Record.
> 
> Cesar, CompLDSTUnit also will need converting to use a Record.
> 
> this because when grouping the CompUnits together it is a lot easier to do
> so using arrays of Records.
> 
> however if i do CompALU first you will get an idea of what it will look
> like and so are not surprised by code changes.
> 
> i will create "dummy" variables in the classes so that it does not require
> massive code changes.

Sure, fire away.

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

* [libre-riscv-dev] [Bug 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-05-19 16:54 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>

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

Jacob Lifshay <programmerjake@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |programmerjake@gmail.com

--- Comment #4 from Jacob Lifshay <programmerjake@gmail.com> ---
I think this should also cover interrupts.

I would suggest having the execution unit be a FSM since traps/interrupts are
rare, so the FSM is not activated unless a trap/interrupt is taken. When we
receive an external interrupt, we could switch the decoder to insert a special
trap instruction instead of decoding normally.

-- 
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 326] nmutil.clz to be retired (removed) because it is identical to PriorityEncoder
From: bugzilla-daemon @ 2020-05-19 17:05 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-326-13@https.bugs.libre-soc.org/>

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

--- Comment #1 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #0)
> i do not know how nmutil.clz came to be written: it is functionally identical
> in absolutely every respect to PriorityEncoder, which is a pre-existing
> standard function in nmigen.
> 
> nmutil.clz therefore needs to be retired, to be replaced by PriorityEncoder.
> we do however need a formal proof of PriorityEncoder

It was written because I needed to count the number of leading zeros when I was
working on the cordic, and I didn't know about PriorityEncoder

With some modifications (reversing input, returning $width when PE raises the
n/invalid bit), it is identical in behavior to clz.py. However, it is much less
efficient for large inputs. Synthesizing a 64 bit leading zero count module
gives me these statistics:

clz.py:
   Cells: 211
   Longest Topological Path: 10

PriorityEncoder:
   Cells: 435
   Longest Topological Path: 63

-- 
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] daily kan-ban update 19may2020
From: Jacob Lifshay @ 2020-05-19 17:13 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDwRS5yHWa=qnyZhCe5tux6Q=9KiXvxg5M_x21=GZ5tnaw@mail.gmail.com>

On Tue, May 19, 2020, 05:00 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> except, i can't complete the diagram because i am blocked waiting for Jacob
> to do the DIV and MUL pipelines, which we have found highlights clearly
> what regs are needed in ways that a cursory examination does not reveal.


I'll be working on the mul and div pipelines today, I'm planning on adding
mul-add and mul-sub support to the partitionable multiplier since that's
much easier than writing a whole new multiplier. Will then add the FU
interface logic needed to drive it, perhaps in simplified form (1 mul per
clock, no packing smaller muls together) since that would allow me to get
back to the load/store unit faster. If there's spare time later, it can be
made fancier to allow issuing multiple smaller ops per clock and/or have
fpmul/fpmuladd added.

Will modify the fpdiv pipe to add idiv/udiv/irem/urem as well as div by
zero and int overflow detection, will then use that in the DIV FUs, can add
support for fdiv/fsqrt/frsqrt if there's spare time later.

I picked both those routes since that seems like the path of least
resistance, and because it makes adding fp later that much easier.

Jacob
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 19may2020
From: Luke Kenneth Casson Leighton @ 2020-05-19 17:34 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD7fXnNeGWcGTiVzMnxSDcKSZuoteY1gAKHm-RGYGh+Bsw@mail.gmail.com>

On Tue, May 19, 2020 at 6:13 PM Jacob Lifshay <programmerjake@gmail.com> wrote:

> I'll be working on the mul and div pipelines today,

ah good, whew

> I'm planning on adding
> mul-add and mul-sub support to the partitionable multiplier since that's
> much easier than writing a whole new multiplier.

true.

(remember, the initial plan is not to use partitioning: just a
straight 64-bit MUL.  we are running in 180nm: latency is not high)

however.... if you feel that this really should be split into 2
pipeline stages, then even without partitioning at all (which,
remember, we are *not* doing - at all - for this critical Oct
deadline) it may indeed be easier to use PartMul because of its
pipeline capability, hard-code the partition bits to "fully open", and
set the "breakdown" point to a matrix of 4x32 or a matrix of 16x16-bit
MULs rather than the 8x8 which we tested the code with, last year.

in particular i think if we went with 4x32-bit MULs it would not
result in massive simulation times.

also now that i think of it, because it already has the
signed/unsigned calculation (done and tested), it may definitely turn
out to be easier to use PartMul than starting from zero.


> Will then add the FU
> interface logic needed to drive it, perhaps in simplified form (1 mul per
> clock, no packing smaller muls together) since that would allow me to get
> back to the load/store unit faster.

if you can cookie-cut soc.fu.shift_rot (cut/paste copy) i did notice
that the input-data and output-data formats are identical to what is
needed for MUL (particularly due to the 3-input MAC).  so that would
just leave the intermediary pipe stages which would be dropped into
soc.fu.shift_rot/pipeline.py ok cookie-cut it would be
soc.fu.mul/pipeline.py

this will get the infrastructure in place very rapidly and give a
template which ultimately just involves filling in main_stage.py and
adjusting pipeline.py

> If there's spare time later, it can be
> made fancier to allow issuing multiple smaller ops per clock and/or have
> fpmul/fpmuladd added.

we're definitely not going to have time to add any of the FP pipeline, at all.

> Will modify the fpdiv pipe to add idiv/udiv/irem/urem as well as div by
> zero and int overflow detection, will then use that in the DIV FUs,

this one i agree fully, yes, good idea, like it.  here, use
soc.fu.logical as a cookie-cut template, using the LogicalInputData
data structure (that's: if you can confirm and agree that it is
identical to what is used, for its register allocation).

> can add support for fdiv/fsqrt/frsqrt if there's spare time later.

there definitely won't.  time is *really* short.

> I picked both those routes since that seems like the path of least
> resistance, and because it makes adding fp later that much easier.

i am inclined to recommend leaving even consideration of FP off the
table, and, when we have time, literally dumping whatever code was
written and replacing it.  although, i suspect that, actually, very
little would actually get thrown away: more... morphed.

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 19may2020
From: Michael Nolan @ 2020-05-19 17:47 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDwRS5yHWa=qnyZhCe5tux6Q=9KiXvxg5M_x21=GZ5tnaw@mail.gmail.com>

Today I was going to try and work on the trap block, but it looks like 
Luke is already working on defining the registers for it and I don't 
want to interfere.

I was able to modify caller.py to correctly generate carries, and added 
checking of the carry bit to the alu unit tests. One snarl with that 
though is I am unable to get qemu to show modifications to the carry bit 
in XER for some reason. This isn't an issue for carry (or overflow), but 
it would be good to have for the 32 bit carry and overflow. I may need 
to hold off on the 32 bit versions until I'm able to run tests on a real 
power machine.

I also looked at the differences between nmutil.clz and nmigen's 
PriorityEncoder, and summarized them in 
https://bugs.libre-soc.org/show_bug.cgi?id=326

--Michael


_______________________________________________
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 326] nmutil.clz to be retired (removed) because it is identical to PriorityEncoder
From: bugzilla-daemon @ 2020-05-19 17:52 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-326-13@https.bugs.libre-soc.org/>

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

Luke Kenneth Casson Leighton <lkcl@lkcl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|CONFIRMED                   |RESOLVED

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #1)
> (In reply to Luke Kenneth Casson Leighton from comment #0)
> > i do not know how nmutil.clz came to be written: it is functionally identical
> > in absolutely every respect to PriorityEncoder, which is a pre-existing
> > standard function in nmigen.
> > 
> > nmutil.clz therefore needs to be retired, to be replaced by PriorityEncoder.
> > we do however need a formal proof of PriorityEncoder
> 
> It was written because I needed to count the number of leading zeros when I
> was working on the cordic, and I didn't know about PriorityEncoder

:)


> With some modifications (reversing input, returning $width when PE raises
> the n/invalid bit), it is identical in behavior to clz.py. However, it is
> much less efficient for large inputs. Synthesizing a 64 bit leading zero
> count module gives me these statistics:
> 
> clz.py:
>    Cells: 211
>    Longest Topological Path: 10
> 
> PriorityEncoder:
>    Cells: 435
>    Longest Topological Path: 63

iinteresting.  that's no good.  i wonder - it's probably because
PriorityEncoder
uses a pmux.  63-long paths for a 64-bit count is *rubbish*.

yep that's pretty clear: clz stays.

-- 
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] daily kan-ban update 19may2020
From: Luke Kenneth Casson Leighton @ 2020-05-19 17:56 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <1b56d581-15d1-cc09-a581-d9547564381b@gmail.com>

On Tue, May 19, 2020 at 6:47 PM Michael Nolan <mtnolan2640@gmail.com> wrote:
>
> Today I was going to try and work on the trap block, but it looks like
> Luke is already working on defining the registers for it and I don't
> want to interfere.

nope, go for it Michael.  i was just taking notes.  it is end-of-day
here for me anyway.

> I was able to modify caller.py to correctly generate carries, and added
> checking of the carry bit to the alu unit tests. One snarl with that
> though is I am unable to get qemu to show modifications to the carry bit
> in XER for some reason. This isn't an issue for carry (or overflow), but
> it would be good to have for the 32 bit carry and overflow. I may need
> to hold off on the 32 bit versions until I'm able to run tests on a real
> power machine.

ar

> I also looked at the differences between nmutil.clz and nmigen's
> PriorityEncoder, and summarized them in
> https://bugs.libre-soc.org/show_bug.cgi?id=326

yep good call, closed and commented nmigen.clz given that it's better.

have to remember that because PriorityEncoder gets used in a few places.

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] priority encoder replacement
From: Jacob Lifshay @ 2020-05-19 18:01 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzkRvwmA=+T6fiyGHoWVQD6D_R+bxtfMy5j0SWyBUSOJw@mail.gmail.com>

On Tue, May 19, 2020, 10:57 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Tue, May 19, 2020 at 6:47 PM Michael Nolan <mtnolan2640@gmail.com>
> wrote:
> > I also looked at the differences between nmutil.clz and nmigen's
> > PriorityEncoder, and summarized them in
> > https://bugs.libre-soc.org/show_bug.cgi?id=326
>
> yep good call, closed and commented nmigen.clz given that it's better.
>
> have to remember that because PriorityEncoder gets used in a few places.


If clz is strictly better, replace PriorityEncoder with clz, or just change
clz to match PriorityEncoder's interface and rename it PriorityEncoder,
deleting the old one.

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] [Bug 314] Create Condition Register pipeline
From: bugzilla-daemon @ 2020-05-19 18:08 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-314-13@https.bugs.libre-soc.org/>

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

Michael Nolan <mtnolan2640@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|lkcl@lkcl.net               |mtnolan2640@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 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-19 18:09 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

Michael Nolan <mtnolan2640@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|lkcl@lkcl.net               |mtnolan2640@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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-05-19 18:09 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>

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

Michael Nolan <mtnolan2640@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|lkcl@lkcl.net               |mtnolan2640@gmail.com
                 CC|                            |mtnolan2640@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

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