SystemC environment configuration method under Linux system

SystemC environment configuration method under Linux system

The following is the configuration method under centos7

Download the systemc source package: SystemC (accellera.org)

insert image description here

Place the compressed package in the user directory and decompress it

tar -zxvf systemc-2.3.3.tar.gz

Enter the systemc-2.3.3 folder

cd systemc-2.3.3

Create a new temporary folder tmp and enter it

mkdir tmpcd tmp

Run the following command

../configure
make
make install

At this point, two folders, include and lib-linux64, are generated in the folder

Setting Environment Variables

export LD_LIBRARY_PATH=home/centos7/systemc-2.3.3/lib-linux64 
///home/cnetos7/ is the path for decompressing the files. You can determine the path based on your needs.

Executing this command is only available at the moment and will become invalid after a reboot. If you need to use it for a long time, it is recommended to add this command to the .bashrc file in the user directory and execute the following command to make it effective after the terminal is restarted.

source .bashrc

Run a systemc program for testing.

test.cpp

//all systemc modules should include systemc.h header file
#include "systemc.h"
//hello_world is module name
SC_MODULE(hello_world){
	SC_CTOR(hello_world){
		//nothing in constructor
	}
	void say_hello(){
		//Print "Hello world!!!" to the console.
		cout<<"Hello World!!!"<<endl;
	}
}; //Don't forget the semicolon here //sc_main in top level function like in C++ main
int sc_main(int argc, char* argv[]){
	hello_world hello("HELLO");
	return 0;
}

Compile and run

g++ test.cpp -I/home/cp/Simulator/systemc/include -L/home/cp/Simulator/systemc/lib-linux64 -o test -lsystemc
./test

The screen will display

insert image description here

Makefile

LIBDIR=-L/home/cp/Simulator/systemc/lib-linux64
INCDIR=-I/home/cp/Simulator/systemc/include
LIB=-lsystemc
all:
	g++ -o test test.cpp $(LIBDIR) $(INCDIR) $(LIB)
clean:
	rm -rf *.o

This is the end of this article about SystemC environment configuration method under Linux system. For more relevant content about SystemC environment of Linux system, please search previous articles of 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of two ways of Linux service management: service and systemctl
  • Linux &, use of nohup and Systemctl
  • Detailed explanation of systemctl command in Linux system

<<:  Examples of clearfix and clear

>>:  MySQL partition table is classified by month

Recommend

Ubuntu16.04 builds php5.6 web server environment

Ubuntu 16.04 installs the PHP7.0 environment by d...

Summary of several commonly used CentOS7 images based on Docker

Table of contents 1 Install Docker 2 Configuring ...

Detailed steps to use Redis in Docker

1. Introduction This article will show you how to...

Practice of implementing custom search bar and clearing search events in avue

Table of contents 1. Customize the search bar con...

The difference between br and br/ in HTML

answer from stackflow: Simply <br> is suffic...

Detailed explanation of MySQL binlog usage

binlog is a binary log file that records all DML ...

Sample code for implementing multi-application deployment using tomcat+nginx

Table of contents Multi-application deployment 1-...

Simple steps to write custom instructions in Vue3.0

Preface Vue provides a wealth of built-in directi...

Details on using order by in MySQL

Table of contents 1. Introduction 2. Main text 2....

JS operation object array to achieve add, delete, modify and query example code

1. Introduction Recently, I helped a friend to ma...

Dynamically add tables in HTML_PowerNode Java Academy

Without further ado, I will post the code for you...

Implementation of Docker cross-host network (manual)

1. Introduction to Macvlan Before the emergence o...

Things You Don’t Know About the CSS ::before and ::after Pseudo-Elements

CSS has two pseudo-classes that are not commonly ...

Detailed usage of Vue more filter widget

This article example shares the implementation me...

Tutorial on deploying nginx+uwsgi in Django project under Centos8

1. Virtual environment virtualenv installation 1....