Wednesday, January 27, 2016

VIS & VL2MV

18/01/2016:
-----------

    Installing VIS model checker
    ----------------------------

        Download from: http://vlsi.colorado.edu/~vis/vis_files_2.4.html

        Note: First do the installation of glu and then install vis or vl2mv (order doesn't matter)

        Installation: Follow the steps in the VIS README file in http://vlsi.colorado.edu/~vis/vis_files_2.4.html

        Pitfalls: Dont extract the vis and glu .tar.gz files using gui. Instead use the commands given below
            % gzip -dc /tmp/glu-2.4.tar.gz | tar xf -
            % gzip -dc /tmp/vis-2.4.tar.gz | tar xf -

        Setting environment for VIS
            set VIS_LIBRARY_PATH=$cwd/share

    Installing vl2mv:
    ----------------

        Follow instructions in the README file in http://vlsi.colorado.edu/~vis/vis_files_2.4.html

        "make check" will fail since the vl2mv-2.4/examples folder is empty. Don't worry about that

VIM

* Changing the tab width to 4 spaces permanenlty
    Add the following to .vimrc (create one if not found in ~/)
        filetype plugin indent on
        " show existing tab with 4 spaces width
        set tabstop=4
        " when indenting with '>', use 4 spaces width
        set shiftwidth=4
        " On pressing tab, insert 4 spaces
        set expandtab
    Ref: http://stackoverflow.com/questions/234564/tab-key-4-spaces-and-auto-indent-after-curly-braces-in-vim 

Indenting a block of codes in Vim
    V j j >
    Ref: http://stackoverflow.com/questions/235839/indent-multiple-lines-quickly-in-vi     

SCREEN

Start: screen -S "Session name"
New window: C-a C-c
Switch windows: C-a C-a
Name a screen: C-a Shift-a
List screen windows: C-a w
Detach screen: C-a d
Detach screen: screen -d
Detach screen from elsewhere and attach it here : screen -d -r "Session id"
List all detached sessions: screen -list
And the obvious thing to do if you are stuck: man screen

PYTHON

26/10/15:
---------

* CLASSES AND METHODS:
----------------------

* Possible conventions include capitalizing method names, prefixing data attribute names with a small unique string (perhaps just an underscore), or using verbs for methods and nouns for data attributes.

*  It is not necessary that the function definition is textually enclosed in the class definition: assigning a function object to a local variable in the class is also ok
# Function defined outside the class
def f1(self, x, y):
    return min(x, x+y)
class C:
    f = f1
    def g(self):
        return 'hello world'
    h = g

* Methods may call other methods by using method attributes of the self argument:
class Bag:
    def __init__(self):
        self.data = []
    def add(self, x):
        self.data.append(x)
    def addtwice(self, x):
        self.add(x)
        self.add(x)

* The syntax for a derived class definition looks like this:
class DerivedClassName(BaseClassName):
    <statement-1>
    .
    .
    .
    <statement-N>

* when the base class is defined in another module:
class DerivedClassName(modname.BaseClassName):

* A method of a base class that calls another method defined in the same base class may end up calling a method of a derived class that overrides it

* There is a simple way to call the base class method directly: just call BaseClassName.methodname(self, arguments).

* There is a convention that is followed by most Python code: a name prefixed with an underscore (e.g. _spam) should be treated as a non-public part of the API (whether it is a function, a method or a data member).

* Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped.

* Useful for Verilog parsing:
A piece of Python code that expects a particular abstract data type can often be passed a class that emulates the methods of that data type instead. For instance, if you have a function that formats some data from a file object, you can define a class with methods read() and readline() that get the data from a string buffer instead, and pass it as an argument.

* PYTHON STYLE GUIDE:
---------------------
* https://www.python.org/dev/peps/pep-0008/

MODELSIM

View schematic of a VHDL file in Modelsim
    * Go to SIM tab in the panel after simulation
    * Right click on the top module name and ADD -> TO SCHEMATIC -> SELECTED REGION
    * Go to SCHEMATIC tab
        * Drag and select all items in the region
        * Right click on it
        * EXPAND NET TO -> DESIGN INPUTS       

ICARUS Verilog

Installation:
------------
Installation guide: http://iverilog.wikia.com/wiki/Installation_Guide

Download the latest one from git
    https://github.com/steveicarus/iverilog

Trying out the first example
    Use the following command to generate .vcd file
        iverilog -o example_3_1.vvp example_3_1_tb.v
    Display the waveforms
        export DISPLAY=:0.0
        gtkwave example_3_1.vcd

GIT

git add -u before committing the changes after you delete a file in the git directory

Flash player installation in Ubuntu

Copied from:  www.adobe.com

Adobe Systems Incorporated
Flash Player 11 for Linux
Version 11.2.202.521
2015

Adobe recommends that all users upgrade to the latest version of Adobe Flash
Player for the most recent features, bug fixes, and security fixes.  For
more information on the new features in Flash Player 9, please visit
http://www.adobe.com/products/flashplayer/.  For more information on system
requirements, fixed issues, and known issues, see the release notes at
http://www.adobe.com/go/flashplayer_releasenotes.

To confirm which version of Flash Player you have currently installed, see
http://www.adobe.com/software/flash/about/. Users should only install
Players that have been downloaded from trusted sources, such as
http://www.adobe.com/.

Your use of this player is governed by the Adobe End User License Agreement
found at http://www.adobe.com/products/eulas/players/flash/.


Privacy
-------

Adobe is committed to preserving the privacy of end users. For more
information on configuring Client-side privacy visit the Settings Manager
Documentation: http://www.adobe.com/go/flashplayerhelp.


Installation instructions
-------------------------

Installing using the plugin tar.gz:
    o Unpack the plugin tar.gz and copy the files to the appropriate location. 
    o Save the plugin tar.gz locally and note the location the file was saved to.
    o Launch terminal and change directories to the location the file was saved to.
    o Unpack the tar.gz file.  Once unpacked you will see the following:
        + libflashplayer.so
        + /usr
    o Identify the location of the browser plugins directory, based on your Linux distribution and Firefox version
    o Copy libflashplayer.so to the appropriate browser plugins directory.  At the prompt type:
        + cp libflashlayer.so <BrowserPluginsLocation>
    o Copy the Flash Player Local Settings configurations files to the /usr directory.  At the prompt type:
        + sudo cp -r usr/* /usr

Installing the plugin using RPM:
   o As root, enter in terminal:
          + # rpm -Uvh <rpm_package_file>
          + Click Enter key and follow prompts

Installing the standalone player:
   o Unpack the tar.gz file
   o To execute the standalone player,
          + Double-click, or
          + Enter in terminal: ./flashplayer


Uninstallation instructions
---------------------------

Manual uninstallation (for users who installed the plugin via Install script):
   o Delete libflashplayer.so binary and flashplayer.xpt file in
   directory /home/<user>/.mozilla/plugins/

RPM uninstallation:
   o As root, enter in terminal:
          + # rpm -e flash-plugin
          + Click Enter key and follow prompts


Technical Issues and Reporting Bugs
-----------------------------------

The Adobe Flash Player Support Center at
http://www.adobe.com/support/flashplayer/ is a free online resource for
support and troubleshooting information. Bug reports may be submitted at
http://www.adobe.com/go/wish. To allow us to investigate reported bugs,
please include the following information:

1) Platform and version
2) Browser version
3) Reproducible steps including a URL to the web site where the problem
   was encountered.

If we need further information about a bug, you will be contacted. An
automated reply will be sent to assure you that we have received your
bug report. Due to the volume of mail received, we are not able to
individually respond to each report.

Use the following commands to generate dependency lists for Flash Player or the Local Setting Manager:

Flash Player:
ldd <BrowserPluginsLocation>/libflashplayer.so

Gnome Local Setting Manager:
ldd /usr/lib/kcm_adobe_flash_player.so (for 32-bit systems)
ldd /usr/lib64/kcm_adobe_flash_player.so (for 64-bit systems)

KDE Local Settings Manager:
ldd /usr/bin/flash-player-properties


Legal
-----

Adobe(R) Flash(R) Player. Copyright (C) 1996 - 2015 Adobe Systems
Incorporated. All Rights Reserved. Adobe and Flash  are either
trademarks or registered trademarks in the United States and/or
other countries.

ANTLR

How to write ANTLR grammar:
---------------------------

* Writing Verilog grammar for the output of VIS, the counter example

    ? : either zero or one
    + : One or more
    * : Zero or more

    Wildcard characters:
        '.' : All characters
        ~c : every character but c

Gimp:

Move selectin in Gimp

https://docs.gimp.org/en/gimp-using-selections.html

VIS & VL2MV

18/01/2016: -----------     Installing VIS model checker     ----------------------------         Download from: http://vlsi.colorado.edu/~...