Matt Venn
03/04/2024, 5:49 PMMatt Venn
03/04/2024, 5:49 PMMatt Venn
03/04/2024, 5:49 PMbox 0 0 0 0
load tt_um_magic_challenge.mag
extract do local
extract all
ext2spice lvs
ext2spice cthresh infinite
ext2spice short resistor
ext2spice -d -o tt_um_magic_challenge.lvs.spice
quit -noprompt
Matt Venn
03/04/2024, 5:49 PMMatt Venn
03/04/2024, 5:50 PMMatt Venn
03/04/2024, 5:57 PMTim Edwards
03/04/2024, 7:21 PM<< EOG
followed by all the commands written inside the shell script so that you can do shell variable substitution. The other way is mentioned in the usage web page for magic:
(versions from 8.3.185) The behavior is the same as above, but if any TCL script is passed on the command line, then all arguments after the name of the TCL script are assumed to be arguments passed to the script and not input files to be processed by magic. The TCL script can see the whole command line argument list in the variable $argv (length $argc).
So you can just type, e.g., magic -dnull -noconsole myscript.tcl arg1 arg2 arg3
and then pick up those arguments from within the script using $argc and $argv as stated above.Matt Venn
03/04/2024, 7:25 PMMatt Venn
03/04/2024, 7:25 PMMatt Venn
03/04/2024, 7:26 PMMatt Venn
03/04/2024, 7:35 PMmagic -dnull -noconsole myscript.tcl arg1
Matt Venn
03/04/2024, 7:36 PMMatt Venn
03/04/2024, 7:37 PMlindex $argv $argc-1
Matt Venn
03/04/2024, 7:37 PMTim Edwards
03/04/2024, 7:39 PMMatt Venn
03/04/2024, 7:40 PMMatt Venn
03/04/2024, 7:40 PMMatt Venn
03/04/2024, 7:41 PMMatt Venn
03/04/2024, 7:48 PMMatt Venn
03/04/2024, 7:48 PMMatt Venn
03/04/2024, 7:48 PMTim Edwards
03/04/2024, 7:52 PMMatt Venn
03/04/2024, 7:53 PMMatt Venn
03/04/2024, 7:54 PMMatt Venn
03/04/2024, 7:54 PMMatt Venn
03/04/2024, 7:54 PMTim Edwards
03/04/2024, 7:57 PMMatt Venn
03/04/2024, 7:58 PMMatt Venn
03/04/2024, 7:58 PMMatt Venn
03/04/2024, 8:00 PMnetgen -batch 'set project tt_um_magic_challenge; source tcl/lvs_netgen.tcl'
Matt Venn
03/04/2024, 8:01 PMMatt Venn
03/04/2024, 8:01 PMTim Edwards
03/04/2024, 8:40 PM;
, but the linux command line will grab it first and interpret it as a linux command separator. Anything you do to get rid of the delimiter like putting the command in quotes causes the command not to be seen as a command.
But this works:
File "test.tcl":
# Tcl file
puts stdout $myvar
puts stdout "that's all, folks!"
exit
Then do:
netgen -batch eval "set myvar hello ; source test.tcl"
So what I did was to put it in quotes to protect it from the shell, and then the command passed to netgen is now "eval", which evaluates the following string argument as a command.Matt Venn
03/04/2024, 8:48 PMaquiles viza
03/05/2024, 8:40 AMdefine ... endef
construct. I hope you find it useful.
https://github.com/akiles-esta-usado/ic-makefile/blob/main/magic.mk
Are your scripts available to see? It could be great to find more use-cases for my project.Matt Venn
03/05/2024, 11:01 AMMatt Venn
03/05/2024, 11:01 AM