adds simple configurer test
This commit is contained in:
parent
0992cefeb8
commit
f639576ac0
|
@ -59,7 +59,7 @@ find_package(ClangFormat)
|
|||
|
||||
set(CONAN_CMAKE_SILENT_OUTPUT ON)
|
||||
conan_check()
|
||||
conan_configure(REQUIRES fmt/8.0.1 spdlog/1.9.2 boost/1.75.0 gsl-lite/0.37.0 systemc/2.3.3 catch2/3.1.0 zlib/1.2.11 lz4/1.9.4
|
||||
conan_configure(REQUIRES jsoncpp/1.9.5 yaml-cpp/0.6.3 spdlog/1.9.2 fmt/8.0.1 boost/1.75.0 gsl-lite/0.37.0 systemc/2.3.3 catch2/3.1.0 zlib/1.2.11 lz4/1.9.4
|
||||
GENERATORS cmake_find_package
|
||||
OPTIONS fmt:header_only=True spdlog:header_only=True
|
||||
)
|
||||
|
|
2
scc
2
scc
|
@ -1 +1 @@
|
|||
Subproject commit fe86bd5b68198a75082fe0b351cd675a62808c58
|
||||
Subproject commit b70b27a878fdec49b6413fd3737d4e10ae72acb3
|
|
@ -5,6 +5,7 @@ add_subdirectory(ahb_pin_level)
|
|||
add_subdirectory(axi4_pin_level)
|
||||
add_subdirectory(ace_pin_level)
|
||||
add_subdirectory(configuration)
|
||||
add_subdirectory(configurer)
|
||||
if(FULL_TEST_SUITE)
|
||||
add_subdirectory(sim_performance)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
add_executable (configurer sc_main.cpp)
|
||||
target_link_libraries (configurer LINK_PUBLIC scc-sysc)
|
||||
add_test(NAME configurer_test COMMAND configurer ${CMAKE_CURRENT_SOURCE_DIR}/test.yaml)
|
|
@ -0,0 +1,67 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
|
||||
more contributor license agreements. See the NOTICE file distributed
|
||||
with this work for additional information regarding copyright ownership.
|
||||
Accellera licenses this file to you under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with the
|
||||
License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
|
||||
#define SC_INCLUDE_DYNAMIC_PROCESSES
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file main.cpp
|
||||
* @brief Testbench file
|
||||
* This file declares and implements the functionality of the target.
|
||||
* Few of the parameters of the target sc_module are configured by the
|
||||
* router sc_module.
|
||||
* @author P V S Phaneendra, CircuitSutra Technologies <pvs@circuitsutra.com>
|
||||
* @date 29th April, 2011 (Friday)
|
||||
*/
|
||||
|
||||
#include <scc/configurer.h>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @fn int sc_main(int argc, char* argv[])
|
||||
* @brief The testbench for the hierarchical override of parameter values example
|
||||
* @param argc The number of input arguments
|
||||
* @param argv The list of input arguments
|
||||
* @return An integer for the execution status
|
||||
*/
|
||||
int sc_main(int sc_argc, char* sc_argv[]) {
|
||||
scc::init_logging(scc::log::INFO);
|
||||
scc::configurer cfg(sc_argc == 2 ? sc_argv[1] : "test.yaml");
|
||||
cfg.dump_configuration("dump.yaml", true);
|
||||
cci::cci_originator sc_main_orig("SC_MAIN");
|
||||
cci::cci_param<int> int_param0{"int_param0", 0, "This is parameter 1", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<int> int_param1{"int_param1", 1, "This is parameter 3", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<int64_t> int64_param0{"int64_param0", 10, "This is parameter 2", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<int64_t> int64_param1{"int64_param1", 10, "This is parameter 4", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<unsigned> unsigned_param{"unsigned_param", 1, "This is parameter 5", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<uint64_t> uint64_param{"uint64_param", 1, "This is parameter 6", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<float> float_param{"float_param", 4, "This is parameter 7", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<double> double_param{"double_param", 4, "This is parameter 7", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<std::string> string_param{"string_param", "", "This is parameter 7", cci::CCI_ABSOLUTE_NAME, sc_main_orig};
|
||||
cci::cci_param<sc_core::sc_time> sc_time_param{"sc_time_param", sc_core::SC_ZERO_TIME, "This is parameter 7", cci::CCI_ABSOLUTE_NAME,
|
||||
sc_main_orig};
|
||||
// Start the simulation
|
||||
SCCINFO("sc_main") << "Begin Simulation.";
|
||||
sc_core::sc_start(sc_core::SC_ZERO_TIME);
|
||||
SCCINFO("sc_main") << "End Simulation.";
|
||||
|
||||
return sc_core::sc_report_handler::get_count(sc_core::SC_ERROR) + sc_core::sc_report_handler::get_count(sc_core::SC_WARNING);
|
||||
;
|
||||
} // End of 'sc_main'
|
|
@ -0,0 +1,10 @@
|
|||
int_param0: 1
|
||||
int_param1: -1
|
||||
int64_param0: 2
|
||||
int64_param1: -2
|
||||
unsigned_param: 3
|
||||
uint64_param: 4
|
||||
float_param: 5.0
|
||||
double_param: 6
|
||||
string_param: test entry
|
||||
sc_time_param: 10 ns
|
Loading…
Reference in New Issue