Showing posts with label FPGA. Show all posts
Showing posts with label FPGA. Show all posts

FPGA-ASIC Design Advantages-Disadvantages


2.4.1 FPGA Design Advantages

  • Faster time-to-market: No layout, masks or other manufacturing steps are needed for FPGA design. Readymade FPGA is available and burn your HDL code to FPGA ! Done !!
  • No NRE (Non Recurring Expenses): This cost is typically associated with an ASIC design. For FPGA this is not there. FPGA tools are cheap. (sometimes its free ! You need to buy FPGA.... thats all !). For ASIC you pay huge NRE and tools are expensive. I would say "very expensive"...Its in crores....!!
  •  
  • Simpler design cycle: This is due to software that handles much of the routing, placement, and timing. Manual intervention is less.The FPGA design flow eliminates the complex and time-consuming floorplanning, place and route, timing analysis.

  • More predictable project cycle: The FPGA design flow eliminates potential re-spins, wafer capacities, etc of the project since the design logic is already synthesized and verified in FPGA device.

  • Field Reprogramability: A new bitstream ( i.e. your program) can be uploaded remotely, instantly. FPGA can be reprogrammed in a snap while an ASIC can take $50,000 and more than 4-6 weeks to make the same changes. FPGA costs start from a couple of dollars to several hundreds or more depending on the hardware features.

  • Reusability: Reusability of FPGA is the main advantage. Prototype of the design can be implemented on FPGA which could be verified for almost accurate results so that it can be implemented on an ASIC. Ifdesign has faults change the HDL code, generate bit stream, program to FPGA and test again.Modern FPGAs are reconfigurable both partially and dynamically.

  • FPGAs are good for prototyping and limited production.If you are going to make 100-200 boards it isn't worth to make an ASIC.

  • Generally FPGAs are used for lower speed, lower complexity and lower volume designs.But today's FPGAs even run at 500 MHz with superior performance. With unprecedented logic density increases and a host of other features, such as embedded processors, DSP blocks, clocking, and high-speed serial at ever lower price, FPGAs are suitable for almost any type of design.

  • Unlike ASICs, FPGA's have special hardwares such as Block-RAM, DCM modules, MACs, memories and highspeed I/O, embedded CPU etc inbuilt, which can be used to get better performace. Modern FPGAs are packed with features. Advanced FPGAs usually come with phase-locked loops, low-voltage differential signal, clock data recovery, more internal routing, high speed, hardware multipliers for DSPs, memory,programmable I/O, IP cores and microprocessor cores. Remember Power PC (hardcore) and Microblaze (softcore) in Xilinx and ARM (hardcore) and Nios(softcore) in Altera. There are FPGAs available now with built in ADC ! Using all these features designers can build a system on a chip. Now, dou yo really need an ASIC ?

  • FPGA sythesis is much more easier than ASIC.

  • In FPGA you need not do floor-planning, tool can do it efficiently. In ASIC you have do it.



2.4.2. FPGA Design Disadvantages

  • Power consumption in FPGA is more. You don't have any control over the power optimization. This is where ASIC wins the race !

  •  You have to use the resources available in the FPGA. Thus FPGA limits the design size.

  •  Good for low quantity production. As quantity increases cost per product increases compared to the ASIC implementation.


2.4.3. ASIC Design Advantages

  • Cost....cost....cost....Lower unit costs: For very high volume designs costs comes out to be very less. Larger volumes of ASIC design proves to be cheaper than implementing design using FPGA.

  • Speed...speed...speed....ASICs are faster than FPGA: ASIC gives design flexibility. This gives enoromous opportunity for speed optimizations.

  •       Low power....Low power....Low power: ASIC can be optimized for required low power. There are several low power techniques such as power gating, clock gating, multi vt cell libraries, pipelining etc are available to achieve the power target. This is where FPGA fails badly !!! Can you think of a cell phone which has to be charged for every call.....never.....low power ASICs helps battery live longer life !!

  • In ASIC you can implement analog circuit, mixed signal designs. This is generally not possible in FPGA.

  • In ASIC DFT (Design For Test) is inserted. In FPGA DFT is not carried out (rather for FPGA no need of DFT !) .


