Sunday, April 5, 2015

linking libaries to simulate verilog Megacores

In Modelsim right click on the source file that contains the declaration of the Megacore. Then, select the Properties option.

There select the Verilog & SystemVerilog tab, then click on the Library File button in the lower part and select the file where the component is declared.

Here be careful to select the .v file as it needs to compile it and add it to the work directory.

Tuesday, May 27, 2014

using github


  1. create local folder with files
  2. create github repository
  3. git clone https://github.com/username/project.git
  4. git add .
  5. git commit -m 'Initial Commit'
  6. git remote add origin  https://github.com/username/project.git
  7. git push origin master

Thursday, May 8, 2014

Installing HandBrake to cut videos in linux

follow this forum in how to install it: 

here are two official HandBrake PPAs, ppa:stebbins/handbrake-releases and ppa:stebbins/handbrake-snapshots.
The former contains stable releases, which are updated about once a year. These releases tend to be rather out-dated when their end-of-life is approaching. The current stable version (0.9.8) was released on 2012-07-18.
The latter contains nightly builds, which are updated daily (or nightly, as it were). These are of course less stable, and undocumented to boot, but they are good software nonetheless. Additionally, as the stable release ages, the developers tend to start recommending users to try the nightly builds instead.
To add one of these to your sources, simply run:
sudo add-apt-repository ppa:stebbins/handbrake-releases
or
sudo add-apt-repository ppa:stebbins/handbrake-snapshots
depending on which you want. To install HandBrake, run:
sudo apt-get update
sudo apt-get install handbrake-gtk
Alternatively, if you would prefer the CLI over the GUI, replace the last line with:
sudo apt-get install handbrake-cli

How to rotate a video 90 degress using HandBreak?
HandBrakeCLI -i /home/luisardila/Desktop/Comm/Luis.mp4 -o /home/luisardila/Desktop/Comm/Luis_90.mp4 --rotate=4

SSH shorcut

in your computer edit the following file:

  • nano .ssh/config
Include the following:

Host=rpi                                  (Choose a name you will remember)
Hostname=192.168.2.7          (your RPi ip  address)
User=pi                                   (User name on RPi, default=pi)
now you can source the file

  • source .ssh/config
and then just ssh to your RPi using the shortcut

  • ssh rpi
finally type your password

Enabling SSH and WiFi dongle on Raspberry Pi

This was done from a fresh RPi, therefore the first thing we do is updating all the applications, then upgrading. Following step we enable the SSH and then we install the application that manage the wifi conection. Finally we enable the wifi con conect automatically once power has come up, therefore enabling an SSH conection after a remote reboot.

1. Follow this video tutorials for SSH

  • apt-get update
  • apt-get upgrade
  • reboot
  • sudo raspi-config
select from menu : "expand filesystem" then "Advanced Options" and then "SSH" --> Enabled --> "Finish"


  • reboot
  • sudo ip addr show
Now you should be able to SSH to you RPi using the IP address shown in the line that starts with "inet 192.168.X.Y   ....."


On your computer do:

  • ssh pi@192.168.X.Y  (Y is your wired address)
  • type password for "pi" user (Note the default is "raspberry")
2. Now we want to plug out Wifi Dongle and have it wirelessly connected, following this tutorial do:

  • sudo apt-get install wicd-curses
  • sudo wicd-curses
Select your wifi network, if it doesn't show then hit the key "P" (preferences)
and type "wlan0" in the field  "wireless interface" hit F10 to save

Select your Wifi network, hit the right arrow to configure:
check static IP
type the IP address following the same skim as your router gateway: i.e:
IP: 192.168.X.Z      (Z is going to be your static wireless address- pick any number)
Mask: 255.255.255.0
Gateway: 192.168.X.R   (R is the ip address of your router)
at the bottom on key type your wifi password
hit F10 to save

After some seconds it will connect, you can unplug the wired cable and verify a remote SSH to the new wireless IP address
  • ssh pi@192.168.X.Z
  • type password

3. Now to allow the wifi conection to come up automatically after a remote reboot do:
  • sudo nano /etc/network/interfaces
Change it to this:

auto lo
iface lo inet loopback 
#Remove the wired network because it
#slows down boot if it's not connected.
#auto eth0
#iface eth0 inet dhcp 
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 192.168.1.20 #(IP address of RaspyFi)
netmask 255.255.255.0
gateway 192.168.1.2 #(IP of router)
wpa-ssid MyWirelessNetwork
wpa-psk MyPassword
4. You are all done, SSH to your wirelessly connected RPi and reboot to test the feature of auto connection after booting.

