2017年12月5日 星期二

PLL & jitter

http://www.designers-guide.org/analysis/PLLnoise+jitter.pdf

2017年6月8日 星期四

Labview Notes


[hotkey]

對象選擇和移動
Shift+滑鼠單擊 選擇多個對象;將對象添加或移除當前選區
方向鍵↑↓←→ 在該方向移動所選對象1個像素
shift+↑↓←→  在該方向快速移動所選對象
shift+滑鼠拖動 限制水平或垂直方向移動對象
Ctrl+滑鼠拖動  克隆所選對象
Ctrl+Shift+滑鼠拖動 克隆所選對象並限制水平或垂直方向移動
Shift+調整大小 保持原比例調整對象大小
Ctrl+調整大小 固定中心點調整大小
Ctrl+空白區域滑鼠拖出矩形 插入更多的空白工作區域
Ctrl+A 全選所有對象
Ctrl+D 應用上次分佈對象操作
滑鼠雙擊空白處 添加自由標籤
Ctrl+滑鼠滾輪  在選擇結構、事件結構或層疊式順序結構的框中滾動切換
Ctrl+Shift+A 應用上次對齊對象操作

前面板和框圖瀏覽
Ctrl+E 在前面板和框圖之間切換
Ctrl+# 使用/禁用網格對齊
Ctrl+/ 最大化/還原窗口
Ctrl+T  並列瀏覽前面板和框圖
Ctrl+F 搜索對象或文本
Ctrl+G 跳至下一個相同的對象或文本
Ctrl+Shift+G 跳至上一個相同的對象或文本
Ctrl+Shift+F 顯示搜索結果窗口
Ctrl+Tab  在打開的LabView窗口之間順序切換
Ctrl+Shift+Tab 在打開的LabView窗口之間逆序切換
Ctrl+Shift+N 顯示鳥瞰窗口
Ctrl+I 顯示VI屬性設置對話框

連線
Ctrl+B 清除所有斷線
Esc/滑鼠右擊/滑鼠左鍵單擊端子 取消當前引出的線段
滑鼠單擊線段 選中該線的一段
滑鼠雙擊線段 選中該線的一個分支
滑鼠三擊線段 選中整條線
A 在引線時暫時禁用自動布線
引線時滑鼠雙擊 將該線懸空
空格鍵 移動對象時自動布線;引線時線段走向在垂直或水平之間切換
Shift+滑鼠單擊 手動布線時取消上一拐點
Ctrl+滑鼠單擊只有兩個輸入端函數的輸入端 交換連至該函數兩個輸入端的線段

子VI
滑鼠雙擊子VI 打開該子VI的前面板
Ctrl+滑鼠雙擊子VI 打開該子VI的前面板和框圖
拖動某VI圖標至框圖上 將該VI作為子VI添加進框圖
Shift+拖動某VI圖標至框圖上 將該VI作為子VI添加進框圖且自動生成默認值的常量作為各輸入參數
Ctrl+滑鼠右鍵單擊框圖並從函數面板中選擇VI 打開該VI的前面板

工具與面板
Ctrl 切換至下一最常用工具
Shift 切換至定位(Positioning)工具
Ctrl+Shift  切換至滾動(Scrolling)工具
空格  在兩個最常用工具間切換(在未使用自動選擇工具下可用)
Shift+Tab  使用自動選擇工具(在未使用自動選擇工具下可用)
Tab 在四個最常用工具間切換(在未使用自動選擇工具下可用)
↑↓←→ 在面板上移動瀏覽焦點
回車 進入子模板
Esc 進入上一級模板
Shift+滑鼠右擊  在滑鼠位置彈出工具面板
Ctrl+L 顯示錯誤列表窗口
Ctrl+Y 顯示歷史信息窗口

調試
Ctrl+↓ 進入節點單步執行
Ctrl+→ 單步執行完節點
Ctrl+↑  執行完當前節點並跳出

文件操作
Ctrl+N 新建VI
Ctrl+O 打開VI
Ctrl+W 關閉VI
Ctrl+S 保持VI
Ctrl+P 列印當前窗口
Ctrl+Q 退出LabView

基本編輯
Ctrl+Z  撤銷上一操作
Ctrl+Shift+Z 重執行上一操作
Ctrl+X 剪切對象
Ctrl+C 複製對象
Ctrl+V 粘帖對象

幫助
Ctrl+H 顯示上下文幫助窗口
Ctrl+Shift+L 鎖定上下文幫助窗口
Ctrl+?或F1 調出LabView幫助文檔

VI層次窗口瀏覽
Ctrl+D 重新繪製VI層次窗口
Ctrl+A 顯示所有VI
Ctrl+滑鼠單擊VI 顯示該VI的所有子VI和其他節點
回車  跳至下一個符合關鍵詞的字元串(開始搜索後有效)
Shift+回車  跳至上一個符合關鍵詞的字元串(開始搜索後有效)

