Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions flow/scripts/synth_preamble.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@ erase_non_stage_variables synth
# If using a cached, gate level netlist, then copy over to the results dir with
# preserve timestamps flag set. If you don't, subsequent runs will cause the
# floorplan step to be re-executed.
#
# Plain cp + touch -r rather than cp -p: -p also preserves mode, which makes
# cp copy ACLs. That fails with EOPNOTSUPP when the source is on an NFSv4
# mount (every file there carries a system.nfs4_acl xattr) and the
# destination filesystem, e.g. ext4 or tmpfs, cannot store it. Only the
# timestamps matter for make's up-to-date checks; touch -r preserves them
# with nanosecond precision and, unlike cp --preserve=timestamps, is
# portable to macOS/BSD.
if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } {
if { [llength $::env(SYNTH_NETLIST_FILES)] == 1 } {
log_cmd exec cp -p $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v
log_cmd exec cp $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v
log_cmd exec touch -r $::env(SYNTH_NETLIST_FILES) \
$::env(RESULTS_DIR)/1_2_yosys.v
} else {
# The date should be the most recent date of the files, but to
# keep things simple we just use the creation date
log_cmd exec cat {*}$::env(SYNTH_NETLIST_FILES) > $::env(RESULTS_DIR)/1_2_yosys.v
}
if { [env_var_exists_and_non_empty CACHED_REPORTS] } {
log_cmd exec cp -p {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR)/.
foreach report $::env(CACHED_REPORTS) {
set dst $::env(REPORTS_DIR)/[file tail $report]
log_cmd exec cp $report $dst
log_cmd exec touch -r $report $dst
}
}
exit
}
Expand Down