SESSION#1

  1. Linux OS
    o Electronic system : 5 layers
    User (you, me)
    Applications
    Operating system
    Firm ware
    Hardware
  2. Linux is best suited for multi user and multi task applications
    o Instiutte server
    o at same time 30 people login to the same server and run the applications
    o 30 : multi user
    o each of them running different jobs: multi task
    o what happens in Windows?
    o logout and log in as new user
    o Windows is capable of multiuser and multitask, but not as good as Linux is.
    o Summary
    o Linux is a better choice for all project execution, since it requires multi user and multi tasking requriements.
    o Hence 99% of the project work we do is based on Linux OS.
    o where do we use Windows?
    o opening PDF and Word docuemtns, XLS, editing those
    o checking mails.
    o Linux is more attactive becuase it comes free of cost.
    o Linux is developed as open source, any one can contribute and any one can use at no cost.
  3. linux and unix are same thing..?
    o UNIX is the architectural level description
    o Linux is implementaiton of this architecture
  4. Shell scripting
    o scripting based on Linux commands
  5. Shell is the place where we are enteirng the vairous Linux commands
    ls -ltr
    Shell is understanding this command, executing that.

6Q. is this same like c , java coding sir ?
o Linx is not same as C/Java
Apple and Oragen => fruites, different for many reasons

  1. How to set alias
    alias abcd=”ls -ltr”
    alias mem_ctrl_top=”cd /home/VLSIGuru/MEM_CTRL/verif/top”
    alias mem_ctrl_ref=”cd /home/VLSIGuru/MEM_CTRL/verif/ref”
    alias mem_ctrl_ckr=”cd /home/VLSIGuru/MEM_CTRL/verif/ckr”
    alias mem_ctrl_sim=”cd /home/VLSIGuru/MEM_CTRL/verif/sim”
    alias mem_ctrl_memories=”cd /home/VLSIGuru/MEM_CTRL/verif/memories”
  2. we have multiple bashrc files? is it not unique?
    o not possible to have multiple bashrc files
  3. how can we update that file?
    o we will not update reference file

SESSION#2

questions

  1. installed but not coming like ls python ,perl like all

agenda:

notes:

  1. How to list files and directories in a specific directory
    ls : just lists the files and directories
    ls -l : show all files and directories in long listing format
    ls -lt : show all files and directories in long listing format with latest updated file in top of the list
    ls -ltr : show all files and directories in long listing format with latest updated file in bottom of the list
    we can also create alias for the long commands:
    alias ll=”ls -ltr”
    how to list only the directories in current directory:
    ls -d */
    how to list only the files in current directory:
    ls -f */
    While I am in one directory, we can list the files and directories that are there in different directory.
    ls
    We don’t need to go to that path to list the directories and files in that path.
    We can list only specific type of files by using * and ? meta characters
    ls .v Above command lists all .v files in current folder ls tech28*.lib
    Above command lists all the files which start with tech, has 28 in between and ends with .lib
    ex: tech_28nm.lib will be listed
    ex: tech_28nm_lib will not be listed

