Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17249 Discussions

Modelsim redirect output stream of a macro

Altera_Forum
Honored Contributor II
4,041 Views

In Modelsim Altera Starter Edition,  

Is there a way to redirect output stream of a macro file to a file ? 

 

I use "mymacro.do" to display what_i_want_in_the_console. 

I would like to parse the ouput stream to a file. 

 

My searches in document, alteraforum and web didn't give anything.
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
2,270 Views

Using the command-line version of vsim, you can redirect the output to a file. Eg., something like 

 

vsim -c testbench -do "run -a; q" &> testbench.log  

 

Cheers 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
2,270 Views

Hi, thanks for answer, 

vsim -c myentity -do mymacro.do &> mymacro.log 

 

But vsim command doesn't like &> mymacro.log. It would like to take this as an entity. 

 

So solution not found yet...
0 Kudos
Altera_Forum
Honored Contributor II
2,270 Views

I found a workaround : write the transcript window to a file 

write transcript myfile.log
0 Kudos
Altera_Forum
Honored Contributor II
2,270 Views

 

--- Quote Start ---  

 

vsim -c myentity -do mymacro.do &> mymacro.logBut vsim command doesn't like &> mymacro.log. It would like to take this as an entity. 

 

--- Quote End ---  

 

 

Were you trying this from a bash shell? I commented that this format was for the command-line version of vsim, not the GUI version. 

 

I use this method in Makefiles to generate logfiles from failing testbenches. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
2,270 Views

Hi, thanks, I will cogitate.

0 Kudos
Altera_Forum
Honored Contributor II
2,270 Views

Here's the Makefile section: 

 

# -----------------------------------------------------------------# Check target# -----------------------------------------------------------------# # Change into the control_test build directory so that the# exitstatus and log files are generated in the control_test# directory. 'make clean' will then remove that directory.# # The logic to test the exit code could be transformed into# a bash script that takes the executable as the argument.# Eg. check_exit_status $testbench# # Each testbench should have the generic makecheck, with a default# of 0. The makefile sets the parameter to 1. The exitstatus file# will not be created when makecheck = 0.# .PHONY: check check: $(CONTROL_TEST_LIB_DONE) @cd $(CONTROL_TEST_DIR); rm -f exitstatus; for check in $(control_test_CHECKS); do echo -n "TEST: $$check"; $(VSIM) $(VSIM_ARGS) -c control_test.$$check -gmakecheck=1 -do "run -a; q" &> $$check.log; if ; then if ; then echo -e "\rFAIL: $$check (see $$check.log)"; rm exitstatus; exit 1; else echo -e "\rPASS: $$check"; rm exitstatus; fi; else echo -e "\rFAIL: $$check. `pwd`/exitstatus file not found. Check the testbench."; exit 1; fi; done
0 Kudos
Reply