安裝 SystemC and TLM on OpenSuSE 12.1 (64-bit Linux)

Setup Environment Variable
edit .cshrc by adding:

setenv SYSTEMC_HOME /opt/systemc/systemc-2.2.0
setenv TLM_HOME     /opt/systemc/TLM-2009-07-15

Install SystemC-2.2.0

照例,要先修改 ./systemc-2.2.0/src/sysc/utils/sc_utils_ids.cpp
加上下列兩行

#include "string.h"
#include "cstdlib"

開始編譯

% cd systemc-2.2.0
% mkdir objdir
% cd objdir
% ../configure --prefix=/opt/systemc/systemc-2.2.0
% make

嗯,跟之前安裝時不一樣,這次跑出來以下錯誤訊息:

../../../../systemc-2.2.0/src/sysc/datatypes/bit/sc_bit_proxies.h:716:16: error: reference ‘m_obj’ cannot be declared ‘mutable’ [-fpermissive]
../../../../systemc-2.2.0/src/sysc/datatypes/bit/sc_bit_proxies.h:1193:18: error: reference ‘m_left’ cannot be declared ‘mutable’ [-fpermissive]
../../../../systemc-2.2.0/src/sysc/datatypes/bit/sc_bit_proxies.h:1194:18: error: reference ‘m_right’ cannot be declared ‘mutable’ [-fpermissive]
../../../../systemc-2.2.0/src/sysc/datatypes/bit/sc_bit_proxies.h:1196:18: error: reference ‘m_refs’ cannot be declared ‘mutable’ [-fpermissive]

Google 一下之後,找到解法,將 src/sysc/datatypes/bit/sc_bit_proxies.h 中的 mutable 都去除
重新 compile

% ../configure --prefix=/opt/systemc/systemc-2.2.0
% make
% sudo make install

最後可以做一下測試

$ make check

Install TLM-2.0.1
Step.1 將 TLM-2.0.1 解到 /opt/systemc/systemc-2.2.0

sudo tar -C /opt/systemc -zxvf ~/work/SystemC/SystemC.org/download/TLM-2.0.1.tgz

Spte.2 修改 systemc-2.2.0/include/sysc/packages/boost/bind/placeholders.hpp

LINE.28 #if defined(__BORLANDC__) || defined(__GNUC__)

Spte.3 修改 systemc-2.2.0/include/sysc/datatypes/bit/sc_lv_base.h

LINE.309     return sc_logic_value_t( (m_data[wi] >> bi & SC_DIGIT_ONE) |
LINE.310                              (m_ctrl[wi] >> bi << 1 & SC_DIGIT_TWO) );

Run TLM-2.0.1 examples
Step.1 修改 TLM-2009-07-15/examples/tlm/build-unix/Makefile.config

LINE.2  DEFAULT_TARGET_ARCH  = linux64

Step.2 執行 examples

% cd TLM-2009-07-15/examples/tlm/build-unix
% make
% make run

Run TLM-2.0.1 unit_test
Step.1 修改 TLM-2009-07-15/unit_test/tlm/build-unix/Makefile.config

LINE.2  DEFAULT_TARGET_ARCH  = linux64

Step.2 執行 examples

$ cd TLM-2009-07-15/unit_test/tlm/build-unix
$ make
$ make run

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *