Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* [libre-riscv-dev] [Bug 186] Create decoder for SOC: Power ISA and RISC-V
From: bugzilla-daemon @ 2020-03-26 21:41 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-186-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=186

--- Comment #132 from Jacob Lifshay <programmerjake@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #131)
> btw don't be afraid to commit unit tests that don't "quotes work quotes".
> 
> when it comes to unit tests, the whole idea is to have
> "things-that-demonstrate-a-need-to-fix-code" rather than "have everything
> absolutely perfect".
> 
> so do go ahead and commit some unit tests that actually break, but you
> expect them to pass at some point in the future.
> 
> i say that because in the past i noticed that you commented out some unit
> tests which "failed".  just leave them to fail, as a reminder.  also
> there's a way to tag them with bugreports (with decorators).
> 
> i'll document this in HDL_workflow.

Actually, I'd decorate them with something like:
import unittest

@unittest.skip("not working yet")
def test_fn():
    body-here

or

@unittest.expectedFailure # FIXME: not working yet
def test_fn():
    body-here


That way, once I add support for GitLab CI we will get a message when one of
the commits fails any of the tests, allowing us to more quickly detect that
something unexpectedly broke. If it's filled with a whole bunch of tests that
we know will fail, then that makes the CI nearly worthless because it will
always be filled with a bunch of failures obscuring the ones we care about.

-- 
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] email etiquette
From: Luke Kenneth Casson Leighton @ 2020-03-26 21:41 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD4G8-OxL+h68iZaQOPch-+6rpuFUKWWhYGi9z-5JFE+sA@mail.gmail.com>

On Thu, Mar 26, 2020 at 9:25 PM Jacob Lifshay <programmerjake@gmail.com> wrote:

> On Thu, Mar 26, 2020, 12:43 Cole Poirier <colepoirier@gmail.com> wrote:
>
> > Sorry for this lapse in judgement Luke. I've been trying my best to
> > adhere to proper mailing list etiquette, and I've switched to using the
> > open source mail client Mailspring to allow me to make sure I'm sending
> > plaintext mail. But of course, this doesn't prevent me from slipping
> > into my old ways, so thank you for this reminder, I'll try very hard not
> > to do this again.
> >
>
> We're not like some of the Kernel mailing lists which will just block any
> mail with html,

yeah that one's fun.  at least it warns you with a reject rather than
silent treatment.  the reason they only accept plaintext is because
the key kernel developers have mail-filters which look for
git-format-patch messages.  therefore you absolutely do not want
html-formatted crap.  plus, on (literally) the world's largest
software project (by a long, long margin) it just pisses a *lot* more
people off.

> so you can still use the gmail client if you want, just
> remember to try to trim excessive context, avoid top-posting, and avoid
> using non-plaintext features.
>
> I'm currently writing this in the gmail app for android, in case you were
> wondering.

i'm also on gmail "m.gmail.com" in a web browser with "mobile tab"
set.  sigh it defaults to html (with no option to set plaintext).
however - yes, i still always trim context.

it's just habit.

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 267] New: The efficiency of adder/subtractor
From: bugzilla-daemon @ 2020-03-26 22:05 UTC (permalink / raw)
  To: libre-riscv-dev

http://bugs.libre-riscv.org/show_bug.cgi?id=267

            Bug ID: 267
           Summary: The efficiency of adder/subtractor
           Product: Libre-SOC's first SoC
           Version: unspecified
          Hardware: PC
                OS: Windows
            Status: CONFIRMED
          Severity: enhancement
          Priority: ---
         Component: ALU (including IEEE754 16/32/64-bit FPU)
          Assignee: lkcl@lkcl.net
          Reporter: tanner.of.kha@gmail.com
                CC: libre-riscv-dev@lists.libre-riscv.org
   NLnet milestone: ---

From the task http://bugs.libre-riscv.org/show_bug.cgi?id=217

