2025年6月8日 星期日

Install Cadence ICADVM





 Purpose: Install Cadence ICADVM

1. Download files from TSRI, the files are:
ICADVM_20.10.340_linux_1of4.tgz
ICADVM_20.10.340_linux_2of4.tgz
ICADVM_20.10.340_linux_3of4.tgz
ICADVM_20.10.340_linux_4of4.tgz


2. Extract/Install the downloaded files:

# tar xfva ICADVM_20.10.340_linux_1of4.tgz -C /opt/EDA
# tar xfva ICADVM_20.10.340_linux_2of4.tgz -C /opt/EDA
# tar xfva ICADVM_20.10.340_linux_3of4.tgz -C /opt/EDA
# tar xfva ICADVM_20.10.340_linux_4of4.tgz -C /opt/EDA


3. Configure Env.

# cd /opt/EDA
/opt/EDA # cp bashrc_eda bashrc_icadvm
/opt/EDA # vi bashrc_icadvm

2025年6月7日 星期六

Install Cadence Virtuoso



















 Step 1: Download all the required files. 

In this case, we need to download the following files:

  • IC_06.18.350_linux_1of4.tgz
  • IC_06.18.350_linux_2of4.tgz
  • IC_06.18.350_linux_3of4.tgz
  • IC_06.18.350_linux_4of4.tgz

Step2: Extrac & Installation

1. Create /opt/EDA directory, you need to use root permission.

Before we begin, we can check the content of /opt directory:

# ls -l /opt

total 0

It shows there is nothing inside. Then we can create /opt/EDA directory:


# mkdir -p /opt/EDA
# ls -l /opt
total 4
drwxr-xr-x 2 root root 4096  3月  7 10:03 EDA

Now you can see that we've already created /opt/EDA directory.

** You only need to do this once **


Extract virtuoso to /opt/EDA directory, please go to your download directory, then type the following commands:

# tar xfva IC_06.18.350_linux_1of4.tgz -C /opt/EDA
./IC/cur
./IC/IC_06.18.350/Hotfix_IC06.18.350_lnx86.sdp
./IC/IC_06.18.350/ic_index.sdx
./IC/IC_06.18.350/IC_README
./IC/IC_06.18.350/IC_ReleaseInfo.pdf
./IC/IC_06.18.350/tools
..

The above command is to extract IC_06.18.350_linux_1of4.tgz to /opt/EDA directory. If there is no error message (no output)

# tar xfva IC_06.18.350_linux_2of4.tgz -C /opt/EDA
# tar xfva IC_06.18.350_linux_3of4.tgz -C /opt/EDA
# tar xfva IC_06.18.350_linux_4of4.tgz -C /opt/EDA

When all the 4 files are extracted & installed. We can proceed to Config Env. step.

Step 3. Config Env.

I usually put bashrc_eda in /opt/EDA directory for everyone to use.

Config /etc/hosts, and add the following lines in it.

140.126.24.16     lshc
140.110.140.29    lstc
140.110.127.149   lstn


Step: 4. Test

Before we run virtuoso, we need to load the configuration file, please run
the following command:

$ source /opt/EDA/bashrc_eda

If you do not load the config file (bashrc_eda), you will see errors like
this:

$ virtuoso
-bash: virtuoso: command not found

$ virtuoso
-bash: /opt/EDA/IC/cur/tools/dfII/bin/virtuoso: cannot execute: required file not found


Basically, virtuoso is installed. However, there are a lot of errors that
need to be fixed. Thus, we are going to Trouble shooting section.

Step. 5: Trouble shooting

We are going to troubleshoot errors one by one.

Error1:
$ virtuoso
-bash: /opt/EDA/IC/cur/tools/dfII/bin/virtuoso: cannot execute: required file not found

Solution:

# cd /bin
# ls -l sh
lrwxrwxrwx 1 root root 4  1月  5  2023 sh -> dash
# rm sh
# ln -s /bin/bash sh
# ls -l sh
lrwxrwxrwx 1 root root 9  3月  7 11:34 sh -> /bin/bash
First, we need to change the softlink of /bin/sh to /bin/bash, not to use
/bin/dash anymore.

# # apt-get install csh ksh
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ksh93u+m
Suggested packages:

  binfmt-support
The following NEW packages will be installed:
  csh ksh ksh93u+m
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,175 kB of archives.
After this operation, 3,675 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y \Enter

..


Once you have installed csh & ksh, you may run virtuoso again:

