Jamil Khatib

Floating Point Unit project

Floating Point Unit project

(C) Copyright 2000 Jamil Khatib.

Contents

1  List of authors and changes
2  Project Definition
    2.1  Introduction
    2.2  Objectives
3  Specifications
    3.1  System Specification
    3.2  External Interfaces
    3.3  Hardware specification
    3.4  Software specification
    3.5  Interface between SW and HW
4  Internal Blocks
5  Design description
    5.1  Decode Unit
        5.1.1  Design notes
        5.1.2  Timing and flow charts
    5.2  Adder/Subtracter Unit
        5.2.1  Design notes
        5.2.2  Timing and flow charts
    5.3  Round/Normalize Unit
        5.3.1  Design Notes
        5.3.2  Timing and flow charts
    5.4  Exceptions generation
        5.4.1  Design Notes
        5.4.2  Timing and flow charts
    5.5  Compare Unit
        5.5.1  Design notes
        5.5.2  Timing and flow charts
    5.6  Scripts, files and any other information
    5.7  Design conventions and coding styles
    5.8  Design Modeling
    5.9  Integration notes
6  Testing and verifications
    6.1  Simulation and Test benches
    6.2  Specifications of test benches
    6.3  verification techniques and algorithms
        6.3.1  Verification Software
    6.4  Test plans
        6.4.1  Adder/Subtractor unit
7  Implementations
8  Reviews and comments
9  References

1  List of authors and changes

Name Changes Date Contact address
Jamil Khatib Initial release 17-7-2000 khatib@opencores.org
Jamil Khatib Tests and Interfaces added 13-8-2000 khatib@opencores.org
Jamil Khatib Design spec changed to generic CPU interface 23-10-2000 khatib@opencores.org
Jamil Khatib Major Changes and architecture enhancment 3-11-2000 khatib@opencores.org
Jamil Khatib General Review 17-12-2000 khatib@opencores.org
Jamil Khatib Verification section is added 25-12-2000 khatib@opencores.org

2  Project Definition

2.1  Introduction

Floating point numbers and calculations have great use in every day calculations like banks transactions, scientific calculations, graphics, egineering drawings and even games. These kind of calculations will be very solw if they are done without any hw support. This floating point unit core should deliver speed up the calculations. The hardware core and software libraries is going to be provided.

2.2  Objectives

The main objective of this project is to build an IEEE-754 compatible Floating-point unit core and its software. This core should give high performance and have the ability to interface to any CPU core. The project should provide a set of small calculation units. The final step should use the fpu core in a stand alon floating point processor.

3  Specifications

3.1  System Specification

3.2  External Interfaces

FPU interface (for single precision)

DirectionSize Name
INPUT[31:0]operand A
INPUT[31:0]operand B
INPUT[TBD:0]operation type
INPUT[1:0]rounding mode:
0 - To nearest even (DEFAULT)
1 - To +¥(round up)
2 - To -¥(round down)
3 - To ZERO
OUTPUT[31:0]result
Compare Result (Conditions and special numbers)
OUTPUT1larger then ( A > B )
OUTPUT1smaller then (A < B)
OUTPUT1equal ( A == B )
OUTPUT1unordered ( A == NAN | B == NAN )
OUTPUT1infinity ( A == INF | B == INF )
OUTPUT1Zero (A == zero)
Exceptions
OUTPUT1overflow
OUTPUT1underflow
OUTPUT1divide by zero
OUTPUT1SNAN: Invalid operation
OUTPUT1INE: inexact
Control
INPUT1Load
UTPUT1ready

3.3  Hardware specification

3.4  Software specification

3.5  Interface between SW and HW

The interface between SW and HW depends on the used CPU and software platform. Instructions definitions should be easliy customizable. All FPU exceptions can derive external interrupt controller that provides interrupts to the CPU. The system should not be platform dependent.

4  Internal Blocks

The hardware can be divided into the following main blocks:

Figure

5  Design description

5.1  Decode Unit

5.1.1  Design notes

5.1.2  Timing and flow charts

TBD

5.2  Adder/Subtracter Unit

three bits in the most right of the no. (Guard, round and sticky)

One complementer can be used and do a swap Two exponent subtractions can be done e1-e2 and e2-e1 so as not to use a complement and to get a negative value

5.2.1  Design notes

5.2.2  Timing and flow charts

5.3  Round/Normalize Unit

5.3.1  Design Notes

5.3.2  Timing and flow charts

5.4  Exceptions generation

5.4.1  Design Notes

5.4.2  Timing and flow charts

5.5  Compare Unit

5.5.1  Design notes

TBD

5.5.2  Timing and flow charts

TBD

5.6  Scripts, files and any other information

The system has been implemented using the VHDL language

5.7  Design conventions and coding styles

5.8  Design Modeling

5.9  Integration notes

6  Testing and verifications

Requeirement Test method Validation method
Interface timing
The external interface must drive The test bench should
Load signal with each new operation check the sequence of signals
It should sheck the Done signal that mustaccording to number of clocks
be driven when valid result is stable
Functionality

6.1  Simulation and Test benches

A test bech should be provided in order to check the validty of both the timing and the functionality of the FPU core.

6.2  Specifications of test benches

The system test bench should be composed of two parts. The data injection and checking part (called client later on) and the timing checking part (called server later on). This approach is seleced in order to have the ability to change the interface of the FPU and check it without the need to check the functionality of the system.

6.3  verification techniques and algorithms

The functional verifications will be made in two steps

  1. Through SW verification by set of test vectors and checking it versus IEEE-754 compliant software.SoftFloat Library can be used
  2. Through prototyping on FPGA and testing it on real operations and calculations. TBD

6.3.1  Verification Software

6.4  Test plans

Testing should take care of complex operations and well known bugs cased by sequence of operations.

Test plans, equations and operations are TBD

6.4.1  Adder/Subtractor unit

Tests to be run on the add/sub unit:

  1. The same exponent
    1. Addition on operands having the same sign
    2. Addition on operands having different signs follow these tests
      • Operand1 is -ve and op2 is +ve and the result is +ve
      • Operand1 is +ve and op2 is -ve and the result is +ve
      • Operand1 is -ve and op2 is +ve and the result is -ve
      • Operand1 is +ve and op2 is -ve and the result is -ve

    3. Different set of numbers should be applied

  2. Different exponents

    1. Do the same tests as above (all tests in 1)
    2. let Op1 has the larger exponent
    3. let Op2 has the larger exponent

  3. Denormalized numbers

    1. Op1 should be denormalized and op2 is normalized
    2. Op2 should be denormalized and op1 is normalized
    3. Both op1 and op2 should be denormalized
    4. calculations as in 1 and 2 should be made but the result should be denormalized

  4. Special numbers
    1. NAN should be one of the operands.
    2. both operands should be NAN
    3. ±¥ should be one of the operands
    4. Both operands should be + ¥ or - ¥
    5. Operands should be NAN and ¥
    6. op1 should be +¥ and op2 should be -¥
    7. op2 should be +¥ and op1 should be -¥

  5. Do the same above tests (in 1 & 2) on the subtraction operation.
  6. Do the same tests in 1,2,3 and let the result be very large to overflow or very small to underflow

7  Implementations

8  Reviews and comments

9  References


File translated from TEX by TTH, version 2.67.
On 25 Dec 2000, 16:14.