whitequark changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings on Mondays at 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang
lf has quit [Ping timeout: 246 seconds]
lf has joined #amaranth-lang
<_whitenotifier-9> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/nextpnr/compare/662679abfe33...3e15e7707d59
<_whitenotifier-9> [YoWASP/nextpnr] whitequark 3e15e77 - Update dependencies.
phire has quit [Quit: No Ping reply in 180 seconds.]
phire has joined #amaranth-lang
bl0x_ has quit [Ping timeout: 246 seconds]
bl0x has joined #amaranth-lang
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 255 seconds]
Degi_ is now known as Degi
<d1b2> <Nate> curious what happened with libresoc
<whitequark> the project leader acted in a way not fitting someone in a leadership position
<cr1901> Oh whoops. I upgraded my pacman packages... including paramiko to 3.x. Then I upgraded amaranth, did the "pip install -e ." dance, and... it reinstalled 2.x XD.
<cr1901> Heads up for the intersection of ppl using pacman and using amaranth's remote functionality (all 3 of them?)
<josuah> I guess all projects get a tint of their maintainer at times...
<josuah> cr1901: do you now have both packages (in the system + in the local user)?
<josuah> Q: how do one search the clock fequency of sync? I wish to have a delay in millisecond for an IR sensor, and wonder about the best way to get this going.
<josuah> for now, I go with passing a parameter from the top module all the way down to my little NecIrDecoder(clk_freq_hz=1e6)
<josuah> oh wait... I do have acess to platform.default_clk_frequency in here...
<josuah> def elaborate(self, platform): <-- here
<josuah> I am thinking... if the clock might change at runtime, so, not really possible to get an "absolute clock frequency" here
<josuah> it depends on how the module is integrated... Well I'll keep a parameter maybe.
<josuah> bl0x: learn-fpga-amaranth/18_mandelbrot/soc.py does the same it seems
<josuah> UartTx(freq_hz=12*1000000, baud_rate=1000000)
<d1b2> <dave berkeley> Last week I uploaded a dot graph of Stream interconnections using my Stream library. I've added nested Elaboratable objects, simply by recursing from the top module. This, combined with my Stream interconnections gives a very useful diagram. I think this idea might have wider use in Amaranth for generating documentation.
<d1b2> <dave berkeley> note : my code to drive the ulx3s ADC worked first time, thank to the simulation tools in Amaranth.
<d1b2> <Olivier Galibert> The tools are real nice until you hit an Instance, and then you cry because you don't have them anymore 🙂
<josuah> dave berkeley: that looks like working very nice!
<josuah> it feels good when you got the low-level primitives right and are able to compose them and it works
<josuah> one of these "ah-ha!" moments
<d1b2> <dave berkeley> I'm building up a library of Stream based components. With the ADC I was able to just set the clock freq, cpha=1 and cpol=1 and it worked. After a spending some time reading the device datasheet it is clear that it didn't require the usual initialisation codes to be sent. The AD56x8 does, which is where the StreamInit come in. You can define data to be sent to the SPI interface on startup, to initialise all the regs. You just pass
<d1b2> an init list to the ctor.
<d1b2> <VA3TEC-Mikek-14362> Dave! This is absolutely great! Do you have a github repo or anything? I would like to review and try and implement it on my Deca Board. (I completely understand that this a tall order & may take some time, and may not be released yet) I have recently was able to compile and load a similar project with Hans's USB to audio FPGA sound card. https://github.com/amaranth-farm/deca-usb2-audio-interface I did a quick search is this
<d1b2> your CORDIC repo? https://github.com/DaveBerkeley/cordic I will try experimenting and understand your project more next, if that ok. Thanks! MikeK
<josuah> that is where amaranth shines to me: ability to build higher level abstractions without loosing its mind
<josuah> SystemVerilog has its own language for doing things that I'd have to learn in addition to Python
<d1b2> <dave berkeley> My code is all intertwined with a project at the moment. I'll extract the Streams / dot stuff and publish it.
<whitequark> one other possibility is to coordinate with the upstream Streams development such that we don't end up with two subtly incompatible versions of Streams
<d1b2> <dave berkeley> Happy to do that.
<whitequark> let's do that then
<whitequark> my timeline is that until the end of the month approximately I'm still handling an international move
<d1b2> <dave berkeley> hope that goes well. How exciting. I will probably still publish my Streams, just so people can criticise it and give feedback. Clearly we want a single implementation in amaranth.
<whitequark> sounds good
byteit101_ has quit [Remote host closed the connection]
<josuah> > international move
<josuah> that is a big event!
<josuah> do you have to find a location where to rest at the destination?
<josuah> Q: my FGPA is faster than my logic analyser, how do I go about slowing-it up?
<whitequark> hm?
<josuah> whitequark: by "international move" I thought you'd be living in a different country for long?
<whitequark> permanently, yes
<josuah> so you would need to plan everything ahead so it goes smoothly I suppose, unless knowing people in the destination
<josuah> hence the "big event" :)
<whitequark> it's more of a war refugee thing really
<whitequark> not much time for planning, rapidly closing window of opportunity, very little funds
<josuah> wishing you to skip all the VISA problems
<whitequark> that part i have sorted
<whitequark> it's more housing, banking, and healthcare that are a problem
<josuah> I am wishing to do the best I can to help
<whitequark> I'll be fine; it's mostly time consuming
<whitequark> if you'd like to help financially you can contribute to https://patreon.com/whitequark
<josuah> I am a bit on the edge on that side myself. I'll keep it in mind in case I don't know what to do of an unexpected heap of funds :P
<whitequark> understandable
<whitequark> to answer your other question: what's your clock source on the FPGA?
<josuah> whitequark: this is the internal oscillator, the default on the iCE40.
<whitequark> SB_HFOSC?
<josuah> default_clk="SB_HFOSC" indeed
<josuah> I could play with hfosc_div=3 but it does not seems to go beyond that
<josuah> oh neat!
<whitequark> oh yeah, it only goes down to 3
<whitequark> that's a hardware limitation
<whitequark> is 6 MHz still too fast?
<josuah> thank you for going down to pointing me the page though
<josuah> whitequark: I can live with it ofc!
<josuah> I am also glad to check how low it can run, far from important though
<josuah> amaranth/tests/test_hdl_cd.py has some .rename() magic, I'll figure out :)
<josuah> it is the week-end, no rush allowed
<d1b2> <dave berkeley> First pass at putting my Stream code into a package. It needs lots more work, but comments are welcome. https://github.com/DaveBerkeley/streams
<josuah> dave berkeley: thank you!
<josuah> dave berkeley: https://github.com/DaveBerkeley/streams/blob/master/streams/spi.py#L158 <- was there some need to avoid `with m.FSM():` and `with m.State("BUSY"):`?
<josuah> maybe that code predates their introduction
<josuah> interesting use of functions as a way of doing tasks as in Verilog or alike, I was looking for a way to do it
<josuah> I definitely can learn from this
<josuah> A: (to my own question) instead of trying to replace the "sync" clock domain, an introduction to addin an extra clock domain proves itself more effective
pbsds6 has joined #amaranth-lang
pbsds has quit [Ping timeout: 250 seconds]
pbsds6 is now known as pbsds
<d1b2> <VA3TEC-Mikek-14362> Thanks Dave! Very cool! 😁
<d1b2> <VA3TEC-Mikek-14362> Just did a C note. And maybe next month, after that cannot guarantee. Wishing you luck. Mike from Canada.
<whitequark> thank you Mike! this helps a lot