[libre-riscv-dev] [Bug 217] create a "ring" system which allows pad locations to be specified conveniently

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Wed Mar 18 23:39:30 GMT 2020


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

--- Comment #42 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jock Tanner from comment #41)
> (In reply to Luke Kenneth Casson Leighton from comment #40)
> > (In reply to Jock Tanner from comment #39)
> > looks great to me.  the docstring quality is excellent.
> 
> When I enter 3 quotes under a 'def', Pycharm creates a docstring template
> for me. I only have to fill in the human-readable descriptions.

niiice.

> > 
> > i did my usual "make myself go over the code by making
> > whitespace cleanups" i find it's a good way to "review" by making my fingers
> > "do" if you know what i mean.  you'll need to do a git pull, there.
> 
> I see. Your style is valid, but it eats up more space than mine (newline
> after and before parentheses aka 'hanging indent').

i tend to make a new function or use an intermediary variable if that happens.

am not a fan of massive.selfexplanatory.variablenames.and.functionnames.

much better to have a short name and a good comment.

> I think hanging indent
> 
> - is better than smaller indent when it comes to cramping things up,
> 
> - has a consistent look in regard of other multiline expressions (split
> strings, lists, list/dict comprehensions, et c.)

if you have good reason to use them i.am all in. bear in mind i keep sometimes
EIGHT 80x63 xterms open at once onscreen side by side (now 12 with a 4k screen)
so small functions and the 80 char limit is really important.

> > so the next two things, i think:
> > 
> > 1. can you make a function which creates the BLOCKAGE "things"?
> >    then call it from add() and sub().  defaults to 2,3,4 however allow
> >    it to be parameterisable.
> 
> What about the existing 'get_layer()'?

nuts. cant see it.  on phone. can you send yrl to gitweb thing?

> > 2. add() and sub() are near-duplicates and to some extent so is alu16.
> >    could you make a function which both add() and sub() call, and break
> >    out pieces for alu16()?  for example, the "find and place" add and sub
> 
> I think it's doable. The code indeed is very repetitive.

yes. i cutpaste it in a hurry

> I have two questions about our current setup.
> 
> 1. Is it OK that we have separate adder and subtractor?

this is just an experiment, from nmigen alu_hier.py example.

> 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?


> 2. Did we lost 'op' pin?

yes, well spotted :)  that should come in at top.

clock on the side just for fits and giggles.

check ringoscillator benchs or grep -r benchs createpin to find examples.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list