<_whitenotifier-e>
[YoWASP/yosys] ... and 9 more commits.
balrog has joined #amaranth-lang
xiretza[m] has quit [*.net *.split]
whitequark has quit [*.net *.split]
_whitenotifier-e has quit [*.net *.split]
key2 has quit [*.net *.split]
duck2 has quit [*.net *.split]
esden has quit [*.net *.split]
jn has quit [*.net *.split]
xiretza[m] has joined #amaranth-lang
_whitenotifier-e has joined #amaranth-lang
whitequark has joined #amaranth-lang
esden has joined #amaranth-lang
key2 has joined #amaranth-lang
duck2 has joined #amaranth-lang
jn has joined #amaranth-lang
adamgreig[m] has quit [Ping timeout: 240 seconds]
mikolajw has quit [Ping timeout: 250 seconds]
pho has quit [Ping timeout: 250 seconds]
jevinskie[m] has quit [Ping timeout: 240 seconds]
cesar has quit [Ping timeout: 256 seconds]
jfng[m] has quit [Ping timeout: 252 seconds]
RobertJrdens[m] has quit [Ping timeout: 250 seconds]
disasm[m] has quit [Ping timeout: 250 seconds]
xiretza[m] has quit [Ping timeout: 260 seconds]
modwizcode has quit [Ping timeout: 268 seconds]
egg|matrix|egg has quit [Ping timeout: 268 seconds]
whitequark has quit [Ping timeout: 260 seconds]
adamgreig[m] has joined #amaranth-lang
egg|matrix|egg has joined #amaranth-lang
modwizcode has joined #amaranth-lang
disasm[m] has joined #amaranth-lang
jfng[m] has joined #amaranth-lang
whitequark has joined #amaranth-lang
cesar has joined #amaranth-lang
Raito_Bezarius has quit [Ping timeout: 250 seconds]
jevinskie[m] has joined #amaranth-lang
RobertJrdens[m] has joined #amaranth-lang
Raito_Bezarius has joined #amaranth-lang
xiretza[m] has joined #amaranth-lang
xiretza[m] has quit [Read error: Connection reset by peer]
RobertJrdens[m] has quit [Write error: Connection reset by peer]
adamgreig[m] has quit [Read error: Connection reset by peer]
modwizcode has quit [Read error: Connection reset by peer]
jfng[m] has quit [Read error: Connection reset by peer]
jevinskie[m] has quit [Read error: Connection reset by peer]
cesar has quit [Read error: Connection reset by peer]
disasm[m] has quit [Write error: Connection reset by peer]
egg|matrix|egg has quit [Read error: Connection reset by peer]
whitequark has quit [Read error: Connection reset by peer]
egg|matrix|egg has joined #amaranth-lang
<SimonSapin>
would Amaranth be a good fit for simulating something where a Memory is used as a framebuffer, and regularly extracting all of the values to show pixels on an actual display?
whitequark has joined #amaranth-lang
modwizcode has joined #amaranth-lang
pho has joined #amaranth-lang
cesar has joined #amaranth-lang
xiretza[m] has joined #amaranth-lang
mikolajw has joined #amaranth-lang
adamgreig[m] has joined #amaranth-lang
jfng[m] has joined #amaranth-lang
disasm[m] has joined #amaranth-lang
<SimonSapin>
it it looks like `yield` can only read one item at a time from a Memory
RobertJrdens[m] has joined #amaranth-lang
jevinskie[m] has joined #amaranth-lang
<Degi>
Hmh, maybe some internal variable can access it
<Degi>
Though maybe repost that message when everybody is back online
<d1b2>
<TheManiacalLemon> I vaguely remember there being some parameter you can pass in to make all of the memory visible at simulation time, at the expense of it generating a TON of signals
<SimonSapin>
Ah yes. I sent this just before the Matrix bridge came back: Would Amaranth be a good fit for simulating something where a Memory is used as a framebuffer, and regularly extracting all of the values to show pixels on an actual display?
<tpw_rules>
i don't think you will be excited by the speed
<SimonSapin>
yeah I kinda expect that :)
<Degi>
Yes, its pretty slow. Can you yield _array?
<SimonSapin>
I think yielding an Array was also an unsupported operation error
<Degi>
It should be possible to loop through the array
<d1b2>
<bob_twinkles> I did something similar (though using cxxrtl, which also didn't handle memories well at the time). My solution was to just stub out the memory interface and implement a more efficient memory simulation outside of my design
<Degi>
[(yield memory._array[i]) for i in range(depth)] or so
<SimonSapin>
right, so one item at a time
<Degi>
But its still all within one cycle
<d1b2>
<TheManiacalLemon> Could always benchmark that one-liner and see how bad it is
<Degi>
Or (yield Cat(memory._array))
<d1b2>
<bob_twinkles> i.e. the memory bus was published as top-level signals and I could just back it using a native array in C++ + some glue code
<d1b2>
<TheManiacalLemon> You could go with an extra-cursed approach and Cat all the signals in your HDL for the memory by just reaching into _array
<d1b2>
<TheManiacalLemon> then it's just one yield at sim time
<Degi>
Though there is a limit at 65535 signals or so, if I remember correctly
<SimonSapin>
I was gonna ask that
<Degi>
I'd just yield loop over the array. Maybe you can time it to see how bad it is
<SimonSapin>
it looks like python will just happily make integers arbitrary large until it runs out of memory
<SimonSapin>
(1 << (1 << 37)).bit_length() takes a couple seconds
<Degi>
Hmm, the 65535 limitation was somewhere in the toolchain IIRC. Might even work in sim.
<mwk>
wasn't that the limit on a single signal's length?
<SimonSapin>
Cat would create that single signal
<mwk>
oh.
<Degi>
Hmm yeah
<SimonSapin>
though if going that way, one might as well skip the array and directly use slices of the One Big Signal as memory
<agg>
SimonSapin: for something vaguely similar i did what bob_twinkles did and had my actual module drive addr, data, en pins to write to the memory, and then in hardware I wire those to a Memory object but in sim I can capture whatever's being written into a 2d numpy array or whatever was convenient for me to display
<agg>
so instead of dumping the whole state of the framebuf each simulator cycle, I read at most one new update per cycle, and store the state outside the simulator
<cr1901>
Why is there a 65535 limit for a signal width (incl/esp array index)?
<mwk>
cr1901: because ending up with a signal that large is usually a sign that something went horribly wrong, and it also tends to cause downstream failures / performance issues in yosys
<cr1901>
That's fine. It's more "something I never thought about", more than "something I think I actually need"
<mwk>
the motivating case for that was when you write "a << b" in nmigen, and b happens to be a 32-bit signal
<mwk>
this immediately results in a 4-gigabit signal
<mwk>
which will cause all kind of OOMs and integer overflows when yosys attempts to actually synth it
<cr1901>
mwk: Also, I'm confusing 65335 for 2^65535 again in my head :P
<cr1901>
An array w/ 65535 indices uses a 16 bit signal, not a 65535 bit signal :D