tcl


Comments

https://wiki.tcl-lang.org/page/comment

File operations

Command line arguments

https://stackoverflow.com/questions/24376421/passing-arguments-from-command-line-into-a-tcl-script

Printing (puts)

# A newline is added by default
% puts "hello world"
hello world

# Use -nonewline to skip the new line
% puts -nonewline "hello world"
hello world%

See: https://wiki.tcl-lang.org/page/Tcl+cheat+sheet

Procedures (proc)

This is how new commands are made in tcl.

proc say_hello {} {
  puts "Hello!"
}

% say_hello
Hello!

Or with an argument:

proc say_hello name {
  puts "Hello $name!"
}

% say_hello "Jack"
Hello Jack!

Or with multiple arguments:

proc say_hello {fname lname} {
  puts "Hello $fname $lname!"
}

% say_hello "Jack" "Sparrow"
Hello Jack Sparrow!

See:

Xilinix Vivado

# https://github.com/ATaylorCEngFIET/mz_428/blob/master/project/project-flow.tcl
# https://www.adiuvoengineering.com/post/microzed-chronicles-scripting-vivado
# start_gui
create_project hello /media/julinusername/zwei/data/vivado_projs/hello -part xc7k160tffv676-1
add_files -norecurse /home/julinusername/verilog/Demo.topEntity/topEntity.v
set_property top topEntity [current_fileset]
update_compile_order -fileset sources_1
launch_runs synth_1 -jobs 8
wait_on_run synth_1
launch_runs impl_1 -jobs 8 -to_step write_bitstream
wait_on_run impl_1

Trivia

References