|
|
Subject: synthesizing 'rightof or 'succ
From: KJ
Date: 11/10/2007 4:36:58 PM
"Neha" <neha.karanjkar@gmail.com> wrote in message
news:1194694650.320351.164330@e34g2000pro.googlegroups.com...
>
> However, Xilinx ISE doesn't synthesize 'rightof or 'succ. Is there any
> way to overcome this? I don't want to copy the same code for each
> state.
>
Besides the work arounds that have been suggested, you should probably open
a web case to Xilinx to fix their tool to properly support this. Work
arounds are fine to get one going where the tool falls flat so your design
is not halted by this failure, but Xilinx should be held to task for not
supporting this perfectly valid language construct....and like all suppliers
they respond to complaints so even if there fix isn't in time for you on
this project, you'll be doing your part to help them improve their tool.
Down the road it will be helping others and maybe yourself in the future.
KJ
Subject: synthesizing 'rightof or 'succ
From: KJ
Date: 11/16/2007 3:50:09 AM
"Andy" <jonesandy@comcast.net> wrote in message
news:68c74a06-bdd3-49c8-934a-9166d8b2e68b@w34g2000hsg.googlegroups.com...
> On Nov 14, 12:31 pm, Mike Treseler <mike_trese...@comcast.net> wrote:
>
> I use variables for one main reason: they behave like the code reads:
> they update immediately. Signals turn sequential code into "pseudo-
> sequential" code, and I don't like that. There, I said it.
>
OK. Generally I don't like that variables change their meaning (because
they've been assigned to and update immediately) when they are assigned to
in several places in a long hunk-o-code with all kinds of paths through it.
Of course nobody writes such code ;) My bigger gripe is the lack of history
though.
>I tend
> to use source level debuggers and self checking features (assertions)
> more than waveforms, but that's just the way I do it. I can certainly
> see that if you rely on waveforms, and want to see past history,
> variables can be a liability.
Assertions don't tell you the root cause of what is wrong, just that a
particular bad something has occurred. Many times one can tell simply by
looking at what assertion failed and quickly deduce the root cause of the
problem, but many times it's not so simple to see what incorrect logic led
to the assertion having failed. In any case, the information that one needs
to debug the failed condition lies in the past (i.e. the simulation history
up to that point) not in the future so stepping through code or really
anything other than analysis of the prior state of (possibly) everything in
the design and testbench is required. Signals, variables and log/trace
output files are the evidence that you use for that forensic analysis.
Things that hinder that analysis typically slows down debug. Wave windows
assist in the forensics as a good analytical tool, for investigating the
scene of the crime (i.e. the failed assert). The two are complementary in
that regard.....having said that though, I realize that the beginner will be
debugging using waves alone (until they recognize the value of asserting
darn near everything that they can instead).
>
> The downside of using entities for "information hiding" is that they
> are an all or nothing solution: once you drop down into another
> entity, there is NO shared visibility, unless you go completely global
> which widens the scope too much (and many synthesis tools still don't
> use anyway).
I didn't mean to imply that if, after initial design creation, the
realization sets in that some lower level entity has a 'need to know' about
something and that the interface to that entity couldn't simply be changed
to include that new signal and now the previously hidden info is known. No
need to go global.
> As far as "proper design", a state variable should only be accessed
> and/or updated within a single process (actually, within the case
> statement that defines the state transitions). To do otherwise makes
> maintenance more difficult because the effects of changes to the state
> assignments and transitions are not limited to the state machine.
The downside to that is that the state machine code itself gets bloated and
hard to maintain because you end up with lots of signal assignments
intertwined with the various 'case' and 'if' branches typical of a state
machine. In any case, a state variable is just another signal and is
deserving of no more or less respect than any other signal or variable in
the design. Changes to the code on any signal will have repercussions
downstream, not just changes to state variables.
Maintenance has more to do with readability then it does with dogma about
scoping rules that apply to 'special' signals like state variables that
inexplicitly do not apply to other signals.
>
> So let me clarify: The use of signals for state variables is not poor
> design per se. The use of a signal for a state variable that is
> accessible outside the state machine is poor design.
A multiple screen long state machine filled with signal assignments in the
various branches of the state machine code is a much poorer design (in my
opinion), since it requires paging back and forth to understand the various
reasons why something can be set or reset. I'd much rather have a 1000 line
file where the logic defining any given signal can be viewed and understood
within a single screen than having to wade through that same file searching
for all the possible places that the signal might get assigned.
>
> Like it or not, there is a lot of benefit in the years of software
> development standards that we can take advantage of to improve our
> hardware designs. Just remember, somebody (maybe you) will have to
> maintain that code some day...
>
Words of wisdom
KJ
Subject: synthesizing 'rightof or 'succ
From: KJ
Date: 11/20/2007 3:53:54 AM
"Dave" <dhschetz@gmail.com> wrote in message
news:ffed6419-a4e9-46ea-9756-cc3b725ce15d@c29g2000hsa.googlegroups.com...
KJ
>
> Does anyone know if there is a reason that declaring signals local to
> a process is not allowed? I've always used signals for registers and
> variables only for temporary values or to make code more readable, so
> I'm used to thinking that way. However, I do like the data-hiding of
> variables, and the fact that I don't have to scroll to the top of the
> architecture to see their definitions. I realize blocks could give the
> same effect, but why not just allow signals local to a process?
Probably the same reason that someone decided that 'if' and 'case'
statements can only be in a process and not as concurrent statements.
KJ
|