URL
https://opencores.org/ocsvn/pcounter/pcounter/trunk
Subversion Repositories pcounter
[/] [pcounter/] [trunk/] [doc/] [README] - Rev 2
Compare with Previous | Blame | View Log
---- * pipelined synchronous pulse counter *---- fast counter for slow-carry architectures-- non-monotonic counting, value calculable by HDL/CPU---- idea&code by Marek Peca <mp@duch.cz> 08/2012-- Vyzkumny a zkusebni letecky ustav, a.s. http://vzlu.cz/-- thanks to Michael Vacek <michael.vacek@vzlu.cz> for testing--Pipelined Synchronous Pulse Counter===================================is a proposal of binary counter, designed to minimize logic pathlength in between flip-flops to one gate (MUX/AND) only, at theexpense of not so straightforward binary counting. The reason for thisdesign has emerged while using Actel (MicroSemi) ProASIC/IGLOOarchitecture, lacking any hardwired support for fast carry.During our work on Actel FPGAs (basically, 3-LUT & DFF only), we wereaware of following types of faster counters:- LFSR counter- Johnson counter- "RLA counter" (as tailored using Actel's SmartGen core generator)Johnson due to its O(2^n) (n as number of bits) can not be used forlonger counts; LFSR's are hard to invert (table lookup seems to beonly known method), therefore also impractical for wider counters. RLAcounter is still too slow and complex for wider counters and moderatespeeds (e.g. > 24bits @ >100MHz).As a consequence, the proposed counter uses synchronous divide-by-twoblocks, each using 1-bit pipeline and carry by single-clockpulse. Design is simple and fast, preliminary results from Synplifyand Actel Designer shows 32bits @200MHz feasible.However, output bit lines are non-proportionaly delayed by discretenumber of clock periods. Therefore, to obtain linear bit word, aninversion formula needs to be applied. Fortunately, the inversion issimple (unlike LFSR's), in C (pcount.c):for (k = 1; k < n; k++)if ((y & ((1<<k)-1)) < k)y = y ^ (1<<k);-- it may be implemented in VHDL core, or within CPU as shown, depending onapplication requirements.Files=====pdivtwo.vhdl basic building block -- 1-stage pipelinedflip-floppdchain.vhdl counter top-level entitypcount_tb.vhdl GHDL testbenchpcount.c C language encoder/decoder of counter bitworddoc/pcounter_4bit_trace.pdf simulated signals of 4-bit counterdoc/pcounter_sch.pdf schematic diagram of the counterResults=======Synthesized within larger circuit for Actel ProASIC3E A3PE1500-Stdas 32bit wide counter, typical frequency: 234MHzComments?=========**** First, if you find this pretty simple idea to be non-original work* *please* send me an e-mail with respective pointers; I will then freeze* the repository, including link to the reference.***If you find this idea useful, apply it whenever you want, however,share your improvements. E.g.:- (fast) HDL implementation of bitword encode/decode- preset/reset/match/enable logicTestimonials (usage/frequency/bits/architecture) are indeed welcome.--Greetings by Marek <mp@duch.cz>