(In reply to Luke Kenneth Casson Leighton from comment #42)
> (In reply to Jock Tanner from comment #41)
> > I think most ALUs
> > just negate and add instead of subtract. I think this would use a bit less
> > logic, and negation in itself is also a useful operation.
> 
> yes. in the "real" alu we have... mmm... not sure, actually.  probably -
> 
> do me a favour and raise a bugreport as a reminder to look up what
> rocketchip does?

Actually I was thinking about what Harris&Harris suggested in their famous
book. You just have to have an inverter on one operand input of an adder. The
two's complement of that operand can be achieved via the carry input.

-- 
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] [OP-CD] OpenPOWER Foundation "Virtual Coffee" Calls
From: Luke Kenneth Casson Leighton @ 2020-03-26 22:05 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDxAoJ+cRDrJr=7JCC1UzFc=9bCzNFm5vkj5N9Jq_ag+Cw@mail.gmail.com>

on now!

On Thursday, March 26, 2020, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:

> On Thu, Mar 26, 2020 at 4:10 AM Luke Kenneth Casson Leighton
> <lkcl@lkcl.net> wrote:
> >
> >
> >
> > On Tuesday, March 24, 2020, Jacob Lifshay <programmerjake@gmail.com>
> wrote:
> >>
> >> Maybe we should participate.
> >
> >
> > i'll be on both.
>
> late... :)  i'll juuust rest my eyes for a bit... ho hum.
>
> the next one is at 22:00 UTC.  if you use this link:
> https://www.timeanddate.com/worldclock/meetingdetails.
> html?year=2020&month=3&day=26&hour=22&min=0&sec=0&p1=136
> or this
> https://www.timeanddate.com/worldclock/meetingtime.html?
> iso=20200326&p1=136
>
> you can "add more cities" - keep London (it's UTC for now) and use its
> time at Thu 22:00 to cross-check your own call-in time.
>
> dial-in numbers (actual telephone) you can find at the link, remember
> to press # twice after entering the meeting ID.
> https://openpowerfoundation.org/openpower-virtual-coffee-calls/
>
> l.
>


-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] email etiquette
From: Hendrik Boom @ 2020-03-26 22:41 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDy4L2uNMvqz69S1jmWmDHaBAFHX6d7MKEenPjttysyzyw@mail.gmail.com>

On Thu, Mar 26, 2020 at 09:41:13PM +0000, Luke Kenneth Casson Leighton wrote:
> On Thu, Mar 26, 2020 at 9:25 PM Jacob Lifshay <programmerjake@gmail.com> wrote:
> 
> 
> > so you can still use the gmail client if you want, just
> > remember to try to trim excessive context, avoid top-posting, and avoid
> > using non-plaintext features.
> >
> > I'm currently writing this in the gmail app for android, in case you were
> > wondering.
> 
> i'm also on gmail "m.gmail.com" in a web browser with "mobile tab"
> set.  sigh it defaults to html (with no option to set plaintext).
> however - yes, i still always trim context.

I've noticed an increasing number of people are sending me html only.
I think many of them don't know they're doing it, don't know what it
is, and don't know how to stop it.

SOmeone seems to be encouraging it by setting defaults in popular software.

-- hendrik

_______________________________________________
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 217] create a "ring" system which allows pad locations to be specified conveniently
From: bugzilla-daemon @ 2020-03-26 22:58 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-217-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=217

--- Comment #45 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Jock Tanner from comment #44)
> Sorry for being missing for some time, it was a busy week for me. My other
> projects and local bureaucracy required my attention.
> 
> So I reworked the ALU16 example with the hope that this approach could be
> (re)used in a future work.
> 
> https://git.libre-riscv.org/?p=soclayout.git;a=blob;f=experiments7/utils.py

niiiice.  that's really clean.  excellent - and precisely what i was hoping
to see.


oh.  one really important thing: we need an "auto" option for the width
and height... and for the *hierarchy to be able to work with that*.

so for example:

Add and Sub use the standard "auto-box" height/width (i forget the function,
sorry)

ALU16 computes its height based on:
max(Add.H, Sub.H, middle-stuff-H) + 100 (to give room for the routing)

and its width based on:
Add.W + Sub.W + middle-stuff-W + 20-or-so

this is actually really important because if we set fixed W+H and the HDL
changes, we're screwed when it comes to re-running the layout.

also, there *may* be small changes when we go to different geometries,
so it's really important to stay flexible and not have hard-coded sizes.

> The amount of required parameters can also be reduced. Maybe we could teach
> the module to deduct either its size or pin spacing. Now the initialization
> looks quite fuzzy.

yes, there's a function which does auto-size assessment, however it does
width *and* height, it doesn't do "width given height" or "height given
width".

also, we need "estimated size of the *remaining Cells which have not been
laid out*.

or "estimated size of just the following group of Cells".

we might have to do that by splitting the HDL into further modules
(this is a fallback plan).

so for example, everything in ALU16 that connects Add() and Sub() -
*all* that HDL goes into a *separate* module, such that ALU16()
*only* has 3 sub-modules:

* Add
* Sub
* ConnectAddAndSub

and thus *only* needs "routing".

