Skip to content

Commit cff08df

Browse files
committed
clean code and add openroad install steps in Dockerfile
1 parent 7b73de2 commit cff08df

5 files changed

Lines changed: 69 additions & 17 deletions

File tree

docker/Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ FROM ubuntu:22.04
33
SHELL ["/bin/bash", "-c"]
44

55
ENV DEBIAN_FRONTEND=noninteractive
6-
ENV PATH="/WORK_REPO/verilator/bin:$PATH"
76
ENV VERILATOR_ROOT=/WORK_REPO/verilator
87
ENV PYMTL_VERILATOR_INCLUDE_DIR=/WORK_REPO/verilator/share/verilator/include
98
ENV PATH="/WORK_REPO/CGRA-Flow/tools/sv2v/bin:$PATH"
9+
ENV PATH="/WORK_REPO/CGRA-Flow/tools/oss-cad-suite/bin:$PATH"
10+
ENV YOSYS_EXE="/WORK_REPO/CGRA-Flow/tools/oss-cad-suite/bin/yosys"
11+
ENV OPENROAD_EXE="/usr/bin/openroad"
12+
ENV PATH="/WORK_REPO/verilator/bin:$PATH"
1013

1114
RUN mkdir /WORK_REPO \
1215
&& cd /WORK_REPO \
@@ -77,7 +80,20 @@ RUN mkdir /WORK_REPO \
7780
&& cd /WORK_REPO/CGRA-Flow \
7881
&& mkdir build && cd build \
7982
&& cp ../docker/config.mk ./ \
80-
&& cp ../docker/constraint.sdc ./
83+
&& cp ../docker/constraint.sdc ./ \
84+
# Install OpenROAD
85+
&& cd /WORK_REPO/CGRA-Flow/tools \
86+
&& wget https://github.com/Precision-Innovations/OpenROAD/releases/download/2024-08-05/openroad_2.0_amd64-ubuntu22.04-2024-08-05.deb \
87+
&& wget https://www.klayout.org/downloads/Ubuntu-22/klayout_0.29.6-1_amd64.deb \
88+
&& wget https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2024-09-20/oss-cad-suite-linux-x64-20240920.tgz \
89+
&& apt-get update \
90+
&& apt-get install -y --fix-broken \
91+
&& dpkg -i klayout_0.29.6-1_amd64.deb || true \
92+
&& apt-get install -y --fix-broken \
93+
&& tar zxvf oss-cad-suite-linux-x64-20240920.tgz -C ./ \
94+
&& apt-get install -y ./openroad_2.0_amd64-ubuntu22.04-2024-08-05.deb \
95+
&& apt-get install -y time \
96+
&& rm -f *.deb *.tgz
8197

8298
WORKDIR "/WORK_REPO/CGRA-Flow/build"
8399
#CMD ["/WORK_REPO/venv/bin/python", "../mode_dark_light.py"]

docker/config.mk

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
export PLATFORM = asap7
2+
export DESIGN_NAME = CgraTemplateRTL
3+
export VERILOG_FILES = $(sort $(wildcard ./designs/src/$(DESIGN_NICKNAME)/*.v))
4+
export SDC_FILE = ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc
5+
#export ABC_AREA = 1
6+
export SYNTH_HIERARCHICAL = 1
7+
export RTLMP_FLOW = True
8+
export ENABLE_DPO = True
9+
export CORE_UTILIZATION = 15
10+
export CORE_ASPECT_RATIO = 1
11+
export GPL_ROUTABILITY_DRIVEN = 1
12+
export CORE_MARGIN = 5
13+
export PLACE_DENSITY = 0.3
14+
export TNS_END_PERCENT = 100
15+
export CTS_BUF_CELL = BUFx8_ASAP7_75t_R
16+
#export CTS_BUF_DISTANCE = 10000
17+
# If this design isn't quickly done in detailed routing, something is wrong.
18+
# At time of adding this option, only 12 iterations were needed for 0
19+
# violations.
20+
export DETAILED_ROUTE_ARGS = -bottom_routing_layer M2 -top_routing_layer M9 -save_guide_updates -verbose 1 -droute_end_iter 45
21+
export RECOVER_POWER = 50
22+
# since we are specifying DETAILED_ROUTE_ARGS, we need to communicate the
23+
# same information to other stages in the flow.
24+
export MIN_ROUTING_LAYER = M2
25+
export MAX_ROUTING_LAYER = M9
26+
27+
# works with 28 or more iterations as of writing, so give it a few more.
28+
export GLOBAL_ROUTE_ARGS=-congestion_iterations 40 -verbose
29+
#export FASTROUTE_TCL = ./designs/$(PLATFORM)/TileRTL__286c363070523335/fastroute.tcl
30+
31+
export configure_cts_characterization [-max_slew max_slew][-max_cap max_cap][-slew_steps slew_steps] [-cap_steps cap_steps]
32+
33+
export global_placement [-routability_driven] [-routability_check_overflow routability_check_overflow] [-routability_max_density routability_max_density]
34+
#export detailed_route_debug -dr
35+
export REMOVE_CELLS_FOR_EQY = TAPCELL*

docker/constraint.sdc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
current_design CgraTemplateRTL
2+
3+
set clk_name core_clock
4+
set clk_port_name clk
5+
set clk_period 1000000
6+
set clk_io_pct 0.2
7+
8+
set clk_port [get_ports $clk_port_name]
9+
10+
create_clock -name $clk_name -period $clk_period $clk_port
11+
12+
set non_clock_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]
13+
14+
set_input_delay [expr $clk_period * $clk_io_pct] -clock $clk_name $non_clock_inputs
15+
set_output_delay [expr $clk_period * $clk_io_pct] -clock $clk_name [all_outputs]
16+

docker/openroad_urls.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

mode_dark_light.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -793,12 +793,6 @@ def clickShowDFG():
793793
"enablePowerGating" : False
794794
}
795795

796-
# json_object = json.dumps(genDFGJson, indent=4)
797-
798-
# with open("param.json", "w") as outfile:
799-
# outfile.write(json_object)
800-
801-
# dumpCgraParam2JSON("paramCGRA.json")
802796
dumpCgraParam2JSON("param.json", genDFGJson)
803797

804798
genDFGCommand = "opt-12 -load ../../CGRA-Mapper/build/src/libmapperPass.so -mapperPass ./kernel.bc"
@@ -1053,12 +1047,6 @@ def clickMapDFG():
10531047
"enablePowerGating" : False,
10541048
}
10551049

1056-
# mappingJsonObject = json.dumps(mappingJson, indent=4)
1057-
1058-
# with open("param.json", "w") as outfile:
1059-
# outfile.write(mappingJsonObject)?
1060-
1061-
# dumpCgraParam2JSON("paramCGRA.json")
10621050
dumpCgraParam2JSON("param.json", mappingJson)
10631051

10641052
mappingCommand = "opt-12 -load ../../CGRA-Mapper/build/src/libmapperPass.so -mapperPass ./kernel.bc"

0 commit comments

Comments
 (0)