New Reply

Dynamic array in Verilog

 
Share Thread Thread Tools
Jul22-12, 06:42 AM   #1
 

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
PhysOrg
engineering news on PhysOrg.com

>> PNNL-developed injection molding process recognized with emerging technologies award
>> How soon could car seats enter the 3-D comfort zone?
>> NASA: Austin, calling Austin. 3-D pizzas to go
Jul22-12, 01:22 PM   #2
 
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.
Jul23-12, 01:12 AM   #3
 
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.
Jul23-12, 01:19 AM   #4
 

Dynamic array in Verilog


When is the size determined, during instantiation of the module or after download?
Jul23-12, 01:56 AM   #5
 
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.
Jul23-12, 02:07 AM   #6
 
Is it an input to the module during instantiation or an input to the FPGA itself (say from software) after it has been downloaded?
Jul23-12, 02:44 AM   #7
 
it is an input to FPGA itself
Jul24-12, 12:48 AM   #8
 
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.
Jul24-12, 01:57 AM   #9
 
yes I think so. I think there is no way instead of using large size array unfortunately
Jul24-12, 12:20 PM   #10

Engineering 2012
 
Recognitions:
Gold Membership Gold Member
Science Advisor 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
Jul25-12, 12:22 AM   #11
 
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.
Jul25-12, 06:11 AM   #12

Engineering 2012
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
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
New Reply
Thread Tools


Similar Threads for: Dynamic array in Verilog
Thread Forum Replies
Printing 1D array in Fortran as 2D array... Programming & Comp Sci 7
dynamic array bug Engineering, Comp Sci, & Technology Homework 9
Inputting an array in to a function or returning an array? (C++) Programming & Comp Sci 5
Does anybody know verilog? Electrical Engineering 1
converting from an array of function values to coordinate array of different length Programming & Comp Sci 3