Jump to content

Elvis Shera

  • Content Count

  • Joined

  • Last visited

About Elvis Shera

  • Rank

Profile Information

  • Gender
  • Location
    Stuttgart Area, Germany

Recent Profile Visitors

620 profile views
  1. @Eyck, "you don't assign anything to adata->sdata in sc_main In your if branch testing the pointer for NULL and create the design but then you throw away the pointer". I missed this. Thanks for pointing out. The issue I have in putting the loop inside sc_main is that I would be assuming how the external application will want to use the mode.? Think about the schenariou where you want to ship this model to a costumer. The only think they should care is the API interface exposed to them... data and methods eventually. In general I am not proud of this approach but I seem c
  2. Hello, I am trying to drive an SC model via a C-shell. My C-Shell program: the SC model is exposed to the c-shell via an API declared as: the main.cpp of my SC model is: the DUT is modeled as a short... where the output = input every time the input is changing. The main program is compiled and I am generating a shared library out of it. Such library is then linked while creating an executable for the c-shell program. By playing around... I either get a core-dump or an error message telling me that it could not insret primitive channel.
  3. 🙂 🙂 I have not notice this. Thank you Ameya
  4. g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enab
  5. I did that and it has at least improved the messaging. I also added the following lines: add_library(systemc SHARED IMPORTED) set_property(TARGET systemc PROPERTY IMPORTED_LOCATION "/home/Tools/SystemC/systemc-2.3.3/lib-linux64/libsystemc.so") now the problem i am seeing is the following: [100%] Linking CXX executable scapp CMakeFiles/scapp.dir/src/main.cpp.o: In function `__static_initialization_and_destruction_0(int, int)': /home/Tools/SystemC/systemc-2.3.3/include/sysc/kernel/sc_ver.h:182: undefined reference to `sc_core::sc_api_version_2_3_3_cxx201103L<
  6. Hi Ameya, here is my file: ========================================================== cmake_minimum_required(VERSION 3.1) # setting this is required project(xor) # this sets the project name SET(TARGET_ARCH "linux64") set(CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME}) SET(SYSTEMC_INC_DIR "${CMAKE_PREFIX_PATH}/include") SET(SYSTEMC_LIB_DIR "${CMAKE_PREFIX_PATH}/lib-${TARGET_ARCH}") include_directories(${PROJECT_SOURCE_DIR}/inc ${SYSTEMC_INC_DIR}) file(GLOB SOURCES "src/*.cpp") set(CMAKE_CXX_STANDARD 11) # enable C++11 standard se
  7. Thanks Philipp, I already use Makefiles and these are ok. I also understand that via cmake build/install the cmake related configuration are generates so is easier then. My question goes in the direction of: If I don't use cmake to install systemC, how can I still use cmake for a systemc project ? I think I am almost done but the linking part is failing. The Makefile example I reported is already in use and working so the question is how do I translate that information for the Linker in an equivalent description for CMakeLists.txt? It should be trivial but it seems I am mis
  8. in a manually made Makefile i have the following: # target architecture TARGET_ARCH = linux64 # specify paths SYSTEMC_INC_DIR = $(SYSTEMC_HOME)/include SYSTEMC_LIB_DIR = $(SYSTEMC_HOME)/lib-$(TARGET_ARCH) LDFLAGS = "-Wl,-rpath,$(SYSTEMC_LIB_DIR)" -L$(SYSTEMC_LIB_DIR) -lsystemc -lm the last taking care of the linking phase... I am new to cmake and I can see that is a nice build system but I am having a mental time to specify the same things in the CMakeLists.txt
  9. What if the SystemC installation has not been done via Cmake? There must be a way to locate the libraries (given that systemc has been installed in a local directory) for the linking process. In that case what are the instruction to achieve this ?
  10. Ok. yes you are right... If I port the code back into the .h file it works... It also seems to be something wrong with the Makefile which is not compiling all the c sources. Maybe this is the real reason. Thanks for your help.
  11. why 2 declarations? I have a declaration inside the *.h file and the implementation in the .cpp file
  12. =============================================================================== #include <systemc.h> #include "stimuli.h" int sc_main(int argc, char* argv[]) { // signal connectivity sc_signal<bool> ASig, BSig; // clock signal is generated from the main in this case sc_clock clk("clk", 10, SC_NS, 0.5); // instance of stimuli block stimuli i_stim("Stimulus"); i_stim.A(ASig); i_stim.B(BSig); i_stim.clk(clk); // Tracing Waveforms sc_trace_file *Tf = sc_create_vcd_trace_file("traces"); Tf-&g
  13. This example is very close to the one in the Duolos website.: https://www.doulos.com/knowhow/systemc/tutorial/modules_and_processes/ For me it does not run either. I have tried to compile with --enable_pthread but still it does not compile. I am using SystemC-2.3.3 on ubuntu 18.04. my installation seems good. make check does give all test passing. Instead of SC_METHOD I am using SC_THREAD which is sensitive to the pos-edge of the clock. tracing the waveform I can see the clock is OK. However the SC_THREAD is not executed at all while I expect to at lest execute once. I h
  14. Ok, that solves the problem of compiling the sources. It is interesting that the same PoC would compile in one machine (RH6) and not compile (compile after the suggestions) in an ubuntu. The only thing which is different is the version of the g++ compiler which in RH6 is older. Are there other things to take into consideration? In addition, at the moment I am running an example which is working in RH6 but is not working on the newer Ubuntu (Simple low-pass filter).
  15. I will try that. Thank you. Question more for the @COSEDA folks. Any idea when we can download the new PoC?
  • Create New...