Commit 6ba55201 authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Added project argument.

parent cd6c217c
#!/usr/local/bin/otclsh
if {$argc != 2} {
puts "usage: $argv0 ns_input_file ir_file"
if {$argc != 3} {
puts "usage: $argv0 project ns_input_file ir_file"
exit 1
}
set project [lindex $argv 0]
set nsfile [lindex $argv 1]
set irfile [lindex $argv 2]
set libdir [file dirname [info script]]
source $libdir/tcl-object.tcl
......@@ -70,7 +73,6 @@ source $libdir/sim.tcl
source $libdir/stubs.tcl
# argv[0] is the ns input file
set prefix [lindex [split [lindex [split [lindex $argv 1] /] end] .] 0]
source [lindex $argv 0]
set prefix $project[lindex [split [lindex [split $nsfile /] end] .] 0]
source $nsfile
......@@ -53,14 +53,15 @@ set libir "$scriptdir/ir/libir.tcl"
source $libir
namespace import TB_LIBIR::ir
if {$argc != 1} {
puts stderr "Syntax: $argv0 <ns-file>"
if {$argc != 2} {
puts stderr "Syntax: $argv0 <project> <ns-file>"
exit 1
}
set nsFile [lindex $argv 0]
set nsFile [lindex $argv 1]
set t [split $nsFile .]
set prefix [join [lrange $t 0 [expr [llength $t] - 2]] .]
set project [lindex $argv 0]
set prefix "$project[join [lrange $t 0 [expr [llength $t] - 2]] .]"
set irFile "$prefix.ir"
set logFile "$prefix.log"
......@@ -81,7 +82,7 @@ if {! [file exists $nsFile]} {
}
outs "Parsing ns input."
if {[catch "exec $ns2ir $nsFile $irFile >@ $logFp 2>@ $logFp" err]} {
if {[catch "exec $ns2ir $project $nsFile $irFile >@ $logFp 2>@ $logFp" err]} {
outs stderr "Error parsing ns input. ($err)"
exit 1
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment