Master the command line to boost your productivity
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.
# 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.
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)
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
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
# 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
# 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 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
| Task | Command |
|---|---|
| Find files | find . -name "*.v" |
| Search in files | grep -r "pattern" . |
| Count lines | wc -l file |
| Compare files | diff file1 file2 |
| Sort output | sort file |
| Unique lines | sort file | uniq |
| Disk usage | du -sh * |
| Current dir size | du -sh . |
Master these commands and you'll navigate any DFT project with confidence:
cd, ls -lrt, pwdcat, head, tail -f, lessgrep -r, findgvim basicsps, kill, nohup