2013年6月24日 星期一

Quartus 11.1, 13.0sp1 on Ubuntu 64bit



sudo apt-get upgrade
sudo apt-get install ia32-libs
./11.1_173_quartus_linux.sh
bash /11.1_173_quartus_linux/setup

error 1: ./setup: Syntax error: "&" unexpected
出現這個錯誤是因為quartus xxxx.sh被設定成/bin/sh,但其實是用bash寫的,所以只需改成bash執行即可。

最近Altera 更新了Quartus 13.0 sp1, 我也順便更新下我的系統 時發現 Altera終於修正了 Quartus 11的問題,所以現在只用無腦的雙擊setup.sh(改名了) Quartus 13就能順利的安裝。

2013年4月15日 星期一

SVN on Ubuntu 12.10


使用svn co https://xxx.xxx/xxx時出現SSL handshake failed: SSL error: Key usage violation in certificate has been detected.


原來是ssl版本的問題,
$sudo apt-get install libneon27
$sudo mv /usr/lib/libneon-gnutls.so.27 /usr/lib/libneon-gnutls.so.27.old
$sudo ln -s /usr/lib/libneon.so.27 /usr/lib/libneon-gnutls.so.27 

Reference
http://stackoverflow.com/questions/10062095/svn-on-ubuntu-sslhandshake-failed


2013年4月9日 星期二

parser - Flex & Bison

  1. 加入 %option c++在xxx.l檔的第一行
  2. 實作yyFlexLexer::yywrap()在xxx.l的c++ code 區
  3. 產生lex.yy.cc而非lex.yy.c,且指令變成flex -+ xxx.l
  4. 在main.cpp #include "FlexLexer.h"
  5. 之後就使用class yyFlexLexer

2013年4月8日 星期一

PC/ FPGA communication

和Altera FPGA通訊最容易的方式應該就是透過USB-blaster了,如果不想花太多時間debug硬體的話,其實只要用Qsys加入NIOS, no chip memory和jtag_uart,然後再用NIOS IDE寫printf/ scanf就能send/recv message from Jtag
然後配上這個程式就可以從PC收發資料了,原始的程式是自http://www.alteraforum.com/forum/showthread.php?t=2199找到的。

2013年4月3日 星期三

擴充Notepad++ Language style

Notepad++ 除了內建的language style外,還可以擴充任何需要的語言
方法是從http://www.noanylove.com/2012/07/notepad-add-user-defined-language/看來的,不過其中翻譯的詞都不同,可能是版本有差吧!


  1.  menu ->檢視 ->自訂語法對話窗
  2. 在http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files有  各種語言的定義,下載所需的之後
  3. 選import 即可


不過下載下來的CUDA定義的字型我不喜歡,所以把它都改回notepad++預設的字型
我的CUDA定義
Flex Bison定義

2013年3月8日 星期五

CUDA的筆記(1)

1 In CUDA, the number of block in a single launch 不可超過65535,另外 the number threads per block 的限制要查詢maxThreadsPerBlock(on device properties structure),可參考CUDA example ,在1_utilties/deviceQuery

CUDA sample 1 vector Adder


__global__ void vectorAdder(float *result,float* src1,float *src2,int N)
{
int x=gridDim.x*blockIdx.x+threadIdx.x;
if(x result[x]=src1[x]+src2[x];
}
為何要有x<N
vectorAdder<<<1,N>>>(c_d,a_d,b_d,N);

在CUDA by Example這本書上說是為了處理當你的thread*block不等於你的data量的情況,但我
我實際上測試時發現,如果沒有if(x<N)

vectorAdder<<<2,N/2>>>(c_d,a_d,b_d,N);執行時就會出錯

但用vectorAdder<<<1,N>>>(c_d,a_d,b_d,N);or vectorAdder<<
<N,1>>>(c_d,a_d,b_d,N);時,會正確。