however this would be a bit of a pain and i'd like to avoid redesigning
the HDL to this kind of extreme level, if possible.


> I deleted all the 'print' statements from the example, since I could not
> grasp the logic and requirements behind them. Perhaps it makes sense to
> return some logging, preferably with a proper use of 'logging' facility.

good idea.  if you can put a template / example together i'll tend to use it :)

so could you track down that auto-box-size computing function and then
look at removing all hard-coded parameters?

you'll likely need to run add.build() manually, then sub.build() manually,
*then* in ALU16()'s build constructor it will have access to the
(computed) width+height of each, *then* it can compute its width and
height.

-- 
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 267] The efficiency of adder/subtractor
From: bugzilla-daemon @ 2020-03-26 23:10 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-267-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=267

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Jock Tanner from comment #0)

> Actually I was thinking about what Harris&Harris suggested in their famous
> book. You just have to have an inverter on one operand input of an adder.
> The two's complement of that operand can be achieved via the carry input.

yes, interestingly, michael and i are reviewing in the simulator, various
implementations (microwatt, qemu, pear_pc), they all seem to do this
http://bugs.libre-riscv.org/show_bug.cgi?id=186#c130

it looks like power was extremely well designed, and microwatt as well,
to basically "translate" opcodes into "everything is an ADD, but you
optionally do add1, add0, add-carry, occasionally invert op1,
oh and farm out carry to different places, or set carry to 0, or 1" etc. etc.

it's quite neat.

-- 
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 217] create a "ring" system which allows pad locations to be specified conveniently
From: bugzilla-daemon @ 2020-03-27  0:03 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-217-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=217

--- Comment #46 from Jock Tanner <tanner.of.kha@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #45)
> so could you track down that auto-box-size computing function and then
> look at removing all hard-coded parameters?

I think it is 'void EtesianEngine::setDefaultAb()'. But I can be wrong, since
it is used only once in Python code shipped with Coriolis, and not documented
anywhere.

-- 
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 217] create a "ring" system which allows pad locations to be specified conveniently
From: bugzilla-daemon @ 2020-03-27  0:38 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-217-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=217

--- Comment #47 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Jock Tanner from comment #46)
> (In reply to Luke Kenneth Casson Leighton from comment #45)
> > so could you track down that auto-box-size computing function and then
> > look at removing all hard-coded parameters?
> 
> I think it is 'void EtesianEngine::setDefaultAb()'. But I can be wrong,
> since it is used only once in Python code shipped with Coriolis, and not
> documented anywhere.

have a look in other experiments, i used the function i am thinking of at least
once.

computeAbutmentBox or something

-- 
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 217] create a "ring" system which allows pad locations to be specified conveniently
From: bugzilla-daemon @ 2020-03-27  1:27 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-217-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=217

--- Comment #48 from Jock Tanner <tanner.of.kha@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #47)
> (In reply to Jock Tanner from comment #46)
> > I think it is 'void EtesianEngine::setDefaultAb()'. But I can be wrong,
> > since it is used only once in Python code shipped with Coriolis, and not
> > documented anywhere.
> 
> have a look in other experiments, i used the function i am thinking of at
> least once.
> 
> computeAbutmentBox or something

Then we're talking about the same thing.

This is the contents of
'cumulus.plugins.clocktree.ClockTree.computeAbutmentBox' (minus the commented
out code):

  def computeAbutmentBox ( cell, spaceMargin, aspectRatio, cellGauge ):
      UpdateSession.open()
      etesian = Etesian.EtesianEngine.create( cell )
      etesian.setDefaultAb()
      etesian.destroy()
      UpdateSession.close()
      return cell.getAbutmentBox()

It's just a call to 'etesian.setDefaultAb()'. All parameters but 'cell' are
ignored.

BTW 'etesian.place()' calls 'etesian.setDefaultAb()' under the hood if cell's
AB is empty, so even this code may be superfluous. But it needs further
experimenting.

-- 
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] microwatt tlb
From: Luke Kenneth Casson Leighton @ 2020-03-27  2:15 UTC (permalink / raw)
  To: openpower-hdl-cores; +Cc: Libre-RISCV General Development

hi this is for paul mackerras when you see it.

great to know you're working on microwatt. been such a long time, and
really good to encounter you over the virtual coffee chat earlier today.

here's the link to the radix walk doc i was talking about:
https://github.com/power-gem5/gem5/blob/gem5-experimental/src/arch/power/radix_walk_example.txt

it is really good.  implementations also exist in the same codebase, the
easiest way to track them down is via the commit logs in the
gem5-experimental branch.

