Coding guide lines

Need to finalize this post

General:
http://en.wikipedia.org/wiki/Indent_style
http://geosoft.no/development/cppstyle.html
http://www.gnu.org/prep/standards/standards.html
http://www.mono-project.com/Coding_Guidelines
http://net.tutsplus.com/tutorials/html-css-techniques/top-15-best-practices-for-writing-super-readable-code/

Verilog and System verilog:
http://blogs.mentor.com/nosimulation/blog/2009/09/11/sv-coding-guidelines/
http://blogs.mentor.com/verificationhorizons/
sva : http://www.soccentral.com/results.asp?CatID=488&EntryID=21595

linux file transer

Command for file transfer
scp -r <source file> <dest_user_name>@<dest_host_name>:<dest_path>

perl debugging links


http://sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/pod/perldebtut.html
http://docstore.mik.ua/orelly/perl/prog3/ch20_01.htm
http://www.obsidianrook.com/devnotes/talks/perl_debugger/

frequently used awk

To print first column of a file
awk < file '{print $1}'

To find the sum of first column elements
awk '{total=total+$1} END {print total}' filename

To print all lines sorted by taking 3rd column as reference
awk '{print $3 $0}' < file | sort


awk fields from two different files
 pr -m -t -s\  file1 file2 | gawk '{print $4,$5,$6,$1}'
 

frequently used vi

Frequntly used VI/GVIM commands:
1. Online VI editor: Use this online Vi editor to practice vi commands.
-------------------------------------------------------------------------------------------
2. Search and replace:
:%s/searchword/replaceword/  takes care of one occurence of searchword in a line.
:%s/searchword/replaceword/g takes care of all occurences of searchword in a line.
-------------------------------------------------------------------------------------------
3. To delete all lines which contains the text "word"
:g/word/d
:g/word1 word2/d
This command tells vi to do a global search for "word word1" and to delete any line containing that text including the space.
-------------------------------------------------------------------------------------------
4. How to indent multiple lines in Vim
  • Open up a text file in Vim that needs indenting.
  • On the line that you want to start your indenting block type: '=='(This will indent the first line).
  • Press the 'v' key to go into visual mode.
  • Move the cursor down to select the number of lines you want to indent.
  • Press '=' to indent the selected cells.
  • As you can see that was the last step, and all your selected lines are indented.
-------------------------------------------------------------------------------------------
5. Using vi, you can issue global commands from command mode. If you are not sure of the case used, you can issue this command from vi command mode before you make the global change:
:set ic
(set ignorecase)
-------------------------------------------------------------------------------------------
6.
:%s/\'.*$//g

-------------------------------------------------------------------------------------------
7. Macros
qa /F_POS_LO <enter> ^i // <ESC> q
-------------------------------------------------------------------------------------------
8. To do an operation between two lines
 -------------------------------------------------------------------------------------------

9. vi delete multiline comment
\/\*[a-z0-9A-Z_; ]*\_[a-zA-Z0-9;_ ]*\*\/

:set ic
(set ignorecase) 

revrse a file
tac
tail -r filename

sample verdi argument file

-sv
-2001
-tbbr_debug
+systemverilogext+svh
+incdir+../../../
+incdir+../../../src/
../../../src/ovm_pkg.sv
../../../src/ovm.svh
../utils/utils_pkg.sv
top.sv