0

We know that YOSYS (YOSYS for win32) can get an AST result using read_verilog _dump_ast command, but the result view in the command window. How can we get the result as a textfile from the command window? Thank you very much!

CliffordVienna
  • 7,995
  • 1
  • 37
  • 57
jason
  • 21
  • 4

1 Answers1

1

You can redirect the yosys log output using the -l command line option (e.g. yosys -l logfile.txt), or using the tee command in yosys:

tee -o outputfile.txt read_verilog -dump_ast1 input .v
CliffordVienna
  • 7,995
  • 1
  • 37
  • 57
  • Thank you very much! You gave me a great help! – jason May 19 '16 at 03:17
  • I have another problem. When we get the AST text file ,how could we read the AST textfile to YOSYS to continue systhsising to get systhsised result?Suppose that after I do some change to the ASTs. – jason May 19 '16 at 03:53
  • @jason You don't. The AST dump is a debug output only. Either modify the original Verilog code, or dump, modify, and read the ilang representation after the verilog front-end is done (see `write_ilang` and `read_ilang`). – CliffordVienna May 19 '16 at 11:03
  • a@CliffordVienna,Thank you very much! Well, what I want to do is to get AST of a given Verilog, then to modify or chang the AST, and last to read the AST to YOSYS (or other tools) synthesising and get a modified Verilog. Now, I just know the first step with your help. Do ASTS from YOSYS easily to change or modify and finally input to YOSYS to synthesized? Which tools is suitable to modify ASTS? If YOSYS can't read the modified AST, which tools can finish this job? – jason May 22 '16 at 03:18