$ virtuoso
2025/03/07 11:36:06 System is not a supported distribution
2025/03/07 11:36:06 An error occurred. We don't recognize OS
2025/03/07 11:36:06 WARNING This OS does not appear to be a Cadence supported Linux configuration.
2025/03/07 11:36:06 For more info, please run CheckSysConf in <cdsRoot/tools.lnx86/bin/checkSysConf <productId>
/opt/EDA/IC/cur/tools/dfII/bin/64bit/virtuoso: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory


This time, it shows another error message which is different than the prior
error message. This means that we have solve the prior error. However, we've
encountered another error here.

-- Missing libcrypto.so.10 --


================================

1. Upgrade our system
We need to upgrade our system at least once per week. Please use root
permission to run the following commands:

# apt-get update
# apt-get upgrade

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  chromium chromium-common chromium-sandbox google-chrome-stable
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 98.6 MB/213 MB of archives.
After this operation, 98.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security bookworm-security/main amd64 chromium amd64 134.0.6998.88-1~deb12u1 [78.3 MB]
Get:2 http://security.debian.org/debian-security bookworm-security/main amd64 chromium-sandbox amd64 134.0.6998.88-1~deb12u1 [101 kB]
Get:3 http://security.debian.org/debian-security bookworm-security/main amd64 chromium-common amd64 134.0.6998.88-1~deb12u1 [20.2 MB]
Fetched 97.2 MB in 4s (27.4 MB/s)          
讀取改變紀錄(changelogs)... 完成
(Reading database ... 345343 files and directories currently installed.)
Preparing to unpack .../google-chrome-stable_134.0.6998.88-1_amd64.deb ...
Unpacking google-chrome-stable (134.0.6998.88-1) over (134.0.6998.35-1) ...
Preparing to unpack .../chromium_134.0.6998.88-1~deb12u1_amd64.deb ...
Unpacking chromium (134.0.6998.88-1~deb12u1) over (134.0.6998.35-1~deb12u1) ...
Preparing to unpack .../chromium-sandbox_134.0.6998.88-1~deb12u1_amd64.deb ...
Unpacking chromium-sandbox (134.0.6998.88-1~deb12u1) over (134.0.6998.35-1~deb12u1) ...
Preparing to unpack .../chromium-common_134.0.6998.88-1~deb12u1_amd64.deb ...
Unpacking chromium-common (134.0.6998.88-1~deb12u1) over (134.0.6998.35-1~deb12u1) ...
Setting up google-chrome-stable (134.0.6998.88-1) ...
Setting up chromium-sandbox (134.0.6998.88-1~deb12u1) ...
Setting up chromium-common (134.0.6998.88-1~deb12u1) ...
Setting up chromium (134.0.6998.88-1~deb12u1) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.36-9+deb12u9) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for menu (2.1.49) ...


Once you complete system upgrade (patch), you may run the same commands again:

# apt-get update
# apt-get upgrade



================
$ virtuoso
2025/03/14 09:50:29 System is not a supported distribution
2025/03/14 09:50:29 An error occurred. We don't recognize OS 
2025/03/14 09:50:29 WARNING This OS does not appear to be a Cadence supported Linux configuration.
2025/03/14 09:50:29 For more info, please run CheckSysConf in <cdsRoot/tools.lnx86/bin/checkSysConf <productId>
/opt/EDA/IC/cur/tools/dfII/bin/64bit/virtuoso: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory

We can go to packages.debian.org to search libcrypto.so.10, and it shows this
file is inside nsight-systems-target package. Thus, we need to install 
nsight-systems-target:

# apt-get install nsight-systems-target

If you are unable to locate nsight-systems-target, you need to modify your 
Debian apt setting:

# cd /etc/apt
# vi sources.list
deb http://140.117.166.164/bookworm/ bookworm main contrib non-free non-free-firmware

deb http://140.117.166.164/bookworm/ bookworm-updates main contrib non-free non-free-firmware


You need to add "contrib non-free" into your download setting. Then type:

# apt-get update
# apt-get install nsight-systems-target

You maybe able to install this file now. 

Now, you can run virtuoso again:

$ virtuoso
2025/03/14 10:09:03 System is not a supported distribution
2025/03/14 10:09:03 An error occurred. We don't recognize OS 
2025/03/14 10:09:03 WARNING This OS does not appear to be a Cadence supported Linux configuration.
2025/03/14 10:09:03 For more info, please run CheckSysConf in <cdsRoot/tools.lnx86/bin/checkSysConf <productId>
/opt/EDA/IC/cur/tools/dfII/bin/64bit/virtuoso: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory

However, the same error message appears. Why ?

If you look at the packages.debian.org website, you can see the the full path
of libcrypto.so.10 is:

