🔧 DFT Blog

Part 1 of 11

Linux Essentials for DFT Engineers

Master the command line to boost your productivity

By Praveen Kumar Vagala

1,289 views

Why Linux?

Most EDA tools (Synopsys, Cadence, Mentor) run on Linux. You'll spend 80% of your time in the terminal. Master these commands and you'll work 10x faster.

Terminal Navigation

# Know where you are
pwd                      # /home/user/project

# Move around
cd /proj/dft/run         # Go to absolute path
cd ../scripts            # Go up one level, then to scripts
cd -                     # Go back to previous directory
cd ~                     # Go home

# List files
ls                       # Basic list
ls -la                   # All files with details
ls -lrt                  # Sort by time (newest last) - VERY USEFUL
ls *.v                   # All Verilog files
ls -lrt is your best friend - shows newest files at bottom, perfect for checking latest runs.

File Operations You'll Use Daily

Viewing Files

cat file.rpt                    # Print whole file
head -50 file.rpt               # First 50 lines
tail -50 file.rpt               # Last 50 lines
tail -f logfile.log             # Watch file live (for running jobs)
less file.rpt                   # Scrollable view (q to quit)

Searching in Files

grep "Error" *.log              # Find "Error" in all log files
grep -i "warning" file.rpt      # Case-insensitive search
grep -r "module_name" .         # Recursive search in current dir
grep -n "fault" file.rpt        # Show line numbers
grep -c "DT" coverage.rpt       # Count matches

Power Combos with Pipes

grep "Error" run.log | wc -l           # Count errors
cat faults.rpt | grep "UD" | head -20  # First 20 undetected faults
grep -r "clk" . | grep -v ".svn"       # Search but exclude .svn

File Management

# Copy/Move
cp file1.v file1_backup.v       # Copy
cp -r dir1 dir1_backup          # Copy directory
mv old_name.v new_name.v        # Rename
mv file.v ../other_dir/         # Move to another directory

# Create/Delete
mkdir -p run/atpg/logs          # Create nested directories
rm file.v                       # Delete file
rm -rf old_run/                 # Delete directory (CAREFUL!)

# Permissions
chmod +x script.sh              # Make executable
chmod 755 script.sh             # rwx for owner, rx for others

Job Control

# Run in background
command &                        # Run in background
nohup command > log.txt &        # Run even after logout

# Check jobs
ps -ef | grep atpg              # Find running ATPG jobs
jobs                            # List background jobs
top                             # Live process monitor

# Kill jobs
kill PID                        # Kill by process ID
kill -9 PID                     # Force kill

GVIM - Your Editor

GVIM is the standard editor in most DFT teams. Learn these basics:

# Open file
gvim file.v &                   # Open in GUI

# Essential commands (press Esc first for command mode)
i           Insert before cursor
a           Insert after cursor
o           New line below
dd          Delete line
yy          Copy line
p           Paste below
u           Undo
Ctrl+r      Redo

# Search
/pattern    Search forward
n           Next match
N           Previous match

# Replace
:%s/old/new/g   Replace all in file

# Save & Quit
:w          Save
:q          Quit
:wq         Save and quit
:q!         Quit without saving

# Navigation
gg          Go to top
G           Go to bottom
:100        Go to line 100

Quick Reference Card

TaskCommand
Find filesfind . -name "*.v"
Search in filesgrep -r "pattern" .
Count lineswc -l file
Compare filesdiff file1 file2
Sort outputsort file
Unique linessort file | uniq
Disk usagedu -sh *
Current dir sizedu -sh .

Summary

Master these commands and you'll navigate any DFT project with confidence:

  1. Navigate: cd, ls -lrt, pwd
  2. View: cat, head, tail -f, less
  3. Search: grep -r, find
  4. Edit: gvim basics
  5. Jobs: ps, kill, nohup