2Q. how t create alias

  1. cd
    cd : Change Directory
    cd . : be in the current folder, this command is not used much
    cd .. : takes us to the folder above the current folder
    cd – : takes us to the just previous folder we were in, before coming to the current folder
    cd : takes us to user home directory
    why /home/VLSIGuru? why not /home?
    Linux is multi user OS, /home has many other users below it.
    /home doesn’t belong to you.
    pwd: present working directory
  2. What are the properties of the files and directories.
    is it a file or directory?
    what is the size?
    what are the permissions?
    when was it created?
    Who created the file?
    Who has edited the file last time?
    Name of the file or directory?
    o this information we get by using long listing format. long listing format:
    1st thing: 10 characters
    -rwxr-x—
    – : first – => it is a file, not a directory
    rwx :
  3. Linux based systems
    o all the users can be divided in to 3 categories
    o user
    2nd to 4th: corresponds to user permissions
    rwx: as the owner of the file, I have read, write and execute permission to the file.
    o group
    5th to 7th characters: corresponds to group permissions
    r-x : Group has permission to read the file, and execute the file, but no permission to change the content.
    o public
    8th to 10th characters: corresponds to public permissions
    — : Other public don’t have any permission to the file, they can’t read, write or execute the file.
    o If I join a company, who is user, who is group and who is public?
    o Qualcomm, Snapdragon 851 PD project
    Sreenivas joined in to above project
    User: Sreenivas
    What files he creates, he is primary user(owner) of those files.
    Group: Team members make the group
    Snapdragon 851 PD project consists of 30 members in total (1 + 29 others)
    All those 30 people make a group
    As a owner of a file I am creating, I can decide what permission should I give to the group.
    Public (If Qualcomm has 10000 employees)
    9970 remaining employees are Public
    o When a primary user creates a file, he/she can give the required access permissions to that file to various users.
    o How to change the permissions?
    will be discussed later
  4. What is meant by an executable file?
    o these are file which can be run by the user
    o how do we run a file
    ./file_name
    the instructions in the file name gets executed.
  5. In this directory(/home/VLSIGuru/A_VERILOG_MAY2021), I want to list all the .v files
    o what command should we use
    o ls won’t be useful here. Ls only works on once specific directory.
    o Our requirement needs to check all the directories below current directory.
    o best suited command for that is: find
  6. find . -name “*.v” | wc
    find : find files and directories
    . : where should I start my search?
    . : current folder
    .. : previous folder(up)
    find . => find things starting from current directory
    -name : command options
    o what name you want to find
    *.v : find all the files names which end with .v, in all teh directory and directories below this.
    | wc
    | => used to merge two command operations
    find command gives us an output
    | is called as pipe
    output of previous command, becomes input to the next command after the pipe(|)
    what is the next command (wc)?
    wc : word count Output:
    find . -name *.v | wc
    41 41 1142
    41 lines
    41 words
    1142 characters
  7. list all the text files
    find . -name *.txt | wc
  8. List all the directories below user home directory
    find has a option called -type
    -type d => list the directories
    -type f => list the files
    find . -name “*” -type d
    * : file or directory with any name
    -type d : search only for directories
  9. List all the files below user home directory
    find . -name “*” -type f
  10. How to create and delete(remove) files
    touch : command used to create a file
    rm : remove the file
    only the primary user(owner) can remove the file
    rm -f : forceful remove
    Windows, OS will warn you regarding removal
    -f : forcefully remove
    Primary user, I may have given only read permission to the file(no w and x), rm will not allow me to remove.
    rm -f will remove in this case.
    we can create and remove the files in different directories also.
    touch directory_path/file_name
    rm directory_path/file_name
    we need to be careful with file removal
    undo is not possible
    there is no recycle bin as in Windows.
    – There is solution based on Linux OS settings
    o Linux has some concept of snapshot, they keep snapshot of the file every day or every week
    We should be very careful while using rm command
    once deleted, it is gone, difficult to retrive
  11. How to create and remove directories
    mkdir : command used to create a directory
    make directory
    rmdir : remove the directory
    only the primary user(owner) can remove the directory
    rm -r can also be used in place of rmdir
    -r : recursive removal, i.e remove everything in this directory and directories below it.
    we can create and remove the directories in different directories also.
    mkdir directory_path/directory_name
    rmdir directory_path/directory_name
    we need to be careful with directory removal
    undo is not possible
    there is no recycle bin as in Windows.
    – There is solution based on Linux OS settings
    o Linux has some concept of snapshot, they keep snapshot of the directory every day or every week
    creating parent directories:
    mkdir -p PD_PROJECT/INPUT_FILES/LIB_FILES/28NM
    $ mkdir PD_PROJECT_1/INPUT_FILES/LIB_FILES/28NM
    mkdir: cannot create directory ‘PD_PROJECT_1/INPUT_FILES/LIB_FILES/28NM’: No such file or directory

14Q. ls -d
sir can list director by this command?

15Q. while creating directory does it give permission by default? like in SAMPLE_VERILOG – rwx-rx–x–
o every OS will have default permissions with which it creates files and directories

  1. how to change the properties of files and directories
    chmod: change file mode bits
    what are these mode bits?
    drwxr-x—+ ==> mode bits two ways to use chmod:
    chmod 3-NUMBERS
    chmod user_based_update
  2. chmod with numbers:
    chmod 777(otehr combinations)
    chmod can be applied for complete set of files
    o it can also be done in recursive manner, it needs to be done very carefully, it can be undone.
    chmod -R 755 .
    o -R : recursive update
    chmod cna only change permissions, it can make a file to directory or vice versa
  3. chmod with used based arguments:
    u : primary user
    g : group
    o : others or public
    • : give permission
    • : remove permission
      r : read
      w : write
      x : execute
    chmod g+rw file_name
    o don’t change execute permission
    o if it was earlier execute permission, let it be
    o if it was earlier not-execute permission, let it be chmod o-rw+x ses3_30May.txt
    remove rw permission and add execute permission. we can’t run different user permissions in single command, that is the limiation of this option.
    chmod g-rwx o-rwx u-rwx ses3_30May.txt
    above command won’t work
    we need to run individually
  4. among these which oen to use
    o user convineince
  5. How to move from one directory to another directory
    cd : change directory
    Either user should know absolute path or relative path.
    absolute path:
    cd /bangalore_centre/my_locality/my_main_raod/required_street
    relative path:
    cd ../new_street_to_go
    This is always same command every directory movement, it depedns on where we are and where we want to go.
    cd ../../../
    takes us 3 directories back
  6. How to move or copy files and directories.
    mv : move
    cp : copy
    copy for directory requires -r option
    -r : recursive copy, without -r, directory copy doesn’t work cp NOTES/ LABS
    cp: -r not specified; omitting directory ‘NOTES/’

22Q. command to see the history of command?
history

  1. How to rename the files and directories
    mv is used to rename the files and directories
    mv course.txt course_new.txt
    mv source_dir_name dest_dir_name
  2. mv can be used for two purposes
    o moving some files and directories to other directories.
    o renaming the files and directories
  3. How to open the file and edit the contents, save the file.
    to open a file:
    – We need to identify the type of the file.
    – choose the right application for that file opening.
    for ex: a text file can be opened with vi, vim, notepad, notepad++, nedit
    .doc : can we open with notepad? we need to choose right application, in this ooffice
    linux has ooffice which is similar to MS office.
    one file is opened, we need to understand how the file editing application works, accrodingly we need to edit and save the changes.
  4. Hide some of the files.
    create the file with .file_name, it becomes hidden file
  5. Display contents of a File
    cat file_name
  6. wc ses4_2Jun.txt
    71 353 2083 ses4_2Jun.txt
    71 : number of lines in the file
    353: number of words
    2083 : number of characters in the file

wc *
0 0 0 course_new.txt
259 1551 8967 ses1_25May.txt
237 1299 7467 ses2_27May.txt
107 681 3963 ses3_30May.txt
71 353 2083 ses4_2Jun.txt
133 660 3935 ses5_5Jun.txt
0 0 0 session_24June.txt
807 4544 26415 total

29Q. cd ..,..>>>>/cd ../../../?
No, wrong

30Q. After our project how to move to next file sir
there is nothing like moving from one file to other

SESSION#3

revision:

Agenda:

  1. Copy one directory from a different path in to current directory
  2. escape, backspace => delete one whole word
  3. How many files are there in 3 directories all together?
    • find . -name “*” -type f | wc
      120 120 3650
  1. Size of all these directories?
    du -sh file_name or directory_name
    du -sh *
    o list size of all the things in current directory
    why knowing size of files and directories is important?
    o every project will have some limitations on file and directory sizes.
    o User should always keep track of how much diskspace he is using.
  2. ls -ltr
    doesn’t give the size of the directory.
  3. how to remove single file?
    rm file_name
  4. List all files in current directory in to a text file
    Output direction symbol should be used.
  5. can we restore recently deleted file?
    No, it is not possible
  6. ls > file_list.txt
    above > symbol is used to redirect all the command output to a text file.
    |&tee

10Q. basically it is giving all the details of file in one Txt file?
o we redicrted, it gave
wc * > wc.txt

  1. how to link gvim with cygwin? so that file can be open in gvim ?
    o there is nothing like linking gvim and cygwin
    o gvim is a differetn application
    o gvim is a text file editor
    o cygwin is a differetn application

