Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/31/2012 in all areas

  1. Hi Sumit, header guards won't necessarily help. They stop two header files being included sequentially - but if you have a function *body* in the header, and include that header in two independent files, you'll still get multiple definitions at link time. My guess is that Timmy is #including a gnoise.cpp. In that case the fix is to make a gnoise.h with the function prototype, with your header guards of course, and include the .h not the .cpp, regards Alan
    2 points
  2. This is a very old version of SystemC. You should use at least SystemC 2.0.1, which fixes some bugs. As Philipp noted, this version is not compatible with modern C++ compilers so that it requires quite some fixes until it will compile without errors and warnings. This will require quite some effort from your side to Google for the warnings and resolve them in the source files. As noted by Philipp, SystemC 2.0 is not compatible with the x86_64 architecture, so you'll have to compile it and all dependent libraries (i.e. in your case Metropolis) for the i386 platform. You can force it during the configure step: $ cd systemc-2.0.1 $ mkdir objdir $ ../configure --target=i396-unknown-linux-gnu $ make However, for the QuickThreads part to compile, you'll have to play additionally with the compiler flags, as Philipp mentioned. To this end, you'll have to edit the Linux section of configure.in to add -m32 to EXTRA_CXXFLAGS and add ASFLAGS="--32". It should look like: *linux*) case "$CXX_COMP" in c++ | g++) EXTRA_CXXFLAGS="-Wall -m32" ASFLAGS="--32" DEBUG_CXXFLAGS="-g" OPT_CXXFLAGS="-O3" TARGET_ARCH="linux" CC="$CXX" CFLAGS="$EXTRA_CXXFLAGS $OPT_CXXFLAGS" ;; *) AC_MSG_ERROR("sorry...compiler not supported") ;; esac QT_ARCH="iX86" ;; Replace <ieeefp.h> by <cmath>. You'll also stumble about other deprecated headers, which will be included. Also the Endian detection in "scfx_ieee.h" fails, you'll have to #define SCFX_LITTLE_ENDIAN to work around this issue. At this point compilation will still fail at various places in the kernel (sc_thread_cor_fn, sc_cthread_cor_fn) and the integer and fixed point libraries (for the different overloaded operators). Primarily, this is due to missing declarations of functions or classes, which are referenced in the implementation and have been previously only introduced in form of friend declarations, but not as proper declarations. You'll have to add those declarations in the appropriate places, preferably in the corresponding header in front of the class with the friend declarations. I gave up at that point. Good luck in trying to make SystemC 2.0 build again. It may be more productive trying to make Metropolis compatible with the current SystemC version. Though, you risk to run in the same issues. Therefore, you may consider to install both into a virtual machine running a 32bit Linux from that time (e.g., Redhat or Debian) Regards, Torsten
    1 point
  3. Ok, after having a closer look at your code, I know remember that a similar issue has popped up very shortly before the release of SystemC 2.3.0. On Microsoft VC++ something strange has been going on in the sc_concatref conersion to sc_big(u)int, which especially affects the comparison operator in certain corner cases. Your workaround is known to avoid this problem. Since a "hotfix" made it into the 2.3.0 release (see src/sysc/datatymes/misc/sc_concatref.h:247, and we have not observed this (or a similar) problem on other platforms, we need more information from your side: SystemC version (Accellera's 2.3.0, right?) platform, compiler, compiler flags compile/runtime warnings and errors a self-contained code sample, preferable less than 100 lines, demonstrating the problem Any valgrind and purify reported memory leaks are probably false positives here. Reported accesses to uninitialized memory may be a better indication for the bug's origin. Can you paste the (first) related error in this case? You can also download the SystemC regression test suite from the accellera.org website and check the systemc/datatypes/misc/concat/test07 test case, which has originally triggered the related issue on MSVC. Greetings from Oldenburg, Philipp
    1 point
×
×
  • Create New...