Coder Social home page Coder Social logo

stf_lib's People

Contributors

bdutro avatar bdutro-sv avatar benoy-sifive avatar davidstwchen avatar dingiso avatar furuame avatar h0lyalg0rithm avatar kathlenemagnus avatar klingaard avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

stf_lib's Issues

g++ compilation errors

With gcc version 11.3.0 (conda-forge gcc 11.3.0-19), building stf_protocol_types.cpp.o results in a few compilation errors:

stf_lib/stf-inc/protocols/tilelink.hpp:23:19: error: 'stf::protocols::tilelink::fields::Code' declared with greater visibility than its base 'stf::ProtocolField<stf::protocols::tilelink::fields::Code, unsigned char>' [-Werror=attributes]
   23 |             FIELD(Code, uint8_t);
      |                   ^~~~
stf_lib/stf-inc/stf_protocol_fields.hpp:39:11: note: in definition of macro '__FIELD'
   39 |     class field_name : public STF_UNPACK_TEMPLATE(parent_class_tuple) { \
      |           ^~~~~~~~~~
stf_lib/stf-inc/stf_protocol_fields.hpp:85:36: note: in expansion of macro '_PROTOCOL_FIELD'
   85 | #define _FIELD_1(field_name, type) _PROTOCOL_FIELD(field_name, type)
      |                                    ^~~~~~~~~~~~~~~
/miniconda3/envs/sparta/include/boost/preprocessor/cat.hpp:29:34: note: in expansion of macro '_FIELD_1'
   29 | #    define BOOST_PP_CAT_I(a, b) a ## b
      |                                  ^
stf_lib/stf-inc/protocols/tilelink.hpp:23:13: note: in expansion of macro 'FIELD'
   23 |             FIELD(Code, uint8_t);

pthread in stf-config.cmake

After trying the example in README, I found this line in stf-config.cmake is not functional

set (STF_LINK_LIBS pthread stf ${zstd_LIBRARIES})

the pthread (&stf) will not be automatically set to lpthread dir by cmake. The word pthread can be removed, since stf_lib can be compiled without pthread, but it shoud be added in cmakelists of app.

App cmake file

Several lines should be added to CMakeLists.txt of stf reader.

find_package(Threads REQUIRED)
target_link_libraries(<project name> Threads::Threads)

Maybe we can give an example of app's cmakelists

Python error when building `stf_tools`

When building https://github.com/sparcians/stf_tools on my Mac, I get the following Python error.

RuntimeError: 
            Attempt to start a new process before the current process
            has finished its bootstrapping phase.
            This probably means that you are on Windows and you have
            forgotten to use the proper idiom in the main module:
                if __name__ == '__main__':
                    freeze_support()
                    ...
            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce a Windows executable.

There is a simple fix for this. Adding a main to the script stfpy/setup.py resolves the issue.

Issue building stf_lib on ubuntu

I tried to build the master branch and encountered the following error

  In file included from /home/suraj/Desktop/Development/std_lib/stf-inc/stf_pte_reader.hpp:11,
                   from /home/suraj/Desktop/Development/std_lib/stf-inc/stf_inst.hpp:20,
                   from /home/suraj/Desktop/Development/std_lib/lib/stf_inst.cpp:10:
  /home/suraj/Desktop/Development/std_lib/stf-inc/stf_page_table.hpp:348:38: error: explicit specialization in non-namespace scope ‘class stf::STFPageTable::  STFPageTableImpl<iem>::SatpEntry’
    348 |                             template<>
        |                                      ^   
  /home/suraj/Desktop/Development/std_lib/stf-inc/stf_page_table.hpp:349:35: error: too few template-parameter-lists
    349 |                             class PageTableMap<VAMode::NO_TRANSLATION> : public PageTableMapBase {
        |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/suraj/Desktop/Development/std_lib/stf-inc/stf_page_table.hpp: In instantiation of ‘class stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_  IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>’:
  /usr/include/c++/12/type_traits:1467:45:   required by substitution of ‘template<class _From1, class _To1, class> static std::true_type std::__is_convertib  le_helper<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>*, stf::STFPageTable::  STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMapBase*, false>::__test(int) [with _From1 = stf::STFPageTable::STFPageTableImpl<st  f::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>*; _To1 = stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_  IEM_RV32>::SatpEntry::PageTableMapBase*; <template-parameter-1-3> = <missing>]’
  /usr/include/c++/12/type_traits:1476:42:   required from ‘struct std::__is_convertible_helper<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_I  EM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>*, stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTabl  eMapBase*, false>’
  /usr/include/c++/12/type_traits:167:12:   recursively required from ‘struct std::__and_<std::is_convertible<stf::STFPageTable::STFPageTableImpl<stf::INST_I  EM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>*, stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpE  ntry::PageTableMapBase*>, std::__not_<std::is_array<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAM  ode::NO_TRANSLATION> > > >’
  /usr/include/c++/12/type_traits:167:12:   required from ‘struct std::__and_<std::__and_<std::is_convertible<stf::STFPageTable::STFPageTableImpl<stf::INST_I  EM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>*, stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpE  ntry::PageTableMapBase*>, std::__not_<std::is_array<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAM  ode::NO_TRANSLATION> > > >, std::is_convertible<std::default_delete<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageT  ableMap<stf::VAMode::NO_TRANSLATION> >, std::default_delete<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMapB  ase> > >’
  /usr/include/c++/12/type_traits:2244:11:   required by substitution of ‘template<class ... _Cond> using _Require = std::__enable_if_t<std::__and_< <templat  e-parameter-1-1> >::value> [with _Cond = {std::__and_<std::is_convertible<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry:  :PageTableMap<stf::VAMode::NO_TRANSLATION>*, stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMapBase*>, std::__n  ot_<std::is_array<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION> > > >, std::i  s_convertible<std::default_delete<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATIO  N> >, std::default_delete<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMapBase> >}]’
  /usr/include/c++/12/bits/unique_ptr.h:366:44:   required by substitution of ‘template<class _Up, class _Ep, class> std::unique_ptr<stf::STFPageTable::STFPa  geTableImpl<stf::INST_IEM::STF_INST_IEM_RV32>::SatpEntry::PageTableMapBase, std::default_delete<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST  _IEM_RV32>::SatpEntry::PageTableMapBase> >::unique_ptr(std::unique_ptr<_Tp, _Dp>&&) [with _Up = stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST  _IEM_RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION>; _Ep = std::default_delete<stf::STFPageTable::STFPageTableImpl<stf::INST_IEM::STF_INST_IEM  _RV32>::SatpEntry::PageTableMap<stf::VAMode::NO_TRANSLATION> >; <template-parameter-1-3> = <missing>]’
  /home/suraj/Desktop/Development/std_lib/stf-inc/stf_page_table.hpp:539:79:   required from here
  /home/suraj/Desktop/Development/std_lib/stf-inc/stf_page_table.hpp:169:66: error: static assertion failed
    169 |                                     static_assert(virt_addr_type != VAMode::NO_TRANSLATION);

I am using g++-12 to compile the project. g++ (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
I am able to build the following tags/commits

Do you need anymore information to debug the issue?

Here is the complete error log error.txt

link error in release mode

Hi brett

I have tried to build stf_lib for riscv-perf-model in release mode and encountered an error

ltf_lib/lib/libstf.a: error adding symbols: file format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)

But it disappeared when compile using debug mode

These are my cmake, clang and linker versions

clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

❯ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.

❯ cmake --version
cmake version 3.25.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

May have a look at the optimization or something else 😸 ?

Thanks,
Dingisoul

-Wconversion make compilation fail

The 513 line in tilelink.hpp failed in compilation because of the -Wconversion in add_compile_options in cmake/stf-config.cmake

stf_lib/stf-inc/protocols/tilelink.hpp:513:44: error: conversion from ‘int’ to ‘__gnu_cxx::__alloc_traits<std::allocator<unsigned char>, unsigned char>::value_type’ {aka ‘unsigned char’} may change value [-Werror=conversion]
  513 |                         packed_data[i / 8] |= static_cast<uint8_t>((mask_[i] & 1) << (i & 7));
      |                         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stf_lib/stf-inc/protocols/tilelink.hpp: In instantiation of ‘void stf::protocols::tilelink::MaskedChannel<T, channel_type>::pack_impl(stf::STFOFstream&) const [with T = stf::protocols::tilelink::ChannelA; stf::protocols::tilelink::ChannelType channel_type = stf::protocols::tilelink::ChannelType::CHANNEL_A]’:
stf_lib/stf-inc/stf_object.hpp:340:17:   required from ‘void stf::TypeAwareSTFObject<Type, BaseType, id_value>::pack(stf::STFOFstream&) const [with Type = stf::protocols::tilelink::ChannelA; BaseType = stf::protocols::tilelink::Channel; typename BaseType::id_type id_value = stf::protocols::tilelink::ChannelType::CHANNEL_A]’
stf_lib/stf-inc/stf_object.hpp:338:25:   required from here
stf_lib/stf-inc/protocols/tilelink.hpp:513:44: error: conversion from ‘int’ to ‘__gnu_cxx::__alloc_traits<std::allocator<unsigned char>, unsigned char>::value_type’ {aka ‘unsigned char’} may change value [-Werror=conversion]

The compilation success with the option being deleted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.