Line 1... |
Line 1... |
/**
|
/*
|
* @file
|
* Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
|
* @copyright Copyright 2016 GNSS Sensor Ltd. All right reserved.
|
*
|
* @author Sergey Khabarov - sergeykhbr@gmail.com
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
* @brief Test application to verify UDP/EDCL transport library.
|
* 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.
|
*/
|
*/
|
|
|
#include "api_core.h"
|
#include "api_core.h"
|
#include "iservice.h"
|
#include "iservice.h"
|
#include "coreservices/iudp.h"
|
#include "coreservices/ilink.h"
|
#include "coreservices/ithread.h"
|
#include "coreservices/ithread.h"
|
|
#include "coreservices/icpugen.h"
|
#include "coreservices/icpuriscv.h"
|
#include "coreservices/icpuriscv.h"
|
/** Plugin verification */
|
/** Plugin verification */
|
#include "simple_plugin/isimple_plugin.h"
|
#include "simple_plugin/isimple_plugin.h"
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <string>
|
#include <string>
|
Line 68... |
Line 78... |
return 0;
|
return 0;
|
}
|
}
|
|
|
// Connect simulator to the EDCL debugger if enabled:
|
// Connect simulator to the EDCL debugger if enabled:
|
if (Config["GlobalSettings"]["SimEnable"].to_bool()) {
|
if (Config["GlobalSettings"]["SimEnable"].to_bool()) {
|
IUdp *iudp1 = static_cast<IUdp *>
|
ILink *iudp1 = static_cast<ILink *>
|
(RISCV_get_service_iface("udpboard", IFACE_UDP));
|
(RISCV_get_service_iface("udpboard", IFACE_LINK));
|
IUdp *iudp2 = static_cast<IUdp *>
|
ILink *iudp2 = static_cast<ILink *>
|
(RISCV_get_service_iface("udpedcl", IFACE_UDP));
|
(RISCV_get_service_iface("udpedcl", IFACE_LINK));
|
|
|
AttributeType t1 = iudp1->getConnectionSettings();
|
AttributeType t1;
|
iudp2->setTargetSettings(&t1);
|
iudp1->getConnectionSettings(&t1);
|
t1 = iudp2->getConnectionSettings();
|
iudp2->setConnectionSettings(&t1);
|
iudp1->setTargetSettings(&t1);
|
iudp2->getConnectionSettings(&t1);
|
|
iudp1->setConnectionSettings(&t1);
|
}
|
}
|
|
|
IService *itst = static_cast<IService *>(RISCV_get_service("example0"));
|
IService *itst = static_cast<IService *>(RISCV_get_service("example0"));
|
if (itst == NULL) {
|
if (itst == NULL) {
|
/**
|
/**
|
Line 94... |
Line 105... |
}
|
}
|
|
|
/**
|
/**
|
* Unreset all CPUs
|
* Unreset all CPUs
|
*/
|
*/
|
AttributeType cpu_list;
|
/*AttributeType cpu_list;
|
RISCV_get_services_with_iface(IFACE_CPU_RISCV, &cpu_list);
|
RISCV_get_services_with_iface(IFACE_CPU_RISCV, &cpu_list);
|
for (unsigned i = 0; i < cpu_list.size(); i++) {
|
for (unsigned i = 0; i < cpu_list.size(); i++) {
|
IService *iserv = static_cast<IService *>(cpu_list[i].to_iface());
|
IService *iserv = static_cast<IService *>(cpu_list[i].to_iface());
|
ICpuRiscV *icpu = static_cast<ICpuRiscV *>(
|
ICpuGeneric *icpu = static_cast<ICpuGeneric *>(
|
iserv->getInterface(IFACE_CPU_RISCV));
|
iserv->getInterface(IFACE_CPU_GENERIC));
|
icpu->lowerSignal(CPU_SIGNAL_RESET); // Active HIGH. Unreset CPU model.
|
icpu->lowerSignal(CPU_SIGNAL_RESET); // Active HIGH. Unreset CPU model.
|
}
|
}*/
|
|
|
if (itst != NULL) {
|
if (itst != NULL) {
|
/** Get plugin specific interface. */
|
/** Get plugin specific interface. */
|
ISimplePlugin * itst_access = static_cast<ISimplePlugin *>(
|
ISimplePlugin * itst_access = static_cast<ISimplePlugin *>(
|
itst->getInterface(IFACE_SIMPLE_PLUGIN));
|
itst->getInterface(IFACE_SIMPLE_PLUGIN));
|