12Q. like we used vi we can use gvim
GVIM: Graphical VIM
o Graphical: some window should pop out, cygwin doesn’t allow windows to pop out

  1. While installing Cygwin, choose editor

14Q. how to choose single editor after installed cygwin
that he said we can install editor in just 5 min how we can do without installing whole package again
o Cygwin is download some database from mirror servers
o you have already downloaded all the packages
o editor will require few additional things => 5 minutes to download them

  1. Linux has important concept called as, which
    which
    o it gives complete path of that executable

[root@vlsiguru ~]# which vcs
/home/tools/synopsys/new_tools/vcs/P-2019.06-SP2-8/bin/vcs
o this is the path where VCS tool is installed
o which version of VCS used? P-2019.06-SP2-8
This uses some concept called $PATH from where it gets all the paths where it needs to search.

  1. root has complete authority in the OS
    yum install perl
    o this command establishes connection with the required server, downloads the files and install them.
  2. GVIM editor
    o two modes
    o Insert mode
    o Escape mode
  3. Linux FIle system
    How files and directories are organized in Linux OS Windows:
    C:, D:, E, F
    C:
    Program files
    Program files (86)

19Q. what is the use of bin if we cant recover file after rm command? Bin is kind of Recycle Bin or it means different?
o bin : Binaries
o ALl things installed in any OS, they are binary files

20Q. tcl not instld in cygwin sir
which tclsh, not tcl

21Q. how you are getting full name by typing just one alphabet or command is coming automatically with typing it completely
enter initial characters, then do tab, it automatically fills

22Q. can you repeat what is parent directory in our example?

  1. Environment variables
    • There are the special variables in the operating system. OS uses these variables for different requirements.
    • 15 to 20 standard environment variables

SESSION#4

revision:

  1. Environemtn varibales

Agenda

  1. Environment varibales
  2. Pipe(|), xargs
  3. SED
  4. AWK

Notes:

  1. PS1
    o Prompt Script 1
  2. Whatever Shell settings I want to take effect in the terminal, we keep them in ~/.bashrc or ~/.tcshrc
  3. what you did for tcsh in that server login i didn’t got it
    o
  4. xargs

./design/CVS/Entries
./design/doc/CVS/Entries
./design/rtl/CVS/Entries
./design/sim/CVS/Entries

./design/sim/CVS/Repository
./design/sim/CVS/Root

  1. using xargs, we are able to process 100’s of files in few seconds
    o Ex:
    o in all the files, we replaced dma with cma
    find . -name “*” -type f | xargs sed -i -e ‘s/dma/cma/g’
    find : listing all the files in current directory and below
    xargs: running sed operation on all those
    sed : it is replacing dma with cma
    s/dma/cma/g : search and substitute dma with cma globally
    o sed: Stream editor
  2. SED and AWK
    SED: one type of Linux command
    AWK: one type of Linux command
  1. find . -name “*” -type f | awk ‘{print “mv “$1” “$1}’ | sed ‘s/dma/cma/3’ | sed ‘s/dma/cma/4’ | grep dma > rename.txt
    • above command consists of 5 commands in it, separated by | symbol
    • find . -name “*” -type f
      o listing all the files
    • awk ‘{print “mv “$1” “$1}’

8.
sed ‘N; s/\n / /; P; D’ inputFileName
It starts processing from the 1st line
o 1st line it holds
o N : start processing next line also along with the current line
o because of this, it starts processing both the lines together
o each input of sed is separated by ;
o s/\n / /
o search for new line character followed by a space
o Print it
o Once printed, delete the line from hold space.

  1. sed is useful for text processing
  2. how sed works
    o it opens the target text file
    o starts reading each line in to pattern space

SESSION#5

revision:

  1. Linux commands can be categorized in to 2 things
    o simple commands that we use everyday
    o complex commands that are used specific to some requirements
  2. Linux gives us option to run multiple commands together
    o running them separately in single line
    o running them in such a way that one command output becomes input to the next command

