-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpipeline.jenkins
159 lines (151 loc) · 8.39 KB
/
pipeline.jenkins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/bin/groovy
pipeline {
agent any
environment {
datc_rdf_dir = "/opt/datc_rdf"
log_dir = "/var/lib/jenkins/jobs/DATC\\ Robust\\ Design\\ Flow/builds/${BUILD_ID}"
log_name = "datc_rdf.log.txt"
result_dir_name = "${BUILD_ID}_${params.design}_${params.synth_script}_${params.placer}_${params.router}"
result_dir = "/usr/share/nginx/html/datc_rdf/${result_dir_name}"
synth_name = "${params.design}_${params.synth_script}"
place_name = "${params.design}_${params.synth_script}_${params.placer}"
sizing_name = "${params.design}_${params.synth_script}_${params.placer}_${params.gate_sizer}"
routing_name = "${params.design}_${params.synth_script}_${params.placer}_${params.router}"
}
stages {
stage("Configuration") {
steps {
echo ""
echo "DATC Robust Design Flow"
echo ""
echo "----------------------------------------------------------"
echo "Design: ${params.design}"
echo "----------------------------------------------------------"
echo "Logc synthesis script : ${params.synth_script}"
echo "Max fanout of buffering : ${params.max_fo}"
echo "Placer : ${params.placer}"
echo " Target density : ${params.target_density}"
echo "Do gate sizing : ${params.run_gs}"
echo "Gate sizer : ${params.gate_sizer}"
echo "Selected router : ${params.router}"
echo " Num layers : ${params.num_layers}"
echo " Tile size : ${params.tile_size}"
echo " Block porosity : ${params.adjustment}"
echo " Safety margin : ${params.safety}"
echo "Results URL : https://rdf.kaist.ac.kr/${result_dir_name}"
echo "----------------------------------------------------------"
echo ""
echo "Generating config.sh..."
writeFile file: "config.sh", text: """#!bin/bash
bench_list=(\"${params.design}\")
script_list=(\"${params.synth_script}\")
max_fo=${params.max_fo}
placer_list=(\"${params.placer}\")
target_density=${params.target_density}
run_gs=${params.run_gs}
sizer=\"${params.gate_sizer}\"
router_list=(\"${params.router}\")
tile_size=${params.tile_size}
num_layer=${params.num_layers}
adjustment=${params.adjustment}
safety=${params.safety}
"""
sh 'chmod 755 config.sh; cp config.sh /opt/datc_rdf/000_config'
echo "Done."
echo ""
}
}
stage('Logic Synthesis') {
steps {
echo 'Running logic synthesis..'
sh 'cd ${datc_rdf_dir}/100_logic_synthesis; ./run_batch'
}
}
stage('Floorplanning') {
steps {
echo 'Creating bookshelf files..'
sh 'cd ${datc_rdf_dir}/200_floorplanning; ./run_batch'
}
}
stage('Placement') {
steps {
echo 'Running placement..'
sh 'cd ${datc_rdf_dir}/300_placement; ./run_batch'
sh 'cd ${datc_rdf_dir}/310_write_def; ./run_batch'
}
}
stage('Timing analysis') {
steps {
echo 'Running timing analysis..'
sh 'cd ${datc_rdf_dir}/320_timing; ./run_batch'
}
}
stage('Gate sizing') {
steps {
echo 'Running timing analysis..'
sh 'cd ${datc_rdf_dir}/400_gate_sizing; ./run_batch'
sh 'cd ${datc_rdf_dir}/410_write_bookshelf; ./run_batch'
sh 'cd ${datc_rdf_dir}/420_legalization; ./run_batch'
sh 'cd ${datc_rdf_dir}/430_write_def; ./run_batch'
sh 'cd ${datc_rdf_dir}/440_timing; ./run_batch'
}
}
stage('Global Routing') {
steps {
echo 'Running global routing..'
sh 'cd ${datc_rdf_dir}/500_gr_bench_gen; ./run_batch'
sh 'cd ${datc_rdf_dir}/510_global_route; ./run_batch'
}
}
}
post {
always {
script {
sh "mkdir ${result_dir}"
sh "mv ${datc_rdf_dir}/100_logic_synthesis/${synth_name} ${result_dir}/1_logic_synth"
sh "mv ${datc_rdf_dir}/200_floorplanning/bookshelf-${synth_name} ${result_dir}/2_bookshelf"
sh "mv ${datc_rdf_dir}/300_placement/${place_name} ${result_dir}/3_placement"
sh "mv ${datc_rdf_dir}/310_write_def/${place_name}.def ${result_dir}/3_placement/"
sh "mv ${datc_rdf_dir}/320_timing/${place_name}/out ${result_dir}/4_timing_report"
if ( params.run_gs == true ) {
sh "mv ${datc_rdf_dir}/400_gate_sizing/${sizing_name} ${result_dir}/5_gate_sizing"
sh "mv ${datc_rdf_dir}/420_legalization/${sizing_name}_FP/${params.design}_FP_dp.pl ${result_dir}/5_gate_sizing"
sh "mv ${datc_rdf_dir}/420_legalization/${sizing_name}_FP/${sizing_name}.png ${result_dir}/5_gate_sizing"
sh "mv ${datc_rdf_dir}/420_legalization/${sizing_name}_FP/${sizing_name}.plt.gz ${result_dir}/5_gate_sizing"
sh "mv ${datc_rdf_dir}/430_write_def/${sizing_name}_FP/${sizing_name}.def ${result_dir}/5_gate_sizing/"
sh "mv ${datc_rdf_dir}/440_timing/${sizing_name}/out ${result_dir}/5_gate_sizing/timing_report"
sh "gzip ${result_dir}/5_gate_sizing/timing_report/*.spef";
sh "gzip ${result_dir}/5_gate_sizing/timing_report/*.plt";
sh "mv ${datc_rdf_dir}/510_global_route/gr_${routing_name} ${result_dir}/6_global_route"
sh "mv ${datc_rdf_dir}/500_gr_bench_gen/${place_name}.gr ${result_dir}/6_global_route/${place_name}.gr"
} else {
sh "mv ${datc_rdf_dir}/510_global_route/gr_${routing_name} ${result_dir}/5_global_route"
sh "mv ${datc_rdf_dir}/500_gr_bench_gen/${place_name}.gr ${result_dir}/5_global_route/${place_name}.gr"
}
if ( params.run_gs == true) {
sh "cd ${result_dir}/5_gate_sizing; rm *.spef; rm *_final.v; rm *.lib"
}
sh "cd ${result_dir}; gzip 2_bookshelf/*"
sh "cd ${result_dir}; gzip */*.plt; gzip */*.pl; gzip */*.def;"
sh "cd ${result_dir}; gzip */*.v; gzip */*.blif; gzip */*.gr"
sh "find . -name '*.spef' -mtime 0 -type f -exec gzip '{}' \\;"
sh "cd ${result_dir}; gzip *global_route/bookshelf*/*"
sh "echo \"\" > ${result_dir}/${log_name}"
sh "echo \"--------------------------------------------------------------------------------\" >> ${result_dir}/${log_name}"
sh "echo \"Thanks for using DATC Robust Design Flow.\" >> ${result_dir}/${log_name}"
sh "echo \"Results can be found at: \" >> ${result_dir}/${log_name}"
sh "echo \" https://<datc_rdf_web_page>/${result_dir_name}\" >> ${result_dir}/${log_name}"
sh "echo \"--------------------------------------------------------------------------------\" >> ${result_dir}/${log_name}"
sh "echo \"\" >> ${result_dir}/${log_name}"
sh "cd ${log_dir}; for f in {1..100}.log; do if [ -f \$f ]; then cat \$f >> ${result_dir}/${log_name}; fi done;"
sh "echo \"\" >> ${result_dir}/${log_name}"
sh "echo \"\" >> ${result_dir}/${log_name}"
sh "echo \"Done.\" >> ${result_dir}/${log_name}"
sh "echo \"\" >> ${result_dir}/${log_name}"
// Cleanning up the workspace
sh 'cd ${datc_rdf_dir}; ./cleanup.sh'
}
cleanWs()
}
}
}