Skip to content

Commit

Permalink
Merge pull request #543 from verilog-to-routing/master
Browse files Browse the repository at this point in the history
[pull] master from verilog-to-routing:master
  • Loading branch information
acomodi authored Sep 14, 2020
2 parents b547ac8 + 25efd66 commit b22e1fe
Show file tree
Hide file tree
Showing 229 changed files with 18,033 additions and 2,826 deletions.
8 changes: 4 additions & 4 deletions .github/kokoro/run-vtr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ set -x
set -e

# Set up the host
source $SCRIPT_DIR/steps/hostsetup.sh
source $SCRIPT_DIR/steps/hostinfo.sh

# Output git information
ls -l
cd github
ls -l
cd vtr-verilog-to-routing
source $SCRIPT_DIR/steps/hostsetup.sh
source $SCRIPT_DIR/steps/hostinfo.sh

# Output git information
source $SCRIPT_DIR/steps/git.sh

if [ $VTR_TEST == "vtr_reg_strong" ]; then
Expand Down
10 changes: 10 additions & 0 deletions .github/kokoro/steps/hostsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ echo
echo "========================================"
echo "Host install packages"
echo "----------------------------------------"

sudo apt-get install -y \
bash \
bison \
Expand Down Expand Up @@ -58,6 +59,15 @@ sudo apt-get install -y \
#Don't include libtbb-dev since it may increase memory usage
#libtbb-dev \

export PATH="$PATH:/home/kbuilder/.local/bin"

pyenv install -f 3.6.3
pyenv global 3.6.3
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
rm get-pip.py
python3 -m pip install -r requirements.txt

if [ -z "${BUILD_TOOL}" ]; then
export BUILD_TOOL=make
fi
Expand Down
41 changes: 22 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
version: ~> 1.0
language: cpp

dist: trusty
dist: bionic
addons:
apt:
sources:
- sourceline: 'ppa:george-edison55/precise-backports' # For cmake
- sourceline: 'deb http://apt.llvm.org/precise llvm-toolchain-precise-3.6 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- sourceline: 'deb http://apt.llvm.org/trusty llvm-toolchain-trusty-6.0 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- sourceline: 'deb http://apt.llvm.org/trusty llvm-toolchain-trusty-7 main' # For clang-format-7
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- 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 @@ -90,13 +80,13 @@ jobs:
name: "Code Formatting - C/C++"
script:
- ./dev/check-format.sh
- state: Test
- stage: Test
name: "Code Formatting - Python"
script:
- ./dev/check-format-py.sh
- stage: Test
name: "Python Lint"
script:
script:
- python3 ./dev/pylint_check.py
- stage: Test
name: "C++ Unit Tests"
Expand All @@ -123,6 +113,22 @@ jobs:
script:
- ./.github/travis/build.sh
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
- stage: Test
name: "Basic Regression Tests with NO_GRAPHICS"
env:
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off"
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
script:
- ./.github/travis/build.sh
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
- stage: Test
name: "Basic Regression Tests with VTR_ENABLE_DEBUG_LOGGING"
env:
- CMAKE_PARAMS="-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on"
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
script:
- ./.github/travis/build.sh
- travis_wait 30 ./run_reg_test.pl vtr_reg_basic -show_failures -j2
- stage: Test
name: "Strong Regression Tests"
env:
Expand Down Expand Up @@ -238,18 +244,15 @@ before_script:
# Switch to python 3.6.3
- pyenv install -f 3.6.3
- pyenv global 3.6.3

# Install python modules
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- python3 get-pip.py
- python3 get-pip.py
- rm get-pip.py
- python3 -m pip install \
pylint \
black
- python3 -m pip install -r requirements.txt

- source .github/travis/common.sh
- ./.github/travis/setup.sh

after_script:
- ./.github/travis/setup.sh

Expand Down
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ option(VTR_ENABLE_PROFILING "Enable performance profiler (gprof)" OFF)
option(VTR_ENABLE_COVERAGE "Enable code coverage tracking (gcov)" OFF)
option(VTR_ENABLE_DEBUG_LOGGING "Enable debug logging" OFF)