2.4.4. ASIC Design Disadvantages

  • Time-to-market: Some large ASICs can take a year or more to design. A good way to shorten development time is to make prototypes using FPGAs and then switch to an ASIC.

  • Design Issues: In ASIC you should take care of DFM issues, Signal Integrity isuues and many more. In FPGA you don't have all these because ASIC designer takes care of all these. ( Don't forget FPGA isan IC and designed by ASIC design enginner !!)
 
  • Expensive Tools: ASIC design tools are very much expensive. You spend a huge amount of NRE.

FPGA vs. ASIC


2.4. FPGA vs. ASIC

Difference between ASICs and FPGAs mainly depends on costs, tool availability, performance and design flexibility. They have their own pros and cons but it is designers responsibility to find the advantages of the each and use either FPGA or ASIC for the product. However, recent developments in the FPGA domain are narrowing down the benefits of the ASICs.

FPGA Vs ASIC
 
 

Standard Cell ASIC Vs Gate Array Vs FPGA


2.3. Standard Cell ASIC Vs Gate Array Vs FPGA

Standard Cell ASIC Vs Gate Arrays Vs FPGA

FPGA


2.2.2. FPGA

FPGA-Field Programmable Gate Arrays
Field Programmable Gate Array (FPGA) are off-the-shelf ICs that can be programmed by the user to capture the logic. There are no custom mask layers so final design implementation is a few hours instead of a few weeks. Simple FPGAs are used for simple functions.
·         FPGAs are increasingly displacing standard cell designs.
·         Capable of capturing 100,000+ designed gates
·         High power consumption
·         High per-unit cost
·         FPGAs are also slow (< 100 MHz)
 

Gate arrays


2.2.2. Gate arrays

 
In a gate array, the transistors level masks are fully defined and the designer can not change them. The design instead programs the wiring and vias to implement the desired function. For example, Interconnections done in layer anything more than 2. In GA design we take a die which have all gates placed but not connected. Metal 2 layer (interconnect) is available, Only layout of interconnect is given to fabrication house.
 
 Gate array designs are slower than cell-based designs but the implementation time is faster as less time must be spent. RTL-based methods and synthesis, together with other CAD tools, are often used for gate arrays. Efficiency decreases with GA.

FPGA Implementation of FIR Filter

FIR Filter

FIR filters are most widely used in FPGA implementations owing to its linear phase property. Compared to IIR filters, FIR filters have simple and regular structures which are easy to implement on hardware. However FIR filters require higher number of taps compared to IIR filters to achieve the same frequency specification. FIR filter implementation on FPGA requires special attention as area, power; speed constraints have to be satisfied. A number of filter architectures for FPGA implementation have discussed. [1][2]. Out of these, Distributed Arithmetic (DA) architecture yields better area, power and speed trade off balance. [1]. A 7th order band pass filter is designed, simulated and synthesized. Modified DA architecture for the implementation of higher order filter is also discussed.

Design of filter using MATLAB

The filter specification is as follows:

Fpass1=1 KHz

Fstop1=0.9 KHz

Fpass2=2 KHz

Fstop2=2.1 KHz

pass band ripple=3dB

stop band ripple=60dB.

For this given specification 10 KHz of sampling frequency is chosen. Equiripple filter design method is opted. Equiripple method provides same tolerance as that of Kaiser Window with less number of filter orders. Filter is designed using ‘fdatool’ of the MATALAB software.


The magnitude and phase response of the designed filter is shown in Figure (1). The figure shows both reference filter response and response of the filter after coefficients have been quantized to fixed point representation. Order of the filter comes out to be 161 i.e. total 162 coefficients. Design of such a higher order filter is difficult task. Using ROM decomposition method of DA architecture we can reduce ROM size, however complexity of system design still exists. Hence to study DA architecture in FIR filter design a lower order filter is designed. Decrease in the order of the filter affects the frequency response of the filter, but it is time being neglected.





FIR Filter

Figure (1) FIR band pass filter response
(click on the figure to enlarge)


Suitable architecture for filter implementation

There is much architecture available which implement FIR filter. Direct form of implementation of FIR filter suffers from less speed and more hardware resources. A single convolution operation requires around 20 CLBs in FPGA implementation. Thus implementation of 7 tap filter with input and coefficient as 8 bit width requires around 20x8=160 CLBs(~300 slices). Systolic array architecture even though improves timing by reducing critical path, utilizes same amount of hardware. When order of the filter increases hardware resource optimization becomes the real challenge. Distributed arithmetic (DA) architecture is comparatively more competitive to any of the other architectures in gate efficiency and operating speed.


