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)"

Friday, May 31, 2013

Enabling DISPLAY environment variable for X11 forwarding from cygwin


I want to do this so I can forward commands to gnuplot from a shell script i have on cygwin, the steps where taken from the web[1,2].

Make sure you have the x11 packages installed in your cygwin and go to step 3, if not start from 1
  1. Run the Cygwin installer (You can obtain cygwin from here: http://www.cygwin.com/setup.exe
  2. At the package list, select to install all packages that are under the X11 category. Click next, accept all the dependencies, and install.
  3. In the  Cygwin shell, run startxwin  
  4. In your Cygwin shell, run export DISPLAY=:0.0.
You'll need to repeat step 3 every time you reboot your computer, and step 4 every time you open a new Cygwin shell (or just run echo "export DISPLAY=:0.0" >>~/.bash_profile to have it run automatically whenever you create a new shell).

Ref: 1, 2