Is this possible: parameterizing a component structure

Joined
May 16, 2006
Messages
2
Reaction score
0
Hi,

I'm confused about a subject that I can't seem to find convered anywhere. Perhaps I have the wording wrong.

I have a timer component. it would be nice if I could just use the generic map, set the generic "BitWidth" to an integer, and then have the VHDL synthesizer resolve the structure. I'm aware that this can be done using behavioral code, but I tend to perfer structural design.

In other words my timer looks like this.


Code:
architecture Structure of Timer is

   component FlipFlop
      ...
   end FlipFlop;


   (some signal declarations)


begin

   FF0 : FlipFlop
      ...

   FF1 : FlipFlop
      ...

       .
       .
       .

   FF[BitWidth] : FlipFlop
      ...


   (Followed by the interconnect).

end Structure;

I'd like BitWidth (the generic integer) to be able to autogenerate (upon synthesis) the number of flipflop components used in the architecture, which includes the component instantiations as well as the number of iterations in the interconnect code. To an acceptable degree, everything I want to do would be possible using the macros in C (#if, #endif, etc).

If this is not worth the time, that's cool, but I'd like to know.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top