-
|
Hi XLS folks, I’m trying to understand the intended memory-lowering direction in XLS codegen. From the docs, it looks like XLS has support for RAMs through proc/channel-style RAM interfaces and But I’m curious about another case: large fixed-size arrays that live inside proc state. For example, conceptually a proc may carry a fixed-size state array: and use it with a fairly RAM-like access pattern: one indexed read, one single-element update, and an explicit cycle boundary before the read value is consumed. In this case, is there a design reason XLS prefers to keep this as ordinary proc state instead of lowering it to an internal synchronous RAM module? I’m especially interested in the distinction between:
I’m not thinking about instantiating vendor primitives like Xilinx RAMB18/XPM directly. More like a generic behavioral module such as a 1R1W synchronous RAM, which FPGA tools could infer as BRAM and ASIC flows could potentially replace with an SRAM macro. A few specific questions:
I’m asking because I’ve been experimenting with proc-style kernels where large state arrays are functionally memory-like, but the generated RTL can become very FF/LUT-heavy on FPGA unless the memory boundary is made explicit. Thanks! I’d love to understand the intended design philosophy before trying to propose anything. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
#861 has some background on the current (and possible future direction considered at the time) for RAM support. maybe @grebe can shed more light if what you're proposing (state RAM lowering) would be in scope? another potentially related work stream is [Explicit State Access] by @NL02, maybe we could support some custom verilog module FFI similar to what we have for channel fifos? |
Beta Was this translation helpful? Give feedback.
-
|
It might indeed be worth considering this as a way to reduce area; however, doing it automatically means adding more constraints to the schedule (since RAMs usually have request->response times >= 1 cycle) - and even blocking certain optimizations we could otherwise do by treating different elements of the array differently. This makes state->RAM lowering a more nuanced architectural decision! I think in general we need to revisit how we want to support RAMs in XLS & DSLX, probably in a more native fashion than the RAM rewrite system. Making them usable for state storage might be a part of this bigger picture. |
Beta Was this translation helpful? Give feedback.
#861 has some background on the current (and possible future direction considered at the time) for RAM support.
maybe @grebe can shed more light if what you're proposing (state RAM lowering) would be in scope?
another potentially related work stream is [Explicit State Access] by @NL02, maybe we could support some custom verilog module FFI similar to what we have for channel fifos?