For each component instantiation a separate map_list
instance
is created. To prevent name space pollution a separate name scope
for each component instantiation is used. Further, each
map_list
instance is called ml
. The instances will be
destroyed automatically when the name scope is left.
Example: The VHDL code
entity incr1 is port (p1, p2 : inout integer); end incr1; ... entity incr2 is port (p1 : out integer := 0; p2 : in integer := 0); end incr2; ... entity top is end model; architecture struct of top is signal a, b : integer := 0; begin comp1: entity incr1 port map (p1 => a, p2 => b); comp2: entity incr2 port map (p1 => b, p2 => a); end struct;is converted into the following constructor for architecture ``struct'':
/* Architecture constructor */ L7testlib_E3top_A6struct:: L7testlib_E3top_A6struct(name_stack &iname, map_list *mlist) : L7testlib_E3top(iname, mlist) { ... { map_list ml; ml.signal_map(":p1",NULL,S1a,NULL); ml.signal_map(":p2",NULL,S1b,NULL); iname.push(":comp1"); kernel.elaborate_component("","incr1","",iname,&ml); iname.pop(); } { map_list ml; ml.signal_map(":p1",NULL,S1b,NULL); ml.signal_map(":p2",NULL,S1a,NULL); iname.push(":comp2"); kernel.elaborate_component("","incr2","",iname,&ml); iname.pop(); } ... };