Hi Clyde!Hi,
[quote repaired]
This a plain VHDL - this should work everywhere.This does not work in Synplify.... It required a signal.Does anything exist in VHDL equivalent to verilog conditional >>>compilation directive ( `ifdef .... `else .... `endif )Just use constants.
define a constant:
constant switchA : integer:=1; -- 1 enabled / 0 disabled
Feed this constant through an entitiy to a lower component:
entity compA is
generic(
switchA : integer:=1 );
port( -- and so on...
);
end compA;
Instantiate this component in the top component (where the constat is defined).
Within compA use the constant:
process(in1,in2)
begin
if (switchA=1) then
out1<=in1 AND in2;
else out1<=in1;
end if;
end process;
As you can see - the constant defines, if and AND-gate is inferred or a simple wire is taken.
With the uses of constants if have written a several extras for a microcontroller, that all can be disabled, if one changes the constant.
Hint: If you synthesize just compA to test the synthesized components
within the behavioral top-component, you have to change the default
value of the constant within the entity AND where the constant is
defined in the top-component.
Your synthesis tool will warn you, that an expression is never reached.
(In my examle: the else-statement.)
Ralf
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:52:39 |
Calls: | 6,712 |
Files: | 12,243 |
Messages: | 5,355,274 |