Dynamic array in Verilog

hello everyone
I know that dynamic array is not supported in Verilog and Quartus. I want to know does anybody has an idea or algorithm to use instead of dynamic array. I mean I am searching for something that works instead of a dynamic array.
thanks

 PhysOrg.com engineering news on PhysOrg.com >> Researchers use light projector and single-pixel detectors to create 3-D images>> GPS solution provides 3-minute tsunami alerts>> Single-pixel power: Scientists make 3-D images without a camera
 nadersb, Dynamic arrays is a verification feature, i.e. for use in test bench. It is not generally synthesizable. Think of what Quartus would have to do to synthesize int dyn_array[];. How much memory, or how many logic elements should it assign? How would it know if the logic fit in a the target device? Perhaps explain why you think you need a synthesizable dynamic array.
 yes I know it is not synthesizable because the problems you have mentioned and thats why I need something else. let me explain more, I have a module that its input is not fixed size. it can be 16,32,64... bits. the easiest solution is to use a large enough array for input, but it wastes too much logic cells. so I am thinking and searching for an algorithm that help me in this case.

Dynamic array in Verilog

When is the size determined, during instantiation of the module or after download?

 size itself is an input. it is a filter that number of its coefficient is changeable.and size depends on how accurate filter should be.
 Is it an input to the module during instantiation or an input to the FPGA itself (say from software) after it has been downloaded?
 it is an input to FPGA itself
 Sounds like your options are either dynamic reconfiguration, or design to accomodate the largest possible size. If this is a transversal (FIR) filter of max length, say, 128 coefficients than you need enough RAM to store these coefficients anyway. If you want to scale back the accuracy then just zero out the unused coefficients. Filter will work normally except with some non-optimal delay. Of course I am speculating without having any idea about your architecture.
 yes I think so. I think there is no way instead of using large size array unfortunately
 Recognitions: Gold Member Science Advisor hmmm are string variables dimensionable on the fly? ignore suggestion if it's silly - i'm still living in the age of interpreted Basic. old jim
 Hey Jim, In an ordinary programming language the programmer often has the luxury of assuming that there is limitless memory available. When the program is run and it decides it needs a certain amount of memory, say for a string variable, it makes the request to the operating system. The operating system keeps track of how much memory is available, and who is using what, and will allocate a block to this program. Later, the program can notify the operating system that it no longer needs this memory, and it gets returned to "the heap". Synthesizable Verilog kind of looks like a programming language but is actually a "hardware description language". It is really just a text way of doing what we did years ago with pencil, stencil, and D-size schematic sheet to design digital logic. If I needed a register big enough to hold a 32-bit word, I drew in 32 flip-flops on my schematic, then build my board. Today in verilog we "instantiate a 32 bit register" and program the FPGA. In both cases a piece of hardware has been created. And, just like there was limited real estate on my digital logic board, there are limited logic resources available within an FPGA, so we try to be very conservative (the point of the OPs post). If I change my mind and decide I needed it to be a 64-bit register, I have to change the verilog code, and reprogram the FPGA and hope that it can "fit" the design. If it needs to be 32-bit most of the time, and 64-bit occasionally, I need to build it with 64-bits. Of course, this is somewhat simplified for clarity's sake. It is actually pretty unlikely that bumping a single register up in size by 32 bits would cause a fitting issue. Even modest FPGAs today provide tens of thousands of flip-flops.

Recognitions:
Gold Member
Thanks EMIguy for that neat introduction. What amazing tools you have these days!

 If I needed a register big enough to hold a 32-bit word, I drew in 32 flip-flops on my schematic...
i remember an old Honeywell DDP15 with discrete transistor flip-flops and drum memory about a foot diameter
it replaced the old 12AU7 based machine for an airline reservation system....
but in my heyday we had 4 bit MSI registers...

anyhow , thanks again. I'll probably never use such a thing but it is comforting to have a rudimentary idea of its existence.

old jim