whitequark changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://libera.irclog.whitequark.org/nmigen
<_whitenotifier-1> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JaG0b
<_whitenotifier-1> [YoWASP/nextpnr] whitequark fbedbc9 - Update dependencies.
emeb_mac has quit [Quit: Leaving.]
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 264 seconds]
Degi_ is now known as Degi
chiastre has quit [Ping timeout: 252 seconds]
chiastre has joined #nmigen
sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #nmigen
<vup> You can, I said you cannot depend on a git version on pypi
<lkcl> i've seen requirements.txt list specific git revision numbers, i'm reasonably sure i've seen symbiflow's requirements.txt for pip3
<lkcl> ah no
<lkcl> yes, because pypi does not contain git repositories, it contains [totally insecure, non-signed] release archives
<lkcl> (which does exactly what is required)
<lkcl> FL4SHK, if you want, *when* the reset signal goes high, for a given Signal's reset *value* to be non-zero, use "reset={thevalue}"
<lkcl> acdc = Signal(name="wholelotofrosie", reset=4239566)
bvernoux has joined #nmigen
<FL4SHK> lkcl: I am aware of `reset=whatever`
<FL4SHK> lkcl: did you hear that I got the packed records and packed arrays work?
<FL4SHK> It's super exciting!
<lkcl> FL4SHK, nice. love to see an example online somewhere.
<FL4SHK> lkcl: does my source code count?
<lkcl> of course! :)
<FL4SHK> It uses a similar interface to `Record` and `Layout`, but it's slightly different.
* lkcl on a call in 8 minutes
<lkcl> ahh btw, is this for Packed SIMD?
<FL4SHK> Is it?
<FL4SHK> It's for anything that needs a record.
<lkcl> Vector (parallel) ALU operations?
<lkcl> VectorAddBus looks like it is
* lkcl need to prepare for a call shortly
<lkcl> FL4SHK, there's 18 months behind this https://libre-soc.org/3d_gpu/architecture/dynamic_simd/
* lkcl afk
<FL4SHK> lkcl: this isn't specificially for SIMD stuff.
kaucasus has joined #nmigen
<kaucasus> Hi folks, I'm doing my thesis on nmigen. I've got a small question. Currently trying to make a demo to show to the promotors. This means that my code should run on a FPGA dev board. We've made a board file, and uploading a blinky works. Now we want to do the following: depending on the
<kaucasus> * Sorry, found out shift+enter didn't work
<kaucasus> * depending on the state of a switch, either select the regular, default clock, or make the clock a pushbutton, so that we can "step" through our demo so that it doesn't run at full speed
<kaucasus> Is that possible to do? We're currently very new, and it isn't directly clear how to do it.
<FL4SHK> kaucasus: can't you use an enable?
kaucasus has quit [Quit: Client closed]
<FL4SHK> oh
kaucasus has joined #nmigen
<FL4SHK> kaucasus: can't you use an enable of some sort?
<FL4SHK> I'm not sure if you need to handle switch bounce or not.
<kaucasus> Probably! But how would you go on to do that? Because as far as I understand, nmigen uses the clock resource defined in your boardfile for the sync domain
<FL4SHK> Do you need to specifically generate a clock?
<kaucasus> not really, we just wanna step through the code, or choose free running otherwise
<FL4SHK> Stepping through the code could, potentially, be done with `if (button down this cycle && button up last cycle)`
<FL4SHK> I don't know if you need ot handle switch bounce or not
<FL4SHK> you may havve to handle that as well.
<kaucasus> Yeah, that'll probably be necessary
<FL4SHK> I think ti depends on your dev board.
<kaucasus> But do we need to structure our code differently then? Because it's not entirely clear to me how you'd change your regular sync code/domain to using the button
<FL4SHK> instead of `@(posedge button)` it becomes `@(posedge clk) if (button active)`
<FL4SHK> I don't know how you even do `@(posedge button)` in nMigen.
<FL4SHK> It's easy in, say, SV.
<miek> you can put all of your code in a Module and wrap it with EnableInserter
<kaucasus> So we need to alter the verilog behind the fact? Because currently it's very nice we can just use the integrated tools to directly synthesise and make a bitfile without futzing around
<FL4SHK> I don't think you have to alter the Verilog.
<FL4SHK> synth tools generally want to know which of your signals as clock signals.
<FL4SHK> Simulation is probably the only place you can do `@(posedge button)`
<vup> you can just create a new `ClockDomain("name")`, add it to `m.domains` and then drive it from the button: `m.d.comb += ClockSignal("name").eq(the_button_signal)`, after that you can use `m.d.name += ...` to use your new domain
<kaucasus> ahhh yeah, that could work!
<FL4SHK> vup: so how does that handle clock constraints in the synth tool?
<vup> FL4SHK: you can use `platform.add_clock_constraint(domain.clk, frequency)` to add a clock constraint
<FL4SHK> I see.
<FL4SHK> vup: what about how it's not a consistent clock?
<vup> unless you plan on sending the clock to a PLL it should not really matter
<vup> (you of course want to specify the maximum frequency you think you will get)
<FL4SHK> Ah, I see. This is news to me
<vup> most tools also support specifying jitter, but I don't think nmigen has abstractions for that currently
<whitequark> you don't want to ever use `@(posedge button)`
<whitequark> you want to debounce first, otherwise you'll get unpredictable results
<saki> What's the suggestion manner for setting up PLLs/clock management?
<whitequark> you can use `Instance` to invoke FPGA primitives directly
<saki> Okay, that's where I was going, but wasn't sure if there was something baked in I missed. Thanks!
bvernoux1 has joined #nmigen
bvernoux has quit [Ping timeout: 260 seconds]
bvernoux1 has quit [Quit: Leaving]
bvernoux has joined #nmigen
peeps[zen] has joined #nmigen
peepsalot has quit [Ping timeout: 252 seconds]
bvernoux1 has joined #nmigen
bvernoux has quit [Ping timeout: 252 seconds]
bvernoux has joined #nmigen
bvernoux1 has quit [Ping timeout: 252 seconds]
<kaucasus> Hey hey, I'm still a bit stuck with my problem from earlier. Currently I've got this as the minimal code: https://pastebin.com/zdxRXE6Q
<kaucasus> Obviously it doesn't quite work, but I'm having trouble "changing" the sync domain depending on the value a switch has
<vup> unless you specify `local=True` when you create a `ClockDomain` they are global
<vup> so to achieve what you are going for the easiest option is probably to create two clock domains (+ the default sync once)
<vup> one clock domain that is fed by the button
<vup> and one clock domain that depending on the state of the switch is either fed by the button clock domain or the default sync domain
<vup> finally you can swap out which clock domain corresponds to `sync` for the `Blinky` module by using `DomainRenamer` (like `DomainRenamer("button_or_default_sync")(Blinky())`)
<kaucasus> and should I then change the submodule (in this case the Blinky class) that every call to m.d.sync be replaced to m.d.button_or_sync?
<vup> thats would be the alternative to using `DomainRenamer`, but using `sync` + `DomainRenamer` is more commonly used
<kaucasus> ahhhh DomainRenamer! That sounds like the class I would be looking for! Thanks, still new to nmigen and finding out about all the internals
bvernoux1 has joined #nmigen
bvernoux has quit [Ping timeout: 252 seconds]
dcallagh has quit [Ping timeout: 268 seconds]
dcallagh has joined #nmigen
whitequark has quit [Ping timeout: 268 seconds]
whitequark has joined #nmigen
pho has quit [Ping timeout: 246 seconds]
RobTaylor[m] has quit [Ping timeout: 246 seconds]
RobTaylor[m] has joined #nmigen
pho has joined #nmigen
jevinskie[m] has quit [Ping timeout: 268 seconds]
jamwaffles[m] has quit [Ping timeout: 250 seconds]
jevinskie[m] has joined #nmigen
jamwaffles[m] has joined #nmigen
Chips4Makers[m] has quit [Ping timeout: 264 seconds]
programmerjake has quit [Ping timeout: 250 seconds]
Chips4Makers[m] has joined #nmigen
programmerjake has joined #nmigen
Niklas[m] has quit [Ping timeout: 268 seconds]
Niklas[m] has joined #nmigen
kaucasus has quit [Quit: Client closed]
RobTaylor[m] has quit [Ping timeout: 268 seconds]
RobTaylor[m] has joined #nmigen
programmerjake has quit [Ping timeout: 268 seconds]
programmerjake has joined #nmigen
bvernoux1 is now known as bvernoux
urja has quit [Read error: Connection reset by peer]
XgF has quit [Remote host closed the connection]
XgF has joined #nmigen
urja has joined #nmigen
emeb_mac has joined #nmigen
RobTaylor[m] has quit [Ping timeout: 246 seconds]
RobTaylor[m] has joined #nmigen
bvernoux has quit [Quit: Leaving]
RobTaylor[m] has quit [Ping timeout: 246 seconds]
RobTaylor[m] has joined #nmigen
peeps[zen] is now known as peepsalot
sm2n_ has joined #nmigen
sm2n has quit [Ping timeout: 260 seconds]
lf has quit [Ping timeout: 252 seconds]
lf has joined #nmigen
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]