for libresoc we really really need clear HDL to "track" if you know what i
mean, because some of these algorithms are very timeconsuming to implement
from scratch.

paul, continuing the (brief) discussion somewhat, in a related way, i
really wanted to make you aware of the implications for microwatt of trying
to make it multistage pipelined.

if you look up jon dawson's IEE754 FPU code you find that it is entirely
FSM based.  as such it is superb for fitting in small FPGAs.

over a 6 month period i morphed it from its humble beginnings into an
absolute beast of a flexibly reprogrammable Object Orientated IEEE754 FP
toolkit, capable of 16, 32 or 64 bit (and anything else you care to add),
arbitrary pipeline depth *or* FSM style engines, SIMD capability, *dynamic*
pipelines, the works.  Jacob helped add a fantastic hybrid fpdiv, sqrt
*and* rsqrt engine all in the same pipeline.  it's now well north of 10,000
lines of python code and takes a week to run all the unit tests.

what i learned along the way was that the FSM based systems vs pipeline
systems trade low gate count and simplicity and code readability for speed,
much higher gate count, and, unless *and even* if OO design is used, turn
into the most awful unreadable unmaintainable total trash.

rocketchip unfortunately, for all the compactness and other advantages, is
particularly bad, *because* of the OO (and total lack of code comments).
the OO hierarchy makes it flat-out impossible for anyone but its original
creators to work with.  (something to alert the chiselwatt team on, there,
although from what i have seen, the code comments in chiselwatt are damn
good).

and yet if you even remotely try anything like modern OO programming design
strategies and tecuniques with these 1980s era languages (HDL, Verilog) you
immediately also run into serious difficulties of a different kind, which i
won't go into, right now.

the bottom line is: adding extra pipeline stages to microwatt not only
complicates it and makes it unreadable and unmaintainable, it increases the
number of LUTs required to the pont where you will need to call it "watt"
or "megawatt"

:)

regarding exceptions and traps: for in-order pipelined systems these are a
damn nuisance.

every solution to every problem in an inorder system is:

stall.

that's it.

after learning about the CDC6600, which is a deeply impressive design that
takes literally months to begin to comprehend, i dislike inorder systems
intensely.

the key thing that i learned from Mitch Alsup about how to handle
exceptions is: you *must* prevent the ALU (or whatever) from "committing"
its result until it is GUARANTEED known that the exception will not occur.

that is the absolute core concept of exceptions (aka interrupts), you MUST
achieve, in some fundamental way.

this is done in an OoO design by marking and tracking the operation - all
the way down the pipeline - with "cancellation masks" (a global ID which
travels *with* the partial result data, down a given pipeline)

this is known as "shadowing", and it is not only the operation that *might*
be cancelled that has to be "shadowmarked", it is *all following
instructions as well* (hence the term "shadow").

shadowed operations are real easy to cancel: pull the "cancel" wire up, ane
everything with the requisite mask ID gets a global signal "whoops we no
longer need to pass this down the pipeline, drop it on the floor".

with all "future" partial (and completed but noncommitted) results now
killed, the PC can safely be redirected at the exception, interrupt, or the
alternative branch, or whatever: these all use *exactly* the same shadowing
technique.

you start to see why the majority of inorder systems use "stall stall stall
stall stall" as the be-all and end-all "onnne and only true solution",
here? [ hallelujah, praise the stall... ] :)

basically if i have discouraged you from pursuing the path of adding
multiple pipeline stages to microwatt, then i have succeeded in what i set
out to explain.  because microwatt's value is not just its small code size,
its readability and compactness makes it an ideal reference implementation
*and*, furthermore, its complete lack of optimisation normally seen in
"simple" pipelined designs actually saves on gates / FPGA resources.

the moment you add extra stages, all that goes out the window.

an associate and contributor on our list, Samuel Falvo, taught me some
awesome tricks.

his CPUs are incredible, designed in the most amazing elegant and unusual
ways.  he wrote his own PLA style "language" (written in lisp) which takes
specifications (in lisp lists) for functionality and *generates* VHDL
combinatorial blocks.

he used this tool to create a 6502-like processor with virtually no
manually written glue logic (even the decoder was written in this simple
specification), that easily fits into an ultra low cost ICE40 yet has
massive amounts of room to spare for peripherals.

the key to the success of this approach was the heavy tradeoff of *not*
using pipeline stages, but effectively doing a FSM style entire execution
design.  actually it wasn't even a FSM, i think he used the term "PLA".  i
am garbling it, it was a year ago, there are some keywords i have missed
out, you get the idea though.

