ChanServ changed the topic of #nmigen to: nMigen hardware description language · code at https://github.com/nmigen · logs at https://freenode.irclog.whitequark.org/nmigen
proteus-guy has quit [Ping timeout: 250 seconds]
<_whitenotifier-3> [nmigen-boards] WRansohoff synchronize pull request #57: Add a board file for Gnarly Grey's iCE40UP5K 'Upduino' board - https://git.io/JvMIc
<_whitenotifier-3> [nmigen-boards] WRansohoff commented on pull request #57: Add a board file for Gnarly Grey's iCE40UP5K 'Upduino' board - https://git.io/JvDQb
<_whitenotifier-3> [nmigen-boards] whitequark commented on pull request #57: Add a board file for Gnarly Grey's iCE40UP5K 'Upduino' board - https://git.io/JvDQh
<_whitenotifier-3> [nmigen-boards] whitequark closed pull request #57: Add a board file for Gnarly Grey's iCE40UP5K 'Upduino' board - https://git.io/JvMIc
<_whitenotifier-3> [nmigen/nmigen-boards] whitequark pushed 1 commit to master [+2/-0/±0] https://git.io/JvDQj
<_whitenotifier-3> [nmigen/nmigen-boards] WRansohoff 18315d8 - Add Upduino v1/v2.
Degi has quit [Ping timeout: 246 seconds]
Degi has joined #nmigen
Vinalon has quit [Quit: Leaving]
_whitelogger has joined #nmigen
q3k has quit [Ping timeout: 240 seconds]
q3k has joined #nmigen
Asu has joined #nmigen
<_whitenotifier-3> [nmigen] ZirconiumX opened issue #339: Add rotate left/right - https://git.io/Jvym8
<_whitenotifier-3> [nmigen] whitequark commented on issue #339: Add rotate left/right - https://git.io/Jvymz
<_whitenotifier-3> [nmigen] ZirconiumX commented on issue #339: Add rotate left/right - https://git.io/JvymV
<_whitenotifier-3> [nmigen] whitequark commented on issue #339: Add rotate left/right - https://git.io/Jvym6
<_whitenotifier-3> [nmigen] ZirconiumX commented on issue #339: Add rotate left/right - https://git.io/JvymH
<_whitenotifier-3> [nmigen] whitequark commented on issue #339: Add rotate left/right - https://git.io/JvyY2
<_whitenotifier-3> [nmigen] whitequark edited a comment on issue #339: Add rotate left/right - https://git.io/JvyY2
<_whitenotifier-3> [nmigen] whitequark edited issue #339: Add rotate left/right by constant amount - https://git.io/Jvym8
<_whitenotifier-3> [nmigen-soc] jfng opened pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyOn
<_whitenotifier-3> [nmigen-soc] codecov[bot] commented on pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyOW
<_whitenotifier-3> [nmigen-soc] whitequark commented on pull request #11: csr.periph: add Peripheral base class. - https://git.io/Jvysm
<_whitenotifier-3> [nmigen-soc] jfng synchronize pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyOn
<_whitenotifier-3> [nmigen-soc] codecov[bot] edited a comment on pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyOW
<_whitenotifier-3> [nmigen-soc] codecov[bot] edited a comment on pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyOW
<_whitenotifier-3> [nmigen-soc] codecov[bot] edited a comment on pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyOW
<_whitenotifier-3> [nmigen-soc] jfng commented on pull request #11: csr.periph: add Peripheral base class. - https://git.io/JvyGo
SingularitySurf has joined #nmigen
proteus-guy has joined #nmigen
<SingularitySurf> Hi, sorry I'm new to nMigen and Python as well actually.. '=D What's the best way of saying a= b? c : d in nMigen?
<whitequark> a.eq(Mux(b, c, d))
<SingularitySurf> ah tanks! didn't know about the Mux
<SingularitySurf> :)
<_whitenotifier-3> [nmigen-soc] awygle commented on pull request #11: csr.periph: add Peripheral base class. - https://git.io/Jvycv
<_whitenotifier-3> [nmigen-soc] whitequark commented on pull request #11: csr.periph: add Peripheral base class. - https://git.io/Jvycc
<ZirconiumX> whitequark: Been thinking about how best to give temporary expressions clearer names
<ZirconiumX> Because they crop up a lot in my codebase
<ZirconiumX> And the `(* src = "..." *)` attributes aren't helpful in that situation
<whitequark> in verilog?
<ZirconiumX> Yeah
<whitequark> you could get write_verilog -inline to work
<whitequark> and I believe that's the way forward
<whitequark> unfortunately, verilog is awful garbage, and I largely gave up on that Yosys PR
<ZirconiumX> I was actually wondering about _Namer in back.rtlil, but that works too
<ZirconiumX> Do you think SEDA would accept something in a more gradual approach rather than a giant PR like this?
<whitequark> it's not that big
<whitequark> the problem is that you have to thread the implicit width through the entire expression printer anyways
<whitequark> so you could shrink the PR but probably not that much
<ZirconiumX> I'm also a bit scared of not knowing the rules of Verilog nearly as well as you :P
<whitequark> the other problem is that Claire (rightfully) insists that the PR be tested for several days under a fuzzer
<whitequark> so if it's many small PRs, that cost compounds
<whitequark> I can procure something with 200-odd cores for that though
<ZirconiumX> Actually, this reminds me, what happened to proc_match?
<whitequark> I never got it to generate muxes
<whitequark> there was a conceptual stumbling block and then I got too sick to be productive
<ZirconiumX> Ah, I see. I've at least rebased the branch to latest Yosys master
<ZirconiumX> And after building it and regenerating the Verilog...nothing changes aside from the Yosys sha1.
<ZirconiumX> Am I missing something here?
<whitequark> hmm
<whitequark> it should be on by default
<whitequark> are you sure the yosys binary nmigen runs is the right one?
<ZirconiumX> Yes, the sha1 of the nmigen generated header matches up with that commit
<ZirconiumX> /* Generated by Yosys 0.9+1706 (git sha1 2d51984d, clang 9.0.0-2 -fPIC -Os) */
<ZirconiumX> My input code here is the combinational chess move generator
<ZirconiumX> It's at the point where nextpnr-ecp5 can't route it anymore
<ZirconiumX> Despite using ~20% of an UM-45F
Vinalon has joined #nmigen
<Degi> You can try changing the router
<ZirconiumX> I did, and ended up getting a router2 bugfix ported over to mainline nextpnr
<Degi> In nMigen you can add to the build() nextpnr_opts="--placer sa -r" --router router1/2 to randomize the seed and use placer "sa" and
<Degi> Oh
<ZirconiumX> Also I recommend not using `--placer sa`
<ZirconiumX> HeAP is the default because it's as good as SA while being much faster
<ZirconiumX> Okay, so I dropped some log_asserts in can_inline_cell_expr and it seems to always be returning false
<ZirconiumX> D'oh, I think I know the problem here
<ZirconiumX> nMigen is decorating everything with `(* src *)` attributes which inhibit inlining
<ZirconiumX> ...Oddly it's now inlining the *right hand side* of an expression...
<ZirconiumX> ...
<ZirconiumX> Left hand side
<ZirconiumX> assign (((((((((((~ i_pbq) & i_nbk)) & (~ i_rqk))) >>> 4'ha)) & 62'h3f3f3f3f3f3f3f3f)) & target_mask)) = (((((((((((~ i_pbq) & i_nbk)) & (~ i_rqk))) >>> 4'ha)) & 62'h3f3f3f3f3f3f3f3f)) & target_mask));
<cr1901_modern> that's a legal verilog expr ._.?
<ZirconiumX> No, Verilog isn't quite mad enough to let you do this shit on the left hand side of an assignment
<ZirconiumX> However, isn't this a tautology?
SingularitySurf has quit [Remote host closed the connection]
Sarayan has joined #nmigen
<Vinalon> Does anyone have a feel for what the overhead is like with AsyncFIFO objects? Like, if I want to use one to nest CPU contexts, would it be better to have a separate FIFO for each register or one very wide FIFO to store all of the values?
<Sarayan> Is there a way to say "tick until that signal is 1" in a python sim?
<ZirconiumX> Vinalon: The FIFOs are built out of Memory cells internally: small Memory cells can be turned into flops, but giant Memory cells will be built out of block RAMs
<Vinalon> You can use 'yield <signal>' to get a value in a simulation; maybe something like: https://bpaste.net/H7VA
<Vinalon> so, smaller widths are probably easier for the tools to optimize? Okay, thanks
<Sarayan> Vinalon: Can you have that in a sub-function? I remember the sim not liking to yield in sub-functions, but I may be wrong
<Vinalon> I'm far from an expert, but I think it should work if you call the function with 'yield from funct(...)'.
<Sarayan> errr ok
<ZirconiumX> Yeah, you need to `yield from` subfunctions
<Sarayan> thanks. Bedtime, I guess I'll try tomorrow
<Vinalon> Good luck!
<awygle> i'd guess "lots of small FIFOs" ends up bigger than "one very wide FIFO", depending on a number of factors including whether the synthesis tool can merge flop RAM into dist RAM into block RAM intelligently
<Vinalon> huh - so would a 'smarter' synthesis tool be more likely to do a good job of handling a bunch of smaller ones, or vice-versa? I usually like to lean towards trusting the compiler (or synthesizer) since low-level tools are always improving.
<daveshah> In general combined is going to be better, as that way no information is lost
<Vinalon> so it'd be okay to have a FIFO that's around 1024-2048 bits wide?
<ZirconiumX> Widths like that scare me :P
<Vinalon> that's what I was thinking, but it would be nice...
<daveshah> I can't see any particular problem with that
<Vinalon> Cool, I'll give it a try - thanks for the information!
<daveshah> Report back any bugs!
<daveshah> I'm presuming this isn't on the LP383 btw
<Vinalon> No, I'm hoping to start with an UP5K but I might have to move up to an ECP5...
<daveshah> I think this is going to need an ECP5
<Vinalon> I'm trying to implement a simple RISC-V CPU and this is how I'm planning to store CPU registers for trap handlers.
<daveshah> Is that something that RISC-V even needs?
<ZirconiumX> Yeah, you can spill the registers to stack if you need to
<Vinalon> Not that I'm aware of, but I really like how ARM Cortex-M cores do all of that in hardware
<ZirconiumX> Actually there's a privileged register for that
<daveshah> That's going to be a very inefficient way to do it
<daveshah> It would force the register file to be implemented using FFs rather than BRAM too
<ZirconiumX> Actually a full spill presents a lot of issues
<daveshah> As there will be spare space at the end of BRAM for a typical register file implementation a shadow register approach would be much more efficient
<daveshah> But I'm not sure if RV actually needs this at all
<ZirconiumX> Like environment calls being completely unimplementable
<Vinalon> Oh...yeah, I'm sure that the whole CPU design is very inefficient, considering how little I know about the tooling and FPGA resources.
<Vinalon> I guess I'm barking up the wrong tree with using FIFOs like this, then, thanks.
<ZirconiumX> FIFOs - async FIFOs especially - are for clock-domain crossing
<Vinalon> yeah, my plan was to use different clock edges for reads and writes, but actually, this brings up another question I had about clock domains
<daveshah> The main problem with this approach is that it would need to access every register bit at once
<daveshah> Which forces a much less efficient implementation than using the dedicated RAM
<daveshah> Unless you really know what you are doing using different clock edges is going to cause more problems, and worse performance, than it solves
<Vinalon> oh; it's better to always use the same edge and wait more cycles?
<daveshah> In general, yes
<Vinalon> and here I thought I was being clever...oh well, thanks.
<Vinalon> Anyways, it sounds like if I want to store a couple of sets of 32 32-bit values, 'Memory' objects might be better than 'FIFO's?
<daveshah> The best bet would be to use one deeper memory and just control the upper address bits
Asu has quit [Remote host closed the connection]
<Vinalon> ohhhh, that would make a lot of sense - thanks! I'll have to stop using an Array of Signals for the main CPU registers, then...how's that for an inefficient design? :)
<ZirconiumX> Oh, yeah, that's gonna be awful
<Vinalon> but it still works better than a Python array of Signals with 'for' loops to generate long 'if/elif' blocks in the 'elaborate' method. Sometimes I'm a little slow on the uptake :P
<awygle> :) we're all learning
<Vinalon> The Python syntax makes these sorts of changes really easy, though. Since the '[]' operators work the same, I only needed to change how the objects were initialized.
<Vinalon> ("Array(Signal(x) for i in range(y))" -> "Memory(width=x, depth=y)")