<d1b2>
<ld;cd> Newb question here, how do I request say 8 LEDs as an 8bit unsigned signal instead of just individually?
<d1b2>
<ld;cd> python In [28]: class Test(n.Elaboratable): ...: def elaborate(self, platform): ...: leds = [platform.request("led", i) for i in range(8)] ...: timer = n.Signal(20) ...: m = n.Module() ...: m.d.sync += timer.eq(timer + 1) ...: m.d.comb += n.Cat(*[i.o for i in leds]).eq(timer[-1]) ...: return m
<d1b2>
<ld;cd> have tried a couple variations on that with different forms of success
<d1b2>
<ld;cd> oh that did do what I want
<d1b2>
<ld;cd> is there a recommended cleaner why of doing that?
jaseg has quit [Ping timeout: 244 seconds]
<d1b2>
<esden> the intuitive thing would be to just have leds = platform.request("led") so that leds ends up with the "led" bundle. 🙂
<d1b2>
<esden> but that might not work not sure
<d1b2>
<ld;cd> lets find out
<d1b2>
<ld;cd> ah and then Repl is the equivalent of the {} verilog forms
<d1b2>
<ld;cd> nope, it just requests the zeroth one looks like
<d1b2>
<TiltMeSenpai> I think you want Cat
<d1b2>
<esden> ohh ok humm
jaseg has joined #nmigen
<d1b2>
<esden> @TiltMeSenpai isn't it what @ld;cd is doing in the example?
<d1b2>
<TiltMeSenpai> oh that is
<d1b2>
<TiltMeSenpai> ignore me
<d1b2>
<TiltMeSenpai> just woke up from a little nap lol
<d1b2>
<esden> hands @TiltMeSenpai a coffee and cookie
<d1b2>
<ld;cd> wonder how discord format tags show up on IRC
electronic_eel has quit [Ping timeout: 264 seconds]
electronic_eel_ has joined #nmigen
<d1b2>
<ld;cd> is this an alright way to conditionally add a resource: python class ECP55GEVNPlatform(LatticeECP5Platform): .... def __init__(self, *, VCCIO1="2V5", VCCIO6="3V3", FTDI_UART=False, EXTCLK_FREQ = None, **kwargs): .... if FTDI_UART: self.resources[('uart', 0)] = UARTResource(0, rx="P2", tx="P3", attrs=Attrs(IO_TYPE="LVCMOS33", PULLMODE="UP"))
<whitequark>
esden: platform.request(x) is the same as platform.request(x, 0)
<whitequark>
in migen this used to return consecutive resources but that's kind of bad because you might request resources in different parts of your code and then at none of these places it is obvious which one you get
<d1b2>
<ld;cd> for context the ECP5EVN has a second UART that isn't wired up by default
<whitequark>
what do you mean by "not wired up"?
<d1b2>
<ld;cd> like
<d1b2>
<ld;cd> you need to swap to zero ohm resistors and if you have one of the bad runs of the eval board reprogram the ftdi eeprom
<whitequark>
in general we don't add __init__ arguments in cases where that would *add* a resource
<whitequark>
it's only for *choosing* between different options, eg IO voltages
<whitequark>
so: just add the UART, add a comment about it too
<whitequark>
some day we'll figure out some way to have sphinx document those things
<d1b2>
<ld;cd> alright
<whitequark>
but for now a comment works
<d1b2>
<ld;cd> Theres also a similar thing with an unpopulated clock footprint, should I add it as a resource and then leave the frequency undefined?
<d1b2>
<ld;cd> or pipe a frequency through init
<d1b2>
<ld;cd> its nominally supposed to be 50Mhz but there are other modules you can add in theory
<whitequark>
leave out Clock()
<whitequark>
Clock() is just a shortcut for platform.add_clock_constraint that's automatically applied
<d1b2>
<ld;cd> alright, cool
<d1b2>
<esden> @whitequark right I do remember that the request used to iterate over the resources. That is not great, I agree. In this case I would somehow expect that if I don't provide an id I can get a Signal(<led count>). (maybe even have a way to provide a range even to request certain set of led would be great) But I guess the way it is is fine too. Definitely better than getting a random led because some other part of the code already requested one. 😄
jock-tanner has joined #nmigen
<_whitenotifier-f>
[nmigen-boards] ld-cd opened pull request #70: Add SPI Flash, UART, and EXTCLK peripherals to ECP5_EVN - https://git.io/JJeh6
<d1b2>
<ld;cd> oh thats neat
jeanthom has joined #nmigen
<whitequark>
ld;cd: can you explain what you meant by "left out the QUADSPI mode"?
<whitequark>
you've provided wp and hold pins; that creates the spi_flash_4x resource on its own
<d1b2>
<ld;cd> oh ok
<d1b2>
<ld;cd> in that case I did not leave out QSPI, sorry for the confuision
<d1b2>
<ld;cd> sorry, thats why I was so confused about the QSPI/normal SPI earlier
<_whitenotifier-f>
[nmigen-boards] ld-cd commented on pull request #70: Add SPI Flash, UART, and EXTCLK peripherals to ECP5_EVN - https://git.io/JJejv
<whitequark>
yeah this should be documented better
<_whitenotifier-f>
[nmigen-boards] whitequark closed pull request #70: Add SPI Flash, UART, and EXTCLK peripherals to ECP5_EVN - https://git.io/JJeh6
<_whitenotifier-f>
[nmigen/nmigen-boards] whitequark pushed 1 commit to master [+0/-0/±1] https://git.io/JJejI
<jock-tanner>
and i getting: assert defs[sig] is self
<jock-tanner>
another popular gotcha?
<ktemkin>
jock-tanner: for bidirectional pins, you'll wind up with a tri-state triple
<ktemkin>
.i, .o, and .oe
<ktemkin>
you'll want to use .o for output, and .oe to decide when the pin is being driven by the signal you assign to .o
<jock-tanner>
ktemkin thank you, it all makes sense now
<_whitenotifier-f>
[nmigen] whitequark commented on issue #414: Py 3.7: ModuleNotFoundError: No module named 'importlib_resources' - https://git.io/JJvYO
<_whitenotifier-f>
[nmigen] whitequark commented on issue #414: Py 3.7: ModuleNotFoundError: No module named 'importlib_resources' - https://git.io/JJvY3
<_whitenotifier-f>
[nmigen] smunaut commented on issue #414: Py 3.7: ModuleNotFoundError: No module named 'importlib_resources' - https://git.io/JJvYi
<_whitenotifier-f>
[nmigen] smunaut closed issue #414: Py 3.7: ModuleNotFoundError: No module named 'importlib_resources' - https://git.io/JJvLU
jock-tanner has quit [Ping timeout: 240 seconds]
jock-tanner has joined #nmigen
<jock-tanner>
no luck with bidir today :`(
<jock-tanner>
Warning (12161): Node "pin_sdram_0__dq:pin_sdram_0__dq|altiobuf_bidir:sdram_0__dq|dataio_b[0]" is stuck at GND because node is in wire loop and does not have a source
FFY00 has quit [Quit: dd if=/dev/urandom of=/dev/sda]
FFY00 has joined #nmigen
<jock-tanner>
i've built a reduced example of it, with dq.oe tied to the vcc, but quartus still says "wire loop"
<tpw_rules>
is there a way to clear a SyncFIFOBuffered?
<whitequark>
you can reset it!
<whitequark>
use a ResetInserter
<tpw_rules>
will that reset just it?
<whitequark>
did you accidentally a word?
<tpw_rules>
no like if i wrap the fifo in a resetinserter and use that reset signal, just the fifo will be reset and the rest of the circuit will run unaffected?
<d1b2>
<ld;cd> Has there been any thinking about how to handle the PS7 (the interface between the fabric and the arm cores/other hard blocks) on the zynqs in anything like nmigen
<d1b2>
<ld;cd> I'd kind of like to port nmigen to my pynq so I don't have to fight with vivado as much
<FL4SHK>
tfw there's now a PS7. I thought those only went up to 5.
<daveshah>
there's now a PS9 (versal)
<daveshah>
PS8 is UltraScale+
<FL4SHK>
I was making a joke regarding the Playstation
<d1b2>
<ld;cd> In an ideal world it would be a non mandatory part of the design but vivado will refuse to synth if you don't instantiate it, and it's the canonical way to get clocks/resets
<d1b2>
<ld;cd> I'm stuck with my dinky little 7 series zc7020 for the moment
<d1b2>
<ld;cd> Or maybe it's an xc7z020, I always get xilinx part numbers jumbled, too many consonants
<agg>
ld;cd can't you just instantiate it with an Instance? I've not used zyncs but had no issue doing the equivalent stuff on the intel SoCs
<agg>
(I've heard it's a lot more fiddly with the zyncs though...)
<d1b2>
<ld;cd> So yeah you could just black box it and instantiate it (although it's a bit of a pain)
<d1b2>
<ld;cd> But I wouldn't really know how to organize a port of the proper nmigen flow because it's kind of in this strange place between a hard ip block, and an io port (idk how altera parts work, but the PS7 generally provides all the clocks for example)
<d1b2>
<ld;cd> But I wouldn't really know how to organize a port of the proper nmigen flow because it's kind of in this strange place between a hard ip block, and an io port (idk how altera parts work, but the PS7 generally provides all the clocks for example)
<d1b2>
<ld;cd> Heckin networking
<agg>
Oh, to sort of provide it as part of the Platform rather than just instantiating in one design?
<d1b2>
<ld;cd> I'm not really sure what the nmigeny way to do it would be
<d1b2>
<ld;cd> Yeah that's what I was thiniking, but it's also fairly configurable
<agg>
If you just want to get it working in your project I'd definitely just make an instance of the relevant modules and it's easy enough to wire those up to your clock domains and axi controllers and whatever else
<agg>
You could even package those instances up as a python library for reuse
<agg>
I don't know how you could integrate it into the platform itself so that eg it works as a default clock though
jeanthom has joined #nmigen
<d1b2>
<ld;cd> Yeah so I can do it on a per project basis, but I'd like to tackle adding it as a proper platform, as so far the zynqs parts have been left behind by the likes of nmigen and litex
<d1b2>
<ld;cd> And they're pretty common in education
<d1b2>
<ld;cd> They also have the advantage of having a hard ddr3 controller and relatively cheap boards with a gig or 2 of ram on them that would be nice for people who want to play with soc stuff
<vup>
ld;cd fwiw anuejn and me have been playing around with PS7 in nmigen a lot