Skip to content

Commit

Permalink
Cleanup and remove god-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
janweinstock committed Apr 3, 2020
1 parent 8efcaaf commit f0f6563
Show file tree
Hide file tree
Showing 95 changed files with 145 additions and 316 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ set(sources

add_library(vcml ${sources})
target_include_directories(vcml PUBLIC ${inc})
target_include_directories(vcml PRIVATE ${src})
target_include_directories(vcml SYSTEM PUBLIC ${SYSTEMC_INCLUDE_DIRS})
target_include_directories(vcml SYSTEM PUBLIC ${LIBELF_INCLUDE_DIRS})

Expand Down
7 changes: 0 additions & 7 deletions include/vcml.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef VCML_H
#define VCML_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/strings.h"
#include "vcml/common/utils.h"
Expand All @@ -43,12 +42,6 @@
#include "vcml/properties/property_provider_file.h"

#include "vcml/backends/backend.h"
#include "vcml/backends/backend_null.h"
#include "vcml/backends/backend_file.h"
#include "vcml/backends/backend_term.h"
#include "vcml/backends/backend_stdout.h"
#include "vcml/backends/backend_tcp.h"
#include "vcml/backends/backend_tap.h"

#include "vcml/debugging/rspserver.h"
#include "vcml/debugging/gdbstub.h"
Expand Down
3 changes: 1 addition & 2 deletions include/vcml/adapters.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
#ifndef VCML_ADAPTERS_H
#define VCML_ADAPTERS_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"
#include "vcml/common/systemc.h"

namespace vcml {

Expand Down
13 changes: 7 additions & 6 deletions include/vcml/backends/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
#ifndef VCML_BACKEND_H
#define VCML_BACKEND_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/strings.h"
#include "vcml/common/report.h"

#include "vcml/common/systemc.h"
#include "vcml/logging/logger.h"
#include "vcml/properties/property.h"

namespace vcml {


class backend: public sc_module
{
public:
Expand All @@ -41,9 +39,12 @@ namespace vcml {
public:
property<log_level> loglvl;

backend(const sc_module_name& nm = "backend");
virtual ~backend();
backend() = delete;
backend(const backend&) = delete;
backend& operator = (const backend&) = delete;

explicit backend(const sc_module_name& nm = "backend");
virtual ~backend();
VCML_KIND(backend);

virtual size_t peek() = 0;
Expand Down
2 changes: 0 additions & 2 deletions include/vcml/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#ifndef VCML_COMMAND_H
#define VCML_COMMAND_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"

#define VCML_NO_ARGS (::std::vector<::std::string>())
Expand Down
5 changes: 1 addition & 4 deletions include/vcml/common/aio.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
#ifndef VCML_AIO_H
#define VCML_AIO_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"
#include <functional>

namespace vcml {

Expand Down
1 change: 0 additions & 1 deletion include/vcml/common/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#ifndef VCML_BITOPS_H
#define VCML_BITOPS_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"

namespace vcml {
Expand Down
66 changes: 0 additions & 66 deletions include/vcml/common/includes.h

This file was deleted.

11 changes: 4 additions & 7 deletions include/vcml/common/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#ifndef VCML_REPORT_H
#define VCML_REPORT_H

#include "vcml/common/includes.h"
#include <exception>

#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/strings.h"

namespace vcml {

Expand All @@ -36,11 +37,6 @@ namespace vcml {
vector<string> m_backtrace;
string m_desc;

static void handle_segfault(int sig, siginfo_t* info, void* context);

// disabled
report();

public:
const char* message() const { return m_message.c_str(); }
const char* origin() const { return m_origin.c_str(); }
Expand All @@ -50,6 +46,7 @@ namespace vcml {

const vector<string> backtrace() const;

report() = delete;
report(const string& msg, const char* file, int line);
virtual ~report() throw();

Expand Down
3 changes: 2 additions & 1 deletion include/vcml/common/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
#ifndef VCML_STRINGS_H
#define VCML_STRINGS_H

#include <stdarg.h>
#include <string.h>
#include <string>
#include <sstream>

#include "vcml/common/includes.h"
#include "vcml/common/types.h"

namespace vcml {
Expand Down
5 changes: 5 additions & 0 deletions include/vcml/common/systemc.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ namespace vcml {
using tlm_utils::simple_target_socket;
using tlm_utils::simple_target_socket_tagged;

#define VCML_KIND(name) \
virtual const char* kind() const { \
return "vcml::" #name; \
}

}

std::istream& operator >> (std::istream& is, sc_core::sc_time& t);
Expand Down
3 changes: 1 addition & 2 deletions include/vcml/common/thctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#ifndef VCML_THCTL_H
#define VCML_THCTL_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include <pthread.h>

namespace vcml {

Expand Down
4 changes: 4 additions & 0 deletions include/vcml/common/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#include <list>
#include <map>
#include <unordered_map>
#include <iterator>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <memory>
#include <functional>

Expand Down
7 changes: 0 additions & 7 deletions include/vcml/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,11 @@
#ifndef VCML_UTILS_H
#define VCML_UTILS_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/strings.h"
#include "vcml/common/thctl.h"

namespace vcml {

#define VCML_KIND(name) \
virtual const char* kind() const { \
return "vcml::" #name; \
}

string dirname(const string& filename);
string tempdir();

Expand Down
2 changes: 0 additions & 2 deletions include/vcml/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#ifndef VCML_COMPONENT_H
#define VCML_COMPONENT_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"
#include "vcml/common/systemc.h"

Expand Down
3 changes: 1 addition & 2 deletions include/vcml/debugging/gdbserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
#ifndef VCML_GDBSERVER_H
#define VCML_GDBSERVER_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/strings.h"
#include "vcml/common/report.h"
#include "vcml/common/thctl.h"

Expand Down
2 changes: 0 additions & 2 deletions include/vcml/debugging/gdbstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
#ifndef VCML_GDBSTUB_H
#define VCML_GDBSTUB_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/thctl.h"

#include "vcml/range.h"

namespace vcml { namespace debugging {
Expand Down
8 changes: 4 additions & 4 deletions include/vcml/debugging/rspserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
#ifndef VCML_RSP_H
#define VCML_RSP_H

#include "vcml/common/includes.h"
#include <pthread.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>

#include "vcml/common/types.h"
#include "vcml/common/strings.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"

#include "vcml/logging/logger.h"

namespace vcml { namespace debugging {

class rspserver
Expand Down
3 changes: 0 additions & 3 deletions include/vcml/debugging/vncserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@

#include <rfb/rfb.h>

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/strings.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"

#include "vcml/logging/logger.h"

namespace vcml { namespace debugging {
Expand Down
12 changes: 2 additions & 10 deletions include/vcml/debugging/vspserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,12 @@
#ifndef VCML_VSPSERVER_H
#define VCML_VSPSERVER_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/strings.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"
#include "vcml/common/aio.h"
#include "vcml/common/version.h"

#include "vcml/logging/logger.h"
#include "vcml/properties/property.h"
#include "vcml/common/systemc.h"
#include "vcml/debugging/rspserver.h"

#include "vcml/component.h"

namespace vcml { namespace debugging {

class vspserver: public rspserver {
Expand All @@ -59,7 +51,7 @@ namespace vcml { namespace debugging {

public:
vspserver() = delete;
vspserver(u16 port);
explicit vspserver(u16 port);
virtual ~vspserver();

void start();
Expand Down
2 changes: 0 additions & 2 deletions include/vcml/dmi_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#ifndef VCML_DMI_H
#define VCML_DMI_H

#include "vcml/common/includes.h"
#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"
#include "vcml/common/systemc.h"

Expand Down
5 changes: 2 additions & 3 deletions include/vcml/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
#ifndef VCML_ELF_H
#define VCML_ELF_H

#include "vcml/common/includes.h"
#include <libelf.h>

#include "vcml/common/types.h"
#include "vcml/common/utils.h"
#include "vcml/common/report.h"

#include "vcml/logging/logger.h"

namespace vcml {
Expand Down
Loading

0 comments on commit f0f6563

Please sign in to comment.