goto statement is recommened in systemc?

Discussion in 'VHDL' started by youngsun park, Oct 16, 2003.

  1. I am looking at some systemc code and found that
    goto is used pretty frequently.

    Anybody has some idea about if it is good
    practice or not?

    I heard that a guy proved that you can program without
    goto statement. Is it still valid in hardware modeling
    like systemc?


    -young.
    youngsun park, Oct 16, 2003
    #1
    1. Advertising

  2. On 16 Oct 2003 11:31:26 -0700, (youngsun park)
    wrote:

    >I am looking at some systemc code and found that
    >goto is used pretty frequently.
    >
    >Anybody has some idea about if it is good
    >practice or not?
    >
    >I heard that a guy proved that you can program without
    >goto statement.


    You can, but there are times when you can't create code that is as
    small or fast without using the goto. It's probably good practice to
    avoid goto when you can use other functions and get the same results.
    Gotos are not as readable.

    > Is it still valid in hardware modeling
    >like systemc?


    I'll have to pass on that one. Although I think it would depend on
    the exact problem and the data dependencies involved. Hardware allows
    parallelism that software does not because of the sequential nature of
    the processor. Also, I have never used systemc.

    Marion McCoskey
    http://www.mcky.net
    Marion McCoskey, Nov 14, 2003
    #2
    1. Advertising

  3. Whether goto's can be synthesized or not depends on your synthesis
    tool. But to answer your original question, goto's are not
    recommended in SystemC. That's certainly true for synthesis, and it's
    a good idea in C/C++ in general, as well.

    If you're interested in learning more about SystemC, I'd suggest
    looking into the free SystemC online training on our website:

    http://LearnSystemC.ForteDS.com

    ===================
    David Pursley
    Forte Design Systems (http://www.ForteDS.com)


    Marion McCoskey <> wrote in message news:<>...
    > On 16 Oct 2003 11:31:26 -0700, (youngsun park)
    > wrote:
    >
    > >I am looking at some systemc code and found that
    > >goto is used pretty frequently.
    > >
    > >Anybody has some idea about if it is good
    > >practice or not?
    > >
    > >I heard that a guy proved that you can program without
    > >goto statement.

    >
    > You can, but there are times when you can't create code that is as
    > small or fast without using the goto. It's probably good practice to
    > avoid goto when you can use other functions and get the same results.
    > Gotos are not as readable.
    >
    > > Is it still valid in hardware modeling
    > >like systemc?

    >
    > I'll have to pass on that one. Although I think it would depend on
    > the exact problem and the data dependencies involved. Hardware allows
    > parallelism that software does not because of the sequential nature of
    > the processor. Also, I have never used systemc.
    >
    > Marion McCoskey
    > http://www.mcky.net
    David Pursley, Nov 18, 2003
    #3
    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. Skybuck Flying

    VHDL Goto statement ?

    Skybuck Flying, Aug 8, 2005, in forum: VHDL
    Replies:
    9
    Views:
    6,140
    ajahn
    Aug 26, 2005
  2. Skybuck Flying

    Re: VHDL Goto statement ?

    Skybuck Flying, Aug 8, 2005, in forum: VHDL
    Replies:
    0
    Views:
    740
    Skybuck Flying
    Aug 8, 2005
  3. Martin

    the goto statement

    Martin, Apr 20, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,311
    Martin
    Apr 21, 2005
  4. Mike42
    Replies:
    21
    Views:
    17,352
    Chris Uppal
    Nov 14, 2005
  5. John

    Recommened readings?

    John, Dec 7, 2004, in forum: Ruby
    Replies:
    8
    Views:
    101
    Nicholas Van Weerdenburg
    Dec 8, 2004
Loading...

Share This Page