Search code examples
tclcadence

Cadence Genus print multiline string


I'm new to Genus, first time working with it. To synthesisze my design I run a rather long .tcl script, which produces a way longer .log file.

To make it easier for me to navigate the log, I would like to print a banner in certain specific points. Here's my try:

puts " ██████  ███████ ████████ ██    ██ ██████  ███    ██ \n"
puts " ██   ██ ██         ██    ██    ██ ██   ██ ████   ██ \n"
puts " ██████  █████      ██    ██    ██ ██████  ██ ██  ██ \n"
puts " ██   ██ ██         ██    ██    ██ ██   ██ ██  ██ ██ \n"
puts " ██   ██ ███████    ██     ██████  ██   ██ ██   ████ \n"

But what I get is far from the expected:

    @file(run_genus.tcl) 94: puts " ██████  ███████ ████████ ██    ██ ██████  ███    ██ \n" 
 ██████  ███████ ████████ ██    ██ ██████  ███    ██ 

@file(run_genus.tcl) 95: puts " ██   ██ ██         ██    ██    ██ ██   ██ ████   ██ \n" 
 ██   ██ ██         ██    ██    ██ ██   ██ ████   ██ 

@file(run_genus.tcl) 96: puts " ██████  █████      ██    ██    ██ ██████  ██ ██  ██ \n" 
 ██████  █████      ██    ██    ██ ██████  ██ ██  ██ 

@file(run_genus.tcl) 97: puts " ██   ██ ██         ██    ██    ██ ██   ██ ██  ██ ██ \n" 
 ██   ██ ██         ██    ██    ██ ██   ██ ██  ██ ██ 

@file(run_genus.tcl) 98: puts " ██   ██ ███████    ██     ██████  ██   ██ ██   ████ \n" 
 ██   ██ ███████    ██     ██████  ██   ██ ██   ████ 

Genus prints out each command and then executes it. This is useful, it allows for example to search for a specific command in the log file, but breaks multiline prints as the one I'm attempting.

Does anyone know what is the proper way of doing what I'm trying to do here?


Solution

  • You can do multiline strings in Tcl easily, provided you've enclosed the string in double quotes or braces.

    puts "\
     ██████  ███████ ████████ ██    ██ ██████  ███    ██ 
     ██   ██ ██         ██    ██    ██ ██   ██ ████   ██ 
     ██████  █████      ██    ██    ██ ██████  ██ ██  ██ 
     ██   ██ ██         ██    ██    ██ ██   ██ ██  ██ ██ 
     ██   ██ ███████    ██     ██████  ██   ██ ██   ████ \n"
    

    I've been a bit tricky with the backslash on the first line so that the word also shows up in readable form in the source.