IC OVERVIEW
RTL DESIGN AND VERIFICATION
1
COURSE INTRODUCTION
Khóa Học Thiết Kế Vi Mạch Cơ Bản - Trung Tâm Đào Tạo Thiết Kế Vi Mạch ICTC
2
COURSE INTRODUCTION
SUMMARY
HOMEWORK
QUESTION
SELF-LEARNING
3
Session 4: LINUX,
VIM, EDA
1. LINUX
2. VIM
. 3. EDA
4
LINUX ENVIRONMENT
Why Linux is widely used among semiconductor companies ?
5
LINUX ENVIRONMENT
Many semiconductor companies use Linux environments for
various reasons:
❑Open source
❑Customization
❑Stability and Reliability
❑Cost efficiency
❑Security
❑Ecosystem
6
BASIC LINUX COMMANDS
Command Description Example
ls List a directory content ls <dir_name>
ls
pwd Shows the current working path pwd
cd Change the current working directory cd <dir_name> : go to <dir_name>
cd .. : go to upper 1 level
cd - : go back to directory before entering current directory
mkdir Creates a new directory mkdir <dir_name>
tree Display the hierarchy of current location tree : display full hierarchy of current location
tree –L 2: display hierarchy of 2 level from current location
rm Remove file or directory rm –rf <dir_name/file_name>
cp Copy file or directory cp –rf <dir_name/file_name> <new_file/new_location>
mv Move file or directory mv <dir_name/file_name> <new_file/new_location>
touch Create a new empty file touch <file_name>
cat Print the content of file to Linux terminal, cat <file_name>
or concatenate files together cat <file_1> <file_2> … <file_n>
7
BASIC LINUX COMMANDS
The most important thing when you use Linux command is:
You Need To Know Where You Are
(means the directory/location that you are staying)
8
LINUX ENVIRONMENT
Common Linux Commands
Lab1: create working directory
1. Login to ICTC, enter your provided ID and password
2. Open Terminal
3. At your home directory, create a folder named “04_ss4” and create below hierarchy under it:
|--04_ss4
| |-- lab1
| |-- lab2
| |-- lab3
4. Create an empty file, named “lab1.txt” under lab1
5. Change the file name from “lab1.txt” to “lab1_<your_name>”.txt, example lab1_duc.txt
6. Copy /ictc/student_data/share/ico/04_ss4/lab1/lab1.txt under your lab1 folder
7. Display the content of lab1.txt in your lab1 folder, it should appears the message “You PASSED this lab”.
Lab2: modify working directory
1. Copy lab3 under lab2 and change the directory name (of lab3 under lab2 folder) to lab2_subdir
2. Replace lab2_subdir directory by /ictc/student_data/share/ico/04_ss4/lab2/lab2_subdir
3. Check if there is a README file inside 00_linux/lab2/lab2_subdir. If it is existed, display the content of README.
it should appears the message “You PASSED this lab”.
9
OTHER LINUX COMMANDS FOR SELF-LEARNING
Command Description Example
grep Search a string within a file grep <string> <file_name>
du Check the size of the file or directory du –sh <file/dir_name>
clear Clear terminal clear
diff/vimdiff Check difference between files diff/vimdiff <file_1> <file_2> … <file_n>
find Find a file, directory find <location> -name <file_name> : find <file_name> in <location>
dind <location> -type d –name <dir_name> : find <dir_name> in
<location>
echo Print something to terminal echo “text”: print “text” to terminal
echo “file.txt”: print “file.txt” (the file name is file.txt) to terminal
date Print current date date
head Display the beginning of the file head –n 10 <file> : display first 10 lines of <file>
tail Display the end of the file tail –n 10 <file> display last 10 lines of <file>
10
LINUX ENVIRONMENT
VIM Editor
❑ Vim is a text editor for Linux. It is mainly because it can be managed entirely without menus or a mouse,
using only a keyboard
❑ Vim is a powerful text editor popular among developers. It's based on shortcuts, called the Vim language,
which can make coding and writing faster and more efficient.
❑ To open Vim, on Linux terminal you can use: vi <file_name>
❑ We have 2 common modes usually used in Vim:
▪ Insert mode: for typing text
o To switch Insert mode, use can type “i” and “insert” on keyboard, so you can start editing the file.
o To exit this mode, use “Esc” on keyboard (back to command mode)
▪ Command mode: You can execute commands like undo, redo, find and replace, save, quit, etc. This
mode is default mode when starting VIM.
11
LINUX ENVIRONMENT
VIM Editor – Common commands
Type of command Command Description
Delete command x or “delete” on keyboard To delete the character
dd To delete the current line
Copy, Paster command yy Copy current line
P Paste the line and place it below the cursor
Save and exit file :w Save the file
:w <file_name> Save the file to another file with name is “file_name”
:wq Save and quit
:q! Exit but not save
Search and replace /text Forward search with text keyword
?text Backward search with text keyword
n Find the previous match string
N (Shift + n) Find next match string
Undo and redo u Undo the last command
ctrl + r Redo 12
LINUX ENVIRONMENT
VIM Editor: Self-Learning
Type of command Command Description
Others :vs Vertically split widows
To change to other split windows, do either below:
1.set mouse=a then move the mouse to other window
2.ctrl+w → left arrow button to go to left, right arrow button to go to right window
:sp Horizontally split window
To change to other split windows, do either below:
1.set mouse=a then move the mouse to other window
2.ctrl+w → upward arrow button to go up, downward arrow button to go to bottom
window
gg Go to first line of the file
GG Go to final line of the file
:set nu Display line number
:%s/text1/text2/g Replace string text1 by text2
13
LINUX ENVIRONMENT
Working directory
Lab3
Step 1: Create the directory tree as below under the lab3 folder, all the files are
empty.
|--lab3
| |--rtl //design dir
| | |-- top.v //design file
| |--sim //simulation dir
| | |-- rtl.f //rtl list
| | |-- tb.f //testbench list
| | |-- compile.f //compile list
| | |-- Makefile //run script
| |--tb //testbench dir
| | |-- test_bench.v //testbench file
14
LINUX ENVIRONMENT
Working directory
Step 2: Open top.v and type exactly as below
module top (
input wire a,
input wire b,
output wire z
);
assign z = a ^ b;
endmodule
15
LINUX ENVIRONMENT
Working directory
Step 3: Open the files rtl.f, tb.f, compile.f and type exactly as shown below:
rtl.f tb.f compile.f
../rtl/top.v ../tb/test_bench.v -f rtl.f
-f tb.f
16
LINUX ENVIRONMENT
Working directory
Step 4:
▪ Copy Makefile from /ictc/student_data/share/ico/04_ss4/lab3/sim/Makefile and replace
your Makefile.
▪ Copy folder tb from /ictc/student_data/share/ico/04_ss4/lab3/tb and replace your tb folder
17
LINUX ENVIRONMENT
Working directory
Basic environment is like below:
|--rtl //design dir
| |-- top.v //design file
|--sim //simulation dir
| |-- rtl.f //rtl list
| |-- tb.f //testbench list
| |-- compile.f //compile list
| |-- Makefile //run script
|--tb //testbench dir
| |-- test_bench.v //testbench file
% cd sim
% make build //compile the design and tb
18
LINUX ENVIRONMENT
Working directory
Basic environment is like below:
|--rtl //design dir
| |-- top.v //design file
|--sim //simulation dir
| |-- rtl.f //rtl list
| |-- tb.f //testbench list
| |-- compile.f //compile list
| |-- Makefile //run script
|--tb //testbench dir
| |-- test_bench.v //testbench file
% make run //run simulation
19
LINUX ENVIRONMENT
Working directory
Basic environment is like below:
|--rtl //design dir
| |-- top.v //design file
|--sim //simulation dir
| |-- rtl.f //rtl list
| |-- tb.f //testbench list
| |-- compile.f //compile list
| |-- Makefile //run script
|--tb //testbench dir
| |-- test_bench.v //testbench file
% make wave //open waveform
20
LINUX ENVIRONMENT
Working directory
Choose Layout → NoDesign to see the Choose signal → right click → Radix to
hierarchy in same window change signals’ display value
21
LINUX ENVIRONMENT
Working directory
Testbench schematic view
Choose hierarchy → right click → Add to
→ Schematic → Full to see the schematic
Double click to dut to see the dut schematic
22
LINUX ENVIRONMENT
Working directory
Press Ctrl and use scroll wheel on your mouse to zoom-in and zoom-out
Or Use (+) and (-) buttons on your control panel
You can double click on the waveform signal to trace the value in the design.
23
SESSION 4
SUMMARY
SUMMARY:
❑ The Linux operating system is widely used in semiconductor industry.
❑ Vim is a powerful text editor for Linux
❑ Makefiles are a type of script in Linux that can be used to automate multiple user
tasks for users
24
HOMEWORK
Homework1:
❑ Step 1: create a folder named homework under your 04_ss4 directory.
❑ Step 2: Copy the file /ictc/student_data/share/ico/04_ss4/homework/vimtutor.txt to your
homework folder.
❑ Step 3: Complete all the lessons in the vimtutor.txt, marking each lesson with “==>DONE” at
the end. Refer to the picture on the right for an example.
Note: “Summary” is not a lesson, do not add “==>DONE” after it.
❑ Step 4: Run the following command in Linux:
grep “==>DONE” vimtutor.txt | wc -l
Expected output is: 33
❑ Step 5: Take a screenshot of the result and submit it via the homewok form.
See the example below. Submit a similar screenshot.
Your lecturer will verify this in your directory.
25
HOMEWORK
Homework2 (*):
❑ Investigate the Makefile and add following requirement
▪ When type “make help”, it will output
▪ When type “make clean”, it will remove all the file generated by the simulation.
▪ When type “make all”, it will build and run the simulation
➢ Keep the new Makefile under your lab3/sim directory
➢ Open Makefile, Screenshot and submit it to your homework form. Your mentor
will check again in your home directory.
➢ Note that the snapshot picture of homework1 and homework2 should be
attached in 1 file. 26