Skip to content

Commit

Permalink
Trim Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
B0WEN-HU committed Aug 19, 2019
1 parent 763fdf4 commit 3cfa541
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 52 deletions.
14 changes: 7 additions & 7 deletions include/verilog/Shared_lib.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

/* -*- c++ -*- */
/*
/*
* Copyright 2019 <+YOU OR YOUR COMPANY+>.
*
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
Expand All @@ -35,12 +35,12 @@ namespace gr {
{
private:
// Private members

// The path and name of the library
std::string lib_name;
std::string lib_path;

// The hanle of the shared library
// The hanle of the shared library
void *lib_handle;

// The status of the shared library
Expand All @@ -65,7 +65,7 @@ namespace gr {
// The function that close the library
void close_lib(void);

// DEBUG
// DEBUG
std::string get_lib_path() const;
std::string get_lib_name() const;
std::string get_lib_status() const;
Expand Down
8 changes: 4 additions & 4 deletions include/verilog/gr_verilog_iotype.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

/* -*- c++ -*- */
/*
/*
* Copyright 2019 <+YOU OR YOUR COMPANY+>.
*
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
Expand Down
14 changes: 7 additions & 7 deletions lib/Shared_lib.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* -*- c++ -*- */
/*
/*
* Copyright 2019 <+YOU OR YOUR COMPANY+>.
*
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
Expand Down Expand Up @@ -46,7 +46,7 @@ namespace gr {
// The load_lib function of the class
int Shared_lib::load_lib(const char *ext_lib_path, const char *ext_lib_name)
{
// Get the the fullname of the shared library
// Get the the fullname of the shared library
std::string lib_fullname = ext_lib_path;
// Check the slash at the end of the path
if (SLASH == lib_fullname.back()) {
Expand All @@ -63,8 +63,8 @@ namespace gr {

lib_fullname += ext_lib_name;
}


// Open the shared library
this->lib_handle = dlopen(lib_fullname.c_str(), RTLD_LAZY);
// If the library was not loaded
Expand Down
10 changes: 5 additions & 5 deletions lib/Shell_cmd.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* -*- c++ -*- */
/*
/*
* Copyright 2019 <+YOU OR YOUR COMPANY+>.
*
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace gr {
return msgvec[i];
}


// The print_msg(std::ostream &out) function
void Shell_cmd::print_msg(std::ostream &out)
{
Expand Down
28 changes: 14 additions & 14 deletions lib/verilog_axi_ii_impl.cc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* -*- c++ -*- */
/*
/*
* Copyright 2019 <+YOU OR YOUR COMPANY+>.
*
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
Expand Down Expand Up @@ -90,7 +90,7 @@ namespace gr {
this->test_access((this->cpp_template_path + CPP_TEMPLATE_NAME).c_str(),
"can't access cpp template");
this->test_access((this->cpp_template_path + HEADER_TEMPLATE_NAME).c_str(),
"can't access header template");
"can't access header template");

// Reset the initial time
this->main_time = 0;
Expand Down Expand Up @@ -118,7 +118,7 @@ namespace gr {
this->check_env("make", "can't find make");
this->check_env("g++", "can't find g++");
this->check_env("verilator", "can't find verilator");

//try {
// this->generate_verilator_file();
//} catch (...) {
Expand Down Expand Up @@ -199,13 +199,13 @@ namespace gr {
{
const ITYPE *in = (const ITYPE *) input_items[0];
OTYPE *out = (OTYPE *) output_items[0];

// Initial and Reset the module
if (NULL == this->sim)
{
typedef void (*Initial_func) (void);
typedef void (*Reset_func) (unsigned int skip_n);

Initial_func axi_init;
Reset_func axi_reset;

Expand Down Expand Up @@ -266,7 +266,7 @@ namespace gr {
return output_i;
}


/* gr::verilog::verilog_axi_ii private member functions */

int
Expand All @@ -282,7 +282,7 @@ namespace gr {
// Shell_cmd class
Shell_cmd bash;
std::string cmd = "";

// $ cd ${verilog_module_path}
cmd += "cd ";
cmd += this->verilog_module_path;
Expand Down Expand Up @@ -321,7 +321,7 @@ namespace gr {
if (!CL_makefile_flag)
cmd += std::string(" ") + this->makefile_template_path + AXI_MODULE_CL_MAKEFILE;
if (!CPP_flag) {
cmd += std::string(" ") + this->cpp_template_path + CPP_TEMPLATE_NAME;
cmd += std::string(" ") + this->cpp_template_path + HEADER_TEMPLATE_NAME;
Expand All @@ -330,7 +330,7 @@ namespace gr {
cmd += ENTER;
}
} */


// $ make -j -f axi_module_cl.mk \
// USER_VL_FILENAME=user_module_name.v \
Expand Down Expand Up @@ -364,7 +364,7 @@ namespace gr {
verilog_axi_ii_impl::load_lib()
{
int lib_err_code;
lib_err_code =
lib_err_code =
this->verilog_module_so.load_lib((this->verilog_module_path + M_dir).c_str(),
SHARED_LIB_NAME);
if (lib_err_code == _EXIT_FAILURE) {
Expand Down Expand Up @@ -392,7 +392,7 @@ namespace gr {
% strerror(errno));
throw std::runtime_error(err_msg);
}

return false;
}

Expand Down
14 changes: 7 additions & 7 deletions lib/verilog_axi_ii_impl.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* -*- c++ -*- */
/*
/*
* Copyright 2019 <+YOU OR YOUR COMPANY+>.
*
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
Expand All @@ -37,16 +37,16 @@ namespace gr {
/* gr::verilog::verilog_axi_ii private member variables */
typedef unsigned int ITYPE;
typedef unsigned int OTYPE;

// The path and name of user's verilog module
// Construct by (const char *filename)
std::string verilog_module_path;
std::string verilog_module_name;

// The path of makefile template
std::string makefile_template_path;

// The path of cpp template
// The path of cpp template
std::string cpp_template_path;

// The class that control the shared library
Expand Down
16 changes: 8 additions & 8 deletions python/qa_verilog_axi_ii.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# Copyright 2019 <+YOU OR YOUR COMPANY+>.
#
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this software; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
#

from gnuradio import gr, gr_unittest
from gnuradio import blocks
Expand All @@ -38,7 +38,7 @@ def test_001_t (self):
src = blocks.vector_source_i(src_data)
vl = verilog.verilog_axi_ii("/home/bowen/Downloads/temp/saxi_passthru.v", True, 1.0, "-Wall", 0)
dst = blocks.vector_sink_i()

self.tb.connect(src, vl)
self.tb.connect(vl, dst)
self.tb.run()
Expand All @@ -47,15 +47,15 @@ def test_001_t (self):
print (expected_result)
print (result_data)
self.assertFloatTuplesAlmostEqual(expected_result, result_data, 9)

def test_002_t (self):
# set up fg
src_data = (1, 3, 5, 9, 10, 12, 17, 19, 21)
expected_result = (2, 6, 10, 18, 20, 24, 34, 38, 42)
src = blocks.vector_source_i(src_data)
vl = verilog.verilog_axi_ii("/home/bowen/Downloads/double/double_axi.v", True, 1.0, "", 0)
dst = blocks.vector_sink_i()

self.tb.connect(src, vl)
self.tb.connect(vl, dst)
self.tb.run()
Expand Down

0 comments on commit 3cfa541

Please sign in to comment.