Thanks for any suggestions.
An example would be:
-- synopsys synthesis_off
<commented code>
-- synopsys synthesis_on
I think that Synplicity honors the above synopsys
sythesis directives. I also think that they have
some of their own. However, I do not think that
VHDL itself supports compile driven directives.
Hope that helps,
Harlin!
--
------------------------------------------------------------
- Harlin L. Hamilton Jr. Phone: (972) 720-5919 -
- Field Applications Engineer Email: har...@cadence.com -
- Mobile: (214) 284-6345 -
- Quickturn, A Cadence Company Fax: (972) 720-5988 -
- 14135 Midway Rd. Suite 300 Page: (888) 268-4205 -
- Dallas, TX 75244 Email Page: 268...@pagemci.com -
------------------------------------------------------------
entity tb is
generic (exec : boolean := false); -- default is not to execute
end entity tb;
architecture bhv of tb is
begin
p1 : process
begin
-- if exec is true ...
if (exec) then
-- ... do what's inside the if
report "Executing Code!";
end if;
end process p1;
end architecture bhv;
compile as you normally would. then when you load your design
into ModelSim, use the -g option to turn on your generic. for
the example above, the command would look like:
vsim tb -gexec=true
(notice how the generic immediately follows the -g)
if the generic is not in the top level, or you want to specify
that all generics of the same name take a particular value, use
the -G option. syntax is same as the example above.
if you use the gui to load your design, there's a tab where you
can specify the generic value (can't remember the name although
i believe it's VHDL Options).
perhaps someone else will post about how to use generics for
synthesis.
ciao,
NaV
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
nullandvoid wrote:
--
P.S. Please note the new email address and website url
-Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930 Fax 401/884-7950
email r...@andraka.com
http://www.andraka.com or http://www.fpga-guru.com
yes, synthesis pragmas/directives are probably the only way to
solve the problem of stepping over text for synthesis. the
experts will probably say that, from a synthesis view, generics
should only be used to parameterize some bounds on a design.
for instance, one designs a RAM and uses generics to create RAMs
of varying widths and depths.
however, i'm not familiar with any directives for compiling for
simulation. also, in the spirit of #ifdef's (which are set at
compile time), generics are set at run time and don't require
editing the code to get a different behavior. to remove or add
pragmas you'll have to modify the code. although, deleting or
adding a few lines is much easier than having to comment many
(hundreds?) lines of code. unless you have an awesome editor.
but then that's an entirely different thread. 8)
constant ENABLE_X : boolean := true;
...
G1: if ENABLE generate
C1: comp1 generic map (...) port map (...);
end generate;
Peter
John <jss...@hotmail.com> wrote in message
news:219DB28AF719D31180CE00609774020D03B3C3D2@US1-NNTP...