whitequark[cis] changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings: Amaranth each Mon 1700 UTC, Amaranth SoC each Fri 1700 UTC · play https://amaranth-lang.org/play/ · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
FFY00_ has joined #amaranth-lang
FFY00 has quit [Ping timeout: 245 seconds]
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 255 seconds]
Degi_ is now known as Degi
Stary has quit [Quit: ZNC - http://znc.in]
Stary has joined #amaranth-lang
buganini has joined #amaranth-lang
buganini has quit [Ping timeout: 260 seconds]
john has quit [Read error: Connection reset by peer]
john has joined #amaranth-lang
frgo has joined #amaranth-lang
frgo_ has quit [Read error: Connection reset by peer]
whitequark[m] has quit [Quit: Idle timeout reached: 172800s]
d_olex has quit [Remote host closed the connection]
frgo_ has joined #amaranth-lang
frgo has quit [Read error: Connection reset by peer]
john has quit [Read error: Connection reset by peer]
john has joined #amaranth-lang
d_olex has joined #amaranth-lang
d_olex has quit [Remote host closed the connection]
d_olex has joined #amaranth-lang
buganini has joined #amaranth-lang
Maja_ has joined #amaranth-lang
buganini has quit [Ping timeout: 260 seconds]
john has quit [Read error: Connection reset by peer]
john has joined #amaranth-lang
buganini has joined #amaranth-lang
buganini has quit [Ping timeout: 244 seconds]
cr1901_ is now known as cr1901
buganini has joined #amaranth-lang
Xesxen has quit [Ping timeout: 252 seconds]
feldim2425_ has joined #amaranth-lang
feldim2425 has quit [Ping timeout: 252 seconds]
Xesxen has joined #amaranth-lang
Psentee has quit [Ping timeout: 252 seconds]
Psentee has joined #amaranth-lang
maikmerten[m] has joined #amaranth-lang
<maikmerten[m]> not being very familiar with Python, just learning Amaranth - it's still fun to tinker around! Here's a 32-bit RISC-V ALU I cobbled together: https://paste.mozilla.org/XYYykbMy (around ~480 iCE40 cells)
<maikmerten[m]> (most likely questionable Python and/or Amaranth style)
<cr1901> Looks good to me. One trick you can do to save space is implement signed LT in terms of LTU by inverting the top bit of both inputs to the LTU unit when treating the inputs as signed.
<cr1901> But measure whether it saves space. It does save space in my particular RV impl, but I've seen it be a net negative.
<maikmerten[m]> I think I already have an equivalent-ish approach for lt and ltu
<maikmerten[m]> (basically, lt and ltu are derived from a 33-bit subtraction result, with bit 33 being the "underflow" bit)
<cr1901> line 87, is xor[31] equivalent to sub[31]?
<cr1901> Oh wait, nevermind
<cr1901> I see what you're doing now
<maikmerten[m]> that's good, because I just cargo-culted that approach from some blog post I read like ~8 years ago ;-)
<maikmerten[m]> ah, found it again: http://retroramblings.net/?p=458
<maikmerten[m]> hmm... somewhat surprised my line 129 works: "ack = (~shift) | (shift & shift_finished)". I assumed the correct way would be to "ack = Signal(1)", then do a "comb += ack.eq(...)"
<maikmerten[m]> (actually, not that surprising thinking about it, given that the expression will also generate a signal)
<maikmerten[m]> (and it means I can compactify the code here and there)
buganini has quit [Ping timeout: 276 seconds]
jfng[m] has joined #amaranth-lang
<jfng[m]> this paper describes the ALU of NIOS 2, with resource-saving techniques specific to fpga
<jfng[m]> iirc, the ALU of Boneless also uses similar ideas
<maikmerten[m]> oh, interesting paper, thanks for sharing!
<maikmerten[m]> actually, given I already compute "xor = self.I_op1 ^ self.I_op2", I can also replace the "self.I_op1 == self.I_op2" with "~xor.any()", I guess
buganini has joined #amaranth-lang
buganini has quit [Ping timeout: 252 seconds]
<whitequark[cis]> <maikmerten[m]> "not being very familiar with..." <- the only thing that i really find objectionable is `comb = m.d.comb`
<whitequark[cis]> `m.<anything>` should be viewed as syntax, like `if` or `else`
d_olex has quit [Read error: Connection reset by peer]
d_olex has joined #amaranth-lang
ldcd[m] has joined #amaranth-lang
<ldcd[m]> Would an AXI adition to amaranth-soc be an RFC or just a PR?
<ldcd[m]> And would it be expected to have feature parity with wishbone (IE Decoder+Arbiter+SRAM?) or would an interface definition and CSR bridge be acceptable as a starting point?
d_olex has quit [Read error: Connection reset by peer]
d_olex has joined #amaranth-lang
<tpw_rules> ldcd[m]: fwiw i have rather janky interface defs and CSR bridges. i need to update them to streams. they're also designed for the weird AXI3/4 hybrid in Cyclone V
d_olex has quit [Read error: Connection reset by peer]
d_olex has joined #amaranth-lang
<jfng[m]> <ldcd[m]> "Would an AXI adition to amaranth..." <- it would need to go through an RFC
<jfng[m]> <ldcd[m]> "And would it be expected to have..." <- sram and a csr bridge could be done later, i think
frgo has joined #amaranth-lang
frgo_ has quit [Read error: Connection reset by peer]
vegard_e[m] has joined #amaranth-lang
<vegard_e[m]> you might want to head over to the matrix channel -- people are responding to you there but the bridge is currently only working in one direction so the replies are not getting here
<ldcd[m]> Right
zyp[m] has joined #amaranth-lang
<zyp[m]> I would argue just the interface/signature alone is probably a large enough scope for a RFC
AledCuda[m] has joined #amaranth-lang
<AledCuda[m]> Ok, CSR bridge is my primary use case so I'm planning on doing that anyways, and decoder turned out to not be quite as much of a pain as I thought, arbiter shouldn't be too bad
<AledCuda[m]> Should I open one RFC for Interface+Signature+Decoder+Arbiter (ie an AXI directory), and one for CSR Bridge and SRAM, or would one RFC for both be acceptable
<AledCuda[m]> or split Interface+Signature and Decoder+Arbiter
<jfng[m]> <zyp[m]> "I would argue just the interface..." <- agreed
<zyp[m]> if the components follow the design of the wishbone equivalents, with the main difference being that they have a different kind of bus attribute, I'm not sure they really need their own RFCs
<AledCuda[m]> They do
<AledCuda[m]> Well thats what I'm attempting
<AledCuda[m]> But I'm happy to open an RFC if it means more eyes in review
<jfng[m]> for arbiter and decoder, it will probably be easier to directly review the implementation
<AledCuda[m]> Ok
<AledCuda[m]> I've seen mention of meetings a few times, do those still occur and are they open?
<jfng[m]> we only do soc meetings when there are items on the agenda
<jfng[m]> which are mostly RFCs, but also PRs if needed
<AledCuda[m]> ok
<AledCuda[m]> I'll try and open a draft PR with an implementation of each of the discussed parts in separate commits this weekend and then proceed however you see fit
<jfng[m]> implementation PRs probably won't be reviewed before an RFC for AXI interfaces is accepted
<AledCuda[m]> Ok, sounds good
balrog_ is now known as balrog
tpw_rules[m] has joined #amaranth-lang
<tpw_rules[m]> test, the bridge seems to kinda be working okay?
<tpw_rules> i can see myself both ways
Wanda[cis] has joined #amaranth-lang
<Wanda[cis]> oh hey, nice
<tpw_rules> hi Wanda[cis] i see you on both irc and matrix
<tpw_rules> actually maybe it was meant the discord bridge
<Wanda[cis]> yeah it's the discord bridge that was (and is) broken
<Wanda[cis]> so no news here
<tpw_rules[m]> ah, sorry
<tpw_rules[m]> would definitely be interested to see and help review an interface prototype if you want to do that before the RFC
<tpw_rules> AledCuda[m]: ^
<AledCuda[m]> Alright, I'll give you a ping when I push that
<tpw_rules> AledCuda[m]: idk if you saw my link with the bridge situation but i've done some of this before (not updated for streams yet) https://github.com/tpwrules/papa_fpga/blob/main/design/amaranth_top/amaranth_top/axi3_csr.py
john has quit [Read error: Connection reset by peer]
john has joined #amaranth-lang
<AledCuda[m]> Yup, a reference is appreciated, I'm explicitly targeting AXI4
<tpw_rules> ah, i did AXI3 + one AXI4 enhancement cause that's what that SoC used
__DuBPiRaTe__ has joined #amaranth-lang
__DuBPiRaTe__ has quit [Remote host closed the connection]