what i am really saying is: please do seriously consider simply stalling on
anything that could have an exception thrown.  arrange for the entire
pipeline to simply grind to a halt, *globally* freezing right the way back
to the decode phase, only proceeding when it is guaranteed known, 100%,
that the exception will NOT occur.

this is, believe it or not, an industry-wide "acceptable" technique in ALL
in-order designs.

look up "minerva rv32" on github (it is very readable code) and grep its
source for the word "stall".

you will find a *combinatorial* global signal propagates throughout *every*
pipeline stage, implementing this "stop the world i want to get off!"
industry-wide "solution".

literally every effort that i have seen that attempts *not* to follow that
"solution" for inorder designs involves the word "but" and it goes downhill
from there.

surprising, ehn? :)

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 217] create a "ring" system which allows pad locations to be specified conveniently
From: bugzilla-daemon @ 2020-03-27  2:17 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-217-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=217

--- Comment #49 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Jock Tanner from comment #48)

>   def computeAbutmentBox ( cell, spaceMargin, aspectRatio, cellGauge ):

yep use that, it is the one JP advised.

-- 
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] extremely busy crowdsupply update started
From: Jacob Lifshay @ 2020-03-27  5:49 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDw_h8VQ3JJFF3FXph7Eg0ucVknuvMk=Xc0jSp0WP13=UQ@mail.gmail.com>

On Thu, Mar 26, 2020 at 2:04 PM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> https://git.libre-riscv.org/?p=crowdsupply.git;a=blob;f=updates/023_2020mar26_decoder_emulator_started.mdwn;hb=HEAD
>
> this is just the beginning, i have to fill in the sections - it would
> be really handy if people could help!
>
> <snip>
>
> if you prefer just reply to this message with a paragraph or two and i
> will cut/paste it?  i'll do the conf-call and the Talos-II
> workstation.

I ended up with quite a bit more than a paragraph or two, hoping
that's ok since this is the first time simple-soft-float as appeared
in the CrowdSupply updates, and I've been working on it since june at
least. I'd appreciate a review by someone else to help catch errors. I
pushed my additions to crowdsupply.git.

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] extremely busy crowdsupply update started
From: Luke Kenneth Casson Leighton @ 2020-03-27  8:47 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD4YYrcn2QPHe_c4TdxmNFWqb3aPAxnZaFGcio3ZPennMA@mail.gmail.com>

On Friday, March 27, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

>
> I ended up with quite a bit more than a paragraph or two, hoping
> that's ok since this is the first time simple-soft-float as appeared
> in the CrowdSupply updates, and I've been working on it since june at
> least. I'd appreciate a review by someone else to help catch errors. I
> pushed my additions to crowdsupply.git.


looks great jacob.

were there any challenges or anything that was difficult or easy?  it is
"insights" that are the kind of thing that make updates interesting.

oh, do mention the "rust library of the month" thing for example, and when
that happened, and how what has been done expands on that since.

also i suggest explicitly mentioning that these two libraries can be used
by *anyone*, they are *not* specific to this project, and are exactly the
kind of side-benefit that comes from sponsorship from NLNet.  hm i might
word that one if that's ok.


oh, nearly forgot! can you also do a quick section on kazan, mentioning the
intermediary milestone?


cole do you want to write a paragraph or two about the build servers?  link
to the post you did a few days ago


veera, the public-inbox setup (and how it helps other people not just us?)

l.




-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] cache SRAM organisation
From: Staf Verhaegen @ 2020-03-27  9:08 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDx9YH=0DWviRYJySR9++n-Nd88ZHkRb8EkWhah3x4MbeQ@mail.gmail.com>

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

Luke Kenneth Casson Leighton schreef op do 26-03-2020 om 21:28 [+0000]:
> On Thu, Mar 26, 2020 at 8:08 PM Staf Verhaegen <staf@fibraservi.eu> wrote:
> > Luke Kenneth Casson Leighton schreef op do 26-03-2020 om 15:15 [+0000]:
> > > On Thursday, March 26, 2020, Staf Verhaegen <staf@fibraservi.eu> wrote:
> > > > I can understand you do this to implement functional units withconfigurable pipeline length but I would strongly discourage to pipelineregister files after each other .
> > > 
> > > 
> > > "pipeline register files after each other"? apologies i am not clear whatyou mean, here.  do you mean "don't do write-thru on the Regfile"?
> > 
> > No I meant for example connecting the output of one port of an asynchronous RAM to for example the address input of another port of an asynchronous RAM.
> 
> ah right, no definitely not.  the connections are:
> RegisterFile readport[0..R] ==> FunctionUnit[0..M] operand latches                                            pipeline stage 0                                            pipeline stage 1                                            ...                                            pipeline stage NRegisterFile writeport[0..W] <== FunctionUnit[0..M] result latches
> (and also: )register file bypass forwardingbus <== FunctionUnit result latchesregister file bypass forwardingbus ==> FunctionUnit operand latches
> so the asynchronous SRAMs will definitely *only* be connected to SFFlatches.  *not* to other asynchronous SRAMs.

