-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
404 lines (348 loc) · 10.6 KB
/
index.html
File metadata and controls
404 lines (348 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Powerful Linux Commands and Basic shell scripting for VLSI Design Tasks</title>
<style>
@page {
size: A4;
margin: 25mm 20mm;
}
body {
font-family: "Segoe UI", Arial, sans-serif;
max-width: 210mm;
margin: 0 auto;
line-height: 1.6;
color: #1f2937;
background: #f8fafc;
}
.cover {
background: linear-gradient(135deg, #0b3c5d, #2563eb);
color: white;
padding: 40px 25px;
border-radius: 12px;
text-align: center;
margin-bottom: 35px;
}
.cover h1 {
font-size: 30px;
margin-bottom: 8px;
}
.subtitle {
font-size: 1.3em;
opacity: 0.95;
}
.meta {
margin-top: 18px;
font-size: 0.95em;
opacity: 0.9;
}
section {
background: white;
padding: 15px;
margin-top: 5px;
border-radius: 8px;
box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}
h2 {
color: #0b3c5d;
border-left: 6px solid #2563eb;
padding-left: 12px;
font-size: 22px;
margin-bottom: 15px;
}
h3 {
color: #1e40af;
margin-top: 25px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}
th {
background: #e0f2fe;
color: #0b3c5d;
}
th, td {
border: 1px solid #c7d2fe;
padding: 10px;
font-size: 13.5px;
}
tr:nth-child(even) {
background: #f1f5f9;
}
code {
background: #e0f2fe;
color: #1e3a8a;
padding: 2px 6px;
border-radius: 4px;
font-weight: 500;
}
pre {
background: #020617;
color: #e5e7eb;
padding: 15px;
border-radius: 10px;
font-size: 13px;
overflow-x: auto;
border-left: 5px solid #38bdf8;
margin-top: 15px;
}
.footer {
text-align: center;
margin-top: 50px;
font-size: 0.95em;
color: #475569;
}
.page-break {
page-break-before: always;
}
</style>
</head>
<body>
<div class="cover">
<h1>Powerful Linux Commands and Basic<h1>
<h1>shell scripting for VLSI Design Tasks </h1>
<p class="subtitle"><b>Mastering grep, sed, awk & basic shell scripting</b></p>
<div class="meta">
<p><b>Sampath Voonna</b> </p>
<p>VLSI Expert, Mysuru</p>
</div>
</div>
<section>
<h2>Introduction</h2>
<ul>
<li>
Commands like <b>grep</b>, <b>sed</b>, and <b>awk</b> help designers quickly search,
filter, and process text-based reports generated by EDA tools.
</li>
<li>
This reference reflects my hands-on learning of Linux power tools during my VLSI
training and focuses on practical command-line workflows used in real-world
EDA environments.
</li>
<li>
These commands and scripts help automate repetitive tasks,
improve debugging efficiency, and speed up analysis of synthesis, timing,
and verification reports.
</li>
<li>
I have learned these commands during my VLSI Physical Design training at
VLSI Experts Pvt. Ltd, Mysuru.
</li>
<h3></h3>
<p>
<b>GitHub:</b> https://github.com/VoonnaSampath <br>
<b>LinkedIn:</b> https://www.linkedin.com/in/gurunadh-sampath-voonna-154939223/ <br>
<i></i>
</p>
</section>
<div class="page-break"></div>
<section>
<h2>grep – Pattern Searching Power Tool</h2>
<table>
<tr>
<th>Command</th>
<th>Description / VLSI Use Cases</th>
</tr>
<tr>
<td><code>grep "Error" file.log</code></td>
<td>To Search for the pattern (Error) in the synthesis or simulation log files</td>
</tr>
<tr>
<td><code>grep -i "warning" *.rpt</code></td>
<td>Case-insensitive search to capture all the warnings in reports</td>
</tr>
<tr>
<td><code>grep -r "module" .</code></td>
<td>To recursive search and find the pattern (module) in the current directory</td>
</tr>
<tr>
<td><code>grep -n -C 3 "clk" design.v</code></td>
<td>Shows 3 lines before and after a match along with line numbers</td>
</tr>
<tr>
<td><code>grep -w "reset" *.v</code></td>
<td>To match whole word only in all the verilog files</td>
</tr>
<tr>
<td><code>grep -c "Error" *.log</code></td>
<td>Counts total matching lines with pattern (Error) per log file </td>
</tr>
<tr>
<td><code>grep -v "INFO" run.log</code></td>
<td>To exclude matching lines to hide non-critical messages in the log file</td>
</tr>
<tr>
<td><code>grep -E "Error|Warning" timing.rpt</code></td>
<td>Extended regex search to extract key timing metrics from the report</td>
</tr>
<tr>
<td><code>grep -l "Error" *.log</code></td>
<td>Lists only the file names that contain the pattern (Error)</td>
</tr>
<tr>
<td><code>grep -H "setup" *.rpt</code></td>
<td>Displays file name along with matching pattern (setup) lines</td>
</tr>
<tr>
<td><code>grep -A 5 "WNS" timing.rpt</code></td>
<td>Shows 5 lines after the match to analyze timing context</td>
</tr>
<tr>
<td><code>grep "^#" script.tcl</code></td>
<td>Searches lines starting with # (comments) in TCL script file</td>
</tr>
</table>
</section>
<div class="page-break"></div>
<section>
<h2>sed – Stream Editor for Automation</h2>
<table>
<tr>
<th>Command</th>
<th>Description / VLSI Use Cases</th>
</tr>
<tr>
<td><code>sed 's/old/new/' file.v</code></td>
<td>Replaces the first occurrence of a signal or module name (old) with (new) in each line of the Verilog file </td>
</tr>
<tr>
<td><code>sed 's/old/new/g' file.v</code></td>
<td>Replaces all occurrences of a signal, module, or parameter name (old) with (new) across the entire Verilog file</td>
</tr>
<tr>
<td><code>sed -n '10,20p' report.rpt</code></td>
<td>Prints lines 10 to 20 from a synthesis or timing report to inspect a specific analysis section</td>
</tr>
<tr>
<td><code>sed '/^$/d' file.txt</code></td>
<td>Deletes all empty lines from synthesis, timing, or power reports for clean formatting </td>
</tr>
<tr>
<td><code>sed '1d' file.log</code></td>
<td>Removes the first line (tool header or version info) from the EDA log file </td>
</tr>
<tr>
<td><code>sed '$d' file.log</code></td>
<td>Removes the last line (summary or statistics footer) from the log file (synthesis or timing) </td>
</tr>
<tr>
<td><code>sed 's/#.*//' script.tcl</code></td>
<td>Removes comment lines from TCL constraint or run scripts to view active commands only</td>
</tr>
<tr>
<td><code>sed -i 's/clk/clk_i/g' design.v </code></td>
<td>Renames a clock signal (clk) to an internal clock (clk_i) throughout the Verilog design file</td>
</tr>
<tr>
<td><code>sed '/ERROR/d' run.log</code></td>
<td>Deletes all ERROR messages from simulation or synthesis logs file to isolate warnings or INFO messages</td>
</tr>
<tr>
<td><code>sed -n '/WNS/p' timing.rpt</code></td>
<td>Prints only Worst Negative Slack (WNS) related lines from the timing report</td>
</tr>
<tr>
<td><code>sed 's/[[:space:]]\+/ /g' report.txt</code></td>
<td>Normalizes spacing in timing, power, or area reports for easier parsing and readability</td>
</tr>
</table>
</section>
<div class="page-break"></div>
<section>
<h2>awk – Report Analysis Tool</h2>
<table>
<tr>
<th>Command</th>
<th>Description / VLSI Use Case</th>
</tr>
<tr>
<td><code>awk '{print $1}' file.txt</code></td>
<td>Prints the first column such as cell name, net name, or timing path identifier from a report file</td>
</tr>
<tr>
<td><code>awk '{print $1, $3}' report.txt</code></td>
<td>Prints the selected columns like timing path name and slack value from the report</td>
</tr>
<tr>
<td><code>awk '{sum+=$2} END {print sum}' data.txt</code></td>
<td>Calculates the total area or power by summing a column in the report</td>
</tr>
<tr>
<td><code>awk '$3 < 0 {print $0}' timing.rpt</code></td>
<td>Prints only timing paths with negative slack to identify setup or hold violations</td>
</tr>
<tr>
<td><code>awk 'END{print NR}' file.txt</code></td>
<td>Counts the total number of entries such as timing paths, cells, or nets in the report</td>
</tr>
<tr>
<td><code>awk '{max=($2>max)?$2:max} END{print max}' data.txt</code></td>
<td>Finds the maximum value of the mentioned column such as worst delay, highest power, or largest area entry</td>
</tr>
<tr>
<td><code>awk '{print NR, $0}' file.txt</code></td>
<td>Prints line numbers along with line numbers (report entries) for easier debugging and traceability</td>
</tr>
<tr>
<td><code>awk '{count[$1]++} END {for(i in count) print i, count[i]}' file.txt</code></td>
<td>Counts repeated occurrences in the mentioned column such as cell names, modules, or timing paths in report</td>
</tr>
<tr>
<td><code>awk '$1=="clk" {print $0}' design.rpt</code></td>
<td>In the mentioned column prints only clock-related entries such as clock nets or clock paths from report</td>
</tr>
<tr>
<td><code>awk '{print $1 "\t" $2}' report.txt</code></td>
<td>Prints formatted output (e.g., cell name and delay) with tab spacing for clean readability</td>
</tr>
</table>
</section>
<div class="page-break"></div>
<section>
<h2>Beginner-Level Linux Shell Scripts </h2>
<h3>1. List and View All DC Reports </h3>
<pre>
#!/bin/bash
cd dc_reports
echo "Listing all DC report files:"
ls *.txt
echo "Showing first 10 lines of timing report:"
head timing.txt
</pre>
<h3>2. Find Errors and Warnings from All Reports</h3>
<pre>
#!/bin/bash
cd dc_reports
echo "Searching for ERROR messages:"
grep -i "error" *.txt
echo "Searching for WARNING messages:"
grep -i "warning" *.txt
</pre>
<h3>3. Extract Only Timing Violations</h3>
<pre>
#!/bin/bash
cd dc_reports
echo "Extracting negative slack paths..."
grep "slack" timing.txt | awk '$NF < 0 {print $0}' > neg_slack.txt
echo "Negative slack report created"
wc -l neg_slack.txt
</pre>
<h3>4. Clean DC Reports by Removing Extra Spaces</h3>
<pre>
#!/bin/bash
cd dc_reports
sed 's/[[:space:]]\+/ /g' area.txt > area_clean.txt
echo "Cleaned area report generated"
</pre>
<h3>5. Find All Timing Reports in the Project</h3>
<pre>
#!/bin/bash
echo "Finding all timing-related reports:"
find . -name "*timing*.txt"
</pre>
</section>
<div class="page-break"></div>
</html>