[VHDL] Comparing entity and component declarations

  • Thread starter M.D. van de Burgwal
  • Start date
M

M.D. van de Burgwal

Assume I have the next entity description in file A:
ENTITY comp1 IS
port (A : IN std_logic; B: OUT std_logic);
END comp1;

I want to use the entity in another file B, so I declare a component:
COMPONENT comp1
port (A : IN std_logic; B: OUT std_logic);
END COMPONENT;

Next, I find a bug in the original entity comp1 in file A and I need to
change some port definition:
ENTITY comp1 IS
port (A : IN std_logic_vector(1 downto 0); B: OUT std_logic);
END comp1;

When I do not change the component declaration in file B, ModelSim (version
SE 5.7d) will compile file B without any changed ports.
Is there any way to make ModelSim compare the original entity declaration
and the component instantation, returning an error when something has
changed? Or are there workarounds?

Thx,
Marcel van de Burgwal
 
P

Pieter Hulshoff

M.D. van de Burgwal said:
When I do not change the component declaration in file B, ModelSim
(version SE 5.7d) will compile file B without any changed ports.
Is there any way to make ModelSim compare the original entity declaration
and the component instantation, returning an error when something has
changed? Or are there workarounds?

If by compile you mean vcom, then no. During the compile of a VHDL file, the
components are taken at face value, and are only compared to their
instantiations. Whether the component matches the entity is only performed
when the design is elaborated in vsim, because only at _that_ time do you
tell the tool which design unit is actually instantiated in that particular
location.

Regards,

Pieter Hulshoff
 
G

Guitarman

M.D. van de Burgwal said:
Assume I have the next entity description in file A:
ENTITY comp1 IS
port (A : IN std_logic; B: OUT std_logic);
END comp1;

I want to use the entity in another file B, so I declare a component:
COMPONENT comp1
port (A : IN std_logic; B: OUT std_logic);
END COMPONENT;

Next, I find a bug in the original entity comp1 in file A and I need to
change some port definition:
ENTITY comp1 IS
port (A : IN std_logic_vector(1 downto 0); B: OUT std_logic);
END comp1;

When I do not change the component declaration in file B, ModelSim (version
SE 5.7d) will compile file B without any changed ports.
Is there any way to make ModelSim compare the original entity declaration
and the component instantation, returning an error when something has
changed? Or are there workarounds?

Thx,
Marcel van de Burgwal


I don't believe so. I would actually find it scary if ModelSim would
edit my files automatically. Xilinx Webpack will automatically
generate a testbench template containing the correct port
instantiation, but that's not what you want.
 
P

Paul Uiterlinden

M.D. van de Burgwal said:
When I do not change the component declaration in file B, ModelSim (version
SE 5.7d) will compile file B without any changed ports.
Is there any way to make ModelSim compare the original entity declaration
and the component instantation, returning an error when something has
changed?

Using a configuration declaration will cause the compiler issue an error
during the compilation of the configuration.

CONFIGURATION conf_name OF toplevel_entity IS
FOR arch_name_toplevel
FOR ALL: comp1
USE ENTITY work.comp1(arch_name_comp1);
END FOR;
END;
END CONFIGURATION conf_name;

Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

pls help me ; vhdl; 0
Illegal sequential statement (VHDL) 0
2 JK Circuit in VHDL 0
VHDL Subtraction two’s complement 0
structural VHDL 0
VHDL program error 2
VHDL code error 10
erreur VHDL 3

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top