Hi,
I've got a XC9536-7 and have played with PE and MS. I've put a 1MHz
crystal on the global clock line in the veroboard mockup. In my tests
I've got some code as follows:
A <= '1';
wait for 10ns;
B <= '1';
Now I can see the above 10ns timing parameter in MS waveform view
Indeed. The simulator processes the whole of the VHDL language,
and your wait statement is perfectly valid VHDL. It's just not
synthesisable to hardware.
a). Is the "wait for x" statement only used in MS for simulation
purposes.
It makes no sense for synthesis to hardware. I suspect that if
you trawl carefully through the XST compilation report you will
find a warning to the effect that the wait statement has been
ignored.
b). If the "wait for x" statement is used somehow within the device
while it's running; how does it know I've put a 1MHz crystal on the
clock line?
Good question. Of course, it doesn't. Synthesis simply cannot
build hardware to do what you asked for.
If you want to get one signal delayed relative to another, it may be
cleaner to do this sort of thing...
process (S)
begin
A <= S; -- copy S to A with zero delay
B <= S after 10 ns; -- B is delayed from S by 10 ns
end process;
Now you have a piece of code that's acceptable to all synthesis
tools and will simply copy S on to both A and B. However, by careful
tweaking of timing constraints within the Xilinx tools you may be able
to get a bigger delay on B than on A.
I would ask, though, why you want to do this. The time delay can
never be reliable - it's subject to process, temperature and
supply voltage variations - so you certainly can't use it,
for example, to build a 100MHz oscillator.
Mainstream modern design techniques are overwhelmingly
synchronous - you use an externally generated clock (exactly
as you are doing) to control all timing in the device. If you want
delays resolved to only 10ns then you'll need a 100MHz clock
(good luck to you, if you're doing it on stripboard!). With
a 1MHz clock you can easily get a 1us time delay simply
by putting a signal through a flip-flop clocked by the 1MHz.
Take a few hours to read any standard textbook on synchronous
design, or trawl back through the comp.lang.vhdl archives to
see some sensible examples, or even take a look at our
website. Ask here again when you've got
some specific issues to solve.
One hint: If you're using CPLDs on a stripboard prototype,
take a LOT of care to keep all the ground connections
as solid as possible - otherwise you risk getting strange
spurious behaviour because connections that are all
nominally 0-volts may flap around relative to each
other when the CPLD outputs make fast transitions.
Adding a resistor of about 50-100 ohms in series with
every output of the CPLD, RIGHT NEXT TO THE
OUTPUT PIN, is often very helpful on hacky prototypes
because it keeps the output currents fairly small.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.