Forum Discussion

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

Browse the ram content

Hello everyone, i am doing image processing on fgpa.

Actually i want to browse the ram content for every row of the image, and whenever the content of the adress is not updated i need to register this adress. I placed the read statement in a for loop but if for example i have 5 adresses that their contents are not updated the output register only the last one. Is there a possible way to register the multiple adresses.

17 Replies

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

    --- Quote Start ---

    Actually i found a vhdl code in this forum about cam on cyclone iii (as i need) it is emulated and uses ram blocks. But the number of the output pins are greater then the available ones. I think about using virtual pins but can this affect my code when i will implement it on my fpga?

    --- Quote End ---

    That sounds like you're trying to implement the design directly to the pins. That wont be possible - how do you expect to connect it to the outside world?

    Virtual pins are just a way to test a block in your design for resource usage. They have no use in a real design.

    You need to think about whats on your chip and how you interface to this CAM from outside the FPGA (or inside, if you're connecting to another block).

    You would never just connect the CAM to the FPGA pins.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello again.

    I want to understand something about CAM. Actually i'm using cyclone iii which have M9K memory blocks. So for my project as i described before, i firstly use a ram to store data. The addresses goes from 0 to 639 and my data is only 2 bits length. I reached to code a CAM but i have this two questions :

    1) The output of CAM is one-hot so to get the encoded address 639 do i need a CAM of the size 640x2 ??? I'm really confused, because to store data i only used one block M9K why would i need more than that to get the address?? ( I need the encoded address not the one-hot one )

    2) For my project it might be more than one address storing the same data but i got only the last one, so the CAM didn't solve my problem, because for my project many addresses will store the same data. So how to pass from one match to multi-match please?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    1. I dont really understand the question. A CAM would return the address of the requested data, and which address returned on a multiple match would be down to the implementation of the CAM.

    2. Then you'll have to build a custom module that returns all of the addresses containing your 2 bit value.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    For my first question, i just want to know how to choose the size of my CAM, knowing that the output of CAM is a one-hot output and the addresses are in the range of 0 to 639.

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

    I dont know what you mean by 1 hot? usually it would just return a number between 0 to 639.

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

    As i read the CAM return one-hot output for example if the matched address is 001 then the one-hot output is 00..010 if it is 010 then the one-hot output is 000..00100 if it is 011 the one-hot output is 00...01000 etc. Then we encode this output to get the address number.