/usr/lib/x86_64-linux-gnu/nsight-systems/target-linux-x64/CollectX/libcrypto.so.10

You need to add /usr/lib/x86_64-linux-gnu/nsight-systems/target-linux-x64/CollectX  for virtuoso to find libcrypto.so.10.

We can use temporary solution:

$ env | grep LD
LD_LIBRARY_PATH=/opt/EDA/IC/cur/tools/lib:/opt/EDA/IC/cur/tools/dfII/lib

Your current library path is like above, we can add one more path:

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/nsight-systems/target-linux-x64/CollectX

The you can verify it:

$ env | grep LD
LD_LIBRARY_PATH=/opt/EDA/IC/cur/tools/lib:/opt/EDA/IC/cur/tools/dfII/lib:/usr/lib/x86_64-linux-gnu/nsight-systems/target-linux-x64/CollectX

Now you have the path in the LD_LIBRARY_PATH setting, and you can run:

$ virtuoso
2025/03/14 10:12:27 System is not a supported distribution
2025/03/14 10:12:27 An error occurred. We don't recognize OS 
2025/03/14 10:12:27 WARNING This OS does not appear to be a Cadence supported Linux configuration.
2025/03/14 10:12:27 For more info, please run CheckSysConf in <cdsRoot/tools.lnx86/bin/checkSysConf <productId>
/opt/EDA/IC/cur/tools/dfII/bin/64bit/virtuoso: error while loading shared libraries: libdb-4.7.so: cannot open shared object file: No such file or directory

We can see that this time it didn't show the error message. However, another
error message appears:


***** 
If you need to make permanent modification, you need to modify 
/opt/EDA/bashrc_eda, and change the setting like this:

LD_LIBRARY_PATH="/opt/EDA/IC/cur/tools/lib:/opt/EDA/IC/cur/tools/dfII/lib:/usr/lib/x86_64-linux-gnu/nsight-systems/target-linux-x64/CollectX"

Next time, you don't need to set LD_LIBRARY_PATH manually. When you source 
/opt/EDA/bashrc_eda file, it will be loaded automatically.

*****


$ virtuoso
2021/01/26 12:03:12 System is not a supported distribution
2021/01/26 12:03:12 An error occurred. We don't recognize OS
2021/01/26 12:03:12 WARNING This OS does not appear to be a Cadence supported Li
nux configuration.
2021/01/26 12:03:12 For more info, please run CheckSysConf in <cdsRoot/tools.lnx
86/bin/checkSysConf <productId>
/opt/EDA/IC/cur/tools/dfII/bin/64bit/virtuoso: error while loading shared librar
ies: libaprutil-1.so.0: cannot open shared object file: No such file or director
y


Solution:

# apt-get install libaprutil1


$ virtuoso
2025/03/14 10:12:27 System is not a supported distribution
2025/03/14 10:12:27 An error occurred. We don't recognize OS 
2025/03/14 10:12:27 WARNING This OS does not appear to be a Cadence supported Linux configuration.
2025/03/14 10:12:27 For more info, please run CheckSysConf in <cdsRoot/tools.lnx86/bin/checkSysConf <productId>
/opt/EDA/IC/cur/tools/dfII/bin/64bit/virtuoso: error while loading shared libraries: libdb-4.7.so: cannot open shared object file: No such file or directory

Now we see this error shows that libdb-4.7.so is missing. However, this file
can not be found in packages.debian.org. You may go to 
/usr/lib/x86_64-linux-gnu directory and run:

# cd /usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu # ls -l libdb-*
-rw-r--r-- 1 root root 1843792  1月 17  2023 libdb-5.3.so

There is a file called libdb-5.3.so, which is a newer version of libdb.

We can create a soft link for libdb-4.7.so#

/usr/lib/x86_64-linux-gnu # ln -s libdb-5.3.so libdb-4.7.so
/usr/lib/x86_64-linux-gnu # ls -l libdb-*
lrwxrwxrwx 1 root root      12  3月 14 10:51 libdb-4.7.so -> libdb-5.3.so
-rw-r--r-- 1 root root 1843792  1月 17  2023 libdb-5.3.so

Then you can run:

$ virtuoso
2025/03/14 10:51:53 System is not a supported distribution
2025/03/14 10:51:53 An error occurred. We don't recognize OS 
2025/03/14 10:51:53 WARNING This OS does not appear to be a Cadence supported Linux configuration.
2025/03/14 10:51:53 For more info, please run CheckSysConf in <cdsRoot/tools.lnx86/bin/checkSysConf <productId>
dlopen failed to open 'libdl.so'