Distributed Arithmetic

A brief theory of DA is explained below.


The convolution sum is given by y=f (h,y)=(from n=0 to N-1)∑h(n)*x(n). In DSP applications, if filter coefficients are known beforehand then partial products of the h (n).x (n) can be calculated. These partial products are stored in ROM as a look up table (LUT) and then accessed by the input samples each bits of which are used as the address for ROM. Coefficients h (n) are constants and inputs x (n) is a variable. Therefore x(n) can be represented as, x(n)=(from b=0 to B-1)∑xb(n).2b with xb(n)Є(0,1) where xb(n) denotes the bth of x(n) or nth sample of x.. The inner product y can be written as, y= (from n=0 to N-1) ∑h (n). (From b=0 to B-1) ∑ xb (k) .2b. redistributing the order of summation we get, y=(from b=0 to B-1) ∑ 2b*(from n=0 to N-1) ∑h(n).xb(n)=(from b=0 to B-1) ∑2b*(from n=0 to N-1) ∑f(h(n),xb(n)).


The distributed arithmetic requires 2N word LUT which is pre-programmed to the target device. These partial products are accessed using input vector xb= (xb(0), xb(1),…..xb(N-1)) are weighed by the power of 2 and accumulated. The inner product of y is computed after N look up cycles.



Figure (2) bit serial DA architecture [1]
(click on the figure to enlarge)


For signed DA system output y can be defined as, y=-2b.f(h(n).xb(n))+(from b=0 to B-1) ∑2b*(from n=0 to N-1) ∑f(h(n),xb(n)). The above equation can be implemented in two ways. In one method accumulator with add and subtract is used to add or subtract the partial products as per the sign bit. In another method ROM with an additional input is used. But this method puts burden of doubling the ROM size. [2]


Addressing of ROM can be either in bit serial or bit parallel fashion. Block diagram of bit serial architecture is shown in Figure (2). Bit serial (i.e. one bit per clock) architecture results in high gate efficiency while bit parallel (i.e. B bits per clock) architecture achieves higher speed. There is a performance price to be paid for this gate efficiency- the computation takes at least B clocks [1]. This can be observed in simulation diagram Figure (3).


Implementation


For the implementation of band pass filter as per the specification implementation of 161 order is necessary. Implementation of such a higher order using simple DA architecture requires ROM size of 2161 which is very large and practically not feasible to implement on FPGA. Even though it is possible to reduce the size of the ROM by utilizing symmetrical property of coefficients, ROM size of the present design is still very large. Hence a 7th order with 8 coefficients having 28=256 look up table values is implemented. Coefficients designed by the ‘fdatool’ of the MATLAB are:-0.027, -0.013, 0.004, 0.012, 0.012, 0.004, -0.013 and -0.027. These coefficients are scaled by 1000 to get integer values. Thus coefficient value becomes: -27, -13, 4, 12, 12, 4, -13 and -27. Distributed arithmetic look up table values (total 256 values) are generated by the executable program ‘dagen.exe’ provided with [2].


Total 8 inputs from ‘sample0’ to ‘sample7’ are given to filter. ‘en’ signal is used to indicate that the input supplied to filter are valid inputs. All the inputs are taken by the filter and stored in registers x0 to x7. These register values are used as ROM (or DA LUT) address vectors. For every partial accumulation bits in these registers are shifted using simple ‘for’ loop. DA LUT is written as separate module using ‘case’ statement and it is instantiated in main module ‘dasign’. This realizes into 256x8 sizes ROM. The signal ‘filt_out_valid’ is used to indicate that the available output is valid.


Simulation and Verification


Verification of the designed filter is carried out by testing impulse response and step response. Simulation waveform of the both step and impulse response is shown in Figure (3).


Impulse response


Impulse response of the system characterizes the filter. Impulse response of the filter is always equal to the value of the filter coefficients. Thus if designed filter produces the filter coefficients as its output for impulse input then correctness of the filter design is verified.


Designed filter is excited with impulse signal. The first sample is assigned a value of one (impulse signal) and all other inputs from sample1 to sample7 are made zero. When ‘en’ signal is enabled filter starts the processing of accumulation of partial products. After N clock cycles, where N is the order of the filter, first output is available and ‘filt_out_valid’ signal goes high indicating filter output is valid and can be read from the controlling hardware. This first output is equivalent to the first coefficient value -27. (Marked by circle in Figure (3)).