I still feel you intermix synchronous and write-through in this statement, the above seems to be possible with synchronous SRAMs.

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] cache SRAM organisation
From: Luke Kenneth Casson Leighton @ 2020-03-27  9:16 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <65e762e270e3660044604cc48f4fbd554d34af13.camel@fibraservi.eu>

On Fri, Mar 27, 2020 at 9:09 AM Staf Verhaegen <staf@fibraservi.eu> wrote:

> I still feel you intermix synchronous and write-through in this statement, the above seems to be possible with synchronous SRAMs.

this would be good.  what would help clarify immensely is if you could
let us know what options to nmigen Memory class are "supported".
then it is really clear.

best,

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] cache SRAM organisation
From: Staf Verhaegen @ 2020-03-27  9:25 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDwznLD5o6rHfWsSXR-8e1hbAfAB04f5O+YkL6pCwGsNfQ@mail.gmail.com>

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

Luke Kenneth Casson Leighton schreef op do 26-03-2020 om 21:37 [+0000]:
> ---crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
> 
> On Thu, Mar 26, 2020 at 8:18 PM Staf Verhaegen <staf@fibraservi.eu> wrote:
> > Luke Kenneth Casson Leighton schreef op do 26-03-2020 om 13:05 [+0000]:
> > > On Thursday, March 26, 2020, Staf Verhaegen <staf@fibraservi.eu> wrote:
> > > > Would like to make separate side remark here. In ASICs MUXes are relativeexpensive gates with respect to delay and power. So if this principle isgenerally applied over the whole design it will make it difficult to make achip that is competitive in power/performance compared to ARM/x86 CPUs.
> > > 
> > > 
> > > just the ALU pipeline registers.  we felt that the advantage of being ableto drop to say 500mhz and halve the number of pipeline stages to say 5, andalso be able to ramp up to 1.6ghz and double bavk up to 10 stages, wasworth considering.
> > 
> > What would be the advantage over running at 800Mhz with 5 pipeline stages ?
> 
> i assume you mean fixed 5-pipeline stages.
> the problem is, if you *want* to run at 1.6ghz and have complexpipeline stages, you simply can't: 5 stages are too long, the gatepropagation delay is too large.  the only way to get to 1.6hz is:split those 5 stages into 10 smaller stages.
> the problem with _that_ is: if you then run those 10 stages at say800mhz, or say even 400 mhz or 100mhz (because you are in power-savingmode), you just *massively* increased the latency for completion ofany given operation.
> so even though those 10 stages are so fast (because you are in 14nm)that, at 100mhz, they complete in under 5% of a 100mhz clock rate, ifyou have a fixed 10-stage pipeline you are absolutely screwed, you*have* to have the penalty of the 10-stage pipeline latency.
> screwed 1:  5-stage pipeline FORCES you to ONLY be able to run atBELOW (e.g) 800mhz
> screwed 2: 10-stage pipeline FORCES you to have massive instructioncompletion latency at below (e.g.) 800mhz.
> solution: give every other pipeline stage's registers a "combinatorial bypass".
> un-screwed 1: when speed is above 800mhz, switch off the combinatorialbypass, pipeline becomes 10-stage.
> un-screwed 2: when speed is below 800mhz, switch ON the combinatorialbypass, latency due to slower clock rate DISAPPEARS because allpipelines are now only 5-stage, not 10.

My point is that you will have the same performance for the fixed 5-stage pipeline running @ 800MHz as for the 10-stage pipeline running @ 1600MHz. Why do want to run @1600MHz ?
Actually the fixed 5-stage 800MHz capable pipeline will not be able to run @1600MHz when converted to configurable 5/10-stage pipeline due to the additional delay from the MUXes inserted in the path plus the fact that you likely can't split up each stage in two stages with each exact the half of the delay.
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] cache SRAM organisation
From: Staf Verhaegen @ 2020-03-27  9:40 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDxeyMEQJP_Dwh0TATbPh_gLPa8yiYdj-42yG0xKuQsUxA@mail.gmail.com>

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

