Skip to content

Vtr flow script py rewrite #1429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 98 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
0e44b39
copied over old python scripts, fixed a spelling error with is_exacut…
shadtorrie May 4, 2020
d5b6f90
Fixing more instances of misspelt is_executable
shadtorrie May 4, 2020
9d8f9d8
vtr-flow.py: switch the old --work_dir to the new -temp_dir as used o…
shadtorrie May 7, 2020
430ac0d
enabled blackbox iterative flow for multi-clock circuits
shadtorrie May 12, 2020
6ee55ab
flow.py: replaced os.path to pathlib.path, vtr-flow.py: replaced and …
shadtorrie May 13, 2020
f503d6c
vtr-flow.py:fixed arguments to match the current ones on master
shadtorrie May 13, 2020
329607c
Reorganized and renamed scripts/python_libs/verilogtorouting and fixe…
shadtorrie May 16, 2020
8102fc5
fixing minor import issue
shadtorrie May 16, 2020
8d3b29d
replaced os with pathlib in vtr-task, vtr-flow, flow and util, also f…
shadtorrie May 19, 2020
ea28ed6
upgraded vtr-flow, vtr-test and vtr-task to python3 also made the pyt…
shadtorrie May 20, 2020
476a894
Adding unit testing for new run vtr flow py script
jgoeders May 21, 2020
3dcb940
Reorganized abc arguments and fixed error handling
shadtorrie May 21, 2020
092ea95
Fix py version bug in check_py_vtr_flow
jgoeders May 21, 2020
dfbce12
Add python3 to travis
jgoeders May 21, 2020
abbb41f
Update chekc_py_vtr_flow to use python3.6
jgoeders May 21, 2020
5410b07
New ppa source for travis-ci and python3.6
jgoeders May 21, 2020
3f048cb
check_py_vtr_flow to use python3.6
jgoeders May 21, 2020
c9c11c2
travis-ci for py scripts needs to run build first
jgoeders May 21, 2020
003b416
Merge branch 'jbg_travis_for_py_scripts' into vtr_script_py_rewrite
shadtorrie May 22, 2020
d270635
vtr-flow.py:fixing track_memory_usage issue
shadtorrie May 22, 2020
3eddd97
Merge pull request #2 from verilog-to-routing/master
jgoeders May 22, 2020
a6ab0d9
Enabling Power estimation by fixing ACE script. also enabled the -del…
shadtorrie May 29, 2020
a860661
adding comments to abc script
shadtorrie May 29, 2020
2f5561c
adding name argument and show_failures, show_failures still needs to …
shadtorrie May 29, 2020
c7fb72f
Updating regression tests to work with python scripts and adding pyth…
shadtorrie May 30, 2020
e41cbcf
fixing pathlib issue
shadtorrie May 30, 2020
b01651c
Merge branch 'vtr_script_py_rewrite' into st_travis_for_py
shadtorrie May 30, 2020
fe0812c
adding compatibility in python scripts to accept pathlib files or str…
shadtorrie May 30, 2020
170d0d9
enabled show_failures in vtr-flow.py
shadtorrie Jun 1, 2020
808fb1e
Creating better file validation
shadtorrie Jun 1, 2020
3c583c7
Merge branch 'vtr_script_py_rewrite' into st_travis_for_py
shadtorrie Jun 1, 2020
4d61c7d
Fixing issue that thought output files should exist before they should
shadtorrie Jun 2, 2020
4385a54
fixing issue that was causing the tests to only be run on the perl sc…
shadtorrie Jun 2, 2020
a17904f
Merge branch 'vtr_script_py_rewrite' into st_travis_for_py
shadtorrie Jun 2, 2020
130cddc
lining up output with original scripts.
shadtorrie Jun 2, 2020
5c8edec
Merge branch 'vtr_script_py_rewrite' into st_travis_for_py
shadtorrie Jun 2, 2020
bab4a89
fixing one last output difference
shadtorrie Jun 2, 2020
3d0708d
Merge branch 'vtr_script_py_rewrite' into st_travis_for_py
shadtorrie Jun 2, 2020
c0c222d
fixing file name issues on the python script. Also made the python sc…
shadtorrie Jun 24, 2020
ba96eb3
adding missing ODIN II arguments.
shadtorrie Jun 25, 2020
f1b2c88
added crit_path_router_iterations argument and used it to impliment t…
shadtorrie Jun 25, 2020
fec5ad2
Adding lut_size argument and making extra abc and odin arguments clea…
shadtorrie Jun 25, 2020
0428050
Added check_equivalent argument and enabled it. Fixed issue with temp…
shadtorrie Jun 26, 2020
7eba52d
fixing default issue
shadtorrie Jun 26, 2020
feef3dd
fixed the eblif issue
shadtorrie Jun 26, 2020
5464661
added and enabled arguments fix_pins, verify_rr_graph, rr_graph_ext, …
shadtorrie Jun 29, 2020
e92a551
fixing issue with routing argument
shadtorrie Jun 29, 2020
80f657c
fixing sdc_file issue and fixing timing issue
shadtorrie Jun 30, 2020
308e413
fixed sdc issue with format of input
shadtorrie Jun 30, 2020
481ea92
fixed an issue with max_router_iterations
shadtorrie Jun 30, 2020
01b5bd8
reverted changes from last commit, fixed an route_chan_width issue, f…
shadtorrie Jul 2, 2020
70b2096
added valgrind functionality
shadtorrie Jul 2, 2020
d0e31b0
fixed num_clb issue
shadtorrie Jul 2, 2020
51758f3
fixing valgrind file error
shadtorrie Jul 2, 2020
39a10c2
rename vtr-flow.py to run_vtr_flow.py, added missing arguments, and a…
shadtorrie Jul 9, 2020
ce6baae
updating documentation to use the python script
shadtorrie Jul 9, 2020
b6f36ec
Merge pull request #3 from verilog-to-routing/master
jgoeders Jul 10, 2020
35be0d4
adding auto doc to the python library and fixing various minor issues.
shadtorrie Jul 10, 2020
a7ffe98
fixing merge conflict
shadtorrie Jul 10, 2020
f987b87
adding check_incremental_sta_consistency argument and functionality, …
shadtorrie Jul 11, 2020
dd5cd2a
fixed format issue
shadtorrie Jul 11, 2020
16eed5e
fixed issue where if there was a syntax error, the test said it passed.
shadtorrie Jul 13, 2020
f21b0ba
added auto doc to cmp_full_vs_incr_STA function
shadtorrie Jul 13, 2020
4213846
remove vtr-task.py and vtr-test.py because I didn't actually work on …
shadtorrie Jul 13, 2020
be7f2ab
cleaning up random comments and fixing possible minor future bugs
shadtorrie Jul 13, 2020
0a20e74
fixing small syntax error
shadtorrie Jul 14, 2020
57c3c4c
fixing verify file issue
shadtorrie Jul 14, 2020
1cdca8e
removed parse and task functionality to be implemented later
shadtorrie Jul 14, 2020
cf1da8a
removed dulicate tests and unnecessary test
shadtorrie Jul 15, 2020
1a64094
removing accidental change
shadtorrie Jul 15, 2020
b63446c
adding newline to end of files
shadtorrie Jul 16, 2020
c7f965d
moved python_lib documentation to be in masters documentation
shadtorrie Jul 17, 2020
ba2312b
fixed file default name
shadtorrie Jul 20, 2020
8a9a4a7
made circuit_name optional argument to vpr
shadtorrie Jul 20, 2020
f7c965f
fixing circuit_name issue
shadtorrie Jul 20, 2020
fc27438
fixing two small bugs
shadtorrie Jul 20, 2020
dab68f8
fixed verbosity confusion and fixed abc_flow_type variable
shadtorrie Jul 20, 2020
b04f235
fixing help message
shadtorrie Jul 21, 2020
a0c6fcd
replacing enum with python enum. replacing mkdir_p with Pathlib.mkdir…
shadtorrie Jul 22, 2020
bbc43f6
cleaned up util.py for pylint
shadtorrie Jul 23, 2020
0e39c90
Switch travis python to 3.6
jgoeders Jul 23, 2020
6ac6562
merged python3.6
shadtorrie Jul 23, 2020
1b99792
Merge remote-tracking branch 'upstream/master'
jgoeders Jul 23, 2020
b1fc0a0
cleaning up error.py and inspect.py for pylint, also removing task fu…
shadtorrie Jul 23, 2020
4b05c8e
actually fixing error.py to pass pylint
shadtorrie Jul 23, 2020
4c78c00
fixed lec issue
shadtorrie Jul 24, 2020
e1d3522
fixed expected fail issue
shadtorrie Jul 24, 2020
fd11257
enabling all of the python library to pass pylint
shadtorrie Jul 24, 2020
b3eecd8
fixing enumerate issue
shadtorrie Jul 27, 2020
c2f12b4
merging master and resolving conflict.
shadtorrie Jul 27, 2020
dbd8d93
fixing accedental change with merge conflict
shadtorrie Jul 27, 2020
e825e21
made errors accept variable arguments
shadtorrie Jul 27, 2020
07c94f9
cleaned up pathlib path
shadtorrie Jul 27, 2020
ce43aa5
fixing args issue
shadtorrie Jul 28, 2020
b02b137
fixed doc to only show important function descriptions
shadtorrie Jul 28, 2020
6ae36da
cleaning up error reporting
shadtorrie Jul 28, 2020
dc4bfec
fixing pylint issue
shadtorrie Jul 28, 2020
a804275
Added error handling if architecture file is not xml
shadtorrie Jul 28, 2020
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ addons:
- sourceline: 'deb http://apt.llvm.org/trusty llvm-toolchain-trusty-8 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'ppa:deadsnakes/ppa' # For python3.6
packages:
- autoconf
- automake
Expand Down Expand Up @@ -44,6 +45,7 @@ addons:
- libxml++2.6-dev
- perl
- python
- python3.6
- python-lxml
- texinfo
- time
Expand Down
6 changes: 3 additions & 3 deletions dev/tutorial/NewDeveloperTutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ Task #5 - Open the Black Box

