Skip to content

Commit 82b720d

Browse files
authored
Merge pull request #473 from SymbiFlow/upstream_sync
Upstream sync
2 parents 253f75b + edfdfa0 commit 82b720d

File tree

234 files changed

+7881
-2107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+7881
-2107
lines changed

.gitattributes

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,34 @@
2020
abc/** -text
2121
abc_with_bb_support/** -text
2222
libs/EXTERNAL/** -text
23+
24+
# Settings to improve linguist data reporting (used by GitHub)
25+
#-------------------------------------------------------------------------
26+
*.v linguist-language=Verilog
27+
*.vh linguist-language=Verilog
28+
*.pv linguist-language=Verilog
29+
*.pl linguist-language=Perl
30+
*.sp linguist-language=Spice
31+
*.pm linguist-language=Spice
32+
33+
# External ABC
34+
abc/** linguist-vendored
35+
abc_with_bb_support/** linguist-vendored
36+
# External libraries
37+
libs/EXTERNAL/** linguist-vendored
38+
# External benchmarks imported into vtr_flow benchmark suite.
39+
vtr_flow/benchmarks/** linguist-vendored
40+
vtr_flow/scripts/perl_libs/** linguist-vendored
41+
# External benchmarks imported into ODIN_II benchmark suite.
42+
ODIN_II/regression_test/benchmark/verilog/large/** linguist-vendored
43+
ODIN_II/regression_test/benchmark/verilog/full/** linguist-vendored
44+
ODIN_II/regression_test/benchmark/verilog/FIR/** linguist-vendored
45+
46+
# Documentation
47+
doc/** linguist-documentation
48+
*.txt linguist-documentation
49+
*.md linguist-documentation
50+
*.rst linguist-documentation
51+
52+
# Generated files
53+
vpr/src/route/gen/** linguist-generated

.travis.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
version: ~> 1.0
12
language: cpp
23

34
dist: trusty
45
addons:
56
apt:
67
sources:
7-
- george-edison55-precise-backports # For cmake
8-
- llvm-toolchain-precise-3.6
9-
- llvm-toolchain-trusty-6.0
10-
- llvm-toolchain-trusty-7 # For clang-format-7
11-
- llvm-toolchain-trusty-8
12-
- ubuntu-toolchain-r-test
8+
- sourceline: 'ppa:george-edison55/precise-backports' # For cmake
9+
- sourceline: 'deb http://apt.llvm.org/precise llvm-toolchain-precise-3.6 main'
10+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
11+
- sourceline: 'deb http://apt.llvm.org/trusty llvm-toolchain-trusty-6.0 main'
12+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
13+
- sourceline: 'deb http://apt.llvm.org/trusty llvm-toolchain-trusty-7 main' # For clang-format-7
14+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
15+
- sourceline: 'deb http://apt.llvm.org/trusty llvm-toolchain-trusty-8 main'
16+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
17+
- sourceline: 'ppa:ubuntu-toolchain-r/test'
1318
packages:
1419
- autoconf
1520
- automake
@@ -47,8 +52,6 @@ addons:
4752
- qt5-default
4853
- clang-format-7
4954
# All the compilers!
50-
- g++-4.9
51-
- gcc-4.9
5255
- g++-5
5356
- gcc-5
5457
- g++-6
@@ -112,7 +115,7 @@ jobs:
112115
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
113116
script:
114117
- ./.github/travis/build.sh
115-
- ./run_reg_test.pl vtr_reg_basic -show_failures -j2
118+
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
116119
- stage: Test
117120
name: "Strong Regression Tests"
118121
env:
@@ -128,7 +131,8 @@ jobs:
128131
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
129132
script:
130133
- ./.github/travis/build.sh
131-
- ./run_reg_test.pl vtr_reg_valgrind_small -show_failures -j2
134+
- travis_wait 30 ./run_reg_test.pl vtr_reg_valgrind_small -show_failures -j2
135+
- stage: Test
132136
name: "Sanitized Basic Regression Tests"
133137
env:
134138
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=on -DVTR_IPO_BUILD=off -DWITH_BLIFEXPLORER=on"

ODIN_II/SRC/include/Hashtable.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <stdlib.h>
2727
#include <stdint.h>
2828
#include <unordered_map>
29+
#include <string>
2930

3031
class Hashtable {
3132
private:

README.developers.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,77 @@ $ make
751751
```
752752
this turns on more extensive assertion checking and re-builds VTR.
753753
754+
## GDB Pretty Printers
755+
To make it easier to debug some of VTR's data structures with [GDB](www.gnu.org/gdb).
756+
757+
### STL Pretty Printers
758+
759+
It is helpful to enable [STL pretty printers](https://sourceware.org/gdb/wiki/STLSupport), which make it much easier to debug data structures using STL.
760+
761+
For example printing a `std::vector<int>` by default prints:
762+
763+
(gdb) p/r x_locs
764+
$2 = {<std::_Vector_base<int, std::allocator<int> >> = {
765+
_M_impl = {<std::allocator<int>> = {<__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>}, _M_start = 0x555556f063b0,
766+
_M_finish = 0x555556f063dc, _M_end_of_storage = 0x555556f064b0}}, <No data fields>}
767+
768+
which is not very helpful.
769+
770+
But with STL pretty printers it prints:
771+
772+
(gdb) p x_locs
773+
$2 = std::vector of length 11, capacity 64 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
774+
775+
which is much more helpful for debugging!
776+
777+
If STL pretty printers aren't already enabled on your system, add the following to your [.gdbinit file](https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html):
778+
779+
python
780+
import sys
781+
sys.path.insert(0, '$STL_PRINTER_ROOT')
782+
from libstdcxx.v6.printers import register_libstdcxx_printers
783+
register_libstdcxx_printers(None)
784+
785+
end
786+
787+
where `$STL_PRINTER_ROOT` should be replaced with the appropriate path to the STL pretty printers.
788+
For example recent versions of GCC include these under `/usr/share/gcc-*/python` (e.g. `/usr/share/gcc-9/python`)
789+
790+
791+
### VTR Pretty Printers
792+
793+
VTR includes some pretty printers for some VPR/VTR specific types.
794+
795+
For example, without the pretty printers you would see the following when printing a VPR `AtomBlockId`:
796+
797+
(gdb) p blk_id
798+
$1 = {
799+
id_ = 71
800+
}
801+
802+
But with the VTR pretty printers enabled you would see:
803+
804+
(gdb) p blk_id
805+
$1 = AtomBlockId(71)
806+
807+
To enable the VTR pretty printers in GDB add the following to your [.gdbinit file](https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html):
808+
809+
python
810+
import sys
811+
812+
sys.path.insert(0, "$VTR_ROOT/dev")
813+
import vtr_gdb_pretty_printers
814+
gdb.pretty_printers.append(vtr_gdb_pretty_printers.vtr_type_lookup)
815+
816+
end
817+
818+
where ``$VTR_ROOT`` should be replaced with the root of the VTR source tree on your system.
819+
820+
## RR (Record Replay) Debugger
821+
822+
[RR](https://rr-project.org/) extends GDB with the ability to to record a run of a tool and then re-run it to reproduce any observed issues.
823+
RR also enables efficient reverse execution (!) which can be *extremely helpful* when tracking down the source of a bug.
824+
754825
# External Subtrees
755826
VTR includes some code which is developed in external repositories, and is integrated into the VTR source tree using [git subtrees](https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree).
756827

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ VTR includes a set of benchmark designs known to work with the design flow.
2323

2424
VTR can also produce [FASM](https://symbiflow.readthedocs.io/en/latest/fasm/docs/specification.html) to program some commercial FPGAs (via [Symbiflow](https://symbiflow.github.io/))
2525

26+
| Placement (carry-chains highlighted) | Critical Path |
27+
| ------------------------------------ | ------------- |
28+
| <img src="https://verilogtorouting.org/img/des90_placement_macros.gif" width="350"/> | <img src="https://verilogtorouting.org/img/des90_cpd.gif" width="350"/> |
29+
30+
| Logical Connections | Routing Utilziation |
31+
| ------------------- | ------------------- |
32+
| <img src="https://verilogtorouting.org/img/des90_nets.gif" width="350"/> | <img src="https://verilogtorouting.org/img/des90_routing_util.gif" width="350"/> |
33+
34+
2635
## Documentation
2736
VTR's [full documentation](https://docs.verilogtorouting.org) includes tutorials, descriptions of the VTR design flow, and tool options.
2837

dev/vpr_animate.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import sys
5+
6+
GRAPHICS_COMMAND = "set_draw_block_outlines 0; set_draw_block_text 0; save_graphics img_{i}_place.png; set_macros 1; save_graphics img_{i}_macros.png; set_macros 0; set_draw_net_max_fanout 1000; set_nets 1; save_graphics img_{i}_nets1.png; set_nets 2; save_graphics img_{i}_nets2.png; set_nets 0; set_cpd 1; save_graphics img_{i}_cpd1.png; set_cpd 2; save_graphics img_{i}_cpd2.png; set_cpd 0; set_routing_util 4; set_clip_routing_util 1; save_graphics img_{i}_routing_util4.png; set_routing_util 0; set_congestion 1; save_graphics img_{i}_congestion2.png; exit 0;"
7+
8+
def parse_args():
9+
parser = argparse.ArgumentParser()
10+
11+
parser.add_argument("vpr")
12+
parser.add_argument("arch")
13+
parser.add_argument("circuit")
14+
parser.add_argument("--gen_state", action="store_true", default=False)
15+
parser.add_argument("--gen_frames", action="store_true", default=False)
16+
parser.add_argument("--render", action="store_true", default=False)
17+
parser.add_argument("--placements", nargs="+")
18+
parser.add_argument("--routings", nargs="+")
19+
20+
return parser.parse_known_args()
21+
22+
def main():
23+
args, extra_args = parse_args()
24+
25+
vpr_base_cmd = "{} {} {} --route_chan_width 300 --max_router_iterations 400 --router_lookahead map --verify_file_digests off --save_graphics on".format(args.vpr, args.arch, args.circuit)
26+
27+
for arg in extra_args:
28+
vpr_base_cmd += " " + arg
29+
30+
if args.gen_state:
31+
vpr_cmd = vpr_base_command + "--write_rr_graph rr_graph.bin --write_placement_delay_lookup placement_delay_lookup.bin --write_router_lookahead router_lookahead.bin"
32+
33+
print(vpr_cmd)
34+
35+
if args.gen_frames:
36+
i = 0
37+
for placement in args.placements:
38+
cmd = '/usr/bin/time -v ' + vpr_base_cmd + " --place_file " + placement + " --read_rr_graph rr_graph.bin --read_placement_delay_lookup placement_delay_lookup.bin --read_router_lookahead router_lookahead.bin "
39+
cmd += " --route"
40+
cmd += " --graphics_commands '{}'".format(GRAPHICS_COMMAND.format(i=i))
41+
cmd += " >& vpr_img_{}.log".format(i)
42+
cmd += " && echo 'Finished {}' || echo 'Failed {}'".format(i, i)
43+
print(cmd)
44+
i += 1
45+
46+
for routing in args.routings:
47+
cmd = '/usr/bin/time -v ' + vpr_base_cmd + " --place_file " + args.placements[-1] + " --read_rr_graph rr_graph.bin --read_placement_delay_lookup placement_delay_lookup.bin --read_router_lookahead router_lookahead.bin "
48+
cmd += " --route_file " + routing + " --analysis"
49+
cmd += " --graphics_commands '{}'".format(GRAPHICS_COMMAND.format(i=i))
50+
cmd += " >& vpr_img_{}.log".format(i)
51+
cmd += " && echo 'Finished {}' || echo 'Failed {}'".format(i, i)
52+
print(cmd)
53+
i += 1
54+
55+
num_frames = len(args.placements) + len(args.routings)
56+
57+
run_time = 20
58+
59+
fps = num_frames / run_time
60+
61+
if args.render:
62+
# cmd = "ffmpeg -y -pattern_type sequence -i 'img_%d_{inmetric}.png' -map_metadata -1 -vf scale=402:300:flags=lanczos -b:v 0 -crf 24 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -t 15 {out}.mp4"
63+
64+
#Scale in raw format to lower resolution
65+
cmd_hq_yuv = "ffmpeg -y -framerate {fps} -pattern_type sequence -i 'img_%d_{inmetric}.png' -vf scale=640:480:flags=lanczos -vcodec rawvideo -pix_fmt yuv420p raw_hq_{out}.yuv"
66+
cmd_lq_yuv = "ffmpeg -y -framerate {fps} -pattern_type sequence -i 'img_%d_{inmetric}.png' -vf scale=250:186:flags=lanczos -vcodec rawvideo -pix_fmt yuv420p raw_lq_{out}.yuv"
67+
68+
#Encode skipping every other frame (select=)
69+
cmd_hq = cmd_hq_yuv + " && ffmpeg -y -framerate {fps2} -s 640x480 -i raw_hq_{out}.yuv -b:v 0 -crf 24 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -ss 0 -filter:v select=\"mod(n-1\,2)\" {out}.mp4"
70+
cmd_mq = cmd_hq_yuv + " && ffmpeg -y -framerate {fps2} -s 640x480 -i raw_hq_{out}.yuv -b:v 0 -crf 28 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -ss 0 -filter:v select=\"mod(n-1\,2)\" {out}.mp4"
71+
cmd_lq = cmd_hq_yuv + " && ffmpeg -y -framerate {fps2} -s 640x480 -i raw_hq_{out}.yuv -b:v 0 -crf 34 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -ss 0 -filter:v select=\"mod(n-1\,2)\" {out}.mp4"
72+
73+
# cmd_hq = "ffmpeg -y -framerate {fps} -pattern_type sequence -i 'img_%d_{inmetric}.png' -map_metadata -1 -vf scale=536:400:flags=lanczos -b:v 0 -crf 24 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -ss 0 {out}.mp4"
74+
# cmd_mq = "ffmpeg -y -framerate {fps} -pattern_type sequence -i 'img_%d_{inmetric}.png' -map_metadata -1 -vf scale=536:400:flags=lanczos -b:v 0 -crf 28 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -ss 0 {out}.mp4"
75+
# cmd_lq = "ffmpeg -y -framerate {fps} -pattern_type sequence -i 'img_%d_{inmetric}.png' -map_metadata -1 -vf scale=536:400:flags=lanczos -b:v 0 -crf 34 -f mp4 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -preset veryslow -tune animation -an -ss 0 {out}.mp4"
76+
77+
#For GIF use only half of frames (select) at lower resolution and skip 2 seconds (-ss 2) at beginning
78+
cmd_gif = "ffmpeg -y -framerate {fps} -pattern_type sequence -i 'img_%d_{inmetric}.png' -vf scale=250:186:flags=lanczos -vcodec rawvideo -pix_fmt yuv420p raw_gif_{out}.yuv && ffmpeg -y -framerate {fps2} -s 250x186 -i raw_gif_{out}.yuv -ss 2 -filter:v select=\"mod(n-1\,2)\" {out}.gif"
79+
80+
#AV1
81+
# cmd = "ffmpeg -y -framerate 30 -pattern_type sequence -i 'img_%d_{inmetric}.png' -map_metadata -1 -vf scale=644:480 -b:v 0 -crf 50 -f mp4 -c:v libaom-av1 -pix_fmt yuv420p -movflags +faststart -strict experimental {out}.av1.mp4"
82+
83+
for inval, outval in [('macros', 'placement_macros'), ('cpd1', 'cpd'), ('routing_util4', 'routing_util'), ('nets2', 'nets')]:
84+
if 'nets' in inval:
85+
print(cmd_lq.format(inmetric=inval, out=outval, fps=fps, fps2=2*fps))
86+
elif 'routing_util' in inval:
87+
print(cmd_mq.format(inmetric=inval, out=outval, fps=fps, fps2=2*fps))
88+
else:
89+
print(cmd_hq.format(inmetric=inval, out=outval, fps=fps, fps2=2*fps))
90+
print(cmd_gif.format(inmetric=inval, out=outval, fps=fps, fps2=2*fps))
91+
92+
if __name__ == "__main__":
93+
main()

0 commit comments

Comments
 (0)