您可以使用数组声明“通用”数量的信号。
如果每个阶段都有共同的信号,则记录数组会有所帮助。
即:
输入my_signals是记录
i,q:签名(31 downto 0);
结束记录;
type my_signal_array是my_signals的数组(自然范围);
signal z:my_signal_array(0到GENERIC_VALUE);
.....
z(0).I clk,real_in => z(n).i,imag_in = z(n).q,real_out => z(n + 1).I,imag_out => z(n + 1).q
);
结束生成;
use_block_B:如果不是use_block_A生成
INST:BLOCK_B(clk => clk,real_in => z(n).i,imag_in = z(n)。q,real_out => z(n + 1).I,imag_out => z(n + 1)。
q);
结束生成;
结束生成; I_out q_out
无论如何,这是个主意。
“z”信号在体系结构中声明(不在生成内部),因此它对生成块是全局的。
以上来自于谷歌翻译
以下为原文
You can declare a "generic" number of signals using arrays. An array of records helps if there are common bundle of signals for each stage. i.e.:
type my_signals is record i,q : signed(31 downto 0);end record;type my_signal_array is array(natural range <>) of my_signals;signal z : my_signal_array(0 to GENERIC_VALUE);.....z(0).I <= some_input..;z(0).q <= some_input...; stages : for n in z'range generatebegin use_block_A : if use_block_A generate INST : BLOCK_A ( clk => clk, real_in => z(n).i, imag_in = z(n).q , real_out => z(n+1).I , imag_out => z(n+1).q ); end generate;
use_block_B : if not use_block_A generate INST : BLOCK_B ( clk => clk, real_in => z(n).i, imag_in = z(n).q , real_out => z(n+1).I , imag_out => z(n+1).q ); end generate;end generate;
I_out <= z(GENERIC_VALUE).I;
q_out <= z(GENERIC_VALUE).q;
Anyway that's the idea. The "z" signal is declared in the architecture (not inside the generate), so that it is global to the generate blocks.
您可以使用数组声明“通用”数量的信号。
如果每个阶段都有共同的信号,则记录数组会有所帮助。
即:
输入my_signals是记录
i,q:签名(31 downto 0);
结束记录;
type my_signal_array是my_signals的数组(自然范围);
signal z:my_signal_array(0到GENERIC_VALUE);
.....
z(0).I clk,real_in => z(n).i,imag_in = z(n).q,real_out => z(n + 1).I,imag_out => z(n + 1).q
);
结束生成;
use_block_B:如果不是use_block_A生成
INST:BLOCK_B(clk => clk,real_in => z(n).i,imag_in = z(n)。q,real_out => z(n + 1).I,imag_out => z(n + 1)。
q);
结束生成;
结束生成; I_out q_out
无论如何,这是个主意。
“z”信号在体系结构中声明(不在生成内部),因此它对生成块是全局的。
以上来自于谷歌翻译
以下为原文
You can declare a "generic" number of signals using arrays. An array of records helps if there are common bundle of signals for each stage. i.e.:
type my_signals is record i,q : signed(31 downto 0);end record;type my_signal_array is array(natural range <>) of my_signals;signal z : my_signal_array(0 to GENERIC_VALUE);.....z(0).I <= some_input..;z(0).q <= some_input...; stages : for n in z'range generatebegin use_block_A : if use_block_A generate INST : BLOCK_A ( clk => clk, real_in => z(n).i, imag_in = z(n).q , real_out => z(n+1).I , imag_out => z(n+1).q ); end generate;
use_block_B : if not use_block_A generate INST : BLOCK_B ( clk => clk, real_in => z(n).i, imag_in = z(n).q , real_out => z(n+1).I , imag_out => z(n+1).q ); end generate;end generate;
I_out <= z(GENERIC_VALUE).I;
q_out <= z(GENERIC_VALUE).q;
Anyway that's the idea. The "z" signal is declared in the architecture (not inside the generate), so that it is global to the generate blocks.
举报