discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] problem with start/end of burst inband FPGA code


From: Brian Padalino
Subject: Re: [Discuss-gnuradio] problem with start/end of burst inband FPGA code
Date: Wed, 1 Aug 2007 18:07:07 -0400

On 8/1/07, George Nychis <address@hidden> wrote:
> Ok, so on to the code:
> http://gnuradio.org/trac/browser/gnuradio/branches/developers/zhuochen/burst/usrp/fpga/inband_lib/chan_fifo_reader.v

As a general rule, you shouldn't have dangling if-else statements
meaning where there's an if, there's an else.  Otherwise, the hardware
isn't sure what is the default thing to do.  Try to write your
statements so you end everything with an else.

Second, does this code have a testbench?  If not, it really should.

Lastly, diagram it out.  Even if it's just for documents sake, make an
ASM chart of the process you are trying to accomplish.  There are some
things in the code which are too complicated, and this might help you
out.

ASM Chart link:
    http://uhaweb.hartford.edu/jmhill/suppnotes/AsmChart/index.htm

Complicated thing:

                   //Check Start/End burst flag
                   if  (fifodata[`STARTOFBURST] == 1 &&
fifodata[`ENDOFBURST] == 1)
                       burst <= 0;
                   else if (fifodata[`STARTOFBURST] == 1)
                       burst <= 1;
                   else if (fifodata[`ENDOFBURST] == 1)
                       burst <= 0;

A burst is started when there is a start of burst, or if we're already
in a burst and it's not the end of a burst, right?  Otherwise, we're
not bursting?  I could very well be wrong, but definitely setup the
flow chart - diagram what you want it to do.

Jeff has a point as well - try to stick with spaces OR tabs, but don't
mix them both (I like 4 spaces myself), but stick to one and go with
it.

Good luck.

Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]