Skip to content

setup gitpod #1078

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bin/
#
CMakeCache.txt
CMakeFiles
build
build*/

#
#VTR Tasks
Expand Down
39 changes: 39 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM gitpod/workspace-full:latest

USER root
# Install util tools.
RUN apt-get update \
&& apt-get install -y \
apt-utils \
sudo \
git \
less \
libfmt-dev \
libspdlog-dev \
lcov \
binutils \
binutils-gold \
build-essential \
flex \
fontconfig \
libcairo2-dev \
libgtk-3-dev \
libevent-dev \
libfontconfig1-dev \
liblist-moreutils-perl \
libncurses5-dev \
libx11-dev \
libxft-dev \
libxml++2.6-dev \
python-lxml \
qt5-default \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


# Give back control
USER root

# Cleaning
RUN apt-get clean
10 changes: 10 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
image:
file: .gitpod.Dockerfile
tasks:
- command: pyenv global 3.7.4 &&
chmod +x envconfig.sh

vscode:
extensions:
- [email protected]:qLtqI3aUcEBX9EpuK0ZCyw==
- [email protected]:Pq/tmf2WN3SanVzB4xZc1g==
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,12 @@ list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/libvtrutil")
list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/libpugiutil")
list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/liblog")
include(AutoClangFormat)

# Adds convenience methods, see cmake/cleanCppExtensions.cmake
# include(cleanCppExtensions)

# Creates options to turn on sanitizers, see cmake/sanitizers.cmake
# include(sanitizers)

# Adds misc targets: format, cppcheck, tidy, see cmake/cleanCppExtensions.cmake
# addMiscTargets()
8 changes: 4 additions & 4 deletions ODIN_II/SRC/Hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ OTHER DEALINGS IN THE SOFTWARE.

void Hashtable::destroy_free_items()
{
for(auto kv: my_map)
for(const auto& kv: my_map)
vtr::free(kv.second);
}

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

void* Hashtable::remove(std::string key)
void* Hashtable::remove(const std::string& key)
{
void *value = NULL;
auto v = this->my_map.find(key);
Expand All @@ -51,7 +51,7 @@ void* Hashtable::remove(std::string key)
return value;
}

void* Hashtable::get(std::string key)
void* Hashtable::get(const std::string& key)
{
void *value = NULL;
auto v = this->my_map.find(key);
Expand Down
3 changes: 2 additions & 1 deletion ODIN_II/SRC/ast_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
#include <stdarg.h>
#include <math.h>
#include <algorithm>
#include <utility>
#include "odin_globals.h"
#include "odin_types.h"

Expand Down Expand Up @@ -523,7 +524,7 @@ void change_to_number_node(ast_node_t *node, VNumber number)

node->type = NUMBERS;
node->types.identifier = temp_ident;
node->types.vnumber = new VNumber(number);
node->types.vnumber = new VNumber(std::move(number));
}