FIR Filter



Figure (3) step and impulse response
(click on the figure to enlarge)


In next step impulse signal is shifted by one time unit i.e. ‘sample1’ is assigned a value of one and remaining all sample values are made zero. The corresponding obtained output is same as second coefficient value (-13). Similarly impulse signal is moved through all the input samples and corresponding outputs are observed. Simulation results clearly show all the coefficient values coming out as ‘filt_out’ as and when impulse signal traverses through input samples. Thus designed filter is verified by verifying the impulse response of the system.


Step response

Step response of the system also characterizes and verifies the functioning of the filter. For the step input filter output should be equal to the sum of all the coefficients. For our design expected step response output vale is=-27-13+4+12+12+4-13-27= -48.


The filter is excited with step input i.e. all input signals from ‘sample0’ to ‘sample7’ are assigned a value of one. When the signal ‘en’ is enabled after eight clock cycles ‘filt_out_valid’ signal goes high and valid output is available and equivalent to sum of coefficients. Thus step response of the filter is verified.


In simulation diagram shown in Figure (3), the value marked by the first circle is step response output and value marked by the second circle is the impulse response output i.e. first coefficient value. From the same simulation diagram it can be observed that total 7 clock cycles are required to calculate the output for every corresponding input. In systolic array architecture or direct method once the latency period is over or the processing pipeline full, for every clock pulse we get output. Thus in DA FIR filters extra hardware resources are required to control the filter.


FPGA Synthesis Results


The design is synthesized on the target device Spartan 3-3s200ft256-4. At first optimization goal is kept as speed. Then the number of slices used is 144 out of 1920(7%). Number of Slice Flip Flops used are125 out of 3840(3%). Number of 4 input LUTs are 261 out of 3840(6%). Total number of bonded IOBs used are 83 out of 173(47%).1 out of 8(12%) global clock is also used. As per timing analysis, maximum frequency of operation is 104.188 MHz.


The design is synthesized keeping optimization goal as area. Then, the devise utilization is as follows: the number of slices used is 171 out of 1920(8%). Number of slice flip flops used are93 out of 3840(2%). Number of 4 input LUTs are 205 out of 3840 (5%). Total numbers of bonded IOBs used are 83 out of 173(47%). One out of 8(12%) global clock is also used. As per timing analysis, maximum frequency of operation is 86.833 MHz.


References

[1]The Role of Distributed Arithmetic in FPGA-based Signal Processing , 5/6/2008

[2] U.Meyer-Baese, Digital signal processing with field programmable gate arrays, Springer, 2nd edition

[3] Stanley A. White Applications of Distributed Arithmetic to Digital Signal Processing: A Tutorial Review, IEEE ASSP magazine, July 1989



Asynchronous FIFO-Clock Generation Using DCM

Clock Generation using Digital Clock Manager (DCM)

Note: Diagram numbers are continued from the previous post.


To generate the required clock for the FIFO Digital Clock Manager (DCM) wizard is used. DCM can implement a clock delay locked loop, a digital frequency synthesizer, digital phase shifter.

Below mentioned DCM ports are used in this design:

  • CLKIN: CLKIN pin is the clock input to the DCM and is always enabled. CLKIN provides the source clock to the DCM. In this design frequency of 50 MHz (in Spartan 3 development board) is used as input to the CLKIN.
  • RST (RST_IN): RST pin is the reset input to the DCM. If RST is not enabled then RST will be tied to GND.
  • CLKDV: Divide output of the DCM is available at CLKDV pin. An option available in the ‘Divide by Value’ list determines the output clock CLKDV frequency. In this FIFO design input clock is divided by a divide value of 5 to get 10MHz write clock. Input clock of 50 MHz is directly taken as read clock.
  • CLKFX: The CLKFX output pin provides fully digital, dedicated frequency synthesizer output to the DCM. The output frequency is a function of the input clock frequency described by M and D, where M is the multiplier (numerator), and D is the divisor (denominator). M and D are calculated for 100 MHz clock frequency. This output can be divided by 2 by using another DCM to get 50MHz of read clock. Instead of doing this, in design, input clock itself is directly used as read clock for the sake of simplicity.
  • CLK0: Frequency output is same as CLKIN input. This output is also used for on-chip or off-chip synchronization.



