SystemC在Ubuntu16.04上安装测试
使用SystemC進行硬件仿真
環境
- linux-x86-64
- bash
- g++
下載解壓SystemC
SystemC下載地址
解壓下載的包
tar zxvf systemc-2.3.3.tar.gz
進入解壓出來的目錄,準備編譯安裝
cd systemc-2.3.3
編譯安裝
打開安裝說明文件INSTALL
vim INSTALL
按照步驟安裝
Create a temporary directory
mkdir objdir
Change to the temporary directory
cd objdir
Choose your compiler by setting the CXX environment variable(我的shell是bash)
export CXX=g++
Configure the package for your system
../configure --prefix=/usr/local/systemc-2.3.2
Compile the package(這里使用make命令)
make
Verify the compiled package
make check
Install the package(root用戶)
make install
安裝好的目錄
配置安裝的庫路徑
添加軟鏈接(使用root用戶/sudo執行)
ln -s /usr/local/systemc-2.3.2/lib-linux64/libsystemc-2.3.2.so /usr/lib/libsystemc-2.3.2.so
修復動態鏈接庫問題
將安裝路徑添加都/etc/ld.so.conf.d/目錄下(使用root用戶/sudo執行)
使用超級用戶的方式:
https://jingyan.baidu.com/article/fd8044fa1e74035031137ae0.html
退出超級用戶:
exit
echo "/usr/local/systemc-2.3.2/lib-linux64/" > /etc/ld.so.conf.d/systemc.conf sudo ldconfig以上為完整的安裝步驟,可以通過以下范例hello程序測試
?hello.h
#ifndef _HELLO_H #define _HELLO_H #include "systemc.h" SC_MODULE(hello){ SC_CTOR(hello){ cout<<"Hello, SystemC!"<<endl; } }; #endif?main.cpp
#include "hello.h" int sc_main(int i, char* a[]){ hello h("hello"); return 0; }通過運行命令
g++ main.cpp -I /usr/local/systemc-2.3.2/include -L /usr/local/systemc-2.3.2/lib-linux64 -o hello -lsystemc生成可執行文件“hello”
通過運行
./hello得到運行結果
運行官方案例pipe
?需要提前修改的Makefile.config,如命所示,這個文件是Makefile的配置文件。該文件原始文件標注為默認位置,需要用戶根據自己的實際安裝位置進行修改
位置有兩處,一處為SystemC的安裝位置。根據上面的步驟可知,systemC安裝在/usr/local/systemc-2.3.2
另外一處是linux的版本號,通過查看文件名,進行修改?
?修改完畢后進入systemc-2.3.3/examples/sysc/pipe文件夾,執行make。
當時出現
anonymous variadic macros were introduced in C++11 ...... cc1plus: all warnings being treated as errors錯誤。通過修改MakeFile.config(和之前修改的文件相同)
?
后,執行make,產生輸出文件
執行./pipe.x, 得到一系列輸出
參考鏈接:
使用SystemC進行硬件仿真 - 喬_木 - 博客園
systemC的安裝_Alex_rz的技術博客_51CTO博客
SystemC在ubuntu上的安裝_Haifeng的博客-CSDN博客
gcc cc1: all warnings being treated as errors - 一沙世界 - 博客園
總結
以上是生活随笔為你收集整理的SystemC在Ubuntu16.04上安装测试的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: python多个变量的for循环
- 下一篇: 备案注销房源是什么意思(备案注销房源)
