Use CLion to build a SystemC development environment under Windows

ready

  • Systemc installation package. ClickHeredownload
  • Install CLion. ClickHeredownload
  • Install Cygwin. ClickHeredownload

Build SystemC

We use CLion to build Systemc

  1. File -> Open
  2. Select %SYSTEMC_HOME%/src
  3. Comment the "Install rules for Systemc library" section and the "set_target_properties" section of CMakeLists.txt
  4. Added in the "Build rules for SystemC library" section of CMakeLists.txt
cmake_minimum_required(VERSION 3.9)
project(sc)

set(CMAKE_CXX_STANDARD 11)
  1. Ctrl + F9 to start building
    The build will generate libsystemc.a in the cmake-build-debug directory.

Hello SystemC

We use CLion to develop SystemC programs.

  1. File -> New Project -> C++ Executable -> Create
  2. Add in CMakeLists.txt
include_directories(D:/Apps/systemc-2.3.2/src)
link_directories(D:/Apps/systemc-2.3.2/src/cmake-build-debug)
link_libraries(systemc.a)
  1. Modify main.cpp to:
#include "systemc.h"

SC_MODULE(Test) {
    void sim() {
        printf("Hello World\n");
    }

    SC_CTOR(Test) {
        SC_METHOD(sim); sensitive << clk.pos();
    }

    sc_in<bool> clk;
};

int sc_main(int argc, char *argv[]) {
    sc_clock clk("clk", 1, SC_NS);

    Test t("test");
    t.clk(clk);

    sc_start(10, SC_NS);
    return 0;
}
  1. Ctrl + F9 compile, then run

Intelligent Recommendation

Use IEDA under Windows, Maven development and operation Hadoop environment to build

Development can be developed locally. See the build under Linux: After installing IDEA, install Maven, download apache-maven-3.5.4-bin.zip and extract it. Configure environment variables: Add to envir...

First, the use GObject-- build glib / gobject development environment under Windows

First, download the development kit There are compiled under Windows Glib GTK development package on the official website. http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.22/glib_2.22.2-1_win32.z...

Use VS2012 to build Lua development environment under Windows

Thanks to the hard work of the original author: http://www.byjth.com/lua/33.html Lua itself is an embedded language. It is not a program that can be run separately, but a library that can be linked to...

Use VS Code to build golang development environment under Windows

Use VS Code to build a golang development environment Download and install golang Download link (Go official mirror station):https://golang.google.cn/dl/ Note: Select the corresponding installation pa...

Use VS2019 to build a Lua development environment under Windows 10

Use VS2019 to build a Lua development environment under Windows 10 1. Download and compile Lua source code 1. Download the Lua source code 2. Use Visual Studio 2019 to compile Lua source code Two, use...

More Recommendation

CLION use: combined with WSL under Windows for Linux development

Article catalog 1 background 2 installation configuration WSL 3 Configuring CLION WSL 4 verification effect 5 Reference documentation 1 background I used to develop Linux applications under Windows, u...

Use CLION plus STM32Cubemx STM32 development environment to build invincible

As we all know, STM32 conventional development environment is KEIL MDK5, but the compiler in many respects do not satisfactory, beat code to point B cells did not ( Plan focuses ), And with the change...

Clion use WSL (Linux subsystem on windows) as a development environment

Windows subsystem on Linux line has a longer period of time, forced software ecosystem, had to use windows, as a C ++ developer's server to me, windows of the environment can not run my program, such ...

ESP32 development-build development environment under Windows

ESP32 basic series ESP32 first experience environment construction GPIO for ESP32 peripheral learning UART for ESP32 peripheral learning ESP32 development to connect the module to the network ESP32 on...

Build SystemC programming environment on MAC

1. Reference link 2. File and library preparation 2.1. SystemC download address: https://accellera.org/downloads/standards/systemc 2.2, BREW installation: (usually installed) 2.3, GCC-8 installation: ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top