Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > goto statement is recommened in systemc?

Reply
Thread Tools

goto statement is recommened in systemc?

 
 
youngsun park
Guest
Posts: n/a
 
      10-16-2003
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.
 
Reply With Quote
 
 
 
 
Marion McCoskey
Guest
Posts: n/a
 
      11-14-2003
On 16 Oct 2003 11:31:26 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (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
 
Reply With Quote
 
 
 
 
David Pursley
Guest
Posts: n/a
 
      11-18-2003
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 <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> On 16 Oct 2003 11:31:26 -0700, (E-Mail Removed) (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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a goto statement (or something similar)? Mike42 Java 21 11-14-2005 12:22 PM
VHDL Goto statement ? Skybuck Flying VHDL 9 08-26-2005 01:46 PM
Re: VHDL Goto statement ? Skybuck Flying VHDL 0 08-08-2005 03:21 AM
the goto statement Martin ASP .Net 4 04-21-2005 10:31 PM
Recommened readings? John Ruby 8 12-08-2004 10:04 PM



Advertisments