lana555 / dynamatic

MIT License
86 stars 37 forks source link

Fail to generate a .DOT file #7

Open ZachGu opened 3 years ago

ZachGu commented 3 years ago

Hi! I was trying to run an example with elastic-circuits, however, I have met an error:

opt -load ../_build/MemElemInfo/libLLVMMemElemInfo.so -load ../_build/ElasticPass/libElasticPass.so -load ../_build/OptimizeBitwidth/libLLVMOptimizeBitWidth.so -load ../_build/MyCFGPass/libMyCFGPass.so -polly-process-unprofitable -mycfgpass _build/2mm/2mm_mem2reg_constprop_simplifycfg_die.ll -S -cfg-outdir=_build/2mm 0Time elapsed: 1e-06s. couldn't open file _Z10kernel_2mmiiPA1024_iS0_S0_S0_S0__freq.txt terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_construct null not valid

0 0x000055eb87a924d3 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/llvm-6.0.1.src/lib/Support/Unix/Signals.inc:398:0

1 0x000055eb87a92566 PrintStackTraceSignalHandler(void*) /home/llvm-6.0.1.src/lib/Support/Unix/Signals.inc:462:0

2 0x000055eb87a9073b llvm::sys::RunSignalHandlers() /home/llvm-6.0.1.src/lib/Support/Signals.cpp:49:0

3 0x000055eb87a91d3f SignalHandler(int) /home/llvm-6.0.1.src/lib/Support/Unix/Signals.inc:252:0

4 0x00007f11ccf17980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)

5 0x00007f11cbbc8fb7 gsignal /build/glibc-S7xCS9/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0

6 0x00007f11cbbca921 abort /build/glibc-S7xCS9/glibc-2.27/stdlib/abort.c:81:0

7 0x00007f11cc5bd957 __strtof_l (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x8c957)

8 0x00007f11cc5c3ae6 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x92ae6)

9 0x00007f11cc5c3b21 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x92b21)

10 0x00007f11cc5c3d54 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x92d54)

11 0x00007f11cc5bf79f __strtof_l (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x8e79f)

12 0x000055eb87a1fda7 void std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_construct<char const>(char const, char const*, std::forward_iterator_tag) /usr/include/c++/7/bits/basic_string.tcc:215:0

13 0x00007f11cb63db55 read_data_from_csv(int, int, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >) /home/dynamatic/elastic-circuits/ElasticPass/ComponentsTiming.cpp:69:0

14 0x00007f11cb63e422 get_component_delay(std::cxx11::basic_string<char, std::char_traits, std::allocator >, int, std::cxx11::basic_string<char, std::char_traits, std::allocator >) /home/dynamatic/elastic-circuits/ElasticPass/ComponentsTiming.cpp:122:0

15 0x00007f11cb6784e8 getNodeDotParams(ENode*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) /home/dynamatic/elastic-circuits/ElasticPass/PrintDot.cpp:1188:0

16 0x00007f11cb679f48 printDotNodes(std::vector<ENode, std::allocator<ENode> >*, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) /home/dynamatic/elastic-circuits/ElasticPass/PrintDot.cpp:1327:0

17 0x00007f11cb67ef88 printDotDFG(std::vector<ENode, std::allocator<ENode> >, std::vector<BBNode, std::allocator<BBNode> >, std::cxx11::basic_string<char, std::char_traits, std::allocator >, bool, std::cxx11::basic_string<char, std::char_traits, std::allocator >) /home/dynamatic/elastic-circuits/ElasticPass/PrintDot.cpp:1826:0

18 0x00007f11cb0f6f2c (anonymous namespace)::MyCFGPass::compileAndProduceDOTFile(llvm::Function&) /home/ dynamatic/elastic-circuits/MyCFGPass/MyCFGPass.cpp:165:0

19 0x00007f11cb0f7253 (anonymous namespace)::MyCFGPass::runOnFunction(llvm::Function&) /home/dynamatic/elastic-circuits/MyCFGPass/MyCFGPass.cpp:173:0

20 0x000055eb872b1604 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/ dynamatic/elastic-circuits/llvm-6.0.1.src/lib/IR/LegacyPassManager.cpp:1520:0

21 0x000055eb872b17a9 llvm::FPPassManager::runOnModule(llvm::Module&) /home/ dynamatic/elastic-circuits/llvm-6.0.1.src/lib/IR/LegacyPassManager.cpp:1541:0