文本
滑鼠雙擊 選中字元串中的一個詞
滑鼠三擊  選中整個字元串
Ctrl+→ 游標后移動一個詞
Ctrl+←  游標向前移動一個詞
Home  游標移動至當前行首
End 游標移到至當前行末
Ctrl+Home  游標移動至整個字元串首
Ctrl+End  游標移動至整個字元串尾
Shift+回車  編輯枚舉型對象項目時插入新項
Esc 取消上一編輯文本操作
Ctrl+回車  確認編輯操作,跳出編輯狀態
Ctrl+=  增大當前字體大小
Ctrl+-  減小當前字體大小
Ctrl+0  顯示字體對話框
Ctrl+1 換至應用程序字體(Application Font)
Ctrl+2 換至系統字體(System Font)
Ctrl+3 換至對話框字體(Dialog Font)
Ctrl+4 換至當前字體(Current Font)

[ref] http://cocdig.com/docs/show-post-44694.html

[abbreviation]
Waveform Data Type (WDT)

[array2file]
1. for 1D/2D array 'write to spreadsheet file.vi'
pro: easily processed by excel/matlab etc.
con: only 1D/2D array, additional process needed for some image application, e.g. row/column/frame 3D array
2. for n-D array 'array to spreadsheet string.vi' & 'write to text file.vi'
pro:
    clear header for every subset of the whole array
    can be easily readout by labview 'spreadsheet string to array.vi'
con:
    additional process required for importing to Matlab

[Mathscript RT]
support 2D array/functions only by Ver. 2017
e.g. a=zeros(2,3,4) is not support
really annoying in image processing, e.g. row/column/frame

2017年6月1日 星期四

Python Notes

[install]
https://www.continuum.io/downloads
http://darren1231.pixnet.net/blog/post/328443678-python-%E6%96%B0%E6%89%8B%E7%9A%84%E6%95%91%E6%98%9F--anaconda%E4%BB%8B%E7%B4%B9%E8%88%87%E5%AE%89%E8%A3%9D
http://ithelp.ithome.com.tw/users/20091404/ironman/797

[Anaconda Environment]
http://yehnan.blogspot.tw/2016/07/anaconda.html
http://www.astro.ncu.edu.tw/~yhsu/yhsu/%E5%BB%BA%E7%AB%8B%E7%94%A8%E6%96%BC%E7%A7%91%E5%AD%B8%E8%A8%88%E7%AE%97%E7%9A%84python%E9%96%8B%E7%99%BC%E7%92%B0%E5%A2%83/
http://darren1231.pixnet.net/blog/post/328443678-python-%E6%96%B0%E6%89%8B%E7%9A%84%E6%95%91%E6%98%9F--anaconda%E4%BB%8B%E7%B4%B9%E8%88%87%E5%AE%89%E8%A3%9D

[matlab to python]
https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html
http://ifcuriousthenlearn.com/blog/2015/05/05/matlab-to-python-conversion/

[labview with python]
http://iammic.pixnet.net/blog/post/27292280-labview%EF%BC%9Alabpython-%E5%AE%89%E8%A3%9D

[Syntax]
http://djangogirlstaipei.herokuapp.com/tutorials/python/?os=windows
http://wiki.python.org.tw/Python/%E7%AC%AC%E4%B8%80%E6%AC%A1%E7%94%A8%E5%B0%B1%E4%B8%8A%E6%89%8B

2016年7月6日 星期三

well proximity effect

Well Proximity Effect
[intro]
implanting N-Well causes Vt increasing near N-Well edges.
The implanting particles above the N-Well edges are clustered at the N-Well edges, i.e. the concentration near N-Well edges are higher than that in the center of the N-Well.

[Environment]
BSIM 4.5 or above
in 90nm/65nm or above CMOS process

[Solution]
Pre-sim:
Cadence: Enable 'Well Proximity Accurate' option for every MOS
HSpice: set SC variable,
    e.g.: M1 VD  VG VS VB NMOS L=0.5U W=2U SC=2u

Layout:
increase the space between N-Well edges and MOSes according to DRC rules or above 3um.
inserting dummy source/drain for sensitive MOSes.

[Ref] http://www.bubuchen.com/2008/09/well-proximity-effect_5006.html

2016年6月15日 星期三

waveview notes

Tools: waveview

hotkey:
'd' --> show marker ON/OFF

Open parameter simulation results
open -> runObFile

2016年1月11日 星期一

Matlab multicore setup

I found a good material/manual
[www] http://mirlab.org/jang/books/matlabProgramming4guru/02-2_Optimization4codeNmem.asp?title=2-2%20%A5%AD%A6%E6%B3B%B2z

Here is the content:

2-2 平行處理

