Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YOSYS][issue/3594] print stack of script commands upon error #3766

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

arcturusannamalai
Copy link
Contributor

[YOSYS][issue/3594] print stack of script commands upon error; this is not a backtrace of program stack but of the Yosys script.
e.g.

-- Executing script file `./demo.ys' --

1. Executing Verilog-2005 frontend: ../yosys/f2.v
Parsing Verilog input from `../yosys/f2.v' to AST representation.
Successfully finished Verilog frontend.

2. Executing Verilog-2005 frontend: ../yosys/hello.v
Parsing Verilog input from `../yosys/hello.v' to AST representation.
Successfully finished Verilog frontend.

3. Executing CXXRTL backend.

3.1. Executing HIERARCHY pass (managing design hierarchy).

3.1.1. Finding top of design hierarchy..

3.2. Executing FLATTEN pass (flatten design).

3.3. Executing PROC pass (convert processes to netlists).

3.3.1. Executing PROC_CLEAN pass (remove empty switches from decision trees).
Cleaned up 0 empty switches.

3.3.2. Executing PROC_RMDEAD pass (remove dead branches from decision trees).
Removed a total of 0 dead cases.

3.3.3. Executing PROC_PRUNE pass (remove redundant assignments in processes).
Removed 0 redundant assignments.
Promoted 0 assignments to connections.

3.3.4. Executing PROC_INIT pass (extract init attributes).

3.3.5. Executing PROC_ARST pass (detect async resets in processes).

3.3.6. Executing PROC_ROM pass (convert switches to ROMs).
Converted 0 switches.

3.3.7. Executing PROC_MUX pass (convert decision trees to multiplexers).

3.3.8. Executing PROC_DLATCH pass (convert process syncs to latches).

3.3.9. Executing PROC_DFF pass (convert process syncs to FFs).

3.3.10. Executing PROC_MEMWR pass (convert process memory writes to cells).

3.3.11. Executing PROC_CLEAN pass (remove empty switches from decision trees).
Cleaned up 0 empty switches.

3.3.12. Executing OPT_EXPR pass (perform const folding).

ERROR: No such command: writx (type 'help' for a command overview)
Error while executing script:
	Running script on file './demo.ys'
---------------------------------
   1 read_verilog ../yosys/*.v
   2 write_cxxrtl demo.cxx
-->3 writx
---------------------------------

Muthu Annamalai and others added 8 commits May 9, 2023 05:30
ERROR: No such command: prox (type help for a command overview)
Error while executing script:
	Running script on file demo.ys
---------------------------------
   1 read_verilog ./tests/lut/map_not.v
   2 opt
   3 proc_clean
-->4 prox
---------------------------------
ERROR: No such command: prox (type help for a command overview)
Error while executing script:
	Running script on file demo.ys
---------------------------------
   1 read_verilog ./tests/lut/map_not.v
   2 opt
   3 proc_clean
-->4 prox
---------------------------------
…m shows clean atexit when there is not much of a stack

Obtained 6 stack frames.
1 | ./yosys(_Z17yosys_print_tracev+0x2e) [0x55c7a207830a]
2 | ./yosys(_Z12yosys_atexitv+0x9) [0x55c7a2078386]
3 | ./yosys(main+0x1c33) [0x55c7a207a020]
4 | /lib/x86_64-linux-gnu/libc.so.6(+0x23510) [0x7fae3a623510]
5 | /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89) [0x7fae3a6235c9]
6 | ./yosys(_start+0x25) [0x55c7a2078215]
…CE7-C8A2DBD19124.tar.gz

Found gzip magic in file /tmp/powerlog/cloud/Powerlog_43077FB1-54B7-4948-9CE7-C8A2DBD19124.tar.gz, decompressing using zlib.

1. Executing Verilog-2005 frontend: /tmp/powerlog/cloud/Powerlog_43077FB1-54B7-4948-9CE7-C8A2DBD19124.tar.gz
Parsing Verilog input from `/tmp/powerlog/cloud/Powerlog_43077FB1-54B7-4948-9CE7-C8A2DBD19124.tar.gz' to AST representation.
/tmp/powerlog/cloud/Powerlog_43077FB1-54B7-4948-9CE7-C8A2DBD19124.tar.gz:1: ERROR: syntax error, unexpected TOK_ID
Obtained 13 stack frames.
1 | 0   yosys                               0x00000001001644ac _Z17yosys_print_tracev + 88
2 | 1   yosys                               0x0000000100164568 _Z12yosys_atexitv + 16
3 | 2   yosys                               0x0000000100205124 _ZN5YosysL22logv_error_with_prefixEPKcS1_Pc + 840
4 | 3   yosys                               0x00000001002052f4 _ZN5Yosys14log_file_errorERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPKcz + 96
5 | 4   yosys                               0x00000001003bc694 _ZNSt3__110__list_impINS_6vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS5_IS7_EEEENS5_IS9_EEE5clearEv + 0
6 | 5   yosys                               0x000000010039772c _Z24frontend_verilog_yyparsev + 2164
7 | 6   yosys                               0x00000001003be520 _ZN5Yosys15VerilogFrontend7executeERPNSt3__113basic_istreamIcNS1_11char_traitsIcEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEENS1_6vectorISB_NS9_ISB_EEEEPNS_5RTLIL6DesignE + 5556
8 | 7   yosys                               0x0000000100171c60 _ZN5Yosys8Frontend7executeENSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEEPNS_5RTLIL6DesignE + 172
9 | 8   yosys                               0x00000001001709a4 _ZN5Yosys4Pass4callEPNS_5RTLIL6DesignENSt3__16vectorINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS9_ISB_EEEE + 532
10 | 9   yosys                               0x0000000100170464 _ZN5Yosys4Pass4callEPNS_5RTLIL6DesignENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 1080
11 | 10  yosys                               0x000000010021479c _ZN5Yosys5shellEPNS_5RTLIL6DesignE + 320
12 | 11  yosys                               0x0000000100165374 main + 3444
13 | 12  dyld                                0x00000001016710f4 start + 520
@arcturusannamalai
Copy link
Contributor Author

Fork off from branch #3757 as per maintainer request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant