siliconcompiler 0.29.2__py3-none-any.whl → 0.29.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/sc_install.py +19 -4
- siliconcompiler/core.py +8 -3
- siliconcompiler/flowgraph.py +23 -5
- siliconcompiler/remote/client.py +3 -0
- siliconcompiler/scheduler/__init__.py +30 -12
- siliconcompiler/tools/__init__.py +1 -1
- siliconcompiler/tools/_common/asic.py +3 -0
- siliconcompiler/tools/_common/asic_clock.py +101 -0
- siliconcompiler/tools/bambu/__init__.py +32 -0
- siliconcompiler/tools/bambu/convert.py +93 -11
- siliconcompiler/tools/bluespec/convert.py +2 -1
- siliconcompiler/tools/chisel/convert.py +2 -1
- siliconcompiler/tools/genfasm/bitstream.py +2 -2
- siliconcompiler/tools/ghdl/convert.py +2 -2
- siliconcompiler/tools/gtkwave/show.py +2 -1
- siliconcompiler/tools/icarus/compile.py +2 -2
- siliconcompiler/tools/klayout/drc.py +2 -1
- siliconcompiler/tools/magic/magic.py +1 -1
- siliconcompiler/tools/netgen/lvs.py +2 -1
- siliconcompiler/tools/openroad/_apr.py +16 -4
- siliconcompiler/tools/openroad/fillmetal_insertion.py +0 -1
- siliconcompiler/tools/openroad/init_floorplan.py +7 -1
- siliconcompiler/tools/openroad/macro_placement.py +1 -2
- siliconcompiler/tools/openroad/pin_placement.py +0 -1
- siliconcompiler/tools/openroad/rdlroute.py +2 -2
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +1 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +78 -94
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +12 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +24 -0
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +3 -2
- siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +1 -0
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +4 -13
- siliconcompiler/tools/openroad/scripts/common/write_data.tcl +2 -5
- siliconcompiler/tools/openroad/scripts/common/write_data_physical.tcl +3 -0
- siliconcompiler/tools/openroad/scripts/common/write_data_timing.tcl +1 -0
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +1 -1
- siliconcompiler/tools/opensta/__init__.py +2 -2
- siliconcompiler/tools/opensta/report_libraries.py +2 -2
- siliconcompiler/tools/opensta/timing.py +2 -1
- siliconcompiler/tools/slang/__init__.py +79 -2
- siliconcompiler/tools/slang/elaborate.py +46 -0
- siliconcompiler/tools/slang/lint.py +10 -76
- siliconcompiler/tools/surelog/parse.py +1 -1
- siliconcompiler/tools/sv2v/convert.py +2 -2
- siliconcompiler/tools/template/template.py +2 -2
- siliconcompiler/tools/verilator/verilator.py +3 -1
- siliconcompiler/tools/vivado/vivado.py +2 -1
- siliconcompiler/tools/vpr/place.py +2 -2
- siliconcompiler/tools/vpr/route.py +2 -2
- siliconcompiler/tools/vpr/show.py +2 -1
- siliconcompiler/tools/yosys/__init__.py +26 -23
- siliconcompiler/tools/yosys/procs.tcl +17 -0
- siliconcompiler/tools/yosys/syn_asic.py +20 -65
- siliconcompiler/tools/yosys/syn_asic.tcl +10 -51
- siliconcompiler/toolscripts/_tools.json +4 -4
- siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -0
- siliconcompiler/toolscripts/rhel8/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/rhel8/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/rhel9/install-openroad.sh +34 -0
- siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -0
- siliconcompiler/toolscripts/rhel9/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/rhel9/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -0
- siliconcompiler/toolscripts/ubuntu20/install-surelog.sh +1 -0
- siliconcompiler/toolscripts/ubuntu20/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/ubuntu22/install-surelog.sh +7 -1
- siliconcompiler/toolscripts/ubuntu22/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/ubuntu24/install-bambu.sh +3 -4
- siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -0
- siliconcompiler/toolscripts/ubuntu24/install-surelog.sh +7 -1
- siliconcompiler/toolscripts/ubuntu24/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +1 -1
- siliconcompiler/utils/__init__.py +24 -0
- siliconcompiler/utils/logging.py +67 -0
- {siliconcompiler-0.29.2.dist-info → siliconcompiler-0.29.4.dist-info}/METADATA +8 -8
- {siliconcompiler-0.29.2.dist-info → siliconcompiler-0.29.4.dist-info}/RECORD +80 -75
- siliconcompiler/tools/bambu/bambu.py +0 -32
- {siliconcompiler-0.29.2.dist-info → siliconcompiler-0.29.4.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.29.2.dist-info → siliconcompiler-0.29.4.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.29.2.dist-info → siliconcompiler-0.29.4.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.29.2.dist-info → siliconcompiler-0.29.4.dist-info}/top_level.txt +0 -0
|
@@ -38,44 +38,6 @@ proc get_modules { { find "*" } } {
|
|
|
38
38
|
return [lsort $modules]
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
proc determine_keep_hierarchy { iter cell_limit } {
|
|
42
|
-
global sc_design
|
|
43
|
-
|
|
44
|
-
# Grab only the modules and not the header and footer
|
|
45
|
-
set modules [get_modules]
|
|
46
|
-
|
|
47
|
-
# Save a copy of the current design so we can do a few optimizations and techmap
|
|
48
|
-
yosys design -save hierarchy_checkpoint
|
|
49
|
-
yosys techmap
|
|
50
|
-
yosys opt -fast -full -purge
|
|
51
|
-
|
|
52
|
-
set cell_counts [dict create]
|
|
53
|
-
|
|
54
|
-
foreach module $modules {
|
|
55
|
-
yosys stat -top $module
|
|
56
|
-
yosys echo off
|
|
57
|
-
set cells_count [yosys tee -q -s result.string scratchpad -get stat.num_cells]
|
|
58
|
-
yosys echo on
|
|
59
|
-
dict set cell_counts $module [expr { int($cells_count) }]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
# Restore design
|
|
63
|
-
yosys design -load hierarchy_checkpoint
|
|
64
|
-
foreach module $modules {
|
|
65
|
-
yosys select -module $module
|
|
66
|
-
yosys setattr -mod -set keep_hierarchy \
|
|
67
|
-
[expr { [dict get $cell_counts $module] > $cell_limit }]
|
|
68
|
-
yosys select -clear
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
preserve_modules
|
|
72
|
-
|
|
73
|
-
# Rerun coarse synth with flatten
|
|
74
|
-
yosys synth -flatten -top $sc_design -run coarse:fine
|
|
75
|
-
|
|
76
|
-
return [expr { [llength $modules] != [llength [get_modules]] }]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
41
|
####################
|
|
80
42
|
# DESIGNER's CHOICE
|
|
81
43
|
####################
|
|
@@ -171,11 +133,11 @@ proc get_buffer_cell { } {
|
|
|
171
133
|
########################################################
|
|
172
134
|
|
|
173
135
|
foreach lib_file "$sc_libraries $sc_macro_libraries" {
|
|
174
|
-
yosys read_liberty -lib $lib_file
|
|
136
|
+
yosys read_liberty -setattr liberty_cell -lib $lib_file
|
|
175
137
|
}
|
|
176
138
|
foreach bb_file $sc_blackboxes {
|
|
177
139
|
yosys log "Reading blackbox model file: $bb_file"
|
|
178
|
-
yosys read_verilog -sv $bb_file
|
|
140
|
+
yosys read_verilog -setattr blackbox -sv $bb_file
|
|
179
141
|
}
|
|
180
142
|
|
|
181
143
|
########################################################
|
|
@@ -216,7 +178,6 @@ if {
|
|
|
216
178
|
set sc_tbuf "true"
|
|
217
179
|
|
|
218
180
|
yosys tribuf
|
|
219
|
-
yosys stat
|
|
220
181
|
}
|
|
221
182
|
|
|
222
183
|
set flatten_design [expr {
|
|
@@ -233,6 +194,10 @@ if { [sc_cfg_tool_task_exists file synth_extra_map] } {
|
|
|
233
194
|
}
|
|
234
195
|
}
|
|
235
196
|
|
|
197
|
+
# Specify hierarchy separator
|
|
198
|
+
yosys scratchpad \
|
|
199
|
+
-set flatten.separator "[lindex [sc_cfg_tool_task_get var hierarchy_separator] 0]"
|
|
200
|
+
|
|
236
201
|
# Start synthesis
|
|
237
202
|
yosys synth {*}$synth_args -top $sc_design -run begin:fine
|
|
238
203
|
|
|
@@ -241,18 +206,12 @@ sc_map_memory $sc_memory_libmap_files $sc_memory_techmap_files 0
|
|
|
241
206
|
|
|
242
207
|
# Perform hierarchy flattening
|
|
243
208
|
if { !$flatten_design && [lindex [sc_cfg_tool_task_get var auto_flatten] 0] == "true" } {
|
|
244
|
-
yosys log -push
|
|
245
|
-
yosys log -header "SC Auto flattening"
|
|
246
|
-
set sc_hier_iterations \
|
|
247
|
-
[lindex [sc_cfg_tool_task_get var hier_iterations] 0]
|
|
248
209
|
set sc_hier_threshold \
|
|
249
210
|
[lindex [sc_cfg_tool_task_get var hier_threshold] 0]
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
yosys log -pop
|
|
211
|
+
|
|
212
|
+
yosys keep_hierarchy -min_cost $sc_hier_threshold
|
|
213
|
+
|
|
214
|
+
yosys synth -flatten {*}$synth_args -top $sc_design -run coarse:fine
|
|
256
215
|
}
|
|
257
216
|
|
|
258
217
|
# Finish synthesis
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"openroad": {
|
|
3
3
|
"git-url": "https://github.com/The-OpenROAD-Project/OpenROAD.git",
|
|
4
|
-
"git-commit": "
|
|
4
|
+
"git-commit": "6645a5370f109cff49d7a735d81dae239df387c0",
|
|
5
5
|
"docker-cmds": [
|
|
6
6
|
"# Remove OR-Tools files",
|
|
7
7
|
"RUN rm -f $SC_PREFIX/Makefile $SC_PREFIX/README.md",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"bluespec": {
|
|
34
34
|
"git-url": "https://github.com/B-Lang-org/bsc.git",
|
|
35
|
-
"git-commit": "
|
|
35
|
+
"git-commit": "2024.07",
|
|
36
36
|
"auto-update": false
|
|
37
37
|
},
|
|
38
38
|
"klayout": {
|
|
39
|
-
"version": "0.29.
|
|
39
|
+
"version": "0.29.11",
|
|
40
40
|
"git-url": "https://github.com/KLayout/klayout.git",
|
|
41
41
|
"docker-skip": true,
|
|
42
42
|
"auto-update": true,
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"yosys": {
|
|
93
93
|
"git-url": "https://github.com/YosysHQ/yosys.git",
|
|
94
|
-
"git-commit": "v0.
|
|
94
|
+
"git-commit": "v0.49",
|
|
95
95
|
"version-prefix": "",
|
|
96
96
|
"auto-update": true
|
|
97
97
|
},
|
|
File without changes
|
|
@@ -11,7 +11,13 @@ cd deps
|
|
|
11
11
|
sudo yum group install -y "Development Tools"
|
|
12
12
|
sudo yum install -y gmp-devel xz
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
haskell_args=""
|
|
15
|
+
if [ ! -z ${PREFIX} ]; then
|
|
16
|
+
haskell_args="-d $PREFIX"
|
|
17
|
+
export PATH="$PREFIX:$PATH"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
curl -sSL https://get.haskellstack.org/ | sh -s - -f $haskell_args
|
|
15
21
|
|
|
16
22
|
git clone $(python3 ${src_path}/_tools.py --tool sv2v --field git-url) sv2v
|
|
17
23
|
cd sv2v
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
|
|
6
|
+
|
|
7
|
+
mkdir -p deps
|
|
8
|
+
cd deps
|
|
9
|
+
|
|
10
|
+
git clone $(python3 ${src_path}/_tools.py --tool openroad --field git-url) openroad
|
|
11
|
+
cd openroad
|
|
12
|
+
git checkout $(python3 ${src_path}/_tools.py --tool openroad --field git-commit)
|
|
13
|
+
git submodule update --init --recursive
|
|
14
|
+
|
|
15
|
+
# Install missing dependencies
|
|
16
|
+
sudo yum install -y bison byacc
|
|
17
|
+
|
|
18
|
+
deps_args=""
|
|
19
|
+
if [ ! -z ${PREFIX} ]; then
|
|
20
|
+
deps_args="-prefix=$PREFIX"
|
|
21
|
+
fi
|
|
22
|
+
sudo ./etc/DependencyInstaller.sh $deps_args
|
|
23
|
+
|
|
24
|
+
cmake_args="-DENABLE_TESTS=OFF"
|
|
25
|
+
if [ ! -z ${PREFIX} ]; then
|
|
26
|
+
cmake_args="$cmake_args -DCMAKE_INSTALL_PREFIX=$PREFIX"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
./etc/Build.sh -cmake="$cmake_args"
|
|
30
|
+
|
|
31
|
+
cd build
|
|
32
|
+
sudo make install
|
|
33
|
+
|
|
34
|
+
cd -
|
|
File without changes
|
|
@@ -11,7 +11,13 @@ cd deps
|
|
|
11
11
|
sudo yum group install -y "Development Tools"
|
|
12
12
|
sudo yum install -y gmp-devel xz
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
haskell_args=""
|
|
15
|
+
if [ ! -z ${PREFIX} ]; then
|
|
16
|
+
haskell_args="-d $PREFIX"
|
|
17
|
+
export PATH="$PREFIX:$PATH"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
curl -sSL https://get.haskellstack.org/ | sh -s - -f $haskell_args
|
|
15
21
|
|
|
16
22
|
git clone $(python3 ${src_path}/_tools.py --tool sv2v --field git-url) sv2v
|
|
17
23
|
cd sv2v
|
|
File without changes
|
|
@@ -10,7 +10,13 @@ cd deps
|
|
|
10
10
|
|
|
11
11
|
sudo apt-get install -y curl
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
haskell_args=""
|
|
14
|
+
if [ ! -z ${PREFIX} ]; then
|
|
15
|
+
haskell_args="-d $PREFIX"
|
|
16
|
+
export PATH="$PREFIX:$PATH"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
curl -sSL https://get.haskellstack.org/ | sh -s - -f $haskell_args
|
|
14
20
|
|
|
15
21
|
git clone $(python3 ${src_path}/_tools.py --tool sv2v --field git-url) sv2v
|
|
16
22
|
cd sv2v
|
|
@@ -14,12 +14,18 @@ sudo apt-get install -y build-essential cmake git pkg-config \
|
|
|
14
14
|
mkdir -p deps
|
|
15
15
|
cd deps
|
|
16
16
|
|
|
17
|
+
python3 -m venv .surelog --clear
|
|
18
|
+
. .surelog/bin/activate
|
|
19
|
+
python3 -m pip install --upgrade pip
|
|
20
|
+
python3 -m pip install cmake
|
|
21
|
+
python3 -m pip install orderedmultidict
|
|
22
|
+
|
|
17
23
|
git clone $(python3 ${src_path}/_tools.py --tool surelog --field git-url) surelog
|
|
18
24
|
cd surelog
|
|
19
25
|
git checkout $(python3 ${src_path}/_tools.py --tool surelog --field git-commit)
|
|
20
26
|
git submodule update --init --recursive
|
|
21
27
|
|
|
22
28
|
make -j$(nproc)
|
|
23
|
-
sudo make install
|
|
29
|
+
sudo -E PATH="$PATH" make install
|
|
24
30
|
|
|
25
31
|
cd -
|
|
@@ -10,7 +10,13 @@ cd deps
|
|
|
10
10
|
|
|
11
11
|
sudo apt-get install -y curl
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
haskell_args=""
|
|
14
|
+
if [ ! -z ${PREFIX} ]; then
|
|
15
|
+
haskell_args="-d $PREFIX"
|
|
16
|
+
export PATH="$PREFIX:$PATH"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
curl -sSL https://get.haskellstack.org/ | sh -s - -f $haskell_args
|
|
14
20
|
|
|
15
21
|
git clone $(python3 ${src_path}/_tools.py --tool sv2v --field git-url) sv2v
|
|
16
22
|
cd sv2v
|
|
@@ -12,9 +12,8 @@ sudo apt-get install -y autoconf autoconf-archive automake libtool \
|
|
|
12
12
|
libfl-dev
|
|
13
13
|
sudo apt-get install -y \
|
|
14
14
|
gcc-11 gcc-11-multilib g++-11 g++-11-multilib \
|
|
15
|
-
llvm-
|
|
16
|
-
|
|
17
|
-
clang-11 libclang-11-dev
|
|
15
|
+
llvm-16 llvm-16-dev libllvm16 \
|
|
16
|
+
clang-16 libclang-16-dev
|
|
18
17
|
|
|
19
18
|
mkdir -p deps
|
|
20
19
|
cd deps
|
|
@@ -38,7 +37,7 @@ make -f Makefile.init
|
|
|
38
37
|
mkdir obj
|
|
39
38
|
cd obj
|
|
40
39
|
|
|
41
|
-
../configure --enable-release --disable-flopoco --with-opt-level=2 $args
|
|
40
|
+
CC=$(which gcc-11) CXX=$(which g++-11) ../configure --enable-release --disable-flopoco --with-opt-level=2 $args
|
|
42
41
|
make -j$(nproc)
|
|
43
42
|
make install
|
|
44
43
|
|
|
File without changes
|
|
@@ -14,12 +14,18 @@ sudo apt-get install -y build-essential cmake git pkg-config \
|
|
|
14
14
|
mkdir -p deps
|
|
15
15
|
cd deps
|
|
16
16
|
|
|
17
|
+
python3 -m venv .surelog --clear
|
|
18
|
+
. .surelog/bin/activate
|
|
19
|
+
python3 -m pip install --upgrade pip
|
|
20
|
+
python3 -m pip install cmake
|
|
21
|
+
python3 -m pip install orderedmultidict
|
|
22
|
+
|
|
17
23
|
git clone $(python3 ${src_path}/_tools.py --tool surelog --field git-url) surelog
|
|
18
24
|
cd surelog
|
|
19
25
|
git checkout $(python3 ${src_path}/_tools.py --tool surelog --field git-commit)
|
|
20
26
|
git submodule update --init --recursive
|
|
21
27
|
|
|
22
28
|
make -j$(nproc)
|
|
23
|
-
sudo make install
|
|
29
|
+
sudo -E PATH="$PATH" make install
|
|
24
30
|
|
|
25
31
|
cd -
|
|
@@ -10,7 +10,13 @@ cd deps
|
|
|
10
10
|
|
|
11
11
|
sudo apt-get install -y curl
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
haskell_args=""
|
|
14
|
+
if [ ! -z ${PREFIX} ]; then
|
|
15
|
+
haskell_args="-d $PREFIX"
|
|
16
|
+
export PATH="$PREFIX:$PATH"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
curl -sSL https://get.haskellstack.org/ | sh -s - -f $haskell_args
|
|
14
20
|
|
|
15
21
|
git clone $(python3 ${src_path}/_tools.py --tool sv2v --field git-url) sv2v
|
|
16
22
|
cd sv2v
|
|
@@ -85,6 +85,7 @@ def get_default_iomap():
|
|
|
85
85
|
|
|
86
86
|
# High level languages
|
|
87
87
|
hll_c = ('c', 'cc', 'cpp', 'c++', 'cp', 'cxx', 'hpp', 'h')
|
|
88
|
+
hll_llvm = ('ll',)
|
|
88
89
|
hll_bsv = ('bsv',)
|
|
89
90
|
hll_scala = ('scala',)
|
|
90
91
|
hll_python = ('py',)
|
|
@@ -132,6 +133,7 @@ def get_default_iomap():
|
|
|
132
133
|
# Build default map with fileset and type
|
|
133
134
|
default_iomap = {}
|
|
134
135
|
default_iomap.update({ext: ('hll', 'c') for ext in hll_c})
|
|
136
|
+
default_iomap.update({ext: ('hll', 'llvm') for ext in hll_llvm})
|
|
135
137
|
default_iomap.update({ext: ('hll', 'bsv') for ext in hll_bsv})
|
|
136
138
|
default_iomap.update({ext: ('hll', 'scala') for ext in hll_scala})
|
|
137
139
|
default_iomap.update({ext: ('hll', 'python') for ext in hll_python})
|
|
@@ -461,3 +463,25 @@ def get_hashed_filename(path, package=None, hash=hashlib.sha1):
|
|
|
461
463
|
pathhash = hash(path_to_hash.encode('utf-8')).hexdigest()
|
|
462
464
|
|
|
463
465
|
return f'{filename}_{pathhash}{ext}'
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
def get_cores(chip, physical=False):
|
|
469
|
+
'''
|
|
470
|
+
Get max number of cores for this machine.
|
|
471
|
+
|
|
472
|
+
Args:
|
|
473
|
+
physical (boolean): if true, only count physical cores
|
|
474
|
+
'''
|
|
475
|
+
|
|
476
|
+
cores = psutil.cpu_count(logical=not physical)
|
|
477
|
+
|
|
478
|
+
if not cores:
|
|
479
|
+
cores = os.cpu_count()
|
|
480
|
+
if physical and cores:
|
|
481
|
+
# assume this is divide by 2
|
|
482
|
+
cores = int(cores / 2)
|
|
483
|
+
|
|
484
|
+
if not cores or cores < 1:
|
|
485
|
+
cores = 1
|
|
486
|
+
|
|
487
|
+
return cores
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LoggerFormatter(logging.Formatter):
|
|
6
|
+
def __init__(self, log_formatprefix, level_fmt, message_fmt):
|
|
7
|
+
self.__formats = {}
|
|
8
|
+
|
|
9
|
+
self.add_format(None, log_formatprefix + level_fmt, message_fmt)
|
|
10
|
+
for level in [logging.DEBUG,
|
|
11
|
+
logging.INFO,
|
|
12
|
+
logging.WARNING,
|
|
13
|
+
logging.ERROR,
|
|
14
|
+
logging.CRITICAL]:
|
|
15
|
+
self.add_format(level, log_formatprefix + level_fmt, message_fmt)
|
|
16
|
+
|
|
17
|
+
def format(self, record):
|
|
18
|
+
log_fmt = self.__formats.get(record.levelno)
|
|
19
|
+
if not log_fmt:
|
|
20
|
+
log_fmt = self.__formats.get(None)
|
|
21
|
+
formatter = logging.Formatter(log_fmt)
|
|
22
|
+
return formatter.format(record)
|
|
23
|
+
|
|
24
|
+
def add_format(self, level, level_format, message_format):
|
|
25
|
+
if level == logging.CRITICAL:
|
|
26
|
+
self.__formats[level] = level_format + message_format
|
|
27
|
+
else:
|
|
28
|
+
self.__formats[level] = level_format + " " + message_format
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ColorStreamFormatter(LoggerFormatter):
|
|
32
|
+
'''
|
|
33
|
+
Apply color to stream logger
|
|
34
|
+
'''
|
|
35
|
+
blue = u"\u001b[34m"
|
|
36
|
+
yellow = u"\u001b[33m"
|
|
37
|
+
red = u"\u001b[31m"
|
|
38
|
+
bold_red = u"\u001b[31;1m"
|
|
39
|
+
reset = u"\u001b[0m"
|
|
40
|
+
|
|
41
|
+
def __init__(self, log_formatprefix, level_fmt, message_fmt):
|
|
42
|
+
super().__init__(log_formatprefix, level_fmt, message_fmt)
|
|
43
|
+
|
|
44
|
+
# Replace with colors
|
|
45
|
+
for level, color in [(logging.DEBUG, ColorStreamFormatter.blue),
|
|
46
|
+
(logging.WARNING, ColorStreamFormatter.yellow),
|
|
47
|
+
(logging.ERROR, ColorStreamFormatter.red),
|
|
48
|
+
(logging.CRITICAL, ColorStreamFormatter.bold_red)]:
|
|
49
|
+
if color:
|
|
50
|
+
fmt = log_formatprefix + color + level_fmt + ColorStreamFormatter.reset
|
|
51
|
+
else:
|
|
52
|
+
fmt = log_formatprefix + level_fmt
|
|
53
|
+
|
|
54
|
+
self.add_format(level, fmt, message_fmt)
|
|
55
|
+
|
|
56
|
+
@staticmethod
|
|
57
|
+
def supports_color(handler):
|
|
58
|
+
if not isinstance(handler, logging.StreamHandler):
|
|
59
|
+
return False
|
|
60
|
+
|
|
61
|
+
supported_platform = sys.platform != 'win32'
|
|
62
|
+
try:
|
|
63
|
+
is_a_tty = hasattr(handler.stream, 'isatty') and handler.stream.isatty()
|
|
64
|
+
except: # noqa E722
|
|
65
|
+
is_a_tty = False
|
|
66
|
+
|
|
67
|
+
return supported_platform and is_a_tty
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: siliconcompiler
|
|
3
|
-
Version: 0.29.
|
|
3
|
+
Version: 0.29.4
|
|
4
4
|
Summary: A compiler framework that automates translation from source code to silicon.
|
|
5
5
|
Author-email: Andreas Olofsson <andreas.d.olofsson@gmail.com>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -38,7 +38,7 @@ Requires-Dist: psutil>=5.8.0
|
|
|
38
38
|
Requires-Dist: Pillow==10.4.0; python_version <= "3.8"
|
|
39
39
|
Requires-Dist: Pillow==11.1.0; python_version >= "3.9"
|
|
40
40
|
Requires-Dist: GitPython==3.1.44
|
|
41
|
-
Requires-Dist: lambdapdk>=0.1.
|
|
41
|
+
Requires-Dist: lambdapdk>=0.1.47
|
|
42
42
|
Requires-Dist: PyGithub==2.5.0
|
|
43
43
|
Requires-Dist: urllib3>=1.26.0
|
|
44
44
|
Requires-Dist: fasteners==0.19
|
|
@@ -46,7 +46,7 @@ Requires-Dist: fastjsonschema==2.21.1
|
|
|
46
46
|
Requires-Dist: docker==7.1.0
|
|
47
47
|
Requires-Dist: importlib_metadata; python_version < "3.10"
|
|
48
48
|
Requires-Dist: sc-surelog==1.84.1
|
|
49
|
-
Requires-Dist: orjson==3.10.
|
|
49
|
+
Requires-Dist: orjson==3.10.15
|
|
50
50
|
Requires-Dist: streamlit==1.40.1; python_version <= "3.8"
|
|
51
51
|
Requires-Dist: streamlit==1.41.1; python_version >= "3.9" and python_full_version != "3.9.7"
|
|
52
52
|
Requires-Dist: streamlit_agraph==0.0.45; python_full_version != "3.9.7"
|
|
@@ -58,15 +58,15 @@ Requires-Dist: pytest==8.3.4; extra == "test"
|
|
|
58
58
|
Requires-Dist: pytest-xdist==3.6.1; extra == "test"
|
|
59
59
|
Requires-Dist: pytest-timeout==2.3.1; extra == "test"
|
|
60
60
|
Requires-Dist: pytest-asyncio==0.24.0; python_version <= "3.8" and extra == "test"
|
|
61
|
-
Requires-Dist: pytest-asyncio==0.25.
|
|
61
|
+
Requires-Dist: pytest-asyncio==0.25.3; python_version >= "3.9" and extra == "test"
|
|
62
62
|
Requires-Dist: pytest-cov==5.0.0; python_version <= "3.8" and extra == "test"
|
|
63
63
|
Requires-Dist: pytest-cov==6.0.0; python_version >= "3.9" and extra == "test"
|
|
64
|
-
Requires-Dist: responses==0.25.
|
|
64
|
+
Requires-Dist: responses==0.25.6; extra == "test"
|
|
65
65
|
Requires-Dist: PyVirtualDisplay==3.0; extra == "test"
|
|
66
66
|
Provides-Extra: lint
|
|
67
67
|
Requires-Dist: flake8==7.1.1; extra == "lint"
|
|
68
68
|
Requires-Dist: tclint==0.5.0; extra == "lint"
|
|
69
|
-
Requires-Dist: codespell==2.
|
|
69
|
+
Requires-Dist: codespell==2.4.1; extra == "lint"
|
|
70
70
|
Provides-Extra: docs
|
|
71
71
|
Requires-Dist: Sphinx==8.1.3; extra == "docs"
|
|
72
72
|
Requires-Dist: pip-licenses==5.0.0; extra == "docs"
|
|
@@ -76,7 +76,7 @@ Provides-Extra: profile
|
|
|
76
76
|
Requires-Dist: gprof2dot==2024.6.6; extra == "profile"
|
|
77
77
|
Provides-Extra: examples
|
|
78
78
|
Requires-Dist: migen==0.9.2; extra == "examples"
|
|
79
|
-
Requires-Dist: lambdalib==0.3.
|
|
79
|
+
Requires-Dist: lambdalib==0.3.3; extra == "examples"
|
|
80
80
|
Provides-Extra: optimizer
|
|
81
81
|
Requires-Dist: google-vizier[jax]==0.1.21; python_version >= "3.10" and extra == "optimizer"
|
|
82
82
|
|
|
@@ -195,7 +195,7 @@ python3 -m pip install -e .[docs,test] # Optional install step for generating d
|
|
|
195
195
|
Installation instructions for all external tools can be found in the
|
|
196
196
|
[External Tools](https://docs.siliconcompiler.com/en/stable/user_guide/installation.html#external-tools) section
|
|
197
197
|
of the user guide. We have included shell setup scripts (Ubuntu) for most of the supported tools.
|
|
198
|
-
See the [./
|
|
198
|
+
See the [./siliconcompiler/toolscripts](./siliconcompiler/toolscripts) directory for a complete set of scripts and [./siliconcompiler/toolscripts/_tools.json](./siliconcompiler/toolscripts/_tools.json) for the currently recommended tool versions.
|
|
199
199
|
|
|
200
200
|
# Contributing
|
|
201
201
|
|