#Allow the user to decide weather to compile the graphics library
#Allow the user to decide whether to compile the graphics library
set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics library")
set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on)
option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VPR." ON)

#Allow the user to enable/disable VPR analytic placement
#VPR option --enable_analytic_placer is also required for Analytic Placement
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)

option(WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF)

option(WITH_ABC "Enable building abc" ON)
Expand Down Expand Up @@ -109,6 +113,16 @@ else()
message(STATUS "Building with IPO: off")
endif()

#
# Build type flags
#

if(NOT MSVC)
# for GCC and Clang
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3")
endif()

#
# Warning flags
#
Expand Down Expand Up @@ -336,7 +350,7 @@ if (VPR_USE_EZGL STREQUAL "auto")
message(STATUS "VPR Graphics: Enabled")
else()
set(VPR_USE_EZGL "off")
message(STATUS "VPR Graphics: Disabled (required libraries missing, on debia/ubuntu try: sudo apt install libgtk-3 libx11-dev")
message(STATUS "VPR Graphics: Disabled (required libraries missing, on debian/ubuntu try: sudo apt install libgtk-3-dev libx11-dev")
endif()
endif()

Expand Down
74 changes: 74 additions & 0 deletions ODIN_II/SRC/HardSoftLogicMixer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "HardSoftLogicMixer.hpp"

#include <stdint.h> // INT_MAX
#include <vector>

#include "multipliers.h" // instantiate_simple_soft_multiplier
#include "odin_error.h" // error_message

HardSoftLogicMixer::HardSoftLogicMixer() {
for (int i = 0; i < operation_list_END; i++) {
if (i == MULTIPLY) {
this->_opts[i] = new MultsOpt();
} else {
this->_opts[i] = new MixingOpt();
}
}
}

HardSoftLogicMixer::~HardSoftLogicMixer() {
for (int i = 0; i < operation_list_END; i++) {
delete this->_opts[i];
}
}
void HardSoftLogicMixer::note_candidate_node(nnode_t* opNode) {
_nodes_by_opt[opNode->type].push_back(opNode);
}

bool HardSoftLogicMixer::hardenable(nnode_t* node) {
return this->_opts[node->type]->hardenable(node);
}

bool HardSoftLogicMixer::enabled(nnode_t* node) {
return this->_opts[node->type]->enabled();
}

int HardSoftLogicMixer::hard_blocks_needed(operation_list opt) {
return _nodes_by_opt[opt].size();
}

void HardSoftLogicMixer::partial_map_node(nnode_t* node, short traverse_number, netlist_t* netlist) {
_opts[node->type]->partial_map_node(node, traverse_number, netlist, this);
}

void HardSoftLogicMixer::perform_optimizations(netlist_t* netlist) {
if (_opts[MULTIPLY]->enabled()) {
int blocks_needed = this->hard_blocks_needed(MULTIPLY);
_opts[MULTIPLY]->set_blocks_needed(blocks_needed);
_opts[MULTIPLY]->assign_weights(netlist, _nodes_by_opt[MULTIPLY]);
_opts[MULTIPLY]->perform(netlist, _nodes_by_opt[MULTIPLY]);
_opts[MULTIPLY]->instantiate_soft_logic(netlist, _nodes_by_opt[MULTIPLY]);
}
}
10 changes: 5 additions & 5 deletions ODIN_II/SRC/Hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ void Hashtable::destroy_free_items() {
}

void Hashtable::add(std::string key, void* item) {
this->my_map.insert({key, item});
this->my_map.emplace(key, item);
}

void* Hashtable::remove(std::string key) {
void* value = NULL;
auto v = this->my_map.find(key);
if (v != this->my_map.end()) {
value = this->my_map[key];
this->my_map.erase(key);
value = v->second;
this->my_map.erase(v);
}
return value;
}
Expand All @@ -51,11 +51,11 @@ void* Hashtable::get(std::string key) {
void* value = NULL;
auto v = this->my_map.find(key);
if (v != this->my_map.end())
value = this->my_map[key];
value = v->second;

return value;
}

bool Hashtable::is_empty() {
return (my_map.size() == 0);
return my_map.empty();
}
Loading

0 comments on commit b22e1fe

Please sign in to comment.