Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/18/10 20:21
Read: times


 
#176756 - Its all hand waving again.
Responding to: ???'s previous message
Andy Peters said:
Jez Smith said:
Used binary to grey code conversion in the addressing scheme for a fifo, it results in very fast hardware.


I wish synthesis tools had an option to generate grey-code counters for just this application! They can generate grey code for state machine state registers, but not for general-use incrementing counters.

OK, so waaay off topic here regarding counters: I have some state machines that have the counter embedded. In other words, there might be one state that initializes the counter to zero, or perhaps loads it, and in another state (or states) the counter is incremented or decremented. I noticed that a particular design wasn't meeting timing (240 MHz!) and as such I looked at what the synthesizer was doing.

This is easy to do, no need to look at the generated RTL schematic. The synth report for each entity lists the stuff it works out. So for my counters, I noticed that the tool was generating adders instead of counters, and general-purpose adders are of course slower than counters (no need to deal with two inputs, etc etc).

The solution, then, is to code the counter in the usual way, with only a sync reset and/or load and a count enable, and a modulo to handle rollover if that situation is legal for the design. This synthesizes a counter and things are faster. The state machine needs to assert the counter load enable/clear and count enable when required. Of course this means being cognizant of pipeline delays -- the state machine asserts the counter enable, which is recognized by the counter on the next clock, and thus the new counter output is available on the second clock after the assertion of the enable.

(Of course you could be suicidal and do a two-process state machine so that the counter enable is recognized immediately and you can save a clock, but that leads to a load of issues.)

-a

-a

I think that is really down to the symantics of the language you are using and wether or not your synthesis tool is able tell the difference between what you meant and what it thinks you meant.

List of 14 messages in thread
TopicAuthorDate
Modeling With Gray Code            01/01/70 00:00      
   Good idea            01/01/70 00:00      
      I use php for a lot of modeling            01/01/70 00:00      
   most recently..            01/01/70 00:00      
      Let's discuss faster...            01/01/70 00:00      
         Its safer..            01/01/70 00:00      
            Slightly hostile enviroment            01/01/70 00:00      
               For sure...hostile            01/01/70 00:00      
                  sort of...            01/01/70 00:00      
      fifo grey-code addressing            01/01/70 00:00      
         Its all hand waving again.            01/01/70 00:00      
   Using Spreadsheets            01/01/70 00:00      
   gawk/sh/cut/sed            01/01/70 00:00      
      Cygwin environment            01/01/70 00:00      

Back to Subject List