此外,我們也可以借用多核電腦的平行處理,來加速程式碼的執行。欲達到此功能,你的電腦必須具備多核心,而且你的系統也必須先安裝平行處理工具箱(Parallel Processing Toolbox,簡稱 PCT)。若兩者兼備,加速計算的方法如下:
  1. 在使用平行處理指令之前,下達「matlabpool local n」指令,其中 n 代表核心數目,例如 4(四核心電腦)或 8(八核心電腦)。
  2. 使用 parfor 指令來取代原來的 for 迴圈,其指令格式如下:
    parfor loopvar = initval:endval, statements, end
  3. 最後下達「matlabpool close」來關閉平行處理的功能。
我們就可以來嘗試一個簡單的範例:
Example 1: 02-程式碼與記憶體之最佳化/parfor01.mver distcomp % 顯示 PCT 的版本 matlabpool local 4 n = 100; rowMedian1=zeros(1000, 1); rowMedian2=zeros(1000, 1); % === 第一種方法:common for-loop tic for i = 1:1000 rowMedian1(i) = max(eig(rand(n))); end time1 = toc; % === 第二種方法:parallep for-loop tic parfor i = 1:1000 rowMedian2(i) = max(eig(rand(n))); end time2 = toc; fprintf('time1 = %g, time2 = %g, speedup factor = %g\n', time1, time2, time1/time2); matlabpool close------------------------------------------------------------------------------------------------------- MATLAB Version: 8.1.0.604 (R2013a) MATLAB License Number: DEMO Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode ------------------------------------------------------------------------------------------------------- Parallel Computing Toolbox Version 6.2 (R2013a) Starting matlabpool using the 'local' profile ... connected to 4 workers. time1 = 4.94823, time2 = 1.62187, speedup factor = 3.05094 Sending a stop signal to all the workers ... stopped.

在這個範例中,我們產生了 1000 個 100x100 的亂數矩陣,然後計算每一個矩陣的特徵值(共有 100個)的最大值,若使用平行處理專用的 parfor 迴圈,計算速度是一般 for 迴圈的 3 倍左右。(我的電腦是四核心。) 如果你在執行 MATLAB 時,一邊還要還要修改論文,此時若 MATLAB 佔用了所有的多核 CPU,可能會導致電腦整個慢下來,讓你無法進行文書編輯。因此 parfor 提供另一個參數,可以指定所用到的工作者個數,指令格式如下:
parfor (loopvar = initval:endval, M), statements, end
其中 M 即是所用到的核心個數。例如在下例中,雖然我的電腦是四核心,但我只使用兩核來進行 parfor 的運算:
Example 2: 02-程式碼與記憶體之最佳化/parfor02.mfprintf('MATLAB version = %s\n', version); matlabpool local 4 n = 100; rowMedian1=zeros(1000, 1); rowMedian2=zeros(1000, 1); % === 第一種方法:common for-loop tic for i = 1:1000 rowMedian1(i) = max(eig(rand(n))); end time1 = toc; % === 第二種方法:parallel for-loop using 2 workers tic parfor (i = 1:1000, 2) % 只用兩個核心 rowMedian2(i) = max(eig(rand(n))); end time2 = toc; fprintf('time1 = %g, time2 = %g, speedup factor = %g\n', time1, time2, time1/time2); matlabpool closeMATLAB version = 8.1.0.604 (R2013a) Starting matlabpool using the 'local' profile ... connected to 4 workers. time1 = 4.91713, time2 = 2.58577, speedup factor = 1.90162 Sending a stop signal to all the workers ... stopped.

由於只用到兩核,所以加速倍數接近兩倍。 在使用 parfor 迴圈時,有幾點要特別注意:
  • 因為每個迴圈可能有不同的核心同時計算,因此迴圈之間不能有相依性,否則會造成錯誤的結果,這是特別需要注意之處。
  • 在 parfor 迴圈的迴圈變數必須是整數,而且每次變大幅度都是1,以下是幾個不符合規定的範例:
    不合格的 parfor 用法說明
    parfor i = 1:2:251, 3, 5,... 非連續整數。
    parfor i = -7.5:7.5-7.5, -6.5,... 非整數。
    A = [3 7 -2 6 4 -4 9 3 7];
    parfor i = find(A>0)
    結果是 1, 2, 4,...,非連續整數。
    parfor i = [5;6;7;8][5;6;7;8]是一個行向量,而非 parfor 所須要的列向量。
PCT 是一個功能強大的工具箱,目前也可以支援多台電腦的平行運算,並可以使用 GPU(Graphic Processing Unit,圖形處理器)來進行大量的平行運算,詳細功能請參考下一小節的介紹。

MATLAB程式設計:進階篇

performing FFT by WaveView



Main steps:
1. open the waveform file and click on ADC output signals
2. performing ADC function
3. performing DAC function
4. performing FFT function

Steps:
1. execute the waveview binary file
>> wv &


2. open the waveform file, arrange signals from MSB to LSB (top-to-down)
eg. ~/ADC/spectre/schematic/psf/tran.tran

 3. select all signals and then click on the ADC icon
 4. 


5. group the A2D signals as one signal





6. performing DAC function on the grouped signal


 7. select the reconstructed waveform and press the tools/FFT icon