5. To disable the power saving feature of the wifi module we follow this page

The problem seems to be that the adapter has power management features enabled by default. This can be checked by running the command:
cat /sys/module/8192cu/parameters/rtw_power_mgnt
A value of 0 means disabled, 1 means min. power management, 2 means max. power management. To disable this, you need to create a new file:
sudo nano /etc/modprobe.d/8192cu.conf
and add the following:
# Disable power management
options 8192cu rtw_power_mgnt=0
Once you save the file and reboot your RPi, the WiFi should stay on indefinitely.

Wednesday, December 11, 2013

PROM memories on the Boards

RDO:

BPI Flash single FPGA > Virtex6 > xcf128x [16 M]

LVDS2FIBER:

Xilinx Flash/PROM > Platform Flash > xcf32p [32 M]


Friday, November 1, 2013

Creating ssh keys for daq slow control linux machine

  Personal history of typed commands using cygwin
  284  ssh-keygen
  285  cd .ssh
  287  pwd
  288  cd /home/
  290  cd .ssh
  291  pwd
  294  cd /home/leardila-perez/.ssh
  295  cd /cygdrive/home/leardila-perez/.ssh
  296  cd /home/
  297  ls
  300  pwd
  301  mkdir .ssh
  302  ls
  303  ls -la
  304  ssh-keygen
  305  pwd
  306  ls .ssh
  307  ls -ld .ssh
  308  cd .ssh
  309  ssh-keygen
  310  ls
  311  chmod 700  .
  312  ls -l
  313  cat id_rsa.pub
  314  ssh -Y leardilap@ssd-sc
  315  ssh -Y ssd@ssd-sc
  316  pwd
  317  cd
  318  pwd
  319  man ssh
  320  export HOME=`pwd
  321  pwd
  322  export HOME=`pwd`
  323  ssh -Y ssd@ssd-sc
  325  env | grep HOME
  326  man ssh
  327  pwd
  328  echo $HOME
  329  cd $HOME
  330  ls -ld .
  331  ls -l
  332  mkdir .ssh
  333  ls -la
  334  cd .ssh
  335  ls -la
  336  cd
  337  cd ~
  338  pwd
  339  cd
  340  ls /home
  341  pwd
  342  cd /home
  343  ls
  344  ssh
  345  history
  346  ssh -Y ssd@ssd-sc
  347  cd
  348  pwd
  349  ln -s /cygdrive/c/SPB_Data
  350  ln -s /cygdrive/c/SPB_Data /home/leardila-perez
  351  cd /home/leardila-perez
  352  ls
  353  ls -la
  354  ssh -Y ssd@ssd-sc

Friday, October 25, 2013

Modifiying db files for epics, rebuilding and relaunching softioc

And here's the command history of what I used to edit and rebuild:
  224  cd /usr/local/epics/ioc/siocftdi/head/
  225  vi ftdiApp/Db/example1.db 
  226  make

When doing make the file gets copied over this folder
wenorum@ssd-sc-daq 217> ls -l ftdiApp/Db/example1.db db/example1.db 
-r--r--r-- 1 wenorum ssd 595 Oct  3 19:06 db/example1.db
-rw-rw-r-- 1 wenorum ssd 595 Oct  3 19:06 ftdiApp/Db/example1.db

Re-Run softioc
1011  cd /usr/local/epics/ioc/siocftdi
 1012  sh run
 1013  sh attach
 1014  sh attach
 1015  sh attach                                             to deattach = Ctrl+A+D    to end type "exit"
 1016  sh run
 1017  history
 1018  make
 1019  pwd
 1020  cd head
 1021  make
 1022  ls db
 1023  ls -l db
 1024  ls
 1025  vi ftdiApp/Db/Makefile
 1026  ls ftdiApp/Db/
 1027  vi ftdiApp/Db/ftdiCommon.db
 1028  make

I've updated the 'run' script a little to try to ensure that multiple copies don't get started.
To summarize: 
......
cd /usr/local/epics/ioc/siocftdi/
sh -x run

Or, to attach to a running IOC to check its console messages or terminate it:
......
cd /usr/local/epics/ioc/siocftdi/
sh -x attach
Then type 'exit'

Also, all console messages are logged in
 /usr/local/epics/ioc/siocftdi/screenlog.0

Friday, September 6, 2013

Compiling xilinx Simulation libraries for modelsim

2.2 Simulation Library Compilation Wizard
This method is highly recommended because library compilation can be performed for more
than one device family and/or language.
1. Open the Simulation Library Compilation Wizard. This can be accessed from Start
Menu!Programs!Xilinx ISE Design Suite 13.x!ISE Design Tools!32-bit Tools.
Note: If you are using 64-bit version of ModelSim use the Simulation Library Compilation
Wizard from 64-bit Tools. ModelSim PE Student Version 10.x is only available in the
32-bit version.
2. The Select Simulator window opens up. Select the appropriate simulator (For Student
Edition select ModelSim PE), enter c:nmodeltech64 10.0cnwin64 for executable location,
compxlib.cfg for Compxlib Con guration File and compxlib.log for Compxlib Log File.
3. Next select the HDL used for simulation. If you are unsure select Both VHDL and Verilog.
However, this will increase the compilation time and the disk space required.
4. Then select all the device families that you will be working with. Again the more number
of devices, more the compilation time and the disk space required. Remember that you
can always run the compilation wizard at a later time for additional devices.
5. The next window is for Selecting libraries for Functional and Timing Simulation. Di erent
libraries are required for di erent types of simulation (behavioral, post-route, etc.). We
suggest that you select All Libraries as the default option. Interested users can refer to
Chapter 6 of the Xilinx Synthesis and Simulation Design Guide for additional information.
6. Finally the window for Output directory for compiled libraries is shown. We suggest to
leave the default values that Xilinx picks. Then select Launch Compile Process.
7. Be patient as the compilation can take a long time depending on the options that you
have chosen.
8. The compile process may have contain a lot of warnings but should be error-free. We
have not explored the reasons behind these warnings, but they do not appear to a ect
the simulation of any of our designs.
9. Once the process is completed, open c:nmodeltech64 10.0cnmodelsim.ini and verify if there
are libraries pointing to the output directory entered in step 6. This will happen only if
you have set the environment variables.
Library compilation is now complete. If you have not set the environment variables then
the wizard creates a modelsim.ini in the output directory entered in step 6. By default this
location is c:nXilinxn13.xnISE DSnISE. Open this le and verify that it contains the location of
the libraries that were just compiled. This le should be copied into every project you create.

Take a look at this PDF for more info.

Tuesday, August 20, 2013

putting custom template format into xilinx autogenerated files

If you have your own installation of the software you could hard code your changes into the Tcl scripts that control this.
For example, the company name could be entered for VHDL modules and VHDL TBs in the following files.

C:\xilinx\13.1\ISE_DS\ISE\data\projnav\scripts\dpm_sourceTasks.Tcl, line 713 – VHDL Module
C:\xilinx\13.1\ISE_DS\ISE\data\testbnch2.tcl – VHDL Testbench

I modified my file like this:  (however i had some issues later and it wasn't doing anything, just creating blank files, If you have a solution for this please let me know, if not try this under your own risk.)

set _t [clock seconds]
set _ts [clock format $_t -format "%H:%M:%S %m/%d/%Y"]
set _date_stamp [clock -format "%m/%d/%Y"]
global xilinx::Dpm::INewSourceHdlDataID
set _iHdlData [$iNewSourceComp GetInterface $INewSourceHdlDataID]
if { $_iHdlData == 0 } {
return [dpm_Fail "interface passed to Create New Source code hook is invalid."]
}
set _entityName ""
dpm_returnOnFail { $_iHdlData GetEntityName _entityName }
set _archName ""
dpm_returnOnFail { $_iHdlData GetModuleName _archName }
dpm_Debug 11 "architecture returned is $_archName"
set _portIter 0
$_iHdlData GetPorts _portIter
puts $hFile "----------------------------------------------------------------------------------"
puts $hFile "-- Company: LBNL"
puts $hFile "-- Engineer: Luis Ardila (leardilap@******** - leardilap@********)"
puts $hFile "-- "
puts $hFile "-- Create Date: $_ts "
puts $hFile "-- Design Name: "
puts $hFile "-- Module Name: $_entityName - $_archName "
puts $hFile "-- Project Name: "
puts $hFile "-- Target Devices: "
puts $hFile "-- Tool versions: "
puts $hFile "-- Description: "
puts $hFile "--"
puts $hFile "-- Dependencies: "
puts $hFile "--"
puts $hFile "-- Revision: "
puts $hFile "-- Date Version Author Description"
puts $hFile "-- $_date_stamp 1.0 Luis Ardila File Created"

puts $hFile "-- Additional Comments: "
puts $hFile "--"
puts $hFile "----------------------------------------------------------------------------------"
puts $hFile "LIBRARY IEEE;"
puts $hFile "USE IEEE.STD_LOGIC_1164.ALL;"

Tuesday, August 6, 2013

Solo quería compartir una frase que me pareció interesante

"Always forgive the one that go to far, never forgive the boring ones" -Marco Grob- fotógrafo exclusivo de retratos


Maine Media Workshops Interview with Marco Grob from Maine Media Workshops + College on Vimeo.

Friday, June 7, 2013

Creating Components and libraries in Kicad

Refer to this tutorial, where it is well documented:

compressing file from the command line and adding the date of creation to it


You need to use tar command as follows (syntax of tar command):
tar -zcvf LC52_`date +%b%d-%y`.tag.gz data/


Where,
  • -z: Compress archive using gzip program
  • -c: Create archive
  • -v: Verbose i.e display progress while creating archive
  • -f: Archive File name
  • -x: Extract files
source: link for compresing and link for date on file 1, 2

Cygwin custom prompt


The next information is taken from (http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html) it is not mine. trying to fix my prompt in a new machine that doesn't show up anything, not even the folder where it is i found this:
Prompt is control via a special shell variable. You need to set PS1, PS2, PS3 and PS4 variable. If set, the value is executed as a command prior to issuing each primary prompt.
  • PS1 - The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string. The default value is \s-\v\$ .
  • PS2 - The value of this parameter is expanded as with PS1 and used as the secondary prompt string. The default is >
  • PS3 - The value of this parameter is used as the prompt for the select command
  • PS4 - The value of this parameter is expanded as with PS1 and the value is printed before each command bash displays during an execution trace. The first character of PS4 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is +

How do I display current prompt setting?

Simply use echo command, enter:
$ echo $PS1Output:
\\u@\h \\W]\\$

How do I modify or change the prompt?

Modifying the prompt is easy task. Just assign a new value to PS1 and hit enter key:
My old prompt --> [vivek@105r2 ~]$
PS1="touch me : "
Output: My new prompt
touch me : 
So when executing interactively, bash displays the primary prompt PS1 when it is ready to read a command, and the secondary prompt PS2 when it needs more input to complete a command. Bash allows these prompt strings to be customized by inserting a number of backslash-escaped special characters that are decoded as follows:
  • \a : an ASCII bell character (07)
  • \d : the date in "Weekday Month Date" format (e.g., "Tue May 26")
  • \D{format} : the format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required
  • \e : an ASCII escape character (033)
  • \h : the hostname up to the first '.'
  • \H : the hostname
  • \j : the number of jobs currently managed by the shell
  • \l : the basename of the shell’s terminal device name
  • \n : newline
  • \r : carriage return
  • \s : the name of the shell, the basename of $0 (the portion following the final slash)
  • \t : the current time in 24-hour HH:MM:SS format
  • \T : the current time in 12-hour HH:MM:SS format
  • \@ : the current time in 12-hour am/pm format
  • \A : the current time in 24-hour HH:MM format
  • \u : the username of the current user
  • \v : the version of bash (e.g., 2.00)
  • \V : the release of bash, version + patch level (e.g., 2.00.0)
  • \w : the current working directory, with $HOME abbreviated with a tilde
  • \W : the basename of the current working directory, with $HOME abbreviated with a tilde
  • \! : the history number of this command
  • \# : the command number of this command
  • \$ : if the effective UID is 0, a #, otherwise a $
  • \nnn : the character corresponding to the octal number nnn
  • \\ : a backslash
  • \[ : begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
  • \] : end a sequence of non-printing characters
the SP1 value is stored in /etc/bash.bashrc at first i didn't have that file so i just copy the one in my other machine and it worked perfect. here is the file:


# To the extent possible under law, the author(s) have dedicated all 
# copyright and related and neighboring rights to this software to the 
# public domain worldwide. This software is distributed without any warranty. 
# You should have received a copy of the CC0 Public Domain Dedication along 
# with this software. 
# If not, see

# base-files version 4.1-1

# /etc/bash.bashrc: executed by bash(1) for interactive shells.

# The latest version as installed by the Cygwin Setup program can
# always be found at /etc/defaults/etc/bash.bashrc

# Modifying /etc/bash.bashrc directly will prevent
# setup from updating it.

# System-wide bashrc file

# Check that we haven't already been sourced.
([[ -z ${CYG_SYS_BASHRC} ]] && CYG_SYS_BASHRC="1") || return

# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return

# Set a default prompt of: user@host and current_directory
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

# Uncomment to use the terminal colours set in DIR_COLORS
# eval "$(dircolors -b /etc/DIR_COLORS)"