Lab 03
Lab 03
Lab 03
Objective
In this lab, you will learn:
1. Understand the basic operation of Function Unit (FU).
2. Write test bench to verify the function of Function Unit and debug.
Demo checklist:
Show TA how do you verify FU, and the pattern coverage of your test
pattern.
Answer the following question.
1. Why do we declare input drivers as reg and output loads as wire
variable in testbench?
2. We use #delay to simulate the waveform of input pattern, but can we
use it to describe the circuit?
3. Is it useful to verify your circuit if the operation commands in circuit
and testbench are the same? (ex. Y = A+B;).
Environment Setup
Copy lab file packages from ee4292. Decompress the package and enter it. You can
check the file list in Appendix.
$ cp ~ee4292/iclab2021/lab03.zip .
$ unzip lab03.zip
$ cd lab03
Description
Functional Unit is one of the most critical designs in most of the microprocessor or DSP
(Digital Signal Processor). In lab2, we have a simple ALU to do some simple arithmetic
functions. A Functional Unit based on the ALU in lab2 and with furthermore functions,
is provided in this lab. lab3_fu.v describes the Functional Unit (shown in Figure 1.)
with two 16-bit input signals and 5-bit instructions. You can input signals and select the
function you want to execute by instructions. The instruction is defined in Table 1. In
this lab, you will write a test bench to test the provided FU and correct the bugs in it.
1
EE429200 IC Design Laboratory
2
EE429200 IC Design Laboratory
Action Items
I. Complete the FU.
Add the rotator function into FU. You can reference table to complete this lab.
Appendix
Filename Description
lab3_fu.v RTL code for FU
lab3_fu_test.v Test bench for FU
lab3_run.f Filelist
golden.dat Golden pattern
generate_golden.py Python script used to generate golden patterns
answer.txt Answer for FU