mirror of
https://github.com/Minres/RISCV-VP.git
synced 2025-12-17 08:51:35 +00:00
fixes clang-format handling and applies clang-fomrat changes
This commit is contained in:
57
.cproject
57
.cproject
@@ -124,11 +124,30 @@
|
|||||||
<configuration configurationName="Release"/>
|
<configuration configurationName="Release"/>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||||
|
<storageModule moduleId="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661.719145049;cdt.managedbuild.toolchain.gnu.base.1730410661.719145049.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1534023345;cdt.managedbuild.tool.gnu.cpp.compiler.input.1510234384">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661.719145049;cdt.managedbuild.toolchain.gnu.base.1730410661.719145049.;cdt.managedbuild.tool.gnu.c.compiler.base.1971017117;cdt.managedbuild.tool.gnu.c.compiler.input.1521427508">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661;cdt.managedbuild.toolchain.gnu.base.1730410661.218663890;cdt.managedbuild.tool.gnu.c.compiler.base.415892287;cdt.managedbuild.tool.gnu.c.compiler.input.1806041557">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661;cdt.managedbuild.toolchain.gnu.base.1730410661.218663890;cdt.managedbuild.tool.gnu.cpp.compiler.base.1878089590;cdt.managedbuild.tool.gnu.cpp.compiler.input.705150349">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule cmakelistsFolder="" moduleId="de.marw.cmake4eclipse.mbs.settings">
|
||||||
|
<targets>
|
||||||
|
<target name=""/>
|
||||||
|
</targets>
|
||||||
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
||||||
<buildTargets>
|
<buildTargets>
|
||||||
<target name="fw-hello-world" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="fw-hello-world" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>CMAKE_BUILD_TOOL</buildCommand>
|
<buildCommand>CMAKE_BUILD_TOOL</buildCommand>
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>fw-hello-world</buildTarget>
|
<buildTarget>fw-hello-world</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
@@ -150,26 +169,22 @@
|
|||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="format" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>$<cmake4eclipse_dyn></buildArguments>
|
||||||
|
<buildTarget>format</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
|
<target name="format-check" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>$<cmake4eclipse_dyn></buildArguments>
|
||||||
|
<buildTarget>format-check</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
</buildTargets>
|
</buildTargets>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="scannerConfiguration">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661.719145049;cdt.managedbuild.toolchain.gnu.base.1730410661.719145049.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1534023345;cdt.managedbuild.tool.gnu.cpp.compiler.input.1510234384">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661.719145049;cdt.managedbuild.toolchain.gnu.base.1730410661.719145049.;cdt.managedbuild.tool.gnu.c.compiler.base.1971017117;cdt.managedbuild.tool.gnu.c.compiler.input.1521427508">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661;cdt.managedbuild.toolchain.gnu.base.1730410661.218663890;cdt.managedbuild.tool.gnu.c.compiler.base.415892287;cdt.managedbuild.tool.gnu.c.compiler.input.1806041557">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1730410661;cdt.managedbuild.toolchain.gnu.base.1730410661.218663890;cdt.managedbuild.tool.gnu.cpp.compiler.base.1878089590;cdt.managedbuild.tool.gnu.cpp.compiler.input.705150349">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule cmakelistsFolder="" moduleId="de.marw.cmake4eclipse.mbs.settings">
|
|
||||||
<targets>
|
|
||||||
<target name=""/>
|
|
||||||
</targets>
|
|
||||||
</storageModule>
|
|
||||||
</cproject>
|
</cproject>
|
||||||
@@ -32,9 +32,6 @@ find_package(elfio)
|
|||||||
find_package(Boost REQUIRED COMPONENTS program_options QUIET)
|
find_package(Boost REQUIRED COMPONENTS program_options QUIET)
|
||||||
include(SystemCPackage)
|
include(SystemCPackage)
|
||||||
|
|
||||||
set(CLANG_FORMAT_EXCLUDE_PATTERNS "scc" "dbt-rise-riscv")
|
|
||||||
find_package(ClangFormat)
|
|
||||||
|
|
||||||
if(ENABLE_COVERAGE)
|
if(ENABLE_COVERAGE)
|
||||||
include(CodeCoverage)
|
include(CodeCoverage)
|
||||||
append_coverage_compiler_flags()
|
append_coverage_compiler_flags()
|
||||||
@@ -58,9 +55,11 @@ if(ENABLE_CLANGTIDY)
|
|||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
set(CLANG_FORMAT_EXCLUDE_PATTERNS /build/ /scc/ /dbt-rise-core/ /dbt-rise-riscv/)
|
||||||
add_subdirectory(scc)
|
add_subdirectory(scc)
|
||||||
add_subdirectory(dbt-rise-core)
|
add_subdirectory(dbt-rise-core)
|
||||||
add_subdirectory(dbt-rise-riscv)
|
add_subdirectory(dbt-rise-riscv)
|
||||||
|
|
||||||
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dbt-rise-plugins)
|
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dbt-rise-plugins)
|
||||||
add_subdirectory(dbt-rise-plugins)
|
add_subdirectory(dbt-rise-plugins)
|
||||||
endif()
|
endif()
|
||||||
@@ -71,6 +70,8 @@ if(NOT LIBS_ONLY)
|
|||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(ClangFormat)
|
||||||
|
|
||||||
if(FW_BUILD)
|
if(FW_BUILD)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
|
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||||
|
|||||||
Submodule dbt-rise-riscv updated: 9e9815c49c...9b545401e1
2
scc
2
scc
Submodule scc updated: 2c3c85ad83...81c76224b8
@@ -5,7 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CLIParser.h"
|
#include "CLIParser.h"
|
||||||
#include <scc/report.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iss/log_categories.h>
|
#include <iss/log_categories.h>
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
@@ -41,10 +40,13 @@ CLIParser::CLIParser(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
auto log_level = vm_["verbose"].as<scc::log>();
|
auto log_level = vm_["verbose"].as<scc::log>();
|
||||||
auto log_level_num = static_cast<unsigned>(log_level);
|
auto log_level_num = static_cast<unsigned>(log_level);
|
||||||
LOGGER(DEFAULT)::reporting_level() = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num);;
|
LOGGER(DEFAULT)::reporting_level() = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num);
|
||||||
|
;
|
||||||
LOGGER(DEFAULT)::print_time() = false;
|
LOGGER(DEFAULT)::print_time() = false;
|
||||||
LOG_OUTPUT(DEFAULT)::ostream() = &std::cout;
|
LOG_OUTPUT(DEFAULT)::ostream() = &std::cout;
|
||||||
LOGGER(connection)::reporting_level() = logging::as_log_level(log_level_num > 4 ? log_level_num-1 : log_level_num);;
|
LOGGER(connection)::reporting_level() =
|
||||||
|
logging::as_log_level(log_level_num > 4 ? log_level_num - 1 : log_level_num);
|
||||||
|
;
|
||||||
LOGGER(connection)::print_time() = false;
|
LOGGER(connection)::print_time() = false;
|
||||||
LOG_OUTPUT(connection)::ostream() = &std::cout;
|
LOG_OUTPUT(connection)::ostream() = &std::cout;
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -59,7 +61,8 @@ CLIParser::CLIParser(int argc, char *argv[])
|
|||||||
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
||||||
sc_core::sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING);
|
sc_core::sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING);
|
||||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, sc_core::SC_DO_NOTHING);
|
sc_core::sc_report_handler::set_actions(sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, sc_core::SC_DO_NOTHING);
|
||||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ERROR, sc_core::SC_LOG | sc_core::SC_CACHE_REPORT | sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
sc_core::sc_report_handler::set_actions(sc_core::SC_ERROR, sc_core::SC_LOG | sc_core::SC_CACHE_REPORT |
|
||||||
|
sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLIParser::build() {
|
void CLIParser::build() {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
#define PLATFORM_SRC_CLIPARSER_H_
|
#define PLATFORM_SRC_CLIPARSER_H_
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
#include <scc/report.h>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <scc/report.h>
|
||||||
|
|
||||||
class CLIParser {
|
class CLIParser {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -10,18 +10,18 @@
|
|||||||
#include <scc/configurable_tracer.h>
|
#include <scc/configurable_tracer.h>
|
||||||
#include <scc/configurer.h>
|
#include <scc/configurer.h>
|
||||||
#include <scc/hierarchy_dumper.h>
|
#include <scc/hierarchy_dumper.h>
|
||||||
|
#include <scc/perf_estimator.h>
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <scc/scv/scv_tr_db.h>
|
#include <scc/scv/scv_tr_db.h>
|
||||||
#include <scc/tracer.h>
|
#include <scc/tracer.h>
|
||||||
#include <scc/perf_estimator.h>
|
|
||||||
#ifdef WITH_LLVM
|
#ifdef WITH_LLVM
|
||||||
#include <iss/llvm/jit_helper.h>
|
#include <iss/llvm/jit_helper.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
|
||||||
#include "vp/tb.h"
|
#include "vp/tb.h"
|
||||||
#include <iostream>
|
#include <boost/program_options.hpp>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#ifdef ERROR
|
#ifdef ERROR
|
||||||
#undef ERROR
|
#undef ERROR
|
||||||
@@ -47,7 +47,8 @@ int sc_main(int argc, char *argv[]) {
|
|||||||
// CLI argument parsing & logging setup
|
// CLI argument parsing & logging setup
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
CLIParser parser(argc, argv);
|
CLIParser parser(argc, argv);
|
||||||
if (!parser.is_valid()) return ERRORR_IN_COMMAND_LINE;
|
if(!parser.is_valid())
|
||||||
|
return ERRORR_IN_COMMAND_LINE;
|
||||||
scc::stream_redirection cout_redir(std::cout, scc::log::INFO);
|
scc::stream_redirection cout_redir(std::cout, scc::log::INFO);
|
||||||
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -72,11 +73,13 @@ int sc_main(int argc, char *argv[]) {
|
|||||||
if(auto trace_level = parser.get<unsigned>("trace-level")) {
|
if(auto trace_level = parser.get<unsigned>("trace-level")) {
|
||||||
auto file_name = parser.get<std::string>("trace-file");
|
auto file_name = parser.get<std::string>("trace-file");
|
||||||
auto enable_sig_trace = (trace_level & 0x1) != 0; // bit0 enables sig trace
|
auto enable_sig_trace = (trace_level & 0x1) != 0; // bit0 enables sig trace
|
||||||
auto tx_trace_type = static_cast<scc::tracer::file_type>(trace_level >> 1); // bit3-bit1 define the kind of transaction trace
|
auto tx_trace_type =
|
||||||
|
static_cast<scc::tracer::file_type>(trace_level >> 1); // bit3-bit1 define the kind of transaction trace
|
||||||
auto trace_default_on = parser.is_set("trace-default-on");
|
auto trace_default_on = parser.is_set("trace-default-on");
|
||||||
cfg.set_value("$$$scc_tracer$$$.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
|
cfg.set_value("$$$scc_tracer$$$.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
|
||||||
cfg.set_value("$$$scc_tracer$$$.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::SC_VCD));
|
cfg.set_value("$$$scc_tracer$$$.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::SC_VCD));
|
||||||
tracer = scc::make_unique<scc::configurable_tracer>(file_name, tx_trace_type, enable_sig_trace, trace_default_on);
|
tracer =
|
||||||
|
scc::make_unique<scc::configurable_tracer>(file_name, tx_trace_type, enable_sig_trace, trace_default_on);
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// instantiate top level
|
// instantiate top level
|
||||||
@@ -85,18 +88,21 @@ int sc_main(int argc, char *argv[]) {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// add non-implemented 'enableTracing' properties
|
// add non-implemented 'enableTracing' properties
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
if(tracer) tracer->add_control();
|
if(tracer)
|
||||||
|
tracer->add_control();
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// dump configuration if requested
|
// dump configuration if requested
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
if(parser.get<std::string>("dump-config").size() > 0) {
|
if(parser.get<std::string>("dump-config").size() > 0) {
|
||||||
std::ofstream of{parser.get<std::string>("dump-config")};
|
std::ofstream of{parser.get<std::string>("dump-config")};
|
||||||
if (of.is_open()) cfg.dump_configuration(of, true);
|
if(of.is_open())
|
||||||
|
cfg.dump_configuration(of, true);
|
||||||
}
|
}
|
||||||
cfg.configure();
|
cfg.configure();
|
||||||
std::unique_ptr<scc::hierarchy_dumper> dumper;
|
std::unique_ptr<scc::hierarchy_dumper> dumper;
|
||||||
if(parser.is_set("dump-structure"))
|
if(parser.is_set("dump-structure"))
|
||||||
dumper.reset(new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
dumper.reset(
|
||||||
|
new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// overwrite config with command line settings
|
// overwrite config with command line settings
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -108,12 +114,14 @@ int sc_main(int argc, char *argv[]) {
|
|||||||
auto plugins = util::join(parser.get<std::vector<std::string>>("plugin"), ",");
|
auto plugins = util::join(parser.get<std::vector<std::string>>("plugin"), ",");
|
||||||
cfg.set_value(core_path + ".plugins", plugins);
|
cfg.set_value(core_path + ".plugins", plugins);
|
||||||
}
|
}
|
||||||
if (parser.is_set("elf")) cfg.set_value(core_path + ".elf_file", parser.get<std::string>("elf"));
|
if(parser.is_set("elf"))
|
||||||
|
cfg.set_value(core_path + ".elf_file", parser.get<std::string>("elf"));
|
||||||
if(parser.is_set("quantum"))
|
if(parser.is_set("quantum"))
|
||||||
tlm::tlm_global_quantum::instance().set(sc_core::sc_time(parser.get<unsigned>("quantum"), sc_core::SC_NS));
|
tlm::tlm_global_quantum::instance().set(sc_core::sc_time(parser.get<unsigned>("quantum"), sc_core::SC_NS));
|
||||||
if(parser.is_set("reset")) {
|
if(parser.is_set("reset")) {
|
||||||
auto str = parser.get<std::string>("reset");
|
auto str = parser.get<std::string>("reset");
|
||||||
uint64_t start_address = str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
|
uint64_t start_address =
|
||||||
|
str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
|
||||||
cfg.set_value(core_path + ".reset_address", start_address);
|
cfg.set_value(core_path + ".reset_address", start_address);
|
||||||
}
|
}
|
||||||
if(parser.is_set("disass")) {
|
if(parser.is_set("disass")) {
|
||||||
@@ -134,7 +142,8 @@ int sc_main(int argc, char *argv[]) {
|
|||||||
sc_core::sc_start(scc::parse_from_string(parser.get<std::string>("max_time")));
|
sc_core::sc_start(scc::parse_from_string(parser.get<std::string>("max_time")));
|
||||||
} else
|
} else
|
||||||
sc_core::sc_start();
|
sc_core::sc_start();
|
||||||
if (!sc_core::sc_end_of_simulation_invoked()) sc_core::sc_stop();
|
if(!sc_core::sc_end_of_simulation_invoked())
|
||||||
|
sc_core::sc_stop();
|
||||||
} catch(sc_core::sc_report& rep) {
|
} catch(sc_core::sc_report& rep) {
|
||||||
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// need double braces, see https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191
|
// need double braces, see
|
||||||
|
// https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191
|
||||||
const std::array<scc::target_memory_map_entry<scc::LT>, 7> PipelinedMemoryBusToApbBridge_map = {{
|
const std::array<scc::target_memory_map_entry<scc::LT>, 7> PipelinedMemoryBusToApbBridge_map = {{
|
||||||
{gpio0.socket, 0x0, 0xc},
|
{gpio0.socket, 0x0, 0xc},
|
||||||
{uart0.socket, 0x1000, 0x14},
|
{uart0.socket, 0x1000, 0x14},
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ namespace tgc_vp {
|
|||||||
|
|
||||||
class rst_gen : public sc_core::sc_module {
|
class rst_gen : public sc_core::sc_module {
|
||||||
SC_HAS_PROCESS(rst_gen);
|
SC_HAS_PROCESS(rst_gen);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
rst_gen(sc_core::sc_module_name const& nm) {
|
rst_gen(sc_core::sc_module_name const& nm) { SC_THREAD(run); }
|
||||||
SC_THREAD(run);
|
|
||||||
}
|
|
||||||
sc_core::sc_out<bool> rst_n{"rst_n"};
|
sc_core::sc_out<bool> rst_n{"rst_n"};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void run() {
|
void run() {
|
||||||
rst_n.write(false);
|
rst_n.write(false);
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ system::system(sc_core::sc_module_name nm)
|
|||||||
void system::gen_reset() {
|
void system::gen_reset() {
|
||||||
if(erst_n.read())
|
if(erst_n.read())
|
||||||
rst_s = 0;
|
rst_s = 0;
|
||||||
else rst_s = 1;
|
else
|
||||||
|
rst_s = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace tgc_vp
|
||||||
} /* namespace sysc */
|
|
||||||
|
|||||||
@@ -9,23 +9,23 @@
|
|||||||
|
|
||||||
#include "minres/irq.h"
|
#include "minres/irq.h"
|
||||||
#include "minres/timer.h"
|
#include "minres/timer.h"
|
||||||
|
#include <array>
|
||||||
|
#include <cci_configuration>
|
||||||
|
#include <memory>
|
||||||
#include <minres/aclint.h>
|
#include <minres/aclint.h>
|
||||||
#include <minres/gpio.h>
|
#include <minres/gpio.h>
|
||||||
#include <minres/qspi.h>
|
#include <minres/qspi.h>
|
||||||
#include <sysc/communication/sc_clock.h>
|
|
||||||
#include <sysc/communication/sc_signal_ports.h>
|
|
||||||
#include <sysc/core_complex.h>
|
|
||||||
#include <minres/uart.h>
|
#include <minres/uart.h>
|
||||||
#include <cci_configuration>
|
|
||||||
#include <scc/memory.h>
|
#include <scc/memory.h>
|
||||||
#include <scc/router.h>
|
#include <scc/router.h>
|
||||||
#include <scc/utilities.h>
|
#include <scc/utilities.h>
|
||||||
|
#include <sysc/communication/sc_clock.h>
|
||||||
|
#include <sysc/communication/sc_signal_ports.h>
|
||||||
|
#include <sysc/core_complex.h>
|
||||||
|
#include <sysc/kernel/sc_module.h>
|
||||||
#include <sysc/kernel/sc_time.h>
|
#include <sysc/kernel/sc_time.h>
|
||||||
#include <sysc/utils/sc_vector.h>
|
#include <sysc/utils/sc_vector.h>
|
||||||
#include <tlm/scc/tlm_signal_sockets.h>
|
#include <tlm/scc/tlm_signal_sockets.h>
|
||||||
#include <array>
|
|
||||||
#include <memory>
|
|
||||||
#include <sysc/kernel/sc_module.h>
|
|
||||||
|
|
||||||
namespace tgc_vp {
|
namespace tgc_vp {
|
||||||
|
|
||||||
@@ -64,15 +64,17 @@ private:
|
|||||||
scc::memory<128_kB, scc::LT> mem_ram{"mem_ram"};
|
scc::memory<128_kB, scc::LT> mem_ram{"mem_ram"};
|
||||||
scc::memory<8_kB, scc::LT> boot_rom{"boot_rom"};
|
scc::memory<8_kB, scc::LT> boot_rom{"boot_rom"};
|
||||||
|
|
||||||
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"}, msip_int_s{"msip_int_s"};
|
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"},
|
||||||
|
msip_int_s{"msip_int_s"};
|
||||||
|
|
||||||
sc_core::sc_vector<sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS>> irq_int_s{"irq_int_s", 32}, local_int_s{"local_int_s", 16};
|
sc_core::sc_vector<sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS>> irq_int_s{"irq_int_s", 32},
|
||||||
|
local_int_s{"local_int_s", 16};
|
||||||
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> core_int_s{"core_int_s"};
|
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> core_int_s{"core_int_s"};
|
||||||
|
|
||||||
void gen_reset();
|
void gen_reset();
|
||||||
#include "../vp/gen/PipelinedMemoryBusToApbBridge.h"
|
#include "../vp/gen/PipelinedMemoryBusToApbBridge.h"
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace sysc */
|
} // namespace tgc_vp
|
||||||
|
|
||||||
#endif /* _PLATFORM_H_ */
|
#endif /* _PLATFORM_H_ */
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
namespace tgc_vp {
|
namespace tgc_vp {
|
||||||
|
|
||||||
SC_HAS_PROCESS(tb);
|
SC_HAS_PROCESS(tb);
|
||||||
tb::tb(const sc_core::sc_module_name &nm): sc_core::sc_module(nm) {
|
tb::tb(const sc_core::sc_module_name& nm)
|
||||||
|
: sc_core::sc_module(nm) {
|
||||||
top.erst_n(rst_n);
|
top.erst_n(rst_n);
|
||||||
rst_gen.rst_n(rst_n);
|
rst_gen.rst_n(rst_n);
|
||||||
top.pins_o(pins_o);
|
top.pins_o(pins_o);
|
||||||
@@ -27,4 +28,4 @@ tb::tb(const sc_core::sc_module_name &nm): sc_core::sc_module(nm) {
|
|||||||
top.clk_i(clk_i);
|
top.clk_i(clk_i);
|
||||||
clk_i = 10_ns;
|
clk_i = 10_ns;
|
||||||
}
|
}
|
||||||
}
|
} // namespace tgc_vp
|
||||||
|
|||||||
2
vpvper
2
vpvper
Submodule vpvper updated: 99f8c5dd4a...23230f8992
Reference in New Issue
Block a user