Figure (15) RTL schematic of DCM module

The RTL schematic of the DCM module is shown in the Figure (15). The test bench simulated waveform (post-translate model from Modelsim v.5.8 simulator launched by Xilinx ISE) for the DCM is shown in Figure (16).



Figure (16) DCM simulation waveforms

Reset is held high for around 20 nS. Hence the CLKDV_OUT and CLKFX_OUT is zero. Then reset is made low. Out put is generated only after 10 input clock cycles. CLKFX_OUT is twice (50MHz*2=100MHz) and CLKDV_OUT is 5 times less (50 MHz/5=10 MHz) than the input clock frequency (50 MHz).


FIFO with DCM: Synthesis and analysis

The verilog code generated for DCM by the architectural wizard is instantiated in the body of top level module fifo_top.v.


a_fifo5 a_fifo55(d_out,f_full_flag,f_half_full_flag,f_empty_flag,

f_almost_full_flag,f_almost_empty_flag,d_in,r_en,w_en,CLK0_OUT,CLKDV_OUT,reset); //instantiate fifo

dcm_fifo dcm_fifo1(CLKIN_IN, RST_IN, CLKDV_OUT, CLKFX_OUT, CLKIN_IBUFG_OUT,CLK0_OUT,

LOCKED_OUT); //instantiate DCM


FIFO code a_fifo5.v is also instantiated in the top level module. Binary counters are instantiated in the a_fifo5.v program. Thus total hierarchical structure of the design is as shown in the Figure (17). Top level module has instantiations to the modules dcm_fifo, a_fifo5. dcm_fifo module generates required clocks for the design while a_fifo5 module implements FIFO memory controller. B_counter module is instantiated twice in a_fifo5 module to obtain read and write address generators.



Figure (17) Hierarchical structure of the FIFO design


FIFO top level module fifo_top.v is verified by the help of test bench program generated by Xilinx ISE and behavioral simulation results are shown in the Figure (19). RTL schematic generated for the top module is shown in the Figure (18). The schematic includes both DCM module and FIFO module connected to each other as per the design requirement. Outputs x, y and z are from DCM module and are not used. The simulation results justify the FIFO working without any error. Input clock CLKIN_IN itself becomes read clock. Since w_clk is generated internally it is not shown in the simulation waveform.



Figure (18) RTL schematic of DCM and FIFO



Figure (19) FIFO top module simulation waveform


The summary of the FPGA resources used for the complete design is listed below. The below mentioned devise utilization summary is part of the synthesis report generated by Xilinx-synthesize-XST.


Device utilization summary:

---------------------------

Selected Device : 3s200ft256-5

Number of Slices: 28 out of 1920 1%

Number of Slice Flip Flops: 23 out of 3840 0%

Number of 4 input LUTs: 54 out of 3840 1%

Number used as logic: 38

Number used as RAMs: 16

Number of IOs: 29

Number of bonded IOBs: 29 out of 173 16%

Number of GCLKs: 3 out of 8 37%

Number of DCMs: 1 out of 4 25%

Timing Summary:

--------------

Speed Grade: -5

Minimum period: 5.091ns (Maximum Frequency: 196.444MHz)

Minimum input arrival time before clock: 6.185ns

Maximum output required time after clock: 11.059ns

Maximum combinational path delay: 6.662ns
------------------------------------------------------------------------------------

From the timing summary it can be observed that maximum operating frequency is increased from around 110 MHz to 196.444 MHz. this can be attributed to the DCM which provides stable clock signal to the hardware resources. 16 numbers of LUTs are utilized as distributed dual port RAM. Synthesis of a_fifo5 showed around 35 numbers of slices. But with the complete implementation it has reduced to 28. Total numbers of flip flops used also reduced.


Merits and demerits of the design

One of the important advantages of the proposed design is that the design shows efficient performance for the synchronous as well as asynchronous clocks (frequency within the maximum operating frequency). All status flags are asserted and deasserted with zero clock cycle delay. The new design uses simple 4 bit binary counters for addressing the FIFO memory. Synchronization between the clock domains is achieved with the pointer difference concept which is very easy to understand and implement. But the design can be slower compared to the design of FIFO with gray pointer approach. But this has to be tested.