Questions:

  1. doubt regarding Assignment Question which you share earlier for unix what is $LM_LICENSE
    o LM_LICENSE
    o For each tool to work, we need to set a license file.
    o The path of the license file is set in to LM_LICENSE environemtn variable.
    o When we invoke the tool, the tool checks for LM_LICENSE path
    o it uses that corresponding license file.

Notes:

  1. Running Linux commands in single line
    [Tue Jun 29 15:11:20 LABS]>ls; wc rename.txt; cd ..; pwd
    design dma_axi64 rename.txt rtl_new sample.txt UVM_ses2_31May.txt
    62 186 4366 rename.txt
    /cygdrive/f/VLSIGURU_MATERIAL/UNIX/Linux_Jun2021
  2. running them in such a way that one command output becomes input to the next command
    o pipe (|)
    o pipe can’t be randomly used on anything ls| wc rename.txt| cd ..| pwd
  3. grep
  4. same character can have different meanings

Verilog:
b = a&c; //&: bitwise and operators
b = &c; //& : unary & operator
b = a&&c; //&& : logical & operator

  1. what LSF, BSUB?
    o another session to discuss these

SESSION#6

revision:

  1. grep
    o various options of the grep
    o special characters
  2. Linux training
    o Linux OS is all about 50 commands
    ls, pwd, cd,

questions:

  1. Question No 15(a) how to make a tcl file, Directly should i make it like touch sample.tcl File then go as per the step or should i need to access it with tclsh then inside them i have to make it ? It is from 1st Assignment
    touch print.tcl
    tcl has not relation with tcshrc, both are completely different
  2. ping
    ex: Google.com must have hosted with some IP address
    ping IP_ADDRESS
  3. uname -a
    o used to find whether machine is 32 bit or 64 bit
  4. how to create a new user and to set password
    Linux terminal
    useradd
    passwd ram => to change teh password

agenda:

  1. we will complete all the topics other than Sed, Awk
  2. LSF, BSUB, sleep, sort

Notes

  1. will it sort only by comparing 1st word of lines ?
    o it compares all the characters starting from 1st characater abcdej
    abcdef ==> 1st o anotehr example
    abcdej ==> 1st
    accdef
  2. grep command is used for?
    o searching a string or word inside a file
  3. In .* convention
    systemverilog
    s.verilog .: ystem
  4. Create Verilog design instance
    • one way
      o manually code => which is very tedious
      dma_axi64 dut(
      .clk(clk),
      so on);
    = other way, is by using functions in GVIM module dma_axi64(clk,reset,scan_en,idle,INT,periph_tx_req,periph_tx_clr,periph_rx_req,periph_rx_clr,pclken,psel,penable,paddr,pwrite,pwdata,prdata,pslverr,pready,AWID0,AWADDR0,AWLEN0,AWSIZE0,AWVALID0,AWREADY0,WID0,WDATA0,WSTRB0,WLAST0,WVALID0,WREADY0,BID0,BRESP0,BVALID0,BREADY0,ARID0,ARADDR0,ARLEN0,ARSIZE0,ARVALID0,ARREADY0,RID0,RDATA0,RRESP0,RLAST0,RVALID0,RREADY0); bring to below format:
    //Instinatiing the design
    dma_axi64 dut(
    .clk(clk),
    .reset(rst),
    .scan_en(scan_en),
    .idle(apb_pif.idle),
    .INT(apb_pif.INT),
    .periph_tx_req(periph_pif.periph_tx_req),
    .periph_tx_clr(periph_pif.periph_tx_clr),
    .periph_rx_req(periph_pif.periph_rx_req),
    .periph_rx_clr(periph_pif.periph_rx_clr),
    .pclken(apb_pif.pclken),
    .psel(apb_pif.psel),
    .penable(apb_pif.penable),
    .paddr(apb_pif.paddr),
    .pwrite(apb_pif.pwrite),
    .pwdata(apb_pif.pwdata),
    .prdata(apb_pif.prdata),
    .pslverr(apb_pif.pslverr),
    .pready(apb_pif.pready),
    .AWID0(axi_pif.awid),
    .AWADDR0(axi_pif.awaddr),
    .AWLEN0(axi_pif.awlen),
    .AWSIZE0(axi_pif.awsize),
    .AWVALID0(axi_pif.awvalid),
    .AWREADY0(axi_pif.awready),
    .WID0(axi_pif.wid),
    .WDATA0(axi_pif.wdata),
    .WSTRB0(axi_pif.wstrb),
    .WLAST0(axi_pif.wlast),
    .WVALID0(axi_pif.wvalid),
    .WREADY0(axi_pif.wready),
    .BID0(axi_pif.bid),
    .BRESP0(axi_pif.bresp),
    .BVALID0(axi_pif.bvalid),
    .BREADY0(axi_pif.bready),
    .ARID0(axi_pif.arid),
    .ARADDR0(axi_pif.araddr),
    .ARLEN0(axi_pif.arlen),
    .ARSIZE0(axi_pif.arsize),
    .ARVALID0(axi_pif.arvalid),
    .ARREADY0(axi_pif.arready),
    .RID0(axi_pif.rid),
    .RDATA0(axi_pif.rdata),
    .RRESP0(axi_pif.rresp),
    .RLAST0(axi_pif.rlast),
    .RVALID0(axi_pif.rvalid),
    .RREADY0(axi_pif.rready)
    ); steps:
    – keep each signal in one-one line
  5. 5 to 10 => 5 lines or 6 lines? 6
  6. totalyl 45 lines
    455 => will it work? it won;t work => totally 5 times it will happen
    445, 5 => 44+1 = 45 times

