--- 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.