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

Linux file management command example analysis [display, view, statistics, etc.]

This article describes the Linux file management ...

Nginx Layer 4 Load Balancing Configuration Guide

1. Introduction to Layer 4 Load Balancing What is...

CSS achieves the effect of aligning multiple elements at both ends in a box

The arrangement layout of aligning the two ends o...

Native js to realize bouncing ball

On a whim, I wrote a case study of a small ball b...

How to modify the root password of mysql under Linux

Preface The service has been deployed on MySQL fo...

How to implement scheduled backup of CentOS MySQL database

The following script is used for scheduled backup...

Getting Started with Mysql--sql execution process

Table of contents 1. Process 2. Core Architecture...

Analyze how to automatically generate Vue component documentation

Table of contents 1. Current situation 2. Communi...

Draw a heart with CSS3

Achieve resultsRequirements/Functionality: How to...

Explanation of the steps for Tomcat to support https access

How to make tomcat support https access step: (1)...

JavaScript data structure bidirectional linked list

A singly linked list can only be traversed from t...

Solution to the inconsistency between crontab execution time and system time

Preface In LINUX, periodic tasks are usually hand...

A brief introduction to MySQL storage engine

1. MySql Architecture Before introducing the stor...