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

Backspace character in System Console

Altera_Forum
Honored Contributor II
1,493 Views

I am testing some memory using System Console and I would like to make a simple progress bar which will show current progress. For that I would need a backspace character. 

 

The Tcl interpreter from Centos 7 works as expected: 

 

$ tclsh % puts $tcl_version 8.5 % puts "abc\bd" abd  

 

 

 

But System Console gives this: 

% puts $tcl_version 8.5 % puts "abc\bd" abcd  

 

 

Is there any way I can delete current characters or maybe whole line in System Console?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
710 Views

Probably not. System Console is a very crippled console interface which I believe is based on Jacl (a Java TCL interpreter). 

 

You might be better off looking at the Dashboard widgets and see if you can use a progress indicator there. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
710 Views

The solution is so simple that I am almost ashamed to post it. You don't have to delete anything if you dont print anything, so for a very simple progress bar it is enough to print a character on the right iterations.  

 

Here is the code: 

 

set BAR_LEN 50 # ############################################################################## # Puts top line proc put_top_line { } { global BAR_LEN puts -nonewline "|" for {set i 0} {$i < $BAR_LEN} {incr i} { puts -nonewline "-" } puts -nonewline "|\n" } # ############################################################################## # Puts# to fill the progress bar, should be called every loop iteration proc put_filler {cur max} { global BAR_LEN if { } { puts -nonewline "|" } elseif { } { puts -nonewline "|\n" } else { set curValue set nextValue if { } { puts -nonewline "#" } } } # ############################################################################## # Test put_top_line for {set i 0} { $i < 1000 } { incr i } { put_filler $i 999 after 10 }
0 Kudos
Reply