On Oct 18, 7:51*pm, "KJ" <kkjenni...@sbcglobal.net> wrote:
> "Amit" <amit.ko...@gmail.com> wrote in message
>
> news:46d0be0d-b4aa-4841-a953-...
> On Oct 18, 5:35 pm, Amit <amit.ko...@gmail.com> wrote:
>
> Synthesis tools don't like the following form (which is from your code) for
> inferring clocked things.
>
> > elsif(clk'event ) then
> > if (clk = '1') then
> <snip>
> > else -- falling edge
> <snip>
> > end if;
>
> Some may accept the following
>
> if rising_edge(clk) then
> * ...
> end if;
> if falling_edge(clk) then
> * ...
> end if;
>
> But as general rule, designing using both edges of the clock is not good
> practice to begin with.
>
> > One thing I forgot to add was that the logic control of this
> > multiplier is clocking this module using a gated clock.
>
> If you're planning on implementing this inside an FPGA, it is very bad
> practice to use a gated clock because it is generally next to impossible to
> pass static timing analysis so your design will be flaky and prone to fail
> under various temperature conditions
> KJ
>
> thanks.
Many synthesizers can handle both clock edge specifications in one
process, as long as the same object is not assigned on both edges. You
can also do:
if rising_edge(clk) then
....
elsif falling_edge(clk) then
....
end if;
I'm not saying this is a good (or bad) design practice, but when
necessary, it will work. In some cases it may mean that you don't have
to double the clock speed everywhere. And STA gets the timing right
without having to use multicycle timing constraints.
Also, most synthesizers will accept a combined clock specification and
enable, such as:
if rising_edge(clk) and (enable = '1') then
Note that this is not a gated clock, since the edge detection is only
performed on clk, not the result of the 'and'.
The last assignment to load_ctrl is probably not going to work the way
you want. Using the clock as an input to combinatorial logic in FPGAs
usually does not work too well. Some synthesis tools accept and
correctly implement signal assignments to expressions of variables
after the clocked 'if' clause in a clocked process, but this isn't an
expression of variables.
Andy
|