K
KJ
Guest
"koce" <bojan_1981@yahoo.com> wrote in message
news:ac53fa4599c1faa8043baa3742850109@localhost.talkaboutelectronicequipment.com...
relative to the clock are poor design practice.
that I'm aware of from Altera...or Xilinx...or Lattice...or Actel, etc.
running Quartus to produce a bit file to program the part).
correctly and synthesized using Quartus so that is not the problem you're
having....but my usage of the generic time is quite different than how
you're trying to use it, although I was using it to accomplish the same
function (i.e. to delay some signal, or create a signal with a specified
pulse width, etc.)
synthesize that code to produce a part on a board.
2. VHDL 'time' types can only be used to compute other constants.
The way to produce a delay in a synchronous design is to pass in two
generics (both of type time). The first being the delay you'd like (i.e.
Tdelay), the second being the clock period that you intend to run the design
at (calling it Clock_Period for example). Now inside the architecture you
define an integer that has a range that goes from 0 to (Tdelay /
Clock_Period).
constant Max_Delay_Count: natural := (Tdelay / Clock_Period);
signal Delay_Counter: natural range 0 to (Max_Delay_Count - 1);
Now build a counter that counts from 0 to (Max_Delay_Count - 1) and go from
there.
Having said all of that, if your intended delay really is of the order of 10
ns then this technique won't work unless you have a 100 MHz clock or faster.
In that case, you'll need an external delay line part on your board.
Kevin Jennings
news:ac53fa4599c1faa8043baa3742850109@localhost.talkaboutelectronicequipment.com...
Usually the reasons for wanting to delay things by some absolute time delayHi everyone,
I use Altera MAXII CPLD for my project. I program it
using Quartus II software and VHDL language. With CPLD
I control switches using one global clock signal. For
one switch, I want to turn it on not on the rising
edge of the global clock but to delay the turning on
(10ns for example).
relative to the clock are poor design practice.
You won't be implementing this in a MAXII CPLD then....or any other offeringIn my VHDL code I use generic type of data.
generic (Tdelay: time:=10ns);
I use thisconstant when I want to delay my signal:
if (clock'event and clock='1')then
s1='1' after Tdelay;
that I'm aware of from Altera...or Xilinx...or Lattice...or Actel, etc.
By 'final' I'm guessing that you mean trying to synthesize the design (i.e.VHDL syntax verification is OK but I have a problem
when I want to do final compilation.
running Quartus to produce a bit file to program the part).
I've passed generics of type time into entities and they get handledtype time does not
match string literal[/i:7ee60fdd55][color=red:7ee60fdd55][/color:7ee60fdd55]
I think that it is because I use generic type of data.
correctly and synthesized using Quartus so that is not the problem you're
having....but my usage of the generic time is quite different than how
you're trying to use it, although I was using it to accomplish the same
function (i.e. to delay some signal, or create a signal with a specified
pulse width, etc.)
today because of the "after Tdelay". You can't use it if you intend toIf you know the other way of delaying signal using
VHDL code please share with me. You will help me a
lot!
1. "s1='1' after Tdelay" is not synthesizable in any FPGA/CPLD on the market
synthesize that code to produce a part on a board.
2. VHDL 'time' types can only be used to compute other constants.
The way to produce a delay in a synchronous design is to pass in two
generics (both of type time). The first being the delay you'd like (i.e.
Tdelay), the second being the clock period that you intend to run the design
at (calling it Clock_Period for example). Now inside the architecture you
define an integer that has a range that goes from 0 to (Tdelay /
Clock_Period).
constant Max_Delay_Count: natural := (Tdelay / Clock_Period);
signal Delay_Counter: natural range 0 to (Max_Delay_Count - 1);
Now build a counter that counts from 0 to (Max_Delay_Count - 1) and go from
there.
Having said all of that, if your intended delay really is of the order of 10
ns then this technique won't work unless you have a 100 MHz clock or faster.
In that case, you'll need an external delay line part on your board.
Kevin Jennings