Trusster Forums » Technical Support

Building for Cygwin and Modelsim 6.6c

(13 posts)

  1. bishopsl
    Member

    I am trying to test the teal/truss environment using Cygwin for the latest Modelsim PE 6.6c, which doesn't support their precompiled mingw32 gcc version 3.x any longer, but the 4.x. Is there an example for a "Makefile.win32" that you could share to help me get Teal/Trus up and running?

    Posted 1 year ago #
  2. bishopsl
    Member

    My attempt at Makefile.win32 for Modelsim 6.6c:

    # Makefile.win32
    ## Makefile options for WIN32 platform using ModelSim
    ##
    ## Requires the gcc ming32 compiler, but no longer supplied by Mentor,
    ## so got latest mingw from internet 10/11/10 => gcc v4.5.0
    ## Also got latest pthread library pthreads-w32-2-8-0-release.
    
    SYS_PLATFORM = unix
    OSNAME = lnx86
    CHIP = x86
    
    # Try using the latest MingGW compiler from my 10/11/2010 upgrade
    SYS_ARCH_CC = c:/mingw/bin/gcc
    # freshly compiled this pthreadGC
    SYS_ARCH_LD_OPT = -L $(SIMULATOR_HOME)/win32pe -lmtipli -lwsock32 -lstdc++ -L. -lpthreadGC2
    
    SYS_ARCH_OPT = -Wall -I $(SIMULATOR_HOME)/include -D_WIN32
    
    SYS_ARCH_CC_LD_DYNAMIC = -shared
    SYS_ARCH_LD_DYNAMIC = -shared
    
    ARCH_RELOCATE_OPT =
    ARCH_DYNAMIC_LD = -shared
    ARCH_SHARED_SUFFIX = dll
    ARCH_DEGUG_FLAG = -ggdb
    
    #SYS_ARCH_OPT =
    D_OPT = $(SYS_ARCH_OPT) $(D_GOPT) $(D_OSOPT)
    
    SYS_ARCH_LD_STATIC = -Bstatic
    
    SYS_ARCHDYNAMIC_LIBS =
    SYS_ARCHSTATIC_LIBS =
    SYS_ARCHLIBS= $(SYS_ARCHSTATIC_LIBS) $(SYS_ARCHDYNAMIC_LIBS)
    
    SYS_ARCH_LDFLAGS = 
    
    SHELL = /bin/sh
    MKDIR = mkdir
    RM = rm -rf
    DIFF = diff
    
    SYS_ARCH_AR = ar cr
    DYNAMIC_LIB_RULE = -o $(DYNAMIC_LIB)
    OBJ_SUFFIX = o

    STDOUT from make:

    c:/mingw/bin/gcc -c ./teal_reg.cpp -o ./teal_reg.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -Dvpi_2_0 -DSIM=mti -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    In file included from ./teal.h:136:0,

    from ./teal_reg.cpp:32:

    ./teal_vout.h:149:60: warning: 'typedef' was ignored in this declaration

    In file included from ./teal.h:137:0,

    from ./teal_reg.cpp:32:

    ./teal_reg.h:95:49: warning: 'typedef' was ignored in this declaration

    ./teal_reg.cpp:391:54: error: 'bool teal::operator==(const teal::reg&, const teal::reg&)' should have been declared inside 'teal'

    ./teal_reg.cpp:398:67: error: 'teal::reg::four_state teal::triple_equal(const teal::reg&, const teal::reg&)' should have been declared inside 'teal'

    ./teal_reg.cpp:428:64: error: 'teal::reg::four_state teal::operator<(const teal::reg&, const teal::reg&)' should have been declared inside 'teal'

    make: *** [teal_reg.o] Error 1

    Posted 1 year ago #
  3. bishopsl
    Member

    And added the following to the Makefile:

    # SLB 10/11/10 Added the environment variables for the Modelsim simulator
    export SIMULATOR_HOME=c:/Modeltech_6.6c
    export SIM=mti_2_0
    ARCH = win32

    Posted 1 year ago #
  4. shimrod
    Member

    Hi

    I checked in the mentor.com download area. You can download gcc from
    there. It is the same directory as modelsim 6.6 (SE or PE)

    Anyway it might not matter. The compile problem you get is the source code.
    I will try to compile it myself and come back.
    Which teal version are you using? From svn or the download archive?

    Best regards
    Rofl

    Posted 1 year ago #
  5. Mike Mintz
    Key Master

    Hi,

    Sorry, that is an error because of the new compiler. Here's the changes:

    *** teal_reg.h.new 2010-06-28 14:47:39.000000000 -0400
    --- teal_reg.h 2006-05-18 08:34:00.000000000 -0400

    *** 110,117 ****
    char to_int (uint32 b) const; //extract one bit (WARNING: Drops X/Z, see operator(uint32))

    //logic
    ! friend four_state ::teal::triple_equal (const reg& lhs, const reg& rhs);
    ! friend bool ::teal::operator== (const reg& lhs, const reg& rhs);
    friend four_state operator< (const reg& lhs, const reg& rhs); //Should be bool?
    friend four_state reduce_xor (const reg&);

    --- 110,117 ----
    char to_int (uint32 b) const; //extract one bit (WARNING: Drops X/Z, see operator(uint32))

    //logic
    ! friend four_state triple_equal (const reg& lhs, const reg& rhs);
    ! friend bool operator== (const reg& lhs, const reg& rhs);
    friend four_state operator< (const reg& lhs, const reg& rhs); //Should be bool?
    friend four_state reduce_xor (const reg&);

    *************** EVEN IF ADVISED OF THE POSSIBILITY OF SU
    *** 284,290 ****
    friend vout& operator<< (vout&, const vreg&);
    };
    vout& operator<< (vout&, const vreg&);
    -
    - reg::four_state triple_equal (const reg& lhs, const reg& rhs);
    - bool operator== (const reg& lhs, const reg& rhs);
    - reg::four_state operator< (const reg& lhs, const reg& rhs); //Should be bool?

    Take care,
    Mike

    Posted 1 year ago #
  6. shimrod
    Member

    Hi

    I tried with modelsim6.6b and mentor supplied gcc

    Instead of modifying the code try --friend-injection.
    That is in the original Makefile (.linux).

    Cheers
    Rolf

    My Makefile below:

    #!/bin/sh
    #Copyright (C) 2004 Mike Mintz

    #This file is part of the Teal Library. This library is free
    #software; you can redistribute it and/or modify it under the
    #terms of the GNU General Public License as published by the
    #Free Software Foundation; either version 2, or (at your option)
    #any later version.

    #This library is distributed in the hope that it will be useful,
    #but WITHOUT ANY WARRANTY; without even the implied warranty of
    #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    #GNU General Public License for more details.

    #//foo.lib in sub dir OS/simulator or OS/company or set LD_LIBRRAY_PATH ? ?
    #//seperate makefile.os.simulator and then "make -f Makefile.os.simulator install"?
    #//how about dropping the lib in lib/ and maybe using a {LIB_PATH} where the default is ./lib ?

    SIM = mti
    SYS_ARCH_CC = g++
    SYS_ARCH_AR = ar cr

    SRC = .
    OBJ = .
    LIB = .
    INCL = .

    #CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=aldec -Daldec -D_ALDEC -DWIN32
    #CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=aldec -Daldec -Dvpi_2_0 -D_ALDEC -DWIN32
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=mti -Dvpi_2_0 -DWIN32 --friend-injection

    STATIC_LIB = $(LIB)/libteal.a
    DYNAMIC_LIB = $(LIB)/libteal.dll

    # This library is needed for some unknown reason
    DUMMY_LIB = $(LIB)/verification_top.dll

    #Note that hdl_connect.cpp must be included at your verification_top(), to ensure that it gets included in the final .so
    # $(SRC)/avv_spi.cpp \

    TEAL_SRC = \
    $(SRC)/teal_synch.cpp \
    $(SRC)/teal_memory.cpp \
    $(SRC)/teal_reg.cpp \
    $(SRC)/teal_vrandom.cpp \
    $(SRC)/teal_vout.cpp \
    $(SRC)/teal_vreg.cpp \
    $(SRC)/teal_dictionary.cpp

    TEAL_OBJ = ${addsuffix .o, ${basename ${TEAL_SRC}}}
    #$(patsubst %.cpp, $(OBJ)/%.o, $(TEAL_SRC))
    ### MAIN TARGETS

    build: $(DYNAMIC_LIB) $(STATIC_LIB)
    touch build

    clean:
    rm -f $(TEAL_OBJ)
    rm -f build
    rm -f *~

    real_clean: clean
    rm -f $(STATIC_LIB)
    rm -f $(DYNAMIC_LIB)
    rm -f $(DUMMY_LIB)

    .cpp.o:
    $(SYS_ARCH_CC) -c $(SRC)/$*.cpp -o $(OBJ)/$@ $(CFLAGS) -I"${PTHREADS_HOME}" -I"${SIM_HOME}/include"

    $(STATIC_LIB): $(TEAL_OBJ)
    @rm -f $(STATIC_LIB)
    $(SYS_ARCH_AR) $(STATIC_LIB) $(TEAL_OBJ)

    $(DYNAMIC_LIB): $(TEAL_OBJ) $(DUMMY_LIB)
    @rm -f $(DYNAMIC_LIB)
    $(SYS_ARCH_CC) -shared -o $(DYNAMIC_LIB) $(TEAL_OBJ) -L"${PTHREADS_HOME}" -L"${SIM_HOME}/win32" -L. -lpthreadGC2 -lmtipli -lverification_top

    $(DUMMY_LIB) : verification_top.cpp
    $(SYS_ARCH_CC) -shared -o $(DUMMY_LIB) verification_top.cpp

    Posted 1 year ago #
  7. bishopsl
    Member

    Sorry I am such a noob here. I added your fix in Mike, and I am now further along but still cannot compile successfully as detailed below:

    I have Cygwin 1.7.7 running on XP SP3 with the following added to my .bashrc:

    # teal+truss stuff
    export SIMULATOR_HOME=c:/Modeltech_6.6c
    export VERILOG_INST_DIR=c:/Modeltech_6.6c
    export SIM=mti
    export ARCH=win32
    export SW_HOME=f:/cygwin/usr/local
    export TRUSS_HOME=$SW_HOME/truss_1_40
    export TEAL_HOME=$SW_HOME/teal_1_40
    export PROJ_BASE=$SW_HOME/examples_1_40a/examples
    alias tealH='cd $TEAL_HOME; ll'
    alias trussH='cd $TRUSS_HOME; ll'

    I downloaded pthreads from ftp://sourceware.org/pub/pthreads-win32/dll-latest and place in teal directory.

    Makefile below
    ----------------------------------------------------------
    #!/bin/sh
    #Copyright (C) 2004 Mike Mintz

    #This file is part of the Teal Library. This library is free
    #software; you can redistribute it and/or modify it under the
    #terms of the GNU General Public License as published by the
    #Free Software Foundation; either version 2, or (at your option)
    #any later version.

    #This library is distributed in the hope that it will be useful,
    #but WITHOUT ANY WARRANTY; without even the implied warranty of
    #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    #GNU General Public License for more details.

    #//foo.lib in sub dir OS/simulator or OS/company or set LD_LIBRRAY_PATH ? ?
    #//seperate makefile.os.simulator and then "make -f Makefile.os.simulator install"?
    #//how about dropping the lib in lib/ and maybe using a {LIB_PATH} where the default is ./lib ?

    #
    ROOT_INCL = -I$(SIMULATOR_HOME)/include -I$(SIMULATOR_HOME)/pli_incs -I$(SIMULATOR_HOME)/pli/interface

    SRC = .
    OBJ = .
    LIB = .
    INCL = .

    include Makefile.$(ARCH)

    #SP = -I$(INCL) $(ROOT_INCL) -I/usr/local/riviera-2005.04/gcc/lib/gcc/i686-pc-linux-gnu/3.4.3/include
    SP = -I$(INCL) $(ROOT_INCL)

    ifeq ($(SIM),mti_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -Dvpi_2_0 -DSIM=mti
    else
    ifeq ($(SIM),mti)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=mti -Dvpi_2_0 -DWIN32
    else
    ifeq ($(SIM),ivl)
    CFLAGS = -Wall $(OPT) $(D_OPT) -Dvpi_2_0 -DSIM=ivl -Divl
    else
    ifeq ($(SIM),ncsim)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=ncsim -Dncsim
    else
    ifeq ($(SIM),vcs_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=vcs -Dvcs -Dvpi_2_0
    else
    ifeq ($(SIM),vcs)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=vcs -Dvcs
    else
    ifeq ($(SIM),cver)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=cver -Dcver
    else
    ifeq ($(SIM),cver_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=cver -Dcver -Dvpi_2_0
    else
    ifeq ($(SIM),aldec)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=aldec -Daldec
    else
    ifeq ($(SIM),aldec_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=aldec -Daldec -Dvpi_2_0
    else
    CFLAGS = "Unknown Simulator type!"
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif

    STATIC_LIB = $(LIB)/libteal.$(SIM).a
    DYNAMIC_LIB = $(LIB)/libteal.$(SIM).$(ARCH_SHARED_SUFFIX)

    #Note that hdl_connect.cpp must be included at your verification_top(), to ensure that it gets included in the final .so
    # $(SRC)/avv_spi.cpp \

    TEAL_SRC = \
    $(SRC)/teal_vout.cpp \
    $(SRC)/teal_reg.cpp \
    $(SRC)/teal_vrandom.cpp \
    $(SRC)/teal_vreg.cpp \
    $(SRC)/teal_dictionary.cpp \
    $(SRC)/teal_memory.cpp \
    $(SRC)/teal_synch.cpp

    TEAL_OBJ = ${addsuffix .o, ${basename ${TEAL_SRC}}}
    #$(patsubst %.cpp, $(OBJ)/%.o, $(TEAL_SRC))
    ### MAIN TARGETS

    build: test_environment build_$(SYS_PLATFORM)

    test_environment:
    @if [ -z "$(SIMULATOR_HOME)" ] ; then \
    echo " " ;\
    echo " Before running this example Please make sure that" ;\
    echo " The environment variable 'SIMULATOR_HOME' is set to the proper" ;\
    echo " installation directory that has an include and lib subdirectories e.g." ;\
    echo " SIMULATOR_HOME = /tools/cadence3.3/tools/ or" ;\
    echo " SIMULATOR_HOME = /usr/local/modeltech/mti/ or" ;\
    echo " SIMULATOR_HOME = /usr/local/ivl/ or " ;\
    echo " SIMULATOR_HOME = /tools/synopsys/vcs/vcs7.2 or ..." ;\
    echo " " ;\
    exit 1;\
    fi
    @if [ -z "$(SIM)" ] ; then \
    echo " " ;\
    echo " Before running this example Please make sure that" ;\
    echo " The environment variable 'SIM' is set to the proper" ;\
    echo " simulator. e.g." ;\
    echo " setenv SIM ncsim or" ;\
    echo " setenv SIM mti or" ;\
    echo " setenv SIM ivl or " ;\
    echo " setenv SIM vcs7.2 or ..." ;\
    echo " " ;\
    exit 1;\
    fi

    build_unix: $(STATIC_LIB) $(DYNAMIC_LIB)
    touch build

    build_wint: $(DYNAMIC_LIB)
    touch build

    clean:
    rm -f $(TEAL_OBJ)
    rm -f build
    rm -f *~

    real_clean: clean
    rm -f $(STATIC_LIB)
    rm -f $(DYNAMIC_LIB)

    .cpp.o:
    $(SYS_ARCH_CC) -c $(ARCH_RELOCATE_OPT) $(SRC)/$*.cpp -o $(OBJ)/$@ $(CFLAGS) $(SP)

    $(STATIC_LIB): $(TEAL_OBJ)
    @rm -f $(STATIC_LIB)
    $(SYS_ARCH_AR) $(STATIC_LIB) $(TEAL_OBJ)

    $(DYNAMIC_LIB): $(TEAL_OBJ)
    @rm -f $(DYNAMIC_LIB)
    $(SYS_ARCH_CC) $(ARCH_DYNAMIC_LD) $(DYNAMIC_LIB_RULE) $(TEAL_OBJ)
    ----------------------------------------------------------

    Makefile.win32 below
    ----------------------------------------------------------
    ## Makefile options for WIN32 platform using ModelSim
    ##
    ## Requires the gcc ming32 compiler supplied by Mentor
    ## Also using pthread library

    ## I haven't changed the system platform options
    SYS_PLATFORM = unix
    OSNAME = lnx86
    CHIP = x86

    SYS_ARCH_CC = C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++
    SYS_ARCH_LD_OPT = -L c:/Modeltech_6.6c/win32pe -lmtipli -lwsock32 -lstdc++ -L. -lpthreadGCE2
    SYS_ARCH_OPT = -Wall -I c:/Modeltech_6.6c/include -D_WIN32

    SYS_ARCH_CC_LD_DYNAMIC = -shared
    SYS_ARCH_LD_DYNAMIC = -shared

    ARCH_RELOCATE_OPT =
    ARCH_DYNAMIC_LD = -shared
    ARCH_SHARED_SUFFIX = dll
    ARCH_DEGUG_FLAG = -ggdb

    #SYS_ARCH_OPT =
    D_OPT = $(SYS_ARCH_OPT) $(D_GOPT) $(D_OSOPT)

    SYS_ARCH_LD_STATIC = -Bstatic

    SYS_ARCHDYNAMIC_LIBS =
    SYS_ARCHSTATIC_LIBS =
    SYS_ARCHLIBS= $(SYS_ARCHSTATIC_LIBS) $(SYS_ARCHDYNAMIC_LIBS)

    SYS_ARCH_LDFLAGS =

    SHELL = /bin/sh
    MKDIR = mkdir
    RM = rm -rf
    DIFF = diff

    SYS_ARCH_AR = ar cr
    DYNAMIC_LIB_RULE = -o $(DYNAMIC_LIB)
    OBJ_SUFFIX = o
    ----------------------------------------------------------

    It doesn't seem that the vpi orpthreads libraries are being recognized:

    /usr/local/teal_1_40> make build
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vout.cpp -o ./teal_vout.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_reg.cpp -o ./teal_reg.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vrandom.cpp -o ./teal_vrandom.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vreg.cpp -o ./teal_vreg.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_dictionary.cpp -o ./teal_dictionary.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_memory.cpp -o ./teal_memory.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    ./teal_memory.cpp: In function 'void teal_memory_note_register()':
    ./teal_memory.cpp:106: warning: deprecated conversion from string constant to 'PLI_BYTE8*'
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_synch.cpp -o ./teal_synch.o -Wall -Wall -I c:/Modeltech_6.6c/include -D_WIN32 -DSIM=mti -Dvpi_2_0 -DWIN32 -I. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    ./teal_synch.cpp: In function 'void teal::teal_top_register()':
    ./teal_synch.cpp:756: warning: deprecated conversion from string constant to 'PLI_BYTE8*'
    ar cr ./libteal.mti.a ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -shared -o ./libteal.mti.dll ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o
    ./teal_vout.o:teal_vout.cpp:(.text+0xe23): undefined reference to `vpi_get'
    ./teal_vout.o:teal_vout.cpp:(.text+0x1736): undefined reference to `_imp__pthread_self'
    ./teal_vout.o:teal_vout.cpp:(.text+0x1ac4): undefined reference to `_imp__pthread_mutex_init'
    ./teal_vout.o:teal_vout.cpp:(.text+0x1c96): undefined reference to `_imp__pthread_mutex_init'
    ./teal_vout.o:teal_vout.cpp:(.text+0x1ec3): undefined reference to `_imp__pthread_mutex_init'
    ./teal_vout.o:teal_vout.cpp:(.text+0x20f1): undefined reference to `_imp__pthread_mutex_init'
    ./teal_vout.o:teal_vout.cpp:(.text$_ZN21internal_mutex_sentryC1EPP16pthread_mutex_t_[internal_mutex_sentry::internal_mutex_sentry(pthread_mutex_t_**)]+0x18): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vout.o:teal_vout.cpp:(.text$_ZN21internal_mutex_sentryD1Ev[internal_mutex_sentry::~internal_mutex_sentry()]+0x10): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_vout.o:teal_vout.cpp:(.text$_ZN10local_vlog12local_print_ERKSs[local_vlog::local_print_(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x19): undefined reference to `vpi_printf'
    ./teal_vout.o:teal_vout.cpp:(.text$_ZN10local_vlogC1Ev[local_vlog::local_vlog()]+0x2d): undefined reference to `_imp__pthread_mutex_init'
    ./teal_vout.o:teal_vout.cpp:(.text$_ZN10local_vlog15output_message_ERKSt5dequeISt4pairIiSsESaIS2_EE[local_vlog::output_message_(std::deque<std::pair<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)]+0x12): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vout.o:teal_vout.cpp:(.text$_ZN10local_vlog15output_message_ERKSt5dequeISt4pairIiSsESaIS2_EE[local_vlog::output_message_(std::deque<std::pair<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)]+0x3c): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_vrandom.o:teal_vrandom.cpp:(.text+0x48e): undefined reference to `_imp__pthread_self'
    ./teal_vrandom.o:teal_vrandom.cpp:(.text+0x6d2): undefined reference to `_imp__pthread_self'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x2e4): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x33e): undefined reference to `vpi_put_value'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x350): undefined reference to `vpi_chk_error'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x931): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x9ac): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x9cb): undefined reference to `vpi_get_value'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0xad8): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0xc98): undefined reference to `vpi_get_str'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0xcec): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0xd21): undefined reference to `vpi_get'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x103a): undefined reference to `vpi_get'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x105a): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x10ec): undefined reference to `vpi_get_str'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x1140): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x1175): undefined reference to `vpi_get'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x148e): undefined reference to `vpi_get'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x14ae): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x169b): undefined reference to `vpi_handle_by_name'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x16b7): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x1984): undefined reference to `vpi_control'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x19c9): undefined reference to `vpi_get'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x1d76): undefined reference to `vpi_get'
    ./teal_vreg.o:teal_vreg.cpp:(.text+0x1d96): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_dictionary.o:teal_dictionary.cpp:(.text+0x1d4): undefined reference to `vpi_get_vlog_info'
    ./teal_memory.o:teal_memory.cpp:(.text+0x204d): undefined reference to `vpi_handle_by_index'
    ./teal_memory.o:teal_memory.cpp:(.text+0x20ef): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_memory.o:teal_memory.cpp:(.text+0x250c): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_memory.o:teal_memory.cpp:(.text+0x255e): undefined reference to `vpi_handle_by_index'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2573): undefined reference to `vpi_chk_error'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2bcc): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2c2b): undefined reference to `vpi_get_str'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2cb3): undefined reference to `vpi_get'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2f04): undefined reference to `vpi_control'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2f34): undefined reference to `vpi_get'
    ./teal_memory.o:teal_memory.cpp:(.text+0x2f8d): undefined reference to `vpi_get_str'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3015): undefined reference to `vpi_get'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3266): undefined reference to `vpi_control'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3296): undefined reference to `vpi_get'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3327): undefined reference to `vpi_register_systf'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3343): undefined reference to `vpi_handle'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3356): undefined reference to `vpi_iterate'
    ./teal_memory.o:teal_memory.cpp:(.text+0x3367): undefined reference to `vpi_scan'
    ./teal_synch.o:teal_synch.cpp:(.text+0x86b): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x889): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x8a9): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x904): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x92d): undefined reference to `_imp__pthread_cond_broadcast'
    ./teal_synch.o:teal_synch.cpp:(.text+0x93f): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x95b): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x988): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x9b5): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x9c1): undefined reference to `_imp__sched_yield'
    ./teal_synch.o:teal_synch.cpp:(.text+0x9e1): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x9f5): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0xd30): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0xd3a): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0xd5d): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0xd82): undefined reference to `_imp__ptw32_push_cleanup'
    ./teal_synch.o:teal_synch.cpp:(.text+0xd9d): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text+0xdb9): undefined reference to `_imp__ptw32_pop_cleanup'
    ./teal_synch.o:teal_synch.cpp:(.text+0xdca): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0xe32): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0xe55): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x11e6): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x11f0): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1213): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1238): undefined reference to `_imp__ptw32_push_cleanup'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1253): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text+0x126f): undefined reference to `_imp__ptw32_pop_cleanup'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1280): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x12e8): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x130b): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x132d): undefined reference to `_imp__pthread_mutex_trylock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x134a): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x136d): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x138b): undefined reference to `_imp__sched_yield'
    ./teal_synch.o:teal_synch.cpp:(.text+0x139c): undefined reference to `_imp__pthread_mutex_trylock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x142e): undefined reference to `_imp__pthread_cond_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x14e8): undefined reference to `_imp__pthread_mutexattr_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x14fe): undefined reference to `_imp__pthread_mutex_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1514): undefined reference to `_imp__pthread_mutex_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1525): undefined reference to `_imp__pthread_mutexattr_destroy'
    ./teal_synch.o:teal_synch.cpp:(.text+0x15cc): undefined reference to `_imp__pthread_mutexattr_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x15e2): undefined reference to `_imp__pthread_mutex_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x15f8): undefined reference to `_imp__pthread_mutex_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1609): undefined reference to `_imp__pthread_mutexattr_destroy'
    ./teal_synch.o:teal_synch.cpp:(.text+0x16d2): undefined reference to `_imp__pthread_cond_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1773): undefined reference to `vpi_register_systf'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1791): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x17ba): undefined reference to `_imp__pthread_create'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1ae1): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x1b3e): undefined reference to `_imp__pthread_attr_init'
    ./teal_synch.o:teal_synch.cpp:(.text+0x2414): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x243d): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x2461): undefined reference to `_imp__pthread_create'
    ./teal_synch.o:teal_synch.cpp:(.text+0x2649): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x2691): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text+0x26af): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x28ab): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x28bd): undefined reference to `_imp__pthread_cond_signal'
    ./teal_synch.o:teal_synch.cpp:(.text+0x28cf): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x28d9): undefined reference to `_imp__sched_yield'
    ./teal_synch.o:teal_synch.cpp:(.text+0x28f6): undefined reference to `_imp__pthread_join'
    ./teal_synch.o:teal_synch.cpp:(.text+0x291f): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x294f): undefined reference to `_imp__pthread_join'
    ./teal_synch.o:teal_synch.cpp:(.text+0x2f81): undefined reference to `verification_top()'
    ./teal_synch.o:teal_synch.cpp:(.text+0x3160): undefined reference to `vpi_remove_cb'
    ./teal_synch.o:teal_synch.cpp:(.text+0x31b4): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x31d9): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x31e3): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x320b): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text+0x3226): undefined reference to `vpi_control'
    ./teal_synch.o:teal_synch.cpp:(.text+0x33c4): undefined reference to `_imp__pthread_cancel'
    ./teal_synch.o:teal_synch.cpp:(.text+0x36ad): undefined reference to `_imp__pthread_join'
    ./teal_synch.o:teal_synch.cpp:(.text+0x3a7b): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x3e75): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x444e): undefined reference to `vpi_register_cb'
    ./teal_synch.o:teal_synch.cpp:(.text+0x46d5): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x46df): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x4705): undefined reference to `_imp__ptw32_push_cleanup'
    ./teal_synch.o:teal_synch.cpp:(.text+0x492a): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text+0x4a29): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x4c62): undefined reference to `_imp__ptw32_pop_cleanup'
    ./teal_synch.o:teal_synch.cpp:(.text+0x4c74): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text+0x4d6d): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text+0x4fba): undefined reference to `vpi_remove_cb'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release12thread_name_E14ptw32_handle_t[teal::thread_release::thread_name_(ptw32_handle_t)]+0x13): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release12thread_name_E14ptw32_handle_t[teal::thread_release::thread_name_(ptw32_handle_t)]+0x56): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release12thread_name_E14ptw32_handle_t[teal::thread_release::thread_name_(ptw32_handle_t)]+0xc3): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release14control_threadEv[teal::thread_release::control_thread()]+0xf): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release14control_threadEv[teal::thread_release::control_thread()]+0x26): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release14control_threadEv[teal::thread_release::control_thread()]+0xbb): undefined reference to `_imp__pthread_cond_broadcast'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release11do_callbackEv[teal::thread_release::do_callback()]+0x21f): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release11do_callbackEv[teal::thread_release::do_callback()]+0x546): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release11do_callbackEv[teal::thread_release::do_callback()]+0x597): undefined reference to `_imp__pthread_cond_signal'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release11do_callbackEv[teal::thread_release::do_callback()]+0x8c1): undefined reference to `_imp__pthread_cond_wait'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release11do_callbackEv[teal::thread_release::do_callback()]+0xaac): undefined reference to `_imp__pthread_mutex_unlock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release15thread_waiting_E14ptw32_handle_t[teal::thread_release::thread_waiting_(ptw32_handle_t)]+0x369): undefined reference to `_imp__pthread_cond_signal'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_releaseC1Ev[teal::thread_release::thread_release()]+0xd): undefined reference to `_imp__pthread_self'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_releaseC1Ev[teal::thread_release::thread_release()]+0x29): undefined reference to `_imp__pthread_cond_init'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_releaseC1Ev[teal::thread_release::thread_release()]+0x3d): undefined reference to `_imp__pthread_mutex_init'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release16thread_completedE14ptw32_handle_t[teal::thread_release::thread_completed(ptw32_handle_t)]+0x14): undefined reference to `_imp__pthread_mutex_lock'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release16thread_completedE14ptw32_handle_t[teal::thread_release::thread_completed(ptw32_handle_t)]+0x6c2): undefined reference to `_imp__pthread_cond_signal'
    ./teal_synch.o:teal_synch.cpp:(.text$_ZN4teal14thread_release16thread_completedE14ptw32_handle_t[teal::thread_release::thread_completed(ptw32_handle_t)]+0x6f9): undefined reference to `_imp__pthread_mutex_unlock'
    collect2: ld returned 1 exit status
    make: *** [libteal.mti.dll] Error 1

    Posted 1 year ago #
  8. bishopsl
    Member

    At least I am compiling teal now (only problem is "warning: deprecated conversion from string constant to 'PLI_BYTE8*'"). Here's the snippets:

    ---------- verification_top.cpp below ----------
    #include "teal.h"
    void verification_top ()
    {
    }
    ---------- verification_top.cpp above ----------

    ---------- Makefile.win32 below ----------
    ## Makefile options for WIN32 platform using ModelSim
    ##
    ## Uses the gcc ming32 compiler supplied by Mentor.
    ## Also using pthread win32 library.

    SYS_PLATFORM = unix
    OSNAME = lnx86
    CHIP = x86

    # path to new pthread library I compiled using MingW
    PTHREADS_2008=f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release

    # pthread library I down-loaded from PTHREADS website
    PTHREADS_2006=f:/cygwin/usr/local/lib/pthreads-w32-2006/Pre-built.2

    SYS_ARCH_CC = C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++

    SYS_ARCH_LD_OPT = -L c:/Modeltech_6.6c/win32pe -L $(PTHREADS_2008) -l pthreadGC2 -l mtipli -l wsock32 -l stdc++ -L.

    SYS_ARCH_OPT = -I c:/Modeltech_6.6c/include -I $(PTHREADS_2008) -D_WIN32

    SYS_ARCH_CC_LD_DYNAMIC = -shared
    SYS_ARCH_LD_DYNAMIC = -shared

    ARCH_RELOCATE_OPT =
    ARCH_DYNAMIC_LD = -shared
    ARCH_SHARED_SUFFIX = dll
    ARCH_DEGUG_FLAG = -ggdb

    #SYS_ARCH_OPT =
    D_OPT = $(SYS_ARCH_OPT) $(D_GOPT) $(D_OSOPT)

    SYS_ARCH_LD_STATIC = -Bstatic
    SYS_ARCHDYNAMIC_LIBS =
    SYS_ARCHSTATIC_LIBS =
    SYS_ARCHLIBS= $(SYS_ARCHSTATIC_LIBS) $(SYS_ARCHDYNAMIC_LIBS)

    SYS_ARCH_LDFLAGS =

    SHELL = /bin/sh
    MKDIR = mkdir
    RM = rm -rf
    DIFF = diff

    SYS_ARCH_AR = ar cr
    DYNAMIC_LIB_RULE = -o $(DYNAMIC_LIB)
    OBJ_SUFFIX = o
    ---------- Makefile.win32 above----------

    ---------- Makefile below ----------
    #!/bin/sh
    #Copyright (C) 2004 Mike Mintz

    #This file is part of the Teal Library. This library is free
    #software; you can redistribute it and/or modify it under the
    #terms of the GNU General Public License as published by the
    #Free Software Foundation; either version 2, or (at your option)
    #any later version.

    #This library is distributed in the hope that it will be useful,
    #but WITHOUT ANY WARRANTY; without even the implied warranty of
    #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    #GNU General Public License for more details.

    #//foo.lib in sub dir OS/simulator or OS/company or set LD_LIBRRAY_PATH ? ?
    #//seperate makefile.os.simulator and then "make -f Makefile.os.simulator install"?
    #//how about dropping the lib in lib/ and maybe using a {LIB_PATH} where the default is ./lib ?

    # teal+truss stuff from my .bashrc
    SIMULATOR_HOME=c:/Modeltech_6.6c
    VERILOG_INST_DIR=c:/Modeltech_6.6c
    SIM=mti
    ARCH=win32
    SW_HOME=f:/cygwin/usr/local
    TRUSS_HOME=$SW_HOME/truss_1_40
    TEAL_HOME=$SW_HOME/teal_1_40
    PROJ_BASE=$SW_HOME/examples_1_40a/examples
    ARCH_SHARED_SUFFIX=dll

    #
    #ROOT_INCL = -I $(SIMULATOR_HOME)/include -I $(SIMULATOR_HOME)/pli_incs -I $(SIMULATOR_HOME)/pli/interface
    ROOT_INCL = -I $(SIMULATOR_HOME)/include

    SRC = .
    OBJ = .
    LIB = .
    INCL = .

    include Makefile.$(ARCH)

    #SP = -I$(INCL) $(ROOT_INCL) -I/usr/local/riviera-2005.04/gcc/lib/gcc/i686-pc-linux-gnu/3.4.3/include
    SP = -I $(INCL) $(ROOT_INCL)

    ifeq ($(SIM),mti_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -Dvpi_2_0 -DSIM=mti
    else
    ifeq ($(SIM),mti)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=mti -Dvpi_2_0
    else
    ifeq ($(SIM),ivl)
    CFLAGS = -Wall $(OPT) $(D_OPT) -Dvpi_2_0 -DSIM=ivl -Divl
    else
    ifeq ($(SIM),ncsim)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=ncsim -Dncsim
    else
    ifeq ($(SIM),vcs_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=vcs -Dvcs -Dvpi_2_0
    else
    ifeq ($(SIM),vcs)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=vcs -Dvcs
    else
    ifeq ($(SIM),cver)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=cver -Dcver
    else
    ifeq ($(SIM),cver_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=cver -Dcver -Dvpi_2_0
    else
    ifeq ($(SIM),aldec)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=aldec -Daldec
    else
    ifeq ($(SIM),aldec_2_0)
    CFLAGS = -Wall $(OPT) $(D_OPT) -DSIM=aldec -Daldec -Dvpi_2_0
    else
    CFLAGS = "Unknown Simulator type!"
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif

    STATIC_LIB = $(LIB)/libteal.$(SIM).a
    DYNAMIC_LIB = $(LIB)/libteal.$(SIM).$(ARCH_SHARED_SUFFIX)

    #Note that hdl_connect.cpp must be included at your verification_top(), to ensure that it gets included in the final .so
    # $(SRC)/avv_spi.cpp \

    TEAL_SRC = \
    $(SRC)/verification_top.cpp \
    $(SRC)/teal_vout.cpp \
    $(SRC)/teal_reg.cpp \
    $(SRC)/teal_vrandom.cpp \
    $(SRC)/teal_vreg.cpp \
    $(SRC)/teal_dictionary.cpp \
    $(SRC)/teal_memory.cpp \
    $(SRC)/teal_synch.cpp

    TEAL_OBJ = ${addsuffix .o, ${basename ${TEAL_SRC}}}
    #$(patsubst %.cpp, $(OBJ)/%.o, $(TEAL_SRC))
    ### MAIN TARGETS

    build: test_environment build_$(SYS_PLATFORM)

    test_environment:
    @if [ -z "$(SIMULATOR_HOME)" ] ; then \
    echo " " ;\
    echo " Before running this example Please make sure that" ;\
    echo " The environment variable 'SIMULATOR_HOME' is set to the proper" ;\
    echo " installation directory that has an include and lib subdirectories e.g." ;\
    echo " SIMULATOR_HOME = /tools/cadence3.3/tools/ or" ;\
    echo " SIMULATOR_HOME = /usr/local/modeltech/mti/ or" ;\
    echo " SIMULATOR_HOME = /usr/local/ivl/ or " ;\
    echo " SIMULATOR_HOME = /tools/synopsys/vcs/vcs7.2 or ..." ;\
    echo " " ;\
    exit 1;\
    fi
    @if [ -z "$(SIM)" ] ; then \
    echo " " ;\
    echo " Before running this example Please make sure that" ;\
    echo " The environment variable 'SIM' is set to the proper" ;\
    echo " simulator. e.g." ;\
    echo " setenv SIM ncsim or" ;\
    echo " setenv SIM mti or" ;\
    echo " setenv SIM ivl or " ;\
    echo " setenv SIM vcs7.2 or ..." ;\
    echo " " ;\
    exit 1;\
    fi

    build_unix: $(STATIC_LIB) $(DYNAMIC_LIB)
    touch build

    build_wint: $(DYNAMIC_LIB)
    touch build

    clean:
    rm -f $(TEAL_OBJ)
    rm -f build
    rm -f *~

    real_clean: clean
    rm -f $(STATIC_LIB)
    rm -f $(DYNAMIC_LIB)

    .cpp.o:
    $(SYS_ARCH_CC) -c $(ARCH_RELOCATE_OPT) $(SRC)/$*.cpp -o $(OBJ)/$@ $(CFLAGS) $(SP)

    $(STATIC_LIB): $(TEAL_OBJ)
    @rm -f $(STATIC_LIB)
    $(SYS_ARCH_AR) $(STATIC_LIB) $(TEAL_OBJ)

    $(DYNAMIC_LIB): $(TEAL_OBJ)
    @rm -f $(DYNAMIC_LIB)
    $(SYS_ARCH_CC) $(ARCH_DYNAMIC_LD) $(DYNAMIC_LIB_RULE) $(TEAL_OBJ) $(SYS_ARCH_LD_OPT)
    ---------- Makefile above----------

    And I run it in the teal directory:

    /usr/local/teal_1_40> make real_clean
    rm -f ./verification_top.o ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o
    rm -f build
    rm -f *~
    rm -f ./libteal.mti.a
    rm -f ./libteal.mti.dll
    bash3.2 : bishopsl : BishopSL : Thu Oct 14 12:20:09
    /usr/local/teal_1_40> make
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./verification_top.cpp -o ./verification_top.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vout.cpp -o ./teal_vout.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_reg.cpp -o ./teal_reg.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vrandom.cpp -o ./teal_vrandom.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vreg.cpp -o ./teal_vreg.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_dictionary.cpp -o ./teal_dictionary.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_memory.cpp -o ./teal_memory.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    ./teal_memory.cpp: In function 'void teal_memory_note_register()':
    ./teal_memory.cpp:106: warning: deprecated conversion from string constant to 'PLI_BYTE8*'
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_synch.cpp -o ./teal_synch.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti -Dvpi_2_0 -I . -I c:/Modeltech_6.6c/include
    ./teal_synch.cpp: In function 'void teal::teal_top_register()':
    ./teal_synch.cpp:756: warning: deprecated conversion from string constant to 'PLI_BYTE8*'
    ar cr ./libteal.mti.a ./verification_top.o ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -shared -o ./libteal.mti.dll ./verification_top.o ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o -L c:/Modeltech_6.6c/win32pe -L f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -l pthreadGC2 -l mtipli -l wsock32 -l stdc++ -L.
    touch build

    Unfortunately when I try to run a test in the "test" subdirectory, I am getting the undefined references to elements of teal.h like "teal_memory_note_call" and the pthread library elements like "_imp__pthread_mutex_init":

    ---------- test.log below ----------
    /usr/local/teal_1_40/test> ./run -c -mti -t memory_test &> ../test.log

    #C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ memory_test.o -o memory_test.mti.so -I.. -Ic:/Modeltech_6.6c/include -L.. -L/home/mmintz/riviera-2005.08/gcc/lib -L/usr/local/lib ../libteal.mti.a -lstdc++ -lpthread -shared -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ memory_test.o -o memory_test.mti.so -I.. -Ic:/Modeltech_6.6c/include -L c:/Modeltech_6.6c/win32pe -L f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -l pthreadGC2 -l mtipli -l wsock32 -l stdc++ -L. -L.. -L/usr/local/lib ../libteal.mti.a -shared -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-w32-2-8-0-release -D_WIN32 -DSIM=mti
    memory_test.o:memory_test.cpp:(.data+0xc): undefined reference to `teal_top_call'

    memory_test.o:memory_test.cpp:(.data+0x44): undefined reference to `teal_memory_note_call'

    ../libteal.mti.a(teal_vout.o):teal_vout.cpp:(.text+0x1736): undefined reference to `_imp__pthread_self'

    ../libteal.mti.a(teal_vout.o):teal_vout.cpp:(.text+0x1ac4): undefined reference to `_imp__pthread_mutex_init'

    ../libteal.mti.a(teal_vout.o):teal_vout.cpp:(.text+0x1c96): undefined reference to `_imp__pthread_mutex_init'
    ---------- test.log above ----------

    Posted 1 year ago #
  9. Mike Mintz
    Key Master

    Hi,

    Can you try the vout_test first? That way we can concentrate on the pthread issue first.

    There is a routine, dumpbin I believe, that can be used to get information on a library or exe.

    We need to confirm that the compile of the lilbteal_mti.a and the libpthreads are of the correct type for your machine.

    Take Care,
    Mike

    Posted 1 year ago #
  10. bishopsl
    Member

    Hi Mike,

    I never have used dumpbin before, but I have the Visual Studio command prompt running, so what commands options should I provide to dumpbin? Thanks.

    Stephen

    Posted 1 year ago #
  11. Mike Mintz
    Key Master

    Hi Stephen,

    Not sure, its been years since I used it. The main things are to see if the COEFF file format is comatable with your system and to find out if teal_memory_note_call is declared in the libteal_mti.a

    Sorry I cannot be of more assistance.

    take Care,
    mike

    Posted 1 year ago #
  12. bishopsl
    Member

    Mike,

    Hi. I tried a different tack, and downloaded legacy pthreads library pthreads-dll-2004-11-22,and then compiled using the Modelsim 6.6c compiler "C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++". This compiled okay except for warnings for teal_top_register and teal_memory_note_register of 'warning: deprecated conversion from string constant to 'PLI_BYTE8*'

    ---------------------- teal make log below ----------------
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./verification_top.cpp -o ./verification_top.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vout.cpp -o ./teal_vout.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_reg.cpp -o ./teal_reg.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vrandom.cpp -o ./teal_vrandom.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_vreg.cpp -o ./teal_vreg.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_dictionary.cpp -o ./teal_dictionary.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_memory.cpp -o ./teal_memory.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    ./teal_memory.cpp: In function 'void teal_memory_note_register()':
    ./teal_memory.cpp:106: warning: deprecated conversion from string constant to 'PLI_BYTE8*'
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./teal_synch.cpp -o ./teal_synch.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I . -I c:/Modeltech_6.6c/include
    ./teal_synch.cpp: In function 'void teal::teal_top_register()':
    ./teal_synch.cpp:756: warning: deprecated conversion from string constant to 'PLI_BYTE8*'
    ar cr ./libteal.mti_2_0.a ./verification_top.o ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -shared -o ./libteal.mti_2_0.dll ./verification_top.o ./teal_vout.o ./teal_reg.o ./teal_vrandom.o ./teal_vreg.o ./teal_dictionary.o ./teal_memory.o ./teal_synch.o -L c:/Modeltech_6.6c/win32pe -L f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -l pthreadGC1 -l mtipli -l wsock32 -l stdc++ -L.
    touch build
    ---------------------- teal make log above ----------------

    When I tried running a test

    run -c -mti_2_0 -t vreg_test

    it compiles okay but once it hits Modelsim I get the errors

    # Loading ./vreg_test.mti_2_0.so
    # ** Error: (vsim-3193) Load of "./vreg_test.mti_2_0.so" failed: DLL dependent library not found.
    # ** Error: (vsim-PLI-3002) Failed to load PLI object file "./vreg_test.mti_2_0.so".

    ---------------- run log below -------------------------
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -c ./vreg_test.cpp -o ./vreg_test.o -Wall -I c:/Modeltech_6.6c/include -I f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -D_WIN32 -Dvpi_2_0 -DSIM=mti -I.. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface
    C:/modeltech_6.6c/gcc-4.2.1-mingw32vc9/bin/g++ -shared vreg_test.o -o vreg_test.mti_2_0.so -I.. -Ic:/Modeltech_6.6c/include -Ic:/Modeltech_6.6c/pli_incs -Ic:/Modeltech_6.6c/pli/interface -L.. ../libteal.mti_2_0.a -L c:/Modeltech_6.6c/win32pe -L f:/cygwin/usr/local/lib/pthreads-dll-2004-11-22 -l pthreadGC1 -l mtipli -l wsock32 -l stdc++ -L.
    Starting simulation at Mon Oct 18 11:03:58 MDT 2010

    rm: cannot remove `vreg_test_results.txt': No such file or directory
    ** Warning: (vlib-34) Library already exists at "work".
    Model Technology ModelSim PE vlog 6.6c Compiler 2010.08 Aug 23 2010
    -- Compiling module sub_module
    -- Compiling module sub2
    -- Compiling module sub1
    -- Compiling module top

    Top level modules:
    top
    For test vreg_test: vsim -trace_foreign 1 -c -do vsim.do top -pli vreg_test.mti_2_0.so +out_file+vreg_test_results.txt
    Reading C:/modeltech_6.6c/tcl/vsim/pref.tcl

    # 6.6c

    # vsim +out_file+vreg_test_results.txt -do vsim.do -c -pli vreg_test.mti_2_0.so -trace_foreign 1 top
    # Loading ./vreg_test.mti_2_0.so
    # ** Error: (vsim-3193) Load of "./vreg_test.mti_2_0.so" failed: DLL dependent library not found.
    # ** Error: (vsim-PLI-3002) Failed to load PLI object file "./vreg_test.mti_2_0.so".
    # Region: /
    # // ModelSim PE 6.6c Aug 23 2010
    # //
    # // Copyright 1991-2010 Mentor Graphics Corporation
    # // All Rights Reserved.
    # //
    # // THIS WORK CONTAINS TRADE SECRET AND
    # // PROPRIETARY INFORMATION WHICH IS THE PROPERTY
    # // OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS
    # // AND IS SUBJECT TO LICENSE TERMS.
    # //
    # Loading work.top
    # Loading work.sub_module
    # Loading work.sub1
    # Loading work.sub2
    # Error loading design
    Error loading design
    Simulation complete at Mon Oct 18 11:04:11 MDT 2010

    grep: vreg_test_results.txt: No such file or directory
    grep: vreg_test_results.txt: No such file or directory
    *** Error: Test "vreg_test" did not seem to pass or fail! ***
    Total results (of 1): PASS: 0 FAIL: 0 ERROR: 1
    ---------------- run log above -------------------------

    Posted 1 year ago #
  13. shimrod
    Member

    Hi Stephen

    As I explained in my previous reply Im able to run the teal tests with modelsim.

    It looks a little weird with the .so suffix to the dll.
    I will take a look at what you have been doing tonight.

    Cheers
    Rolf

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.