Catherine[m] 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 · Matrix #amaranth-lang:matrix.org
GenTooMan has joined #amaranth-lang
GenTooMan has quit [Ping timeout: 256 seconds]
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
<_whitenotifier-9> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/nextpnr/compare/54ffc6cfe7a3...b4ba2c3c47aa
Bluefoxicy has joined #amaranth-lang
<_whitenotifier-9> [YoWASP/nextpnr] whitequark b4ba2c3 - Update dependencies.
GenTooMan has joined #amaranth-lang
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 246 seconds]
Degi_ is now known as Degi
Bluefoxicy has quit [Ping timeout: 260 seconds]
Bluefoxicy has joined #amaranth-lang
pbsds has quit [Quit: The Lounge - https://thelounge.chat]
pbsds has joined #amaranth-lang
Bluefoxicy has quit [Ping timeout: 246 seconds]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Ping timeout: 256 seconds]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
key2 has quit [Quit: Connection closed for inactivity]
Bluefoxicy has quit [Ping timeout: 256 seconds]
Bluefoxicy has joined #amaranth-lang
ebb has quit [Ping timeout: 240 seconds]
leptonix has quit [Remote host closed the connection]
ebb has joined #amaranth-lang
leptonix has joined #amaranth-lang
leptonix has quit [Quit: leaving]
ebb has quit [Quit: Somebody set up us the bomb]
ebb has joined #amaranth-lang
ebb has quit [Max SendQ exceeded]
ebb has joined #amaranth-lang
leptonix has joined #amaranth-lang
povik has joined #amaranth-lang
bob_twinkles has quit [*.net *.split]
tcal has quit [*.net *.split]
_alice has quit [*.net *.split]
electronic_eel has quit [*.net *.split]
Xesxen has quit [*.net *.split]
ktemkin has quit [*.net *.split]
Abhishek_ has quit [*.net *.split]
XgF has quit [*.net *.split]
LoveMHz has quit [*.net *.split]
tcal has joined #amaranth-lang
Abhishek_ has joined #amaranth-lang
LoveMHz has joined #amaranth-lang
_alice has joined #amaranth-lang
electronic_eel has joined #amaranth-lang
Xesxen has joined #amaranth-lang
bob_twinkles has joined #amaranth-lang
ktemkin has joined #amaranth-lang
XgF has joined #amaranth-lang
Chips4MakersakaS has quit [Quit: Idle timeout reached: 172800s]
ebb has quit [Quit: Somebody set up us the bomb]
leptonix has quit [Ping timeout: 246 seconds]
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chaoticryptidz has joined #amaranth-lang
ebb has joined #amaranth-lang
leptonix has joined #amaranth-lang
indy has quit [Ping timeout: 245 seconds]
indy has joined #amaranth-lang
leptonix has quit [Remote host closed the connection]
leptonix has joined #amaranth-lang
wehnelt[m] has quit [Quit: Idle timeout reached: 172800s]
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chaoticryptidz has joined #amaranth-lang
Bluefoxicy has quit [Ping timeout: 246 seconds]
Bluefoxicy has joined #amaranth-lang
zyp[m] has quit [Quit: Idle timeout reached: 172800s]
Bluefoxicy has quit [Ping timeout: 246 seconds]
Bluefoxicy has joined #amaranth-lang
GenTooMan has quit [Ping timeout: 245 seconds]
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chaoticryptidz has joined #amaranth-lang
Wanda[cis] has quit [Quit: Idle timeout reached: 172800s]
<mcc111[m]> Starting with the tutorial.
<mcc111[m]> I see you cannot write to a single signal from both Sync and Comb.
<mcc111[m]> That makes sense, but how does one set a signal which is written to from Sync, but has an "initial" value?
<whitequark[cis]> Signal(reset=...)
<mcc111[m]> Great, thanks
<whitequark[cis]> it actually should have been called Signal(initial=...) since that more accurately represents the actual meaning
<whitequark[cis]> s//`/, s/initial/init/, s//`/
<whitequark[cis]> and we may actually change that
Bluefoxicy has quit [Ping timeout: 260 seconds]
Bluefoxicy has joined #amaranth-lang
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chaoticryptidz has joined #amaranth-lang
<mcc111[m]> So I'm looking at how you're allowed to create multiple clock domains, and you can use any signal as the clock for a domain, meaning I could cause an event to trigger on a signal's rising edge by creating a clk_edge="pos" sync domain for that signal. However, I see claimed in several places in the document I'm reading that a value can't be written to by multiple domains. I think this means that if a signal is written from both my
<mcc111[m]> "rising edge domain" and also from some other domain, that's not allowed. Is that correct? What is the recommended way to do something "on edge" given this limitation?
<crzwdjk> You can store the previous value of the thing and then compare it to the current value
<crzwdjk> e.g. m.d.sync += thing_prev.eq(thing)
<crzwdjk> with m.If(thing != thing_prev): ...
<whitequark[cis]> mcc111: if you are a beginner, most of your designs should be in one clock domain
<whitequark[cis]> you can think of having multiple clock domains roughly the same way as having multiple threads
<whitequark[cis]> there are similar synchronization issues that arise
<whitequark[cis]> however, on an FPGA, you do not have Thread Sanitizer or anything like that. if you don't get synchronization right, you're mostly just screwed in really opaque ways
<josuah> for real-world complex ASICs too I suspect, designers try to keep it all under the same clock domain
<josuah> something like "sysclk", often the same as the central MCU bus
<whitequark[cis]> 'it depends'
<whitequark[cis]> these days you often just can't afford one clock domain, for various reasons (power is an important one)
<whitequark[cis]> but the cost is still high
<whitequark[cis]> even on small MCUs you usually have 3-4 clock domains at least
<whitequark[cis]> a common one is CPU, APB, AHB
<whitequark[cis]> and usually something else, like an RTC clock domain, or an analog one, or USB, or something
<whitequark[cis]> so despite the costs you still see a lot of CDC
GenTooMan has joined #amaranth-lang
<mcc111[m]> OK thanks
<mcc111[m]> <crzwdjk> "You can store the previous value..." <- That makes sense, it seems surprising there isn't a lower level primitive tho, i thought fpga had specific edge detection parts
<adamgreig[m]> it has lots of things designed to run on clock edges, but it's generally a mistake to run those off arbitrary signals that aren't clock signals