Luke Kenneth Casson Leighton schreef op vr 27-03-2020 om 09:16 [+0000]:
> On Fri, Mar 27, 2020 at 9:09 AM Staf Verhaegen <staf@fibraservi.eu> wrote:
> > I still feel you intermix synchronous and write-through in this statement, the above seems to be possible with synchronous SRAMs.
> 
> this would be good.  what would help clarify immensely is if you couldlet us know what options to nmigen Memory class are "supported".then it is really clear.

The nmigen Memory abstraction does not seem to allow a good representation of a write-through SRAM. AFAICS it does not allow to have the output of the read port be changed by what you write on the write port.

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] cache SRAM organisation
From: Luke Kenneth Casson Leighton @ 2020-03-27  9:44 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <6fbfb2a3258be77f4fce69661b283dc31a683f7b.camel@fibraservi.eu>

On Fri, Mar 27, 2020 at 9:25 AM Staf Verhaegen <staf@fibraservi.eu> wrote:

> My point is that you will have the same performance for the fixed 5-stage pipeline running @ 800MHz

no, it won't: it'll be half the clock speed.  it won't be double the
number of computations: it'll be the exact same number of
computations.  therefore, half the speed means half the number of
computations because the *throughput* is the same

when you use "cpufreq-set" to change the clock rate, if the clock rate
is halved, the computer is twice as slow.

yes it's confusing :)

you may be thinking that the pipeline is split into *two halves*, each
half processing separate computations.  this is not the case.


> as for the 10-stage pipeline running @ 1600MHz. Why do want to run @1600MHz ?

because you get double the performance by doing so (with increase in
power consumption of course).

when bypass latches are closed:

* maximum speed: 800 mhz
* stages: 5
* latency (completion time): 1.25e-9 times 5 = 6.25e-9
* throughput: 800 MOPS

when bypass latches are open:

* maximum speed: 1600 mhz (double - appx)
* stages: 10 (double)
* latency (completion time): 6.25e-10 times *10* = 6.25e-9 *EXACTLY THE SAME*
* throughput: 1600 MOPS *DOUBLE THE MOPS*

when bypass latches are open and we run at 800mhz:

* actual speed: 800 mhz
* stages: 10 (double)
* latency (completion time): 1.25e-9 times *10* = 1.25e-8 *HALF THE LATENCY*
* throughput: 800 MOPS *SAME*

so this should show why we want to do this: you get better latency,
which in turn means that there is less pressure on us to have massive
number of Function Units (particularly Branch Prediction Units), to
compensate for huge pipeline lengths.


> Actually the fixed 5-stage 800MHz capable pipeline will not be able to
> run @1600MHz when converted to configurable 5/10-stage pipeline
> due to the additional delay from the MUXes inserted in the path
> plus the fact that you likely can't split up each stage in two stages with
> each exact the half of the delay.

yes, very much agreed.  we will need to do some careful analysis (when
there is time!  this is very much for "revision 2") right down at the
gate level.

also, it may turn out that we simply can't run certain stages at that
kind of speed, or other factors which we haven't anticipated.

in the meantime, however, things like the MUL code (which is based on
a Wallace Multiplier and needs converting to Dadda) have been
*specifically* designed as easy-to-connect combinatorial blocks, with
the "joining" part done as nmigen OO classes that can be *dynamically
replaced* by us, as programmers.

and we are currently using that flexibility to combine *multiple
combinatorial blocks* in a chain... *and* to combine those further
blocks into pipeline-latched blocks.

so if we find that one particular combinatorial chain is too long to
fit into a single 1600mhz pipeline phase, then "oh dear, whoops", all
we do is, find that code, tweak a couple of parameters in a few files,
and the combinatorial chain is now split into additional pipeline
stages.

not, "argh we have a massive redesign to do".


it's a new idea: we just have to experiment, see what happens.
honestly, if we hit even 1200mhz for a first ASIC (in 45 or 28 nm)
that would be absolutely fantastic.

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] cache SRAM organisation
From: Luke Kenneth Casson Leighton @ 2020-03-27  9:46 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <b26f79a2b7dd14ba4ad19240ec9986630f1085ff.camel@fibraservi.eu>