If you find libdl.so in packages.debian.org, there is nothing.

However, if you go to /usr/lib/x86_64-linux-gnu directory

# cd /usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu # ls -l libdl*
-rw-r--r-- 1 root root     8 11月  1 20:42 libdl.a
-rw-r--r-- 1 root root 14480 11月  1 20:42 libdl.so.2

There is a file called libdl.so.2, so we need to create a soft link for it:

/usr/lib/x86_64-linux-gnu # ln -s libdl.so.2 libdl.so
/usr/lib/x86_64-linux-gnu # ls -l libdl*
-rw-r--r-- 1 root root     8 11月  1 20:42 libdl.a
lrwxrwxrwx 1 root root    10  3月 14 10:58 libdl.so -> libdl.so.2
-rw-r--r-- 1 root root 14480 11月  1 20:42 libdl.so.2


Then you may run virtuoso again:

$ virtuoso

This time, virtuoso can be executed (If you are lucky.)


2023年4月27日 星期四

Linux 安全傳輸資料之心得

 0. 常見網路攻擊手法

a. 掃 IP

# nmap -sT 192.168.10.0/24 -> 掃 192.168.10.0/24 網段


b. SSH 自動登錄攻擊

  Why SSH ?
  SSH 是提供使用者連線的一個服務,其埠是 22,如果沒有提供 ssh 服務的話,
  使用者將只能在主機前面登錄進行操作。

1. 檢視系統日誌

在 Debian Linux 底下請檢視 /var/log/auth.log 這個檔案,如果機器有直接接上網路
(沒有防火牆),那就會受到來自世界各地的攻擊。


2. 加強連線防護

https://zh.wikipedia.org/zh-tw/Fail2ban

如果避免主機遭受 SSH 攻擊 ?

fail2ban

假設判別一個 IP 是拿來攻擊的,在它輸入 N 次錯誤帳號/密碼時即把此 IP ban 掉。

fail2ban 的缺點 ?

a. 當封鎖 IP 太多時,fail2ban 會佔掉系統很多的運算能量。
b. 如果有人忘記密碼,當他登錄三次失敗,其 IP 就會被 ban。


3. 採用金鑰模式

https://xenby.com/b/220-%E6%95%99%E5%AD%B8-%E7%94%A2%E7%94%9Fssh-key%E4%B8%A6%E4%B8%94%E9%80%8F%E9%81%8Ekey%E9%80%B2%E8%A1%8C%E5%85%8D%E5%AF%86%E7%A2%BC%E7%99%BB%E5%85%A5


4. 其它防護技巧 (敲敲門、換 port、架 VPN)

敲敲門

https://newtoypia.blogspot.com/2018/02/spa.html

敲敲門的缺點是你必需有能力設定防火牆,如果你沒有管理防火牆的權限,你就沒辦法設
定 22 port 的轉址,那敲敲門這種防護方式對你來說沒有意義。

換 port

https://www.taki.com.tw/blog/change-ssh-port/

既然 22 port 很容易被攻擊,那我就把 ssh 預設的 22 port 改成其它 port,以避免
SSH 攻擊

換 port 的缺點:如果遇上真正的高手,那機器還是有可能被入侵。


架 VPN

好處:

1. 不必管防火牆設定,所有主機可透通連線
2. 不必擔心別人入侵,因為所有的 IP 如果不是假 IP 就是在防火牆後面。
3. 可建立不同網段的主機,整合在同一個群組裡面。

缺點:

我們必須找一個真實 IP 來掛 VPN 主機,如果 VPN 主機的網路連線有問題,那所有的
機器都無法連線。

5. 綜合討論

2021年5月19日 星期三

如何建立/更新 debian 鏡像站

 如何建立 debian 鏡像站


請將底下指令寫成 getdeb.sh


HOST=opensource.nchc.org.tw

METHOD=http # http, rsync, https

#echo "Don't do this in india"

#exit


debmirror \

        --arch=i386,amd64,armhf,arm64 \

        --dist=bullseye,buster,buster-updates,buster-backports\

        --di-arch=i386,amd64,armhf,arm64 \

        --di-dist=stable,unstable \

        --host=$HOST \

        --root=":debian" \

        --diff=none -p \

        --nosource \

        --method=$METHOD \

        --ignore-missing-release \

        --ignore-release-gpg \

        --ignore-small-errors \

        --section main,contrib,non-free \

        --i18n \

        --ignore-release-gpg /home/ftp/debian/ ;



另存新檔在 /home/ftp 目錄下,然後安裝 debmirror 套件,再執行

/home/ftp # sh getdeb.sh

