Ancestors

Toot

Written by Wolf480pl on 2025-01-12 at 14:01

Do I remember correctly that the way Block RAM works in Spartan-3E is

you write it as

mem_out <= mem[addr]

but in reality it's the address that gets written synchronously to the read port, and the RAM takes most of the following cycle to give you an output that behaves like a wire?

=> More informations about this toot | More toots from wolf480pl@mstdn.io

Descendants

Written by Wanda on 2025-01-12 at 14:34

@wolf480pl kinda yeah (it's how basically all blockrams work btw)

what actually happens in hardware is slightly more complicated: the clock edge latches the address in a register, and the address is combinationally decoded into a wordline (selecting a BRAM row); then after some delay, the read strobe generator actually triggers the wordline, causing the data to appear on the bitlines; the weak signal from the bitlines is then amplified and latched into the read data latch by yet another delayed strobe

all the delays involved (and the write strobe delay of course) are actually programmable in the bitstream; they just happen to be set to fixed values by the toolchain, presumably as determined to be optimal during Spartan-3E bringup

=> More informations about this toot | More toots from mwk@donotsta.re

Written by Wanda on 2025-01-12 at 14:37

@wolf480pl fun fact: early Altera devices are one of the few that have a variation on the formula, btw: to avoid having to deal with carefully calibrated delays, they decided to use the falling edge of the clock for the memory operation. so the address, write data and control lines are latched in on the rising edge, things take a bit to stabilise internally, then the falling edge actually triggers the write or gives you the read data.

this makes it incredibly annoying to deal with in any kind of generic fashion.

=> More informations about this toot | More toots from mwk@donotsta.re

Written by Wolf480pl on 2025-01-12 at 14:51

@mwk awesome, thanks for the explanation.

The BRAM using programmable sub-cycle delays in an otherwise synchronous circuit sound somewhat cursed, just the right amount of cursed for an FPGA :D

Though I'm curious why Altera's use of falling clock edge somehow ended up more cursed

=> More informations about this toot | More toots from wolf480pl@mstdn.io

Written by Wanda on 2025-01-12 at 14:55

@wolf480pl using falling edge is fine when you have a single clock domain involved (because who cares), but makes it a pain to reason about what's going on when you have two domains involved (because you're using your BRAM as a clock domain crossing FIFO)

=> More informations about this toot | More toots from mwk@donotsta.re

Written by Wolf480pl on 2025-01-12 at 14:55

@mwk oh....

"fun"

=> More informations about this toot | More toots from wolf480pl@mstdn.io

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113815747916819570
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
273.00637 milliseconds
Gemini-to-HTML Time
0.967599 milliseconds

This content has been proxied by September (3851b).