Detect RAMs from static arrays #234
JulianKemmerer
started this conversation in
General
Replies: 2 comments
-
Need to take into account how many times writes and reads occur to the RAM and what order they occur in read first write first etc And properly wire data flow to a module like ram template are - has feedback wires :-/ |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hows this syntax? typedef struct a_dual_port_ram_t {
uint32_t read(uint32_t addr);
void write(uint32_t addr, uint32_t data_in);
uint32_t the_ram[128];
} a_dual_port_ram_t;
void my_func(uint32_t raddr, uint32_t waddr, uint32_t wdata) {
static a_dual_port_ram_t my_ram;
uint32_t rdata = my_ram.read(raddr);
my_ram.write(waddr, wdata);
return rdata;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As opposed to making users specify RAM ~template functions
Ex. see
And infer a RAM with two read ports and one write port
Beta Was this translation helpful? Give feedback.
All reactions