如此一來即可更新你的 debian 鏡像站。





2021年5月2日 星期日

ADS 安裝 (2021/05/03)

 如何安裝 ADS (Advanced Design System)

ADS 是用來進行 RF 設計的工具,它的出版商是 KeySight,不是本課程先前所提到那些公司,因此其安裝跟設定都要特別處理:

1. 下載

請下載 ads_2020_update2.0_linux_x64.tar 以及 ads.csh

2. 解壓縮/安裝

解壓縮

tar xfva ads_2020_update2.0_linux_x64.tar

安裝

./SETUP.SH

裡面有很多問題,請一一作答,在設定安裝目錄的時候請輸入安裝目錄為

/opt/EDA/ads/ADS2020_update2
 

安裝完畢後,請以 root 權限切換到 /opt/EDA/ads 目錄,並新增 cur 連結,操作如下:

# cd /opt/EDA/ads
/opt/EDA/ads # ln -s /opt/EDA/ads/ADS2020_update2 cur

作完之後執行 ls -l 來驗證連結無誤,操作如下:

/opt/EDA/ads # ls -l
總計 8
drwxr-xr-x 63 root root 4096  5月  3 10:58 ADS2020_update2
lrwxrwxrwx  1 root root   15  5月  3 11:01 cur -> ADS2020_update2

3. 設定
 

請設定環境變數

ADS_bin="/opt/EDA/ads/cur/bin"

export PATH=$PATH:$ADS_bin

剛剛有下載一個 ads.csh 的檔案,現在來觀察其內容:

setenv HPEESOF_DIR /usr/ads
set path=($HPEESOF_DIR/bin $path)
setenv LM_LICENSE_FILE 1900@lscic3.cic.org.tw:$LM_LICENSE_FILE

我們可以看到 ADS 的 License 設定為 1900@lscic3.cic.org.tw,現在要先確定這台機器能不能連上,請執行底下操作:

$ ping lscic3.cic.org.tw

看看能不能連上,如果沒問題的話,請在環境變數中加上:

export LM_LICENSE_FILE=1900@lscic3.cic.org.tw

把環境設定載入,然後準備執行 ads。


4. 故障排除

$ ads

我們第一次啟動 ads 時,會出現無法檢查 License 的錯誤,此時要自己定義 license server,請輸入 1900@lscic3.cic.org.tw,然後 ads 會自動跳出。

之後,我們再重啟 ads 即可正確啟動這套軟體。

2021年2月10日 星期三

寫於好讀網站關站

好讀於今年 1/1 正式關門,沒想到創辦人周劍輝博士已經在 2017/12/04 因心臟病過世,也沒想到我何其有幸可以在他走之前跟他能在網路上結緣。
好讀的電子書掃下來之後,因為他們不曉得可以使用 ImageMagik 來進行影像強化、雜訊移除跟自動切頁的工作,所以他們用 OCR 的辦識率一直不高。需要很多人作後端的手工校正,我因為某種原因跟周博士聯繫上,並且寫了一些 script 協助他作影像強化。原本以為對好讀會有幫助的,沒想到我跟周博士聯繫完沒多久他就驟然離世。
今天才知道好讀網站也關站(我真是後知後覺)了,順手留下紀錄,作為這段過程的註腳。

 

後記:好讀又於 2021/02/12 復站了,這次可以維持多久不知道,大家好好把握吧!!


 

2020年10月17日 星期六

建置程式開發環境

建置程式開發環境

教學目標:

在 Linux 上面有許多程式開發環境,從最陽春的 vim、Emacs 乃至於大型專案開發會用到的Eclipse 都是 Linux 上面的程式開發環境。使用 vim 作程式開發對學生而言略嫌功能太過簡陋,而 Eclipse 是屬於大型專案工具,光是啟動、運作都需要不少資源,因此不大建>議學生使用。本課程的目標即在於教導學生建置 Linux 上面的程式開發環境,我們的首選>是 geany 這個輕量級的 IDE 程式開發工具。


教學方法:

在這門課程上我們採用 geany 來進行程式開發,其安裝方式如下:

# apt-get install geany

Geany 的好處是它的介面非常精簡,支援 C/C++、 Python 等程設語言之語法高亮度顯示,

而且可以直接呼叫 GNU C 或是 Python 來進行程式編譯與執行的操作,簡單來說其功能非常類似 DOS 時代的 Turbo C/C++ 一樣,是個輕量級的程式開發環境。下圖是 geany 載入 C 語言的畫面,我們可以看到其介面非常的簡潔,適合初學程式設計的學生來使用。