Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
dsd1-10 / dsd-07=Verilog / esug.pdf
Скачиваний:
94
Добавлен:
05.06.2015
Размер:
1.38 Mб
Скачать

Ambit BuildGates Synthesis User Guide

Using Tcl within ac_shell and pks_shell

Error Handling

Any Tcl procedure (including your own) may call the Tcl error command. Most ac_shell commands will call error when invoked with illegal syntax, or for other fatal errors such as

file-not-found.

When sourcing a script from either the command-line invocation of ac_shell or the source command, interpretation will stop if any command reports an error.

If you anticipate that invoking a command may return an error, then you should use one of the following two methods:

Invoke ac_shell using the -continue flag

When an error is encountered ac_shell returns to the ac_shell prompt (no further commands are processed). The flag is used to prevent ac_shell from exiting upon detection of an error when invoking the ac_shell command through a script. The -continue flag only applies to the script sourced upon starting ac_shell using the - f option. For example,

ac_shell -continue -f run.tcl

The flag does not have any effect on subsequent scripts sourced from the ac_shell prompt.

Note: The command line option -continueOnScriptError is the same as the - continue flag and is still supported.

Use the Tcl catch command.

This is the preferred method because it allows more control over error handling. For example, if you refer to a file call_run.v that may not exist, you can do the following

ac_shell> set err [catch {read_verilog call_run.v} msg]

The variable err is set to 0 (success) or 1 (failure), and the optional variable msg is set to the error message that is produced by read_verilog, if one exists.

September 2000

219

Product Version 4.0

Ambit BuildGates Synthesis User Guide

Using Tcl within ac_shell and pks_shell

September 2000

220

Product Version 4.0

Соседние файлы в папке dsd-07=Verilog