Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Clear RAM 2-port

Hi,

I created a RAM 2-port, port A for writing only, port B for reading only.

Before I write a new data into port A in RAM 2-port, I want to clear/reset all data and address in Port B first? how can I do that ?

Thanks in advance

Hung

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It's not clear what you mean with "clear/reset all data and address in Port B". Apparently not clearing the RAM content, which would need a sequential program anyway. The data appearing at port B will be updated according to the specified RAM behaviour. What do you want to achieve besides the default behavior?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Because I configure Port A and Port B with different size. Port A is 1-bit data, 13-word address. Port B is 32-bit data, 256-word address for M9K. when I write new data in Port A, then access data from Port B it may be duplicated with the previous data. Therefore, before writing new data to port A, I want to reset RAM 2-port to the initial status when we just turn on the board.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you will have to write all 256 addresses from port B to clear it. You cannot "reset" a ram.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Well you don't need to. Just don't read until write finished i.e.check last address of write then read