07-04-2019 06:46 AM
I'm having trouble running synthesis on a design that includes a configuration of components that are instantiated inside a for…generate loop (see below for a small piece of code that reproduces the issue). Whenever a configuration references such components, I get the following critical warning:
[Project 1-560] Could not resolve non-primitive black box cell 'inner' instantiated as 'inst/gen.inst'. 5 instances of this cell are unresolved black boxes. [/devel/teststuff/vivado_configuration_test/isolated/mwe.vhd:11]
If I try to continue with implementation anyway, the warning turns into this (unsurprising) error:
[DRC INBB-3] Black Box Instances: Cell 'inst/gen.inst' of type 'inner' has undefined contents and is considered a black box. The contents of this cell must be defined for opt_design to complete successfully.
Interestingly this only happens if the to-be-configured-component lives inside a for…generate block.
If the components live inside an if…generate block (or no generate block at all), everything works as expected.
So if this is supported/working for the if…generate case, I suspect it's also supposed to be supported/working for the for…generate case.
Is this actually the case and this is a synthesis bug, or is this the expected behaviour (or am I simply doing something wrong)?
Minimal reproducing example:
entity outer is -- This entity includes a component that will be configured port(i: bit_vector(4 downto 0); o: out bit_vector(4 downto 0)); end entity; architecture a of outer is component inner port(i: bit; o: out bit); end component; begin gen: for idx in 0 to 4 generate inst: inner port map(i => i(idx), o => o(idx)); end generate;
-- If the for...generate were to be replaced with an if...generate
-- it synthesises without an issue:
-- gen: if true generate
-- inst: inner port map(i => i(0), o => o(0));
-- end generate; end architecture; entity to_be_configured is -- This will be used to configure 'outer' port(i: bit; o: out bit); end entity; architecture impl of to_be_configured is begin o <= not i; end architecture; configuration test_config of outer is for a for gen for all: inner use entity work.to_be_configured; end for; end for; end for; end configuration; entity testbench is port(i: bit_vector(4 downto 0); o: out bit_vector(4 downto 0)); end entity; architecture mwe of testbench is component outer port(i: bit_vector(4 downto 0); o: out bit_vector(4 downto 0)); end component; for inst: outer use configuration work.test_config; begin inst: outer port map(i => i, o => o); end architecture;
Schematic of the synthesised design of the testbench entity.
07-04-2019 07:08 AM
Do any of these prior solutions for NBB-3 give you any insight?
Hope that Helps
If so, Please mark as solution accepted. Kudos also welcomed. :-)
07-04-2019 04:00 PM
Any particular reason for using configurations. They are now one of the least useful parts of VHDL. Now you can use direct instantiation it's just easier to use generates to pick which entity or architecture you want.
What are using using configurations for?
07-05-2019 12:19 AM
In general I agree with you. In this instance however, I want to change the entity that is instantiated (as inner) in outer without changing the architecture of outer. Ever further, I want to have multiple instances of potentially different configurations (with the same architecture except for the used entity for inner) of outer in my design.
To my knowledge this can't really be done without configurations.