Skip to content

Commit 8c0b43e

Browse files
committed
Make fake yosys/openroad/klayout executables for flow testing
With these you can "run" any design in seconds with: make OPENROAD_CMD=test/fake_openroad YOSYS_EXE=test/fake_yosys KLAYOUT_CMD=test/fake_klayout You'll get a log of all the commands that would be executed by these tools. Signed-off-by: Matt Liberty <[email protected]>
1 parent 93a69fb commit 8c0b43e

File tree

4 files changed

+95
-1
lines changed

4 files changed

+95
-1
lines changed

flow/scripts/floorplan.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ if { [env_var_exists_and_non_empty FASTROUTE_TCL] } {
111111

112112
source_env_var_if_exists FOOTPRINT_TCL
113113

114-
if { ![env_var_equal SKIP_REPAIR_TIE_FANOUT 1] } {
114+
if { ![env_var_equals SKIP_REPAIR_TIE_FANOUT 1] } {
115115
# This needs to come before any call to remove_buffers. You could have one
116116
# tie driving multiple buffers that drive multiple outputs.
117117
# Repair tie lo fanout

flow/test/fake_klayout

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
5+
for arg in sys.argv[1:]:
6+
if arg.startswith("out_file="):
7+
_, file_name = arg.split('=', 1)
8+
with open(file_name, 'w') as f:
9+
pass

flow/test/fake_openroad

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env tclsh
2+
3+
proc unknown {cmd args} {
4+
puts "'$cmd $args'"
5+
6+
# The return value is arbitrary but this seems to get through the flow
7+
# The empty string fails as a boolean and 0 leads to a divide by zero.
8+
return 1
9+
}
10+
11+
# Create the (empty) output files
12+
proc write_db {args} {
13+
set filename [lindex $args end]
14+
close [open $filename w]
15+
}
16+
17+
proc write_sdc {args} {
18+
set filename [lindex $args end]
19+
close [open $filename w]
20+
}
21+
22+
set i 0
23+
while {$i < $argc} {
24+
set arg [lindex $argv $i]
25+
if {$arg == "-help"} {
26+
} elseif {$arg == "-version"} {
27+
} elseif {$arg == "-no_init"} {
28+
} elseif {$arg == "-threads"} {
29+
incr i
30+
} elseif {$arg == "-no_splash"} {
31+
} elseif {$arg == "-exit"} {
32+
} elseif {$arg == "-gui"} {
33+
} elseif {$arg == "-no_settings"} {
34+
} elseif {$arg == "-python"} {
35+
puts "-python not supported"
36+
exit 1
37+
} elseif {$arg == "-log"} {
38+
incr i
39+
} elseif {$arg == "-metrics"} {
40+
incr i
41+
} elseif {$arg == "-db"} {
42+
incr i
43+
} else {
44+
source $arg
45+
}
46+
incr i
47+
}

flow/test/fake_yosys

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env tclsh
2+
3+
proc unknown {cmd args} {
4+
puts "'$cmd $args'"
5+
6+
# The return value is arbitrary but this seems to get through the flow
7+
# The empty string fails as a boolean and 0 leads to a divide by zero.
8+
return 1
9+
}
10+
11+
# Create the (empty) output files
12+
proc json {args} {
13+
set filename [lindex $args end]
14+
set f [open $filename w]
15+
puts $f "{ \"modules\": {} }"
16+
close $f
17+
}
18+
19+
proc write_verilog {args} {
20+
set filename [lindex $args end]
21+
close [open $filename w]
22+
}
23+
24+
set i 0
25+
while {$i < $argc} {
26+
set arg [lindex $argv $i]
27+
if {$arg == "-V"} {
28+
} elseif {$arg == "-v"} {
29+
incr i
30+
} elseif {$arg == "-c"} {
31+
incr i
32+
source [lindex $argv $i]
33+
} else {
34+
puts "Unknown arg $arg"
35+
exit 1
36+
}
37+
incr i
38+
}

0 commit comments

Comments
 (0)