On Fri, Mar 27, 2020 at 9:40 AM Staf Verhaegen <staf@fibraservi.eu> wrote:
>
> Luke Kenneth Casson Leighton schreef op vr 27-03-2020 om 09:16 [+0000]:
> > On Fri, Mar 27, 2020 at 9:09 AM Staf Verhaegen <staf@fibraservi.eu> wrote:
> > > I still feel you intermix synchronous and write-through in this statement, the above seems to be possible with synchronous SRAMs.
> >
> > this would be good.  what would help clarify immensely is if you couldlet us know what options to nmigen Memory class are "supported".then it is really clear.
>
> The nmigen Memory abstraction does not seem to allow a good representation of a write-through SRAM. AFAICS it does not allow to have the output of the read port be changed by what you write on the write port.

urk, that's an important oversight.  we'll need to raise a bugreport
with whitequark about it.

jacob: was that other bug you found with nmigen Memory simulation ever fixed?

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 268] New: nmigen does not seem to support write-through SRAM
From: bugzilla-daemon @ 2020-03-27  9:50 UTC (permalink / raw)
  To: libre-riscv-dev

http://bugs.libre-riscv.org/show_bug.cgi?id=268

            Bug ID: 268
           Summary: nmigen does not seem to support write-through SRAM
           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: ---

http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2020-March/005453.html

we would like to have write-through capability in nmigen Memory.  when
one write-port writes, a read-port *in the same major cycle* is capable
of receiving that same data.

Staf mentions that the SRAM that he is doing makes that data available
on the *falling* edge (not on the exact same cycle).

-- 
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] cache SRAM organisation
From: Luke Kenneth Casson Leighton @ 2020-03-27  9:52 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzvKyPZTGsW53K1RqoOf6N4nxFywBf8gK372M=h00Ctzg@mail.gmail.com>

On Fri, Mar 27, 2020 at 9:46 AM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> On Fri, Mar 27, 2020 at 9:40 AM Staf Verhaegen <staf@fibraservi.eu> wrote:

> > The nmigen Memory abstraction does not seem to allow a good representation of a write-through SRAM. AFAICS it does not allow to have the output of the read port be changed by what you write on the write port.
>
> urk, that's an important oversight.  we'll need to raise a bugreport
> with whitequark about it.

ok raised a bugreport here.

if nothing else, Staf, we just augment the SRAM with external MUX
logic, or we simply use SFFs for the RegFile.  it'll be big, but it
will work.

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] cache SRAM organisation
From: Lauri Kasanen @ 2020-03-27 10:03 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDwf7s=r6bhq6N=VG7QQ1iD4jHYEG6mGvtxL32Uxnhzqwg@mail.gmail.com>

On Fri, 27 Mar 2020 09:44:30 +0000
Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:

> when bypass latches are open and we run at 800mhz:
>
> * actual speed: 800 mhz
> * stages: 10 (double)
> * latency (completion time): 1.25e-9 times *10* = 1.25e-8 *HALF THE LATENCY*

Sorry, but isn't that double the latency?

- Lauri

_______________________________________________
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] cache SRAM organisation
From: Luke Kenneth Casson Leighton @ 2020-03-27 10:10 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20200327120326.785de798331c48bb88b79ade@gmx.com>

On Fri, Mar 27, 2020 at 10:02 AM Lauri Kasanen <cand@gmx.com> wrote:
>
> On Fri, 27 Mar 2020 09:44:30 +0000
> Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:
>
> > when bypass latches are open and we run at 800mhz:
> >
> > * actual speed: 800 mhz
> > * stages: 10 (double)
> > * latency (completion time): 1.25e-9 times *10* = 1.25e-8 *HALF THE LATENCY*
>
> Sorry, but isn't that double the latency?

sigh, yeeees :)

_______________________________________________
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] cache SRAM organisation
From: Staf Verhaegen @ 2020-03-27 10:36 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDwf7s=r6bhq6N=VG7QQ1iD4jHYEG6mGvtxL32Uxnhzqwg@mail.gmail.com>

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

Luke Kenneth Casson Leighton schreef op vr 27-03-2020 om 09:44 [+0000]:
> On Fri, Mar 27, 2020 at 9:25 AM Staf Verhaegen <staf@fibraservi.eu> wrote:
> > My point is that you will have the same performance for the fixed 5-stage pipeline running @ 800MHz
> 
> no, it won't: it'll be half the clock speed.  it won't be double thenumber of computations: it'll be the exact same number ofcomputations.  therefore, half the speed means half the number ofcomputations because the *throughput* is the same
> when you use "cpufreq-set" to change the clock rate, if the clock rateis halved, the computer is twice as slow.

You are right.

> yes it's confusing :)

Yes and no, it is the basic functionality of a pipeline :(
You have the same latency but can have double the number of operations in flight.

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

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