Advanced Verification of Single Precision Floating Point ALU
Advanced Verification of Single Precision Floating Point ALU
point ALU
Varunkumar J [1], Anusha R [2], Shreenidhi S [3], Vishwas S [4]
Department of Electrical & Electronics Engineering
PES Institute of Technology and Management, NH-206, Sagar Road, Shivamogga District-577204, Karnataka
Email: [email protected], [email protected], [email protected], [email protected]
I. INTRODUCTION
Figure-1
Arithmetic is a basic operation in everyday life
Numbers in this format are composed of the following
which include operations such as addition, subtraction
three elements:
and multiplication. To keep a check on proper working
1. Sign bit(S)
on these arithmetic operations, ALU is the most
It is the first bit of the binary representation, where “0”
important element of the system.
represents a Positive number and “1” represents a
But for most of the applications we need floating Negative number.
point numbers in order to provide high precision and Example: 1 10000010 10101000000000000000000 this
represent very small or very large numbers. Hence is a Negative number.
“Floating Point ALU (FPU)” was designed. 0 10000011 10100000000000000000000 this
An Arithmetic logic unit (ALU) is a digital is a Positive number.
electronic that performs arithmetic and bitwise logical
operations on integer binary numbers. This is contrast 2. Exponent(E)
to a floating-point unit (FPU), which operates on The next 8 bits represent the Exponent. In 32-bit
floating point numbers. Multiple ALUs are incorporated floating-point representation a unique number i.e., 127
in a single CPU. is used. It is known as “Bias”. This Bias number is
determined by 2k-1 -1, where ‘k’ is the number of bits in
Floating-point numbers are widely used in many the exponent field (for 32-bit FPU k is 8).
applications. ALU is a block in a microprocessor that Bias =127 for 32-bit FPU. (28-1 -1 = 128-1 = 127)
handles arithmetic operations and FPU is a coprocessor Example: 0 10000011 10100000000000000000000
which handles the floating-point operations. Some 10000011 – the decimal value of exponent part is 131.
CPUs have more than one floating-point unit (FPU) that By doing Bias operation on exponent i.e., 131-127 = 4.
handles floating-point operations.
This is designed by one person or more using a 3. Mantissa(M)
particular logic, but while using we come across plenty The mantissa will be of 24 bits and one bit will be an
of test cases in which it may fail to perform. Therefore, “Implicit bit” which is ‘1’ and the other 23 bits will be
verification of the design has to be done for the given the real mantissa which has to determined.
design specifications in which maximum testcases Example: 0 10000011 10100000000000000000000
should be passed to obtain maximum Coverage. The mantissa is calculated as (without Implicit bit),
Compared to the process of developing a Design unit, 1*(1/2) +0*(1/4) +1*(1/8) +0*(1/16) +…. = 0.625
the process of verifying the Design unit will require Thus, the mantissa will be (with implicit bit)
more time and resources. The verification process can 1+0.625 = 1.625.
be started as soon as the design specification is The decimal number is:
developed. The verification process can be done (Sign) (Exponent)*(Mantissa)
parallelly with the design process. i.e., (+) (24) *(1.625) = 26.
Authorized licensed use limited to: College of Engineering - THIRUVANANTHAPURAM. Downloaded on December 18,2022 at 08:42:41 UTC from IEEE Xplore. Restrictions apply.
III. METHODOLOGY This is a “Golden model” that replicates the DUV.
Building a Verification Environment: It generates the reference results which is used for
comparison. It receives the inputs from the driver
through a mailbox and sends the outputs to the
scoreboard through another mailbox.
9. Scoreboard
It receives the golden values from reference model
through a mailbox and also the outputs (actual
results) from monitor through a mailbox. It
compares both the values and generates a report.
IV. OPERATIONS
Authorized licensed use limited to: College of Engineering - THIRUVANANTHAPURAM. Downloaded on December 18,2022 at 08:42:41 UTC from IEEE Xplore. Restrictions apply.
After the operation resultant is checked for Functional coverage is a feature from which the
overflow. measurement can be made as how much of the design
specification has been exercised in verification.
3. Special cases in Floating point operations.
The special cases include “zero, normal, 2. VERIFICATION PROCESS
subnormal, NaN (Not a Number) and infinity”. The verification process includes, collection of
Before performing the normal operations DUT (Device Under Test), building a SystemVerilog
(addition or subtraction or division), the operands Environment for verification. The Environment
are checked for special cases. If there exists a includes blocks shown in block diagram. The process of
special case the normal operation will not be verification starts by providing the number of testcases
performed, rather a special output will be displayed required. Then the random data generated will be sent
as per the special case. to driver block as per the number of testcases. The
driver will drive these data to the DUT and also to the
V. VERIFICATION METHODOLOGY reference model block.
1. TEST BENCH COMPONENTS The DUT will perform its operations as per its
The key elements in the System Verilog Test bench program, and will send its response through its output.
used here are: The Reference model will be programmed as
i. Classes per the DUT’s specifications. Therefore, the Reference
ii. Scoreboard block will perform its operations with the given inputs
iii. Generators and will send the response through its output (the input
iv. Interface and output can be saved if required in some cases). The
v. Mailbox output or response from Reference model is known as
vi. Functional coverage “Golden values”.
The Monitor block is connected to DUT’s
Classes output and hence the Monitor will get the output.
Classes are written in SystemVerilog and utilize the
same software techniques as would be present in a C++ The Scoreboard is connected to both Reference
style environment. Classes with the help of object model and Monitor. Therefore, the scoreboard will get
handles allow objects to be dynamically created, the outputs from monitor and reference block. The
deleted, assigned and accessed. Scoreboard will compare the monitor’s output with the
Golden values. After comparing, it verifies if the
Scoreboard response from DUT is matching with our Golden
Scoreboard has two mailboxes, the data from these two values. If they are same, then it can be said that the
mailboxes are compared and if they don’t match, then DUT is working as per the given specifications.
the errors will be dealt with.
The coverages will show the testcases that
Generators have been met. It will show the scenarios where the
Here the Random pattern data are generated and they testcases are not met. It will help to see whether the
are sent as inputs to two main blocks i.e., Design under corner cases are covered or not.
test (DUT) and Golden value generator. In some cases,
the data is constrained so as to limit the amount of non- CONCLUSION
useful data generated. The Verification environment has been built in
SystemVerilog (SV) language for the verification of the
Interface DUT (Design program) of the Single Precision (32 bit)
Interface is used to communicate between blocks. floating-point ALU for addition, subtraction and
multiplication operations using QuestaSim software.
Mailbox IEEE-754 standard based floating-point representation
Mailbox is a communication medium which transfers has been used. We developed the test cases to achieve
data between the two blocks. Mailboxes can be created 100% functional coverage. From this, it can be seen that
having either a bounded or unbounded queue size. by performing Verification on the DUT, the operations
of the DUT is verified for all the test cases as per the
Functional coverage specifications.
367
Authorized licensed use limited to: College of Engineering - THIRUVANANTHAPURAM. Downloaded on December 18,2022 at 08:42:41 UTC from IEEE Xplore. Restrictions apply.
OUTPUT WAVEFORMS
ADDITION
SUBTRACTION
MULTIPLICATION
REFERENCES
[1] IEEE–754[2008]: This standard specifies interchange and [7] Design and Simulation of Floating point Pipelined ALU using
arithmetic formats and methods for binary and decimal floating- HDL and IP core generator- Itagi Mahi,S.S.Kerur, Department
point in arithmetic. of Electronics and communication Engineering, SDMCET,
Dharwad, India.
[2] IRJET research paper engineering students of Abha Gaikwad
college of Engineering, Nagpur, maharashtra. [8] Single precision Floating point ALU- Pradnya A. Shengale,
vidya Dahake, Mithilesh Mahendra, EC, Abha Gaikwad patil
[3] The Development of Advanced Verification Environment using college of Engineering and technology, Nagpur, Maharashtra,
System Verilog – Martin Keaveney, Anthohny McMahon, Nial India.
o’keeffe, kevin keane, James O’Reilly, Department of
Electronic Engineering, GMIT, Dublin road, Galway. [9] Simulation and synthesis model for addition of single precision
floating point numbers using Verilog – Ravi payal, school of
[4] Floating Point Arithmetic Unit Using Verilog Lalita Gangwar1 electronics, CDAC, Noida.
and Rajan Chaudhary Department of Electronics and
Communication, Future Institute of Engineering and [10] Questa Sim user’s manual.
Technology Bareilly, India.
[11] SystemVerilog for verification – Springer.
[5] Floating point Arithmetic unit using Verilog- Lalitha Ganagwari
and Rajan Chaudhary, Department of Electronics and
communication, Future Institute of Engineering and technology,
India.
368
Authorized licensed use limited to: College of Engineering - THIRUVANANTHAPURAM. Downloaded on December 18,2022 at 08:42:41 UTC from IEEE Xplore. Restrictions apply.