Skip to main content

SystemC Development of Eclipse on Linux



    SystemC Development on Eclipse on Linux


For setting up the systemc development enviornment on Linux requires below packages available in you pc.

  • SystemC packages : Contains all SystenC related library/header file and esential stuff defined by accellera.
    Registration is required @ Accellera.org
  • Eclipse with C/C++ tools.
    Form linux software packages center or “apt-get install eclipse”
  • Before proceeding for systemC build enviornment run below command to be free from all intermideate troubles :)
  • sudo apt-get upgrade
  • sudo apt-get install build-essential
  • sudo apt-get update
Installing systemc Packages in Linux PC

Untar the SystemC packages
  • tar -xzvf systemc-2.3.1.tgz
Crating SystemC install Dir
  • sudo mkdir /usr/local/systemc-2.3.1
Configuiring the system c
./configure –prefix=/usr/local/systemc-2.3.1
  • Compile the packages and install
  • sudo make
  • sudo make clean
  • sudo make -j 3
  • sudo make install
  • Exporting the SystemC variable path in
  • export SYSTEMC_HOME=/usr/local/systemc-2.3.1/
  • sudo gedit /etc/environment
    and
    add below lines.
    SYSTEMC_HOME=”/usr/local/systemc-2.3.1/”
    export LD_LIBRARY_PATH=/usr/local/systemc-2.3.1/lib-linux64
  • sudo ~/.bashrc
    SYSTEMC_HOME=”/usr/local/systemc-2.3.1/”
    export LD_LIBRARY_PATH=/usr/local/systemc-2.3.1/lib-linux64:$LD_LIBRARY_PATH


Installing Eclipse Packages in Linux PC

Install below commands for eclipse and dependent packages
  • sudo apt-get install eclipse eclipse-cdt g++

Create a new C/C++ project using the menu File -> New -> Other.
Add all your systemc program files to the project.
It is time to inform eclipse+CDT where our systemC include headers and library files are.
  • Click Project -> Properties. Navigate to C/C++ Build -> Settings -> Tool Settings tab.
  • Under GCC C++ Compiler -> Includes, Add /usr/local/systemc-2.3.1/include to Include Paths.


































Add systemc dependent Library location in C++ linker settings.
Under
  • GCC C++ Linker -> Libraries,
  • Add /usr/local/systemc-2.3.1/lib-linux to Library Search Paths.
  • Add systemc and m to Libraries.































Reboot the pc

Create a basic Hello world kind of project and use the eclipse normally.

Run Configuration :
































Example code :
//==========================================================================
// Name : Hello.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
// 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.\n";
}
};

// sc_main in top level function like in C++ main
int sc_main(int argc, char* argv[]) {
hello_world hello("HELLO");
// Print the hello world
hello.say_hello();
printf("Hello");
return(0);
}




=====================================
Output after running :

SystemC 2.3.1-Accellera --- Feb 13 2016 02:15:11
Copyright (c) 1996-2014 by all Contributors,
ALL RIGHTS RESERVED
Hello World.


Comments

Popular posts from this blog

PCIe Linux Driver Understanding in Brief

PCIe Wires and Voltages  The Memory bus  The I/O bus  The bus clock Bus locking / wait states  The Bridge and Delayed Transaction  Bursts  Bus mastering, bus arbitration, DMA PCI PCIe Very slow bus in today’s terms (66 MHz) Ø   It’s not a bus, it’s a packet network of 32 bit elements Ø   Hotpluggable, energy saving Ø   Each device has its own dedicated wires Ø   Transaction Layer Packets (TLPs) instead of bus transactions Ø   Posted and non-posted bus requests Ø   Data flow control, error detection and retransmit Ø   Full backward compatibility and interoperability with legacy PCI (including INTx) Ø   Lanes: 1x, 2x, 4x, 8x, 16x Speeds: PCIe 1.0: 2.5 Gb/s raw bits, 2.0 Gb/s data bits, parallel to 62.5 MHz 32-bit bus... Memory space (32/64 bits), I/O space, configuration space Bus Mastering (DMA) and bursts Bridges Vendor ID, Device ID, class, subclass pci.ids, lspci a

MMU -Linux Memory Managment

What is Virtual Memory? ● Virtual Memory is a system that uses an address mapping ● Maps virtual address space to physical address space – Maps virtual addresses to physical RAM – Maps virtual addresses to hardware devices ● PCI devices ● GPU RAM ● On-SoC IP blocks                                                           x86 Physical Memory Map Two address spaces : -------------------- ● Physical addresses – Addresses as used by the hardware ● DMA, peripherals ● Virtual addresses – Addresses as used by software ● Load/Store instructions (RISC) ● Any instruction accessing memory (CISC) Virtual Memory Details: ----------------------- ● Mapping is performed in hardware ● No performance penalty for accessing alreadymapped RAM regions ● Permissions are handled without penalty ● The same CPU instructions are used for accessing RAM and mapped hardware ● Software, during its normal operation, will only use virtual addresses. – Includes kernel and

Smart Card Technology ISO7816 T =0/1

Smart Card Working :  ============= 1. Insertion of the smart card in the slot. 2. Detection of the smart card insertion by the interfacing device (i.e., microcontroller). 3. Cold reset of the smart card by the interfacing device. 4. Answer to Reset (ATR) response by the card to the microcontroller. 5. Protocol and Parameter Selection (PPS) exchange between the smart card and the microcontroller (if the smart card supports PPS). 6. Execution of the command(s) between the smart card and the interfacing device. 7. Removal of the smart card from the slot. 8. Detection of the smart card removal by the microcontroller. 9. Deactivation of the smart card contacts by the microcontroller. After Mechanical Contact with inter facung device interfacing device has to perform a Cold Reset of the smart card using the following steps: 1. Pull the RST line to low state. 2. Pull the VCC line to high state. 3. The UART module in the interfacing device