1. Using the custom Verilog circuit and architecture created in Task #4,
directly run Odin II on it to generate a blif netlist. You may need to skim the Odin II
readme file and the vtr_flow/scripts/run_vtr_flow.pl.
readme file and the vtr_flow/scripts/run_vtr_flow.py.

2. Using the output netlist of Odin II, run ABC to generate a technology-mapped blif file.
You may need to skim vtr_flow/scripts/run_vtr_flow.pl.
You may need to skim vtr_flow/scripts/run_vtr_flow.py.

3. Using the output of ABC, run VPR to complete the mapping of a user circuit
to a target architecture. You may need to consult the VPR User Manual and skim
You may need to skim vtr_flow/scripts/run_vtr_flow.pl.
You may need to skim vtr_flow/scripts/run_vtr_flow.py.

4. Read the VPR section of the online documentation.

Expand Down
6 changes: 5 additions & 1 deletion doc/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import recommonmark

sys.path.append(".")
sys.path.insert(0, os.path.abspath('../../vtr_flow/scripts/python_libs'))
from markdown_code_symlinks import LinkParser, MarkdownSymlinksDomain

# Cool looking ReadTheDocs theme
Expand Down Expand Up @@ -58,13 +59,16 @@
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.imgmath',
'sphinx.ext.napoleon',
'sphinx.ext.coverage',
'breathe',
'notfound.extension',
'sphinx_markdown_tables',
'sdcdomain',
'archdomain',
'rrgraphdomain',
'recommonmark'
'recommonmark',
'sphinx.ext.autodoc'
]

