I am facing a confusing problem in my program. I need in my program to port map (calling) a component. Also, inside the component, I need to do another port mapping (calling) which is illegal in VHDL. Do you have an alternative solution to this problem. Here is an example of what I meant.
Here I start my program:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity binary1 is
port( N: in std_logic;
d: out integer);
end binary1 ;
Architecture Behavior1 of binary1 is
Here is a component for example:
component binary_integer_1 is
port ( b1: in std_logic;
int1: out integer);
end component;
The command for calling the component: begin s0: binary_integer_1 port map(n,d); end Behavior1 ;
Also, here is the main program:
library ieee;
use ieee.std_logic_1164.all;
entity binary_integer_1 is
port ( b1: in std_logic;
int1: out integer);
end binary_integer_1;
architecture Behavior4 of binary_integer_1 is
begin
process(b1)
begin
if b1 = '1' then
int1 <= 1;
else
int1 <= 0;
end if;
end process;
end Behavior4;
For example, if I want to do a port map inside the upper entity. I have got an illegal statement. Please, provide me with another way to do it.