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
<charlottia> Honestly, I may be leading you astray! Please let me know how it goes!
<Stevetronics> Hey all! I have a very stupid question that I suspect is a "keyboard -> chair" glitch. I'm just poking around in Amaranth for the first time and working through the counter example in the docs to make sure my toolchain works. I can run the counter testbench if and only if I don't try to write a vcd output; I suspect that I have a version mismatch
<Stevetronics> somewhere because pysim is dying on a TypeError trying to find line breaks. Has anyone seen an error like this?
<charlottia> @vipqualitypost This isn't about making a new CD, but for me one easy way to get a clock going at the same speed as my platform clock when was to set `m.d.comb += spi_clk.eq(~clk)` (well `spi_cs & ~clk`). This way, our rising edge (when we're reading and changing things) is the SPI clock's falling edge.
<whitequark> Stevetronics: that sounds odd; can you post the complete error please?
<d1b2> <vipqualitypost> @chalottia thanks for the tip! that makes sense for alignment
<Stevetronics> whitequark - here's a paste of the error output: https://pastebin.com/Yg8whRb0
<whitequark> oh! can you post your source code please?
<whitequark> the one that produces the error
<Stevetronics> Yep! One sec
<d1b2> <vipqualitypost> it looks like you don't include 'w' parameter
<Stevetronics> Here's the counter itself (with changes from the example - rather than a configurable overflow number on a 16-bit counter, I just made the counter width configurable and overflow at 2^width - 1): https://pastebin.com/E9tUxx1R
<Stevetronics> And the testbench - just added a command line arg to set the width: https://pastebin.com/7BPAV299
<whitequark> and if you use just sim.run without sim.write_vcd you get an error?
<Stevetronics> nope, if I just do sim.run, it completes fine (no output, but all the asserts pass)
<whitequark> oh, I see now
<Stevetronics> Yeah - it errors when run is called in the write_vcd context
<whitequark> I see you're using Python 3.11; which Amaranth version is that?
<whitequark> for Python 3.11 you need Amaranth from git for the variable namer to work
<whitequark> there are actually two issues you're hitting; it shouldn't fail like that if it can't extract a variable name
<whitequark> both are fixed in git
<Stevetronics> aha - I grabbed the pip version ('amaranth[builtin-yosys]') about two hours ago
<whitequark> I recommend the git one; I think there's instructions for that in the docs as well
<Stevetronics> Got it - the docs are very clear, so I should be able to test in just a minute.
<Stevetronics> worked like a charm - thanks for the heads up!
Stevetronics has quit [Ping timeout: 246 seconds]
Stevetronics has joined #amaranth-lang
Stevetronics has quit [Ping timeout: 246 seconds]
pbsds has quit [Quit: The Lounge - https://thelounge.chat]
anubis has joined #amaranth-lang
Degi has joined #amaranth-lang
pbsds has joined #amaranth-lang
<FL4SHK> any news on the implementation of the interfaces RFC?
<whitequark> expect by today or tomorrow (depending on timezone)
anubis has quit [Ping timeout: 246 seconds]
anubis has joined #amaranth-lang
anubis has quit [Remote host closed the connection]
anubis has joined #amaranth-lang
key2 has quit [Quit: Connection closed for inactivity]
anubis has quit [Quit: Leaving]
anubis has joined #amaranth-lang
anubis has quit [Remote host closed the connection]
anubis has joined #amaranth-lang
Degi has quit [Ping timeout: 246 seconds]
Degi has joined #amaranth-lang
anubis has quit [Remote host closed the connection]
anubis has joined #amaranth-lang
anubis has quit [Remote host closed the connection]
anubis has joined #amaranth-lang