This ends the article series on asynchronous FIFO I designed. There are many methods by which design can be implemented. I shared what I designed. Your comments are always welcome!



Related Articles

Asynchronous FIFO: Simulation and Synthesis


Asynchronous FIFO: Simulation using Modelsim

Note: Diagram numbers are continued from the previous post.

Test bench strategy is to generate all corner conditions like full and empty. Simulation waveforms are shown in Figure (11) to Figure (13). These waveforms are generated using test bench program provided in previous article. Read clock frequency 50 MHz and write clock frequency 10 MHz are generated using initial procedural statements:

initial begin #10 r_clk=0; forever #10 r_clk=~r_clk; end

initial begin #5 w_clk=0; forever #50 w_clk=~w_clk; end

Duty cycle of r_clk is 10 nS and w_clk is 50 nS.

Other conditions like w_en, r_en etc are generated using below set of statements:

initial begin d_in=1;

@(posedge w_en);

repeat(20) @(posedge w_clk) d_in=d_in+2;

repeat(20) @(posedge w_clk) d_in=d_in-1;

end

initial begin reset=1;#30 reset=0;end

initial begin fork #50 w_en=1; #1800 w_en=0; #2500 w_en=1 ; join end

initial begin fork #50 r_en=0; #1850 r_en=1; #2400 r_en=0; #2500 r_en=1; join end

In the above two statements ‘fork’ and ‘join’ are used to start the simulation at zero simulation time. Reset signal is activated for first 30 nS and then it is deactivated. For the first 5 nS reset is active which tests asynchronous reset condition

For asynchronous reset condition except d_out all other variables are initialized to default states, including f_empty_flag. r_ptr, w_ptr, ptr_diff are initialized to zero. All FIFO status flags are initialized to default values. Since reset signal is connected to binary counters, reset of counters causes reset of both read and write pointers, pointer difference and all status flags. This can be observed in the simulated waveform shown in Figure (11). Verilog code has to be improved for the complete asynchronous reset including reset of d_out. When I tried to add asynchronous reset to RTL code of dual port RAM, synthesizer does not infer dual port RAM. Instead, it infers set of registers. This problem has to be sorted out.



Figure (11) Simulation waveform 1


After 1800nS amount of time w_en is disabled. This time gap is chosen so that FIFO full condition can be generated. (See Figure (11)). When ptr_diff becomes equal to (fifo_depth-1) f_full_flag goes high and w_ptr stops counting. Further data on the d_in bus will overwrite on the last location of the FIFO. This is unavoidable since there is no control over the d_in bus. When FIFO is half filled (i.e. fifo_depth/2) f_half_full_flag is asserted and in next w_clk cycle it goes to normal state. Similarly when FIFO reaches almost full condition f_almost_full_flag is asserted. Thus all status flags are activated within zero clock delay. (See Figure (13))