22 0x000055eb872b1b31 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/dynamatic/elastic-circuits/llvm-6.0.1.src/lib/IR/LegacyPassManager.cpp:1597:0

23 0x000055eb872b225b llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/dynamatic/elastic-circuits/llvm-6.0.1.src/lib/IR/LegacyPassManager.cpp:1700:0

24 0x000055eb872b2453 llvm::legacy::PassManager::run(llvm::Module&) /home/dynamatic/elastic-circuits/llvm-6.0.1.src/lib/IR/LegacyPassManager.cpp:1732:0

25 0x000055eb8652a799 main /home/dynamatic/elastic-circuits/llvm-6.0.1.src/tools/opt/opt.cpp:765:0

26 0x00007f11cbbabbf7 __libc_start_main /build/glibc-S7xCS9/glibc-2.27/csu/../csu/libc-start.c:344:0

27 0x000055eb864fa43a _start (/home/dynamatic/elastic-circuits/llvm-6.0.1/bin/opt+0x101543a)

Stack dump: 0.Program arguments: /home/dynamatic/elastic-circuits/llvm-6.0.1/bin/opt -load ../_build/MemElemInfo/libLLVMMemElemInfo.so -load ../_build/ElasticPass/libElasticPass.so -load ../_build/OptimizeBitwidth/libLLVMOptimizeBitWidth.so -load ../_build/MyCFGPass/libMyCFGPass.so -polly-process-unprofitable -mycfgpass _build/2mm/2mm_mem2reg_constprop_simplifycfg_die.ll -S -cfg-outdir=_build/2mm 1.Running pass 'Function Pass Manager' on module '_build/2mm/2mm_mem2reg_constprop_simplifycfg_die.ll'. 2.Running pass 'Creates new CFG pass' on function '@_Z10kernel_2mmiiPA1024_iS0_S0_S0S0'

I don’t know how to solve this problem. Thank you very much for your help!

lana555 commented 3 years ago

Hi, does it happen with every example you run, or is it just this one? Could you try the fir, for instance?

ZachGu commented 3 years ago

Hi. I have tried the fir and other examples, and met the same error.

lana555 commented 3 years ago

Are you using the VM or your own setup? Could you also let me know how you are running the example? If you are not doing the following, could you maybe try and let me know if this works: from elastic-circuits/examples, just run make name=fir graph

ZachGu commented 3 years ago

I build and install binaries according to the README files in each folder. However, I used LLVM-6.0.1 instead of LLVM-6.0.0, since I did not the the source code of LLVM-6.0.0. And I used to run the example as the way you suggested.

Andrea-Guerrieri commented 3 years ago

Hi, from what I see it could be related to a compatibility issue between your OS and LLVM, or to the installation path. To help you I need to understand more details. Can you please tell a bit more about your installation environment?

Andrea

ZachGu commented 3 years ago

Hi, my os is Ubuntu 18.04.5 and my LLVM version is 6.0.1. I installed the LLVM and dynamatic under my local workspace.

Andrea-Guerrieri commented 3 years ago

Hi. I may have a possible solution for your problem.

Try to initialize your execution environment with the following commands (replacing your installation path) before running dynamatic.

export PATH=$PATH:/home/dynamatic/Dynamatic/bin/ export CLANG_DIR=/home/dynamatic/Dynamatic/etc/llvm-6.0/bin export DHLS_INSTALL_DIR=/home/dynamatic/Dynamatic export OPT_DIR=$CLANG_DIR export ELASTIC_DIR=/home/dynamatic/Dynamatic/etc/dynamatic/elastic-circuits

Also, please move or create a symbolic link to the dynamatic repository into $DHLS_INSTALL_DIR/etc. A possible command could be (adapted with your installation path)

ln -s your_repository_path $DHLS_INSTALL_DIR/etc/dynamatic

Please tell me if this solve or not the problem. Thanks

panyan928 commented 3 years ago

@Andrea-Guerrieri Hi, I have solved the problem by your method, But I have a new question about Buffers. When I run the following command by README bin/buffers buffers -filename=xxx -period=5 but I get a error say the file could not be opened, just like this.

****************************************
dataflow graph name: /home/actri/dynamatic/elastic-circuits/examples/_build/boolean_graph
milp solver: cbc
delay: 0, period: 5
timeout: 180
set optimization: true
first MG optimization: false
****************************************
File /home/actri/dynamatic/elastic-circuits/examples/_build/boolean_graph.dot could not be opened.

I tried to change the file path, the file does exist. Can you help me?