Declare a variable number of signals with variable bitwidth in VHDL'93

后端 未结 2 1326
春和景丽
春和景丽 2021-01-27 06:44

I\'m trying to implement an generic adder tree similar to here. For storing the intermediate results, I need to declare a variable number of signals with variable bitwidth. For

2条回答
  •  青春惊慌失措
    2021-01-27 07:01

    What you are asking for is not possible in any version of VHDL, v93 or otherwise. You can define a type inside a generate statement, but not use a generate within a type definition.

    Your initial solution is the way that I would do it personally - if targeting an FPGA using modern tools the unused MSBs at each stage will be optimised away during synthesis, so the resulting circuit is as you've described with no additional overhead (i.e. the tools are clever enough to know that adding two 8-bit numbers can never occupy more than 9 bits).

提交回复
热议问题