Signal r_en enabled to start read operation. At this time w_en is disabled so that empty condition can be generated. R_en is detected in coming positive edge of clock cycle and hence data is read with zero r_clk cycle delay. (See Figure (12). When ptr_diff becomes zero f_empty_flag is asserted. r_ptr stops incrementing. But for every r_clk data is read from the last location and put on to the d_out bus.




Figure (12) Simulation waveform 2


When both r_en and w_en are enabled read clock domain has to wait till data has been written to FIFO. Thus empty flag goes low for the positive edge of w_clk. At the next positive edge of the r_clk data has been read out and put in d_out bus. Since r_ptr has incremented ptr_diff becomes zero and f_empty_flag goes high again. This status remains till next positive edge of w_clk. Observe the asynchronous read and write operation in the Figure (13). F_empty_flag and r_next_en signals are compliment to each other. As soon as data is written to the FIFO r_next_en signal is enabled. Read address is incremented and both read and write pointers become equal. This makes the ptr_diff zero and once again f_empty_flag is asserted. Thus there is no pessimistic reporting of assertion or removal of FIFO status flags.


Thus overall performance of the designed FIFO resembles the performance of the FIFO IP core provided by the Xilinx. Algorithm and methodology used are entirely different in both designs. IP core uses acknowledgement signal for the confirmation of read and write operation. But proposed design does not have any such mechanism. It is assumed that data sending and receiving hardware takes care of the data once the FIFO full and empty condition are asserted.



Figure (13) Simulation waveform 3


Asynchronous FIFO: Synthesis using Xilinx ISE and Spartan 3


Synthesis of the design based on two different optimization goal makes difference in usage of logic cells and maximum operating frequency of the design. Maintaining ‘speed’ as optimization goal, maximum achievable frequency is 113.830MHz.

----------------------------------------------

Timing Summary:

Speed Grade: -5

Minimum period: 8.785ns (Maximum Frequency: 113.830MHz)

Minimum input arrival time before clock: 4.692ns

Maximum output required time after clock: 12.049ns

Maximum combinational path delay: No path found

---------------------------------------------------------


Maintaining ‘area’ as optimization goal, maximum achievable frequency is 90.212MHz.


--------------------------------------------------------

Timing Summary:

Speed Grade: -5

Minimum period: 11.085ns (Maximum Frequency: 90.212MHz)

Minimum input arrival time before clock: 4.574ns

Maximum output required time after clock: 13.375ns

Maximum combinational path delay: No path found

---------------------------------------------------------------------


The difference in the operating frequency can be attributed to the delay in the adder-subtractor circuit. Dual port distributed RAM is used for memory. Output data d_out is registered (RTL schematic is shown in Figure (14)) which is one of the advantages of this design.



Figure (14) Registered output


The part of the synthesis report generated by Xilinx ISE, shown below infers the hardware which remains same for both optimization goals.


----------------------------------------------------------------------

Synthesizing Unit .

Related source file is a_fifo5.v.

Found 16x8-bit dual-port distributed RAM for signal .

-----------------------------------------------------------------------

| aspect ratio | 16-word x 8-bit | |

| clock | connected to signal | rise |

| write enable | connected to internal node | high |

| address | connected to signal | |

| dual address | connected to signal | |

| data in | connected to signal | |

| data out | not connected | |

| dual data out | connected to internal node | |

| ram_style | Auto | |

-----------------------------------------------------------------------

INFO:Xst:1442 - HDL ADVISOR - The RAM contents appears to be read asynchronously. A synchronous read would allow you to take advantage of available block RAM resources, for optimized device usage and improved timings. Please refer to your documentation for coding guidelines.

Found 8-bit register for signal .

Found 4-bit addsub for signal <$n0003>.

Found 4-bit comparator greater for signal <$n0007> created at line 60.

Found 4-bit comparator less for signal <$n0008> created at line 62.

Found 4-bit adder for signal <$n0009> created at line 64.

Found 4 1-bit 2-to-1 multiplexers.

Summary:

inferred 1 RAM(s).

inferred 8 D-type flip-flop(s).

inferred 2 Adder/Subtracter(s).

inferred 2 Comparator(s).

inferred 4 Multiplexer(s).

Unit synthesized.

-----------------------------------------------------------------


But observation of the low level synthesis gives the device utilization summary. Device utilization with ‘speed’ as optimization goal is as follows:


-----------------------------------------

Device utilization summary:

---------------------------

Selected Device: 3s200ft256-5

Number of Slices: 36 out of 1920 1%

Number of Slice Flip Flops: 20 out of 3840 0%

Number of 4 input LUTs: 50 out of 3840 1%

Number of bonded IOBs: 24 out of 173 13%

Number of GCLKs: 2 out of 8 25%

-------------------------------------------------------------


Device utilization with ‘area’ as optimization goal is as follows:


-----------------------------------------

Device utilization summary:

-----------------------------------------

Selected Device : 3s200ft256-5

Number of Slices: 34 out of 1920 1%

Number of Slice Flip Flops: 16 out of 3840 0%

Number of 4 input LUTs: 47 out of 3840 1%

Number of bonded IOBs: 24 out of 173 13%

Number of GCLKs: 2 out of 8 25%

------------------------------------------------------------


In the case of ‘area’, slices are reduced by 2, slice flip-flops are reduced by 4, 4 input LUTs are reduced by 3. For the present design read clock is working at 50MHz. Hence operating speed of the design is very important and optimization goal is maintained as ‘speed’. Other than the package pin constraints, area constraints or timing constraints are not provided to the design while synthesis. Since the design doesn’t consume much of the resource of the FPGA area is not important factor. Package pin constraints are given so as to implement the design on Spartan 3 development board. This is done for the fifo_top.v code which includes clock generation code for the design.


Related Articles