.do files... why?

R

Rob Gaddi

Guest
Alright, I've got to fess up. I'm lost as to the point of .do files.
They seem to suffer through all of Tcl's wacky syntax, but with the
added benefit of not giving you access to the standard Tcl commands.

Am I missing something here? Or is the entire point of the exercise
that Tcl is considered to be intimidating, whereas a proprietary macro
language is not?

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
 
In article <20121016103951.01e68467@rg.highlandtechnology.com>,
Rob Gaddi <rgaddi@technologyhighland.invalid> wrote:
Alright, I've got to fess up. I'm lost as to the point of .do files.
They seem to suffer through all of Tcl's wacky syntax, but with the
added benefit of not giving you access to the standard Tcl commands.

Am I missing something here? Or is the entire point of the exercise
that Tcl is considered to be intimidating, whereas a proprietary macro
language is not?
If you're talking about Modelsim - I was under the impression that they
were one in the same. We seem to name our modelsim scripts haphazardly -
some .tcl, some .do

Perhaps .tcl is intended for pure tcl, and .do is intended for "tcl" plus
modelsim builtins? I dunno. Never given it too much thought...

--Mark
 
On 16/10/2012 18:39, Rob Gaddi wrote:
Alright, I've got to fess up. I'm lost as to the point of .do files.
They seem to suffer through all of Tcl's wacky syntax, but with the
added benefit of not giving you access to the standard Tcl commands.

Am I missing something here?
Yes, Tcl and do files are the same with the exception of some error
(onerror/onbreak) and breakpoint handling.

Hans
www.ht-lab.com


Or is the entire point of the exercise
that Tcl is considered to be intimidating, whereas a proprietary macro
language is not?
 
On Tue, 16 Oct 2012 10:39:51 -0700, Rob Gaddi wrote:

Alright, I've got to fess up. I'm lost as to the point of .do files.
They seem to suffer through all of Tcl's wacky syntax, but with the
added benefit of not giving you access to the standard Tcl commands.

Am I missing something here? Or is the entire point of the exercise
that Tcl is considered to be intimidating, whereas a proprietary macro
language is not?

There is no difference between a .do and a .tcl file, in the sense
that Modelsim doesn't really care what the filename is.
Modelsim uses the one Tcl interpreter for everything.
(BTW, you should have access to all of Tcl's wacky commands, albeit
possibly an older version of Tcl.)

What matters is how you call it:

source filename
vs
do filename

There are a few differences that I have discovered in my
scripting travels:

- error (onerror/onbreak) and breakpoint handling
(as mentioned in Hans' post).

- [info script] returns a null string in a do script
whereas it does the normal thing (returning info about
the script) when "sourced".


The last point matters if you are writing "location idependent"
code, e.g.

# converts a path relative to the script being run into an absolute one.
proc file_rel2abs {path} {
if { [ string length [ info script ] ] > 0 } {
return [file normalize [file join [file dirname [info script]] $path ] ]
} else {
error "use source rather than do"
}
}


Regards,
Allan
 
Rob Gaddi wrote:
I'm lost as to the point of .do files.
snip
Am I missing something here?

Mentor's .do file syntax predates tcl.

I first used .do files on Apollo workstations running
Mentor V6 simulators (Quicksim IIRC) in the mid-late 80's.

ModelTech then adopted a similar (if not identical)
command file syntax when they launched the low-budget
V-System(?), well before they were acquired by Mentor.

-Brian
 

Welcome to EDABoard.com

Sponsor

Back
Top