linux is good operating system, which can be mastered by practice.

  1. Process management

8Q. how to know which PID is for which process like in Windows in Task manager we get running Application Name. How to find it by PID Number?
o ps will give all the details
PID

  1. bsub, LSF
  2. How to give priority to any job ?
    o If we get check with IT(server admin) team, they will provide following details
    o which server farm(LSF) has server freely available
    o you launch the jobs on that server
    o bsub command some options which cna give priority to speicifc job.
  3. FTP
    file transfer protocol
    • It is used for transferring a file form one server(PC) to another server(PC)
      Any File transfer application will require me to login to the server(desitation)
      o ftp
      o scp
      o server copy
  4. TOpics pending
    o CTAGS
    o basic linux commands
    o sleep
    o more, less, head, tail, cat
    o sed, awk

SESSION#7

revision:

  1. GVIM techniques
    o Function
    o Visual block
  2. ping
  3. LSF, BSUB

Agenda:

  1. sleep
  2. file display commands
  3. CTAGs
  4. Some generic commands
  5. FIle compress and extract
  6. Makefile
  7. softlinks
  8. SED
  9. AWK

Notes:

  1. sleep
  2. ctags
    o what are tags
    o tags is a file that is created with pointer to the various files where keyword is defined
    o how to create tag file
    o Go to the top most directory of the project(or the places under which all the project files are present)
    o ctags -R .
    o we can also select the diretories to tag
    o how to map GVIM with tag file
    o :set tags=tag_file_name
    o how to use tags to navigating the file
    o keep the cursor on the keywrod(tag) we want to search
    o ctrl+] => will show us available options which are pointing to that tag
    o enter the number, that destination file automatically opens
    o if there is only one option, it automatically takes us to that file.
    o to come back use, ctrl+o
  3. Some generic commands
  4. What is significance of \ while running Linux command in shell?
    o 30/June, I gave 12 questions to complete
    o you may not know answers for all 12 questions==> this is not a problem
  5. FIle compress and extract
    Windows:
    right click, zip or rar
    Linux:
    commands to do this
    tar
  6. Makefile
  7. sed
  8. once please explain again \n part how its deciding alternate
  9. two categories of sed
    o delete based on search operation
    o search and subsitutte
    o display the lines of a file
    o delete specific lines of a file
    o using different apprach
  10. Important thing about sed is
    o it processes informaiton line by line, not a whole file
    o if we want to merge multiple lines for processing in single pattern space, use ‘N;’
    o all options needs to be separated by ; inside ‘ ‘
  11. can you please explain how to delete space infront of a specific line
  12. what to do for undo the last command output? to go to previous output
    sed without -i option
    output gets displayed to the screen, review that output, if it is proper, then run same command with -i option, the file will get updated.
Course Registration