Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Detect RAMs from static arrays #121

Closed
JulianKemmerer opened this issue Oct 2, 2022 · 2 comments
Closed

Detect RAMs from static arrays #121

JulianKemmerer opened this issue Oct 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@JulianKemmerer
Copy link
Owner

As opposed to making users specify RAM ~template functions

Ex. see

  static uint32_t my_ram[N];
  uint32_t rd_data1 = my_ram[addr1];
  uint32_t rd_data2 = my_ram[addr2];
...
  if(wr){
    my_ram[wr_addr] = wr_data;
  }

And infer a RAM with two read ports and one write port

@JulianKemmerer JulianKemmerer added the enhancement New feature or request label Oct 2, 2022
@JulianKemmerer JulianKemmerer self-assigned this Oct 2, 2022
@JulianKemmerer
Copy link
Owner Author

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 :-/

@JulianKemmerer
Copy link
Owner Author

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;
}

@JulianKemmerer JulianKemmerer removed their assignment Feb 3, 2023
Repository owner locked and limited conversation to collaborators Nov 16, 2024
@JulianKemmerer JulianKemmerer converted this issue into discussion #234 Nov 16, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant