我的VHDL架构实例化一堆库单元,其中一些在generate
块内,例如。
a_inst: foo_cell
port map ( ... );
b_gen: for i in 1 to 3 generate
b_inst_i : foo_cell
port map ( ... );
end generate b_gen;
在配置中,我想将这些实例绑定到库中的特定配置。我想在
中使用for all
for all : foo_cell
use configuration foo_lib.foo_cell_cfg;
end for;
有人可能会认为这也涵盖了generate
块,但不是,我找到的最简洁的可能性是
for b_gen
for all : foo_cell
use configuration foo_lib.foo_cell_cfg;
end for;
end for;
每个generate
都需要重复此操作。
是否有更简洁的方法来实现相同的结果?
编辑:这是一个可编辑的示例(为了简单起见,在work
中使用“库单元格”而不是单独的库)
entity foo_cell is
end foo_cell;
architecture RTL of foo_cell is
begin
end RTL;
configuration foo_cell_cfg of foo_cell is
for RTL
end for;
end foo_cell_cfg;
entity MWE is
end MWE;
architecture RTL of MWE is
component foo_cell
end component;
begin
a_inst: foo_cell;
b_inst: for i in 1 to 3 generate
b_i: foo_cell;
end generate;
end RTL;
configuration MWE_RTL_cfg of MWE is
for RTL
for all : foo_cell
use configuration work.foo_cell_cfg;
end for;
for b_inst
for all : foo_cell
use configuration work.foo_cell_cfg;
end for;
end for;
end for;
end MWE_RTL_cfg;
我将所有这些内容放在一个文件mwe.vhd
中并使用irun -elaborate mwe.vhd -top mwe_rtl_cfg