if have_sphinxcontrib_bibtex:
Expand Down
2 changes: 1 addition & 1 deletion doc/src/dev/tutorials/new_developer_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Open the Black Box

At this stage, you have gotten a taste of how an FPGA architect would go about using VTR. As a developer though, you need a much deeper understanding of how this tool works. The purpose of this section is to have you to learn the details of the VTR CAD flow by having you manually do what the scripts do.

Using the custom Verilog circuit and architecture created in the previous step, directly run Odin II on it to generate a blif netlist. You may need to skim the ``ODIN_II/README.rst`` and the ``vtr_flow/scripts/run_vtr_flow.pl``.
Using the custom Verilog circuit and architecture created in the previous step, directly run Odin II on it to generate a blif netlist. You may need to skim the ``ODIN_II/README.rst`` and the ``vtr_flow/scripts/run_vtr_flow.py``.

Using the output netlist of Odin II, run ABC to generate a technology-mapped blif file. You may need to skim the ABC homepage (http://www.eecs.berkeley.edu/~alanmi/abc/).

Expand Down
2 changes: 1 addition & 1 deletion doc/src/tutorials/flow/basic_flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The following steps show you to run the VTR design flow to map a sample circuit

Some also contain a ``golden_results.txt`` file that is used by the scripts to check for correctness.

The ``vtr_release/vtr_flow/scripts/run_vtr_flow.pl`` script describes the CAD flow employed in the test.
The ``vtr_release/vtr_flow/scripts/run_vtr_flow.py`` script describes the CAD flow employed in the test.
You can modify the flow by editing this script.

At this point, feel free to run any of the tasks pre-pended with "regression".
Expand Down
1 change: 1 addition & 0 deletions doc/src/vtr/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ VTR also includes a set of benchmark designs known to work with the design flow.
parse_vtr_task
parse_config
pass_requirements
python_libs/vtr



4 changes: 2 additions & 2 deletions doc/src/vtr/power_estimation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ The easiest way to run the VTR flow is to use the :ref:`run_vtr_flow` script.

In order to perform power estimation, you must add the following options:

* :option:`run_vtr_flow.pl -power`
* :option:`run_vtr_flow.pl -cmos_tech` ``<cmos_tech_properties_file>``
* :option:`run_vtr_flow.py -power`
* :option:`run_vtr_flow.py -cmos_tech` ``<cmos_tech_properties_file>``

The CMOS technology properties file is an XML file that contains relevant process-dependent information needed for power estimation.
XML files for 22nm, 45nm, and 130nm PTM models can be found here::
Expand Down
38 changes: 38 additions & 0 deletions doc/src/vtr/python_libs/vtr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _python_libs/vtr:

VTR Flow Python library
-----------------------
The VTR flow can be imported and implemented as a python library. Below are the descriptions of the useful functions.

VTR flow
========
.. automodule:: vtr.flow
:members: run

ODIN II
=======

.. automodule:: vtr.odin.odin
:members:

ABC
===

.. automodule:: vtr.abc.abc
:members:

ACE
===

.. automodule:: vtr.ace.ace
:members:

VPR
===

.. automodule:: vtr.vpr.vpr
:members:

.. toctree::
:maxdepth: 2
:caption: Contents:
20 changes: 10 additions & 10 deletions doc/src/vtr/run_vtr_flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ This script runs the VTR flow for a single benchmark circuit and architecture fi

The script is located at::

$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.pl
$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.py

.. program:: run_vtr_flow.pl
.. program:: run_vtr_flow.py

Basic Usage
~~~~~~~~~~~

At a minimum ``run_vtr_flow.pl`` requires two command-line arguments::
At a minimum ``run_vtr_flow.py`` requires two command-line arguments::

run_vtr_flow.pl <circuit_file> <architecture_file>
run_vtr_flow.py <circuit_file> <architecture_file>

where:

Expand Down Expand Up @@ -44,20 +44,20 @@ The script will also produce an output files (\*.out) for each stage, containing
Advanced Usage
~~~~~~~~~~~~~~

Additional *optional* command arguments can also be passed to ``run_vtr_flow.pl``::
Additional *optional* command arguments can also be passed to ``run_vtr_flow.py``::

run_vtr_flow.pl <circuit_file> <architecture_file> [<options>] [<vpr_options>]
run_vtr_flow.py <circuit_file> <architecture_file> [<options>] [<vpr_options>]

where:

* ``<options>`` are additional arguments passed to ``run_vtr_flow.pl`` (described below),
* ``<vpr_options>`` are any arguments not recognized by ``run_vtr_flow.pl``. These will be forwarded to VPR.
* ``<options>`` are additional arguments passed to ``run_vtr_flow.py`` (described below),
* ``<vpr_options>`` are any arguments not recognized by ``run_vtr_flow.py``. These will be forwarded to VPR.

For example::

run_vtr_flow.pl my_circuit.v my_arch.xml -track_memory_usage --pack --place
run_vtr_flow.py my_circuit.v my_arch.xml -track_memory_usage --pack --place

will run the VTR flow to map the circuit ``my_circuit.v`` onto the architecture ``my_arch.xml``; the arguments ``--pack`` and ``--place`` will be passed to VPR (since they are unrecognized arguments to ``run_vtr_flow.pl``).
will run the VTR flow to map the circuit ``my_circuit.v`` onto the architecture ``my_arch.xml``; the arguments ``--pack`` and ``--place`` will be passed to VPR (since they are unrecognized arguments to ``run_vtr_flow.py``).
They will cause VPR to perform only :ref:`packing and placement <general_options>`.

Detailed Command-line Options
Expand Down
4 changes: 2 additions & 2 deletions doc/src/vtr/running_vtr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The :ref:`run_vtr_flow` script is provided to execute the VTR flow for a single

.. code-block:: none

$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.pl <circuit_file> <architecture_file>
$VTR_ROOT/vtr_flow/scripts/run_vtr_flow.py <circuit_file> <architecture_file>

It requires two arguments:

Expand All @@ -41,7 +41,7 @@ Architecture files can be found under::

The script can also be used to run parts of the VTR flow.

.. seealso:: :ref:`run_vtr_flow` for the detailed command line options of ``run_vtr_flow.pl``.
.. seealso:: :ref:`run_vtr_flow` for the detailed command line options of ``run_vtr_flow.py``.


Running Multiple Benchmarks & Architectures with Tasks
Expand Down
7 changes: 5 additions & 2 deletions run_reg_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
my $skip_qor = 0;
my $show_failures = 0;
my $num_cpu = 1;
my $script = "run_vtr_flow.py";
my $long_task_names = 0;

# Parse Input Arguments
Expand All @@ -87,6 +88,8 @@
$long_task_names = 1;
} elsif ( $token eq "-j" ) { #-j N
$num_cpu = int(shift(@ARGV));
} elsif ( $token eq "-script" ) {
$script = shift(@ARGV);
} elsif ( $token =~ /^-j(\d+)$/ ) { #-jN
$num_cpu = int($1);
} elsif ($token eq "quick_test") {
Expand Down Expand Up @@ -337,10 +340,10 @@ sub run_single_test {

print "\nRunning $test\n";
print "-------------------------------------------------------------------------------\n";
print "scripts/run_vtr_task.pl $run_params \n";
print "scripts/run_vtr_task.pl $run_params -script $script \n";
print "\n";
chdir("$vtr_flow_path");
my $test_status = system("scripts/run_vtr_task.pl $run_params \n");
my $test_status = system("scripts/run_vtr_task.pl $run_params -script $script \n");
chdir("..");

#Perl is obtuse, and requires you to manually shift the return value by 8 bits
Expand Down
8 changes: 8 additions & 0 deletions vtr_flow/scripts/python_libs/vtr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .util import load_config_lines, mkdir_p, find_vtr_file, CommandRunner, print_verbose, relax_W, file_replace, make_enum, RawDefaultHelpFormatter, VERBOSITY_CHOICES,format_elapsed_time, write_tab_delimitted_csv, load_list_file, find_vtr_root, argparse_str2bool, get_next_run_dir, get_latest_run_dir, verify_file
from .inspect import determine_lut_size, determine_min_W, determine_memory_addr_width
from .abc import run, run_lec
from .vpr import run,run_relax_W,cmp_full_vs_incr_STA
from .odin import run
from .ace import run
from .error import *
from .flow import run, VTR_STAGE
1 change: 1 addition & 0 deletions vtr_flow/scripts/python_libs/vtr/abc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .abc import run, run_lec
Loading