문제

is there a simple way to make inferred synchronous RAM with read-first then write logic for Altera Cyclone II?

I need this to implement cancel option into my RAM’s driver.

I am thinking about some state machine that first reads the memory and remembers it in DFF and after that writes to it, but honestly, I have no idea how to even start writing it. And maybe there’s simpler solution?

도움이 되었습니까?

해결책

Something like this should result into the desired behavior (read old value and write new value):

process (clk)
begin
  if (clk'event and clk = '1') then
      if (write_enable = '1') then
          ram_block(write_address) <= new_data;
      end if;
      old_data <= ram_block(read_address);
  end if;
end process;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top