Re: Why does the placement of a statement mater in vhdl, I thought itwas a parallel language ?

Discussion in 'VHDL' started by ghelbig, Sep 18, 2008.

  1. ghelbig

    ghelbig Guest

    On Sep 17, 10:20 pm, "Morten L. Haugen" <>
    wrote:
    > Why does the placement of a statement mater in vhdl, I thought it was a
    > parallel language )-:
    >
    > What vhdl mechanism occurs when the placement of a statement (before or
    > after an if statement) makes a complete different result in a clocked
    > process? First process below generates a flip-flop for rd_1_en, while the
    > second process below generates just a constant '1' for rd_2_en.
    >
    > Seems to be valid construction, checked with modelsim, synplify, Xilinx XST.
    >
    > I guess its delta delays defining what happens, any body who understand this
    > in detail?
    >
    > Same result in all tools?
    >
    > p_one_ff : process(clk)
    >
    > begin
    >
    > if rising_edge(clk) then
    >
    > rd_1_en <= '1'; -- statement in question !!!!!!!!
    >
    > if (sel_low = '1') then
    >
    > rd_1_en <= '0';
    >
    > end if;
    >
    > end if;
    >
    > end process p_one_ff;
    >
    > p_constant_1 : process(clk)
    >
    > begin
    >
    > if rising_edge(clk) then
    >
    > if (sel_low = '1') then
    >
    > rd_2_en <= '0';
    >
    > end if;
    >
    > rd_2_en <= '1'; -- statement in question !!!!!!!!
    >
    > end if;
    >
    > end process p_constant_1;
    >
    > Morten L. Haugen,
    >
    > GE Vingmed Ultrasound, Norway


    You are getting exactly the results I would expect.

    In each process you have two assignments to the same signal. The
    assignments will be done from top to bottom, just like any other
    procedural language.

    Your first process has a common method for avoiding latches; set every
    signal in the process at the beginning, then change some of them
    according to conditions.

    (BTW, Verilog behaves the same way.)

    Hope that helps,
    G.
     
    ghelbig, Sep 18, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RWQ=?=

    Mater Pages and Cross-page Postbacks.

    =?Utf-8?B?RWQ=?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    430
    =?Utf-8?B?QXR1bCBCYWhs?=
    Jul 25, 2005
  2. KJ
    Replies:
    2
    Views:
    1,636
    Brian Drummond
    Sep 22, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,961
    Smokey Grindel
    Dec 2, 2006
  4. backhus
    Replies:
    0
    Views:
    451
    backhus
    Sep 18, 2008
  5. Andy
    Replies:
    0
    Views:
    466
Loading...

Share This Page