Trusster Forums » General Announcements

Compiling and Using teal/truss on Ubuntu 11.10 / gcc-4.6.1

(35 posts)
  • Started 2 months ago by wisemonkey
  • Latest reply from wisemonkey

No tags yet.


  1. wisemonkey
    Member

    Hi I've followed http://forums.trusster.com/topic/teal-build-error-fedora and used following particular patch post by Mike:

    >
    *** teal_reg.h.new 2010-06-28 14:47:39.000000000 -0400
    --- teal_reg.h 2006-05-18 08:34:00.000000000 -0400
    *************** EVEN IF ADVISED OF THE POSSIBILITY OF SU
    *** 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?
    --- 284,286 ----

    -and -
    *** teal_vreg.cpp.new 2010-06-28 14:45:41.000000000 -0400
    --- teal_vreg.cpp 2010-06-28 14:45:28.000000000 -0400
    *************** void teal::vreg::connect_ () {
    *** 143,149 ****

    #if defined (vpi_2_0)
    if (! handle_) {
    ! local_log << teal_error << "Unable to get handle for \"" << path_and_name_ << "\" size:" << (int)path_and_name_.size () << endm;
    vpi_control (vpiFinish);
    }

    --- 143,149 ----

    #if defined (vpi_2_0)
    if (! handle_) {
    ! local_log << teal_error << "Unable to get handle for \"" << path_and_name_ << "\" size:" << path_and_name_.size () << endm;
    vpi_control (vpiFinish);
    }

    >

    However
    ! friend four_state ::teal::triple_equal (const reg& lhs, const reg& rhs);
    ! friend bool ::teal::operator== (const reg& lhs, const reg& rhs);
    ! local_log << teal_error << "Unable to get handle for \"" << path_and_name_ << "\" size:" << path_and_name_.size () << endm;

    Were giving errors on ! operator so I removed it and got it compiled completely.

    But now when I try to use examples I receive following (similar) errors in all cases so I'm assuming either I didn't compile properly or still there is an issue?

    truss_channel.h:113:4: error: cast from ‘alu::operation*’ to ‘int’ loses precision [-fpermissive]
    make: *** [testbench.o] Error 1

    If required I can attach complete log of output as well

    Posted 2 months ago #
  2. Mike Mintz
    Key Master

    Hi Wisemonkey,

    That looks like a size_t/64 bit issue to me. My guess is that sizeof (int) is 32 and size of (alu::operation*) is 64 bits.

    This is my mistake, but can you try casting to a uint64 or a size_t?

    Take Care,
    Mike

    Posted 2 months ago #
  3. wisemonkey
    Member

    I appreciate fast response but can you please be more precise, I'm not much of a software developer but trying to learn and I've no idea in which file (or where) you want me to cast int to 64 bit? I looked in alu_test.h and alu_test.cpp but I don't think I should be casting int to 64 bit there, am I ?

    Posted 2 months ago #
  4. wisemonkey
    Member

    My bad didn't look that I need to fix truss_channel.h

    Anyways I changed that file 3 places to have size_t instead of int, however now its failing with:

    truss_channel.h:108:10: error: ambiguous overload for ‘operator<<’ in ‘(& teal::operator<< [with TP1 = const std::basic_string<char>&, TP2 = std::pair<int, int>]((* &((truss::channel<alu::operation>*)this)->truss::channel<alu::operation>::log_), (*(const teal::vmanip<const std::basic_string<char>&, std::pair<int, int> >*)(& teal::mark_start((* & std::basic_string<char>(((const char*)"/home/wisemonkey/PlayGround/Trusster/InstallDir/truss_c++/inc/truss_channel.h"), (*(const std::allocator<char>*)(& std::allocator<char>())))), std::pair<int, int>((* &2055), (* &108)))))))->teal::vout::operator<<((* & std::basic_string<char>(((const char*)"get: after wait. size is "), (*(const std::allocator<char>*)(& std::allocator<char>()))))) << truss::channel<data_type>::size [with data_type = alu::operation, size_t = long unsigned int]()’

    Posted 2 months ago #
  5. Mike Mintz
    Key Master

    Hi Wisemonkey,

    Darn I was afraid of that. Can you just comment out the lines (108 and I think two others) in truss_channel.h?

    Sorry for being vague in my last post.

    Take Care,
    Mike

    Posted 2 months ago #
  6. wisemonkey
    Member

    ok I commented line 108 and 105 which were something like:
    log_ << teal_debug << "get: after wait. size is " << size () << teal::endm;

    Now again fails on line 113:
    truss_channel.h:113:64: error: ambiguous overload for ‘operator<<’ in ‘((((truss::channel<data_type>*)this)->truss::channel<data_type>::log_ << teal::mark_start("/home/wisemonkey/PlayGround/Trusster/InstallDir/truss_c++/inc/truss_channel.h", std::pair<int, int>(teal::vlog::debug, 113))) << "get: data is ") << (size_t)((& returned))’

    And np about vague answer even I was not paying proper attention to file name and line number.

    BTW fails on lines 88 and 90 as well where I changed from int to size_t

    Posted 2 months ago #
  7. wisemonkey
    Member

    I tried using uint64 but I guess need to define it in file scope?

    truss_channel.h:113:46: error: ‘uint64’ was not declared in this scope

    Posted 2 months ago #
  8. Mike Mintz
    Key Master

    Oh probably teal::uint64

    Posted 2 months ago #
  9. wisemonkey
    Member

    so casting it to teal::uint64 seems to fix the issue at hand.

    next it failed at
    gcc: error: /home/wisemonkey/PlayGround/Trusster/InstallDir/truss_c++/src/verification_top.o: No such file or directory

    If I browse to the folder in question there is truss_verification_top.o but not verification_top.o

    I'll try after renaming this file but is it correct approach?

    Posted 2 months ago #
  10. wisemonkey
    Member

    Yup just renamed truss_verification_top.o to verification_top.o and it advanced.

    now I've

    Segmentation fault
    System call failed at /home/wisemonkey/PlayGround/Trusster/InstallDir/truss_c++/bin/truss line 461
    Posted 2 months ago #
  11. wisemonkey
    Member

    hmm I suppose issue with iverilog?

    vvp -m hdl/alu_test.ivl.so alu_test I removed +seed+ and +out_file+ arguments.

    gives segmentation fault.

    I'm not sure if its iverilog issue or truss issue.

    Thanks

    Posted 2 months ago #
  12. Mike Mintz
    Key Master

    Humm, as a quick test, remove the call to $verification_top in the verilog testbench. Then run without the so. That should confirm that iverilog is set up fine.

    We can either drop to the teal tests or gdb this test. The test tests are in teal/test directory. Starting with the vout one is probably best.

    To gdb iverilog, type gdb vvp. Then type "run -m hdl/alu_test.ivl.so alu_test"

    I am sorry that this is being a pain. I have some time this weekend to test with ivl. What version are you using?

    Take Care,
    Mike

    Posted 2 months ago #
  13. wisemonkey
    Member

    Thanks Mike,
    My iverilog version is 0.9.4 -- Icarus Verilog version 0.9.4 (v0_9_4)

    About removing call $verification_top -- I'm looking at file `
    /path/to/examples/testcase/dir/example/examples/alu/verification/testbench/top

    file -- testbench.v is 69 lines of file and doesn't have single call to $verification_top.

    I'll look into other files.

    Keeping everything else same I tried running gdb for alu testcase.

    Here is output:

    (gdb) run -m hdl/alu_test.ivl.so alu_test
    Starting program: /usr/bin/vvp -m hdl/alu_test.ivl.so alu_test
    [Thread debugging using libthread_db enabled]
    Cannot find new threads: generic error

    Thanks for quick replies and keeping up with me. I'm trying to provide feedback as good as I can as well :)

    Posted 2 months ago #
  14. Robert Ekendahl
    Key Master

    Is there a reason you're on Ubuntu (more then it being the best user experience)? Any chance you can run on something else?
    When it comes to linux Ubuntu is by far my favorite distro but my experience in HW simulation tells me that it will not easily work. No simulator companies (i.e Synopsys, MTI or Cadence) supports it (to my knowledge) and I have personally tried installing vcs under it and failed.

    If you can perhaps consider using centOS5 or similar (I tried VCS under centos6 and it doesn't work).

    Both Mike and I are mostly using CentOS versions and would be more familiar with the issues.

    CentOS is a Red Hat Enterprise clone (binary compatible). While a REALLY boring distro it's stable and more commonly used in the HW field

    I don't know what your error means but it could be that you don't have the right threading library (pthreads) installed. This might be because you're running on something far newer then expected.

    My personal setup of choice is a MacBook Pro running a VM (CentOS5). It beats even Ubuntu in sexiness and VM is more then fast enough. That said I haven't tried to use icarus in ages.

    Posted 2 months ago #
  15. wisemonkey
    Member

    Robert: I'll get centOS5 running under virtual box and let u know if I have any issues.

    And reason to run it directly under ubuntu is just cause I hate using VMs -- they keep hogging resources :P

    But yea its about time I should look bit into different distros (I'll try centOS5, centOS6 and latest fedora will let you know the results)

    I hope I can use 64bit version with no issue right?

    Posted 2 months ago #
  16. Robert Ekendahl
    Key Master

    I'm with you (believe me). The distro's that work for HWSIM is really depressing. User Experience is not a top priority to say the least. I've found that the best way around it is to separate your user experience machine from your actual simulation machine (virtual or not). True VM are slower and use up space but neither are much of a bottle neck nowadays (and if they are you have the $$$ to solve it).

    You should have more luck in CentOS and helpfully Mike or I can recognize any errors better.

    With Ubuntu (and the errors you are showing) you are in unknown land.

    Do you have access to any simulator licenses?

    Posted 2 months ago #
  17. wisemonkey
    Member

    I would say unfortunately I don't have access to any other simulator (Just coming out of school)

    I can use them at school but don't have permission to compile packages there so its pretty much my own machine.

    Though I've good repo with one of the professors will try to see if I can manage to use it with vcs as well

    Thanks

    Posted 2 months ago #
  18. Mike Mintz
    Key Master

    Perhaps you could convince the professors that teal/truss is a good thing that they should use ;-)

    We do have several professors using Teal and Truss.

    Posted 2 months ago #
  19. wisemonkey
    Member

    yup thats what I'll try will let you guys know in a day or 2 :)

    Posted 2 months ago #
  20. wisemonkey
    Member

    Ok so I got permission to try compiling it on school machine (and then maybe document it :-/) anyways looks like they upgraded school distro to fedora 15 -- 2.6.41.1-1.fc15.x86_64 #1 SMP Fri Nov 11 21:36:28 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

    I'm working remotely don't know exact number of machine having centOS (if its still available).

    My centOS is being downloaded hopefully will be done tonight.

    School has working copy of vcs and while trying to compile teal there had an error:

    ./teal_memory.cpp:364:77: error: cast from ‘teal::uint8*’ to ‘teal::uint32’ loses precision [-fpermissive]
    make: *** [teal_memory.o] Error 1

    I'll update you with results of centOS again.

    Posted 2 months ago #
  21. wisemonkey
    Member

    I made it uint64 and it worked, hope its correct.

    Will try it on 32 bit distro

    Posted 2 months ago #
  22. wisemonkey
    Member

    So I'm at the point:

    linux/bin/vcsMsgReport1: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

    Need to check for newer installation of vcs this one is from 2008, we have multiple installations, will get back to you guys with updates.

    Posted 2 months ago #
  23. Robert Ekendahl
    Key Master

    I think this is a common issue that I've seen before. Don't remember off hand what the solution is. But I think we're looking for libstdc++.so.5 (i.e. version 5) and Fedora 15 probably have a newer version installed.

    You have confirmed that vcs runs on this machine right? Fedora is not officially supported by Synopsys and I'm not sure how new version 15 is. (For example I know VCS doesn't run on RH6 at the moment)

    Posted 2 months ago #
  24. Mike Mintz
    Key Master

    What version of vcs? The older versions of vcs need older compilers.

    If you can get the version, I'll know what version of gcc you have to use.

    Posted 2 months ago #
  25. wisemonkey
    Member

    Hey guys apparently vcs and all libraries are configured properly for csh only and not for bash

    I don't have missing library issue anymore as I switched from bash to csh.

    BTW I'm using vcs version 2008.09

    Now next hurdle I've is:

    alu_test.vcs.so: could not read symbols: File in wrong format
    collect2: ld returned 1 exit status
    make: *** [product_timestamp] Error 1
    Make exited with status 2

    I'll try to run it same as Mike told me -- looking at whole command

    Posted 2 months ago #
  26. Mike Mintz
    Key Master

    Do a file alu_test.vcs.so

    I suspect it's 64 bit but the vcs is 32 bit.

    Posted 2 months ago #
  27. wisemonkey
    Member

    ok so file alu_test.vcs.so is ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped indeed it looks like 64 bit.

    Now vcs:
    says its a shell script, I'm looking in script itself and its too big and I can't locate which binary it invokes.

    Posted 2 months ago #
  28. Mike Mintz
    Key Master

    Unless the -m64 switch is being sent into vcs, it will run 32 bit.

    I believe you can add -m32 to the Makefiles of truss and teal to force them to 32 bit.

    Posted 2 months ago #
  29. wisemonkey
    Member

    Hey Mike,
    Sorry was on vacation over weekend :)
    Anyways so I've edited following lines from Makefile for teal
    `ifeq ($(SIM),vcs)
    CFLAGS = -Wall -m32 $(OPT) $(D_OPT) -DSIM=vcs -Dvcs
    else`

    However teal_memory gave me scope error.
    I'll rather download centOS (32bit) 5 and give u feedback with iverilog. It seems centOS DVD torrent has some issue, downloading CDs now.

    Thanks

    Posted 2 months ago #
  30. Mike Mintz
    Key Master

    Hi,

    You that is the correct mod to make. There is also a Makefile for truss and I believe there is also a compile in the truss script.

    But lets start by getting the teal tests to run.

    I am really sorry this is a pain. I do think teal/truss is worth it !

    Posted 2 months ago #

RSS feed for this topic

Reply »

You must log in to post.