/*---------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions ODIN_II/SRC/hierarchy_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
STRING_CACHE *copy_param_table_sc(STRING_CACHE *to_copy);

ast_node_t *resolve_hierarchical_name_reference_by_path_search(sc_hierarchy *local_ref, std::string identifier);
ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, std::string identifier);
ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, const std::string& identifier);

sc_hierarchy *init_sc_hierarchy()
{
Expand Down Expand Up @@ -326,7 +326,7 @@ ast_node_t *resolve_hierarchical_name_reference_by_path_search(sc_hierarchy *loc
/*---------------------------------------------------------------------------
* (function: resolve_hierarchical_name_reference_by_upward_search)
*-------------------------------------------------------------------------*/
ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, std::string identifier)
ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, const std::string& identifier)
{
if (!identifier.empty())
{
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/implicit_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void free_implicit_memory_index_and_finalize_memories()

if (!implicit_memories.empty())
{
for (auto mem_it : implicit_memories)
for (const auto& mem_it : implicit_memories)
{
finalize_implicit_memory(mem_it.second);
vtr::free(mem_it.second->name);
Expand Down
6 changes: 3 additions & 3 deletions ODIN_II/SRC/include/Hashtable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class Hashtable
public:

// Adds an item to the hashtable.
void add (std::string key, void *item);
void add (const std::string& key, void *item);
// Removes an item from the hashtable. If the item is not present, a null pointer is returned.
void* remove (std::string key);
void* remove (const std::string& key);
// Gets an item from the hashtable without removing it. If the item is not present, a null pointer is returned.
void* get (std::string key);
void* get (const std::string& key);
// Check to see if the hashtable is empty.
bool is_empty ();
// calls free on each item.
Expand Down
4 changes: 2 additions & 2 deletions ODIN_II/SRC/include/netlist_visualizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <string>
#include "odin_types.h"

void graphVizOutputNetlist(std::string path, const char* name, short marker_value, netlist_t *input_netlist);
void graphVizOutputCombinationalNet(std::string path, const char* name, short marker_value, nnode_t *current_node);
void graphVizOutputNetlist(const std::string& path, const char* name, short marker_value, netlist_t *input_netlist);
void graphVizOutputCombinationalNet(const std::string& path, const char* name, short marker_value, nnode_t *current_node);

#endif
2 changes: 1 addition & 1 deletion ODIN_II/SRC/include/node_creation_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ char *node_name(nnode_t *node, char *instance_prefix_name);
char *hard_node_name(nnode_t *node, char *instance_name_prefix, char *hb_name, char *hb_inst);
nnode_t *make_mult_block(nnode_t *node, short mark);

edge_type_e edge_type_blif_enum(std::string edge_kind_str);
edge_type_e edge_type_blif_enum(const std::string& edge_kind_str);
const char *edge_type_blif_str(nnode_t *node);

#endif
8 changes: 4 additions & 4 deletions ODIN_II/SRC/include/odin_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

long shift_left_value_with_overflow_check(long input_value, long shift_by);

std::string get_file_extension(std::string input_file);
void create_directory(std::string path);
void assert_supported_file_extension(std::string input_file, int line_number, int file_number);
std::string get_file_extension(const std::string& input_file);
void create_directory(const std::string& path);
void assert_supported_file_extension(const std::string& input_file, int line_number, int file_number);
FILE *open_file(const char *file_name, const char *open_type);

const char *name_based_on_op(operation_list op);
Expand Down Expand Up @@ -66,7 +66,7 @@ double wall_time();
int print_progress_bar(double completion, int position, int length, double time);

void trim_string(char* string, const char *chars);
bool only_one_is_true(std::vector<bool> tested);
bool only_one_is_true(const std::vector<bool>& tested);
int odin_sprintf (char *s, const char *format, ...);

void passed_verify_i_o_availabilty(nnode_t *node, int expected_input_size, int expected_output_size, const char *current_src, int line_src);
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/include/parse_making_ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ast_node_t *newDefparam(ids id, ast_node_t *val, int line_number);
void next_parsed_verilog_file(ast_node_t *file_items_list);

/* VISUALIZATION */
void graphVizOutputAst(std::string path, ast_node_t *top);
void graphVizOutputAst(const std::string& path, ast_node_t *top);
void graphVizOutputAst_traverse_node(FILE *fp, ast_node_t *node, ast_node_t *from, int from_num);

#endif
2 changes: 1 addition & 1 deletion ODIN_II/SRC/multipliers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ void instantiate_hard_multiplier(nnode_t *node, short mark, netlist_t * /*netlis

declare_hard_multiplier(node);

std::string node_name = "";
std::string node_name;
if( node->name )
{
node_name = node->name;
Expand Down
10 changes: 5 additions & 5 deletions ODIN_II/SRC/netlist_create_from_ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ ast_node_t *find_top_module()


/* check for which module wasn't marked as instantiated...this one will be the top */
std::string module_name_list("");
std::string desired_module("");
std::string module_name_list;
std::string desired_module;
bool found_desired_module = false;

if ( global_args.top_level_module_name.provenance() == argparse::Provenance::SPECIFIED )
Expand All @@ -243,7 +243,7 @@ ast_node_t *find_top_module()

for (i = 0; i < num_modules ; i++)
{
std::string current_module = "";
std::string current_module;

if( ast_modules[i]->children[0]->types.identifier )
{
Expand Down Expand Up @@ -3180,7 +3180,7 @@ signal_list_t *assignment_alias(ast_node_t* assignment, char *instance_name_pref

if(address->count > right_memory->addr_width)
{
std::string unused_pins_name = "";
std::string unused_pins_name;
for(long i = right_memory->addr_width; i < address->count; i++)
{
if (address->pins && address->pins[i] && address->pins[i]->name)
Expand Down Expand Up @@ -3275,7 +3275,7 @@ signal_list_t *assignment_alias(ast_node_t* assignment, char *instance_name_pref
{
if(address->count > left_memory->addr_width)
{
std::string unused_pins_name = "";
std::string unused_pins_name;
for(long i = left_memory->addr_width; i < address->count; i++)
{
if (address->pins && address->pins[i] && address->pins[i]->name)
Expand Down
4 changes: 2 additions & 2 deletions ODIN_II/SRC/netlist_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void backward_traversal_net_graph_display(FILE *out, short marker_value, nnode_t
/*---------------------------------------------------------------------------------------------
* (function: graphVizOutputNetlist)
*-------------------------------------------------------------------------------------------*/
void graphVizOutputNetlist(std::string path, const char* name, short marker_value, netlist_t *netlist)
void graphVizOutputNetlist(const std::string& path, const char* name, short marker_value, netlist_t *netlist)
{
char path_and_file[4096];
FILE *fp;
Expand Down Expand Up @@ -185,7 +185,7 @@ void depth_first_traverse_visualize(nnode_t *node, FILE *fp, short traverse_mark
/*---------------------------------------------------------------------------------------------
* (function: graphVizOutputCobinationalNet)
*-------------------------------------------------------------------------------------------*/
void graphVizOutputCombinationalNet(std::string path, const char* name, short marker_value, nnode_t *current_node)
void graphVizOutputCombinationalNet(const std::string& path, const char* name, short marker_value, nnode_t *current_node)
{
char path_and_file[4096];
FILE *fp;
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/node_creation_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const char *edge_type_blif_str(nnode_t *node)
}
}

edge_type_e edge_type_blif_enum(std::string edge_kind_str)
edge_type_e edge_type_blif_enum(const std::string& edge_kind_str)
{

if (edge_kind_str == "fe") return FALLING_EDGE_SENSITIVITY;
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/odin_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static std::string make_marker_from_str(std::string str, int column)

static void print_culprit_line(long column, long line_number, long file)
{
std::string culprit_line = "";
std::string culprit_line;
if (file >= 0 && file < include_file_names.size()
&& line_number >= 0)
{
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/odin_ii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int terminate_odin_ii(netlist_t *odin_netlist)
}

struct ParseInitRegState {
int from_str(std::string str)
int from_str(const std::string& str)
{
if (str == "0") return 0;
else if (str == "1") return 1;
Expand Down
10 changes: 5 additions & 5 deletions ODIN_II/SRC/odin_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ long shift_left_value_with_overflow_check(long input_value, long shift_by)
return input_value << shift_by;
}

std::string get_file_extension(std::string input_file)
std::string get_file_extension(const std::string& input_file)
{
auto dot_location = input_file.find_last_of('.');
if( dot_location != std::string::npos )
Expand All @@ -70,7 +70,7 @@ std::string get_file_extension(std::string input_file)
}
}

void create_directory(std::string path)
void create_directory(const std::string& path)
{
// CREATE OUTPUT DIRECTORY
int error_code = 0;
Expand All @@ -86,7 +86,7 @@ void create_directory(std::string path)
}
}

void assert_supported_file_extension(std::string input_file, int line_number, int file_number)
void assert_supported_file_extension(const std::string& input_file, int line_number, int file_number)
{
bool supported = false;
std::string extension = get_file_extension(input_file);
Expand All @@ -97,7 +97,7 @@ void assert_supported_file_extension(std::string input_file, int line_number, in

if(! supported)
{
std::string supported_extension_list = "";
std::string supported_extension_list;
for(int i=0; i<file_extension_supported_END; i++)
{
supported_extension_list += " ";
Expand Down Expand Up @@ -1017,7 +1017,7 @@ void trim_string(char* string, const char *chars)
/**
* verifies only one condition evaluates to true
*/
bool only_one_is_true(std::vector<bool> tested)
bool only_one_is_true(const std::vector<bool>& tested)
{
bool previous_value = false;
for(bool next_value: tested)
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/output_blif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void output_blif(const char *file_name, netlist_t *netlist)
/* open the file for output */
if (global_args.high_level_block.provenance() == argparse::Provenance::SPECIFIED )
{
std::string out_file = "";
std::string out_file;
out_file = out_file + file_name + "_" + global_args.high_level_block.value() + ".blif";
out = fopen(out_file.c_str(), "w+");
}
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/parse_making_ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,7 @@ int unique_label_count;
/*---------------------------------------------------------------------------
* (function: graphVizOutputAst)
*-------------------------------------------------------------------------*/
void graphVizOutputAst(std::string path, ast_node_t *top)
void graphVizOutputAst(const std::string& path, ast_node_t *top)
{
char path_and_file[4096];
FILE *fp;
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/read_blif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ void create_latch_node_and_driver(FILE *file, Hashtable *output_nets_hash)
}
else
{
std::string line = "";
std::string line;
for(int i=0; i< input_token_count; i++)
{
line += names[i];
Expand Down
4 changes: 2 additions & 2 deletions ODIN_II/SRC/simulate_blif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,7 @@ static void instantiate_memory(nnode_t *node, long data_width, long addr_width)
}
}

static int parse_mif_radix(std::string radix)
static int parse_mif_radix(const std::string& radix)
{
return (radix == "HEX") ? 16:
(radix == "DEC") ? 10:
Expand Down Expand Up @@ -2759,7 +2759,7 @@ static test_vector *parse_test_vector(char *buffer)
*
* If you want better randomness, call srand at some point.
*/
static bool contains_a_substr_of_name(std::vector<std::string> held, const char *name_in)
static bool contains_a_substr_of_name(const std::vector<std::string>& held, const char *name_in)
{
if(!name_in)
return false;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Verilog to Routing (VTR)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/Loksu/vtr-verilog-to-routing)
[![Build Status](https://travis-ci.com/verilog-to-routing/vtr-verilog-to-routing.svg?branch=master)](https://travis-ci.org/verilog-to-routing/vtr-verilog-to-routing) [![Documentation Status](https://readthedocs.org/projects/vtr/badge/?version=latest)](http://docs.verilogtorouting.org/en/latest/?badge=latest)

## Introduction
Expand Down
Loading