Commit 143b950a authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

update to latest VILLAScommon submodule

parent 506f3190
......@@ -20,9 +20,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##############################################################################
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.5)
project(VILLASfpga C CXX)
project(VILLASfpga
LANGUAGES C CXX
VERSION 0.1.0
)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
......
Subproject commit e2ab88e67c79be5d4cae71164be3eabb232ddc04
Subproject commit 5071327844fd93de6d44ce9e47459a41b9bd17cb
......@@ -74,7 +74,7 @@ private:
MemoryManager::AddressSpaceId slaveMemoryAddrSpaceId;
SpdLogger logger;
Logger logger;
int gpuId;
......@@ -109,7 +109,7 @@ public:
void run(void*);
private:
SpdLogger logger;
Logger logger;
};
} // namespace villas
......
......@@ -69,9 +69,9 @@ villas::gpu::GpuAllocator::getName() const
GpuFactory::GpuFactory() :
Plugin(Plugin::Type::Gpu, "GPU")
Plugin("GPU", "GpuFactory")
{
logger = loggerGetOrCreate("GpuFactory");
logger = villas::logging.get("GpuFactory");
}
// required to be defined here for PIMPL to compile
......@@ -94,7 +94,7 @@ std::string Gpu::getName() const
cudaDeviceProp deviceProp;
if(cudaGetDeviceProperties(&deviceProp, gpuId) != cudaSuccess) {
// logger not yet availabe
loggerGetOrCreate("Gpu")->error("Cannot retrieve properties for GPU {}", gpuId);
villas::logging.get("Gpu")->error("Cannot retrieve properties for GPU {}", gpuId);
throw std::exception();
}
......@@ -442,7 +442,7 @@ Gpu::Gpu(int gpuId) :
pImpl{std::make_unique<impl>()},
gpuId(gpuId)
{
logger = loggerGetOrCreate(getName());
logger = villas::logging.get(getName());
pImpl->gdr = gdr_open();
if(pImpl->gdr == nullptr) {
......
......@@ -112,20 +112,20 @@ public: // TODO: make this private
MemoryManager::AddressSpaceId addrSpaceIdHostToDevice;
protected:
SpdLogger
Logger
getLogger() const
{ return loggerGetOrCreate(name); }
{ return villas::logging.get(name); }
SpdLogger logger;
Logger logger;
};
using CardList = std::list<std::shared_ptr<PCIeCard>>;
class PCIeCardFactory : public Plugin {
class PCIeCardFactory : public plugin::Plugin {
public:
PCIeCardFactory() :
Plugin(Plugin::Type::FpgaCard, "FPGA Card plugin") {}
Plugin("pcie", "Xilinx PCIe FPGA cards") {}
static CardList
make(json_t *json, struct pci* pci, std::shared_ptr<VfioContainer> vc);
......@@ -133,9 +133,9 @@ public:
static PCIeCard*
create();
static SpdLogger
static Logger
getStaticLogger()
{ return loggerGetOrCreate("PCIeCardFactory"); }
{ return villas::logging.get("PCIeCardFactory"); }
};
} // namespace fpga
......
......@@ -37,6 +37,7 @@
#include <jansson.h>
#include <villas/log.hpp>
#include <villas/colors.hpp>
#include <villas/memory.hpp>
#include <villas/plugin.hpp>
......@@ -76,7 +77,7 @@ public:
friend std::ostream&
operator<< (std::ostream& stream, const IpIdentifier& id)
{ return stream << TXT_BOLD(id.name) << " vlnv=" << id.vlnv; }
{ return stream << id.name << " vlnv=" << id.vlnv; }
bool
operator==(const IpIdentifier& otherId) const {
......@@ -212,7 +213,7 @@ protected:
};
/// Specialized logger instance with the IPs name set as category
SpdLogger logger;
Logger logger;
/// FPGA card this IP is instantiated on (populated by FpgaIpFactory)
PCIeCard* card;
......@@ -235,20 +236,18 @@ protected:
class IpCoreFactory : public Plugin {
class IpCoreFactory : public plugin::Plugin {
public:
IpCoreFactory(std::string concreteName) :
Plugin(Plugin::Type::FpgaIp, std::string("IpCore - ") + concreteName)
{}
using plugin::Plugin::Plugin;
/// Returns a running and checked FPGA IP
static IpCoreList
make(PCIeCard* card, json_t *json_ips);
protected:
SpdLogger
Logger
getLogger() const
{ return loggerGetOrCreate(getName()); }
{ return villas::logging.get(getName()); }
private:
/// Create a concrete IP instance
......@@ -263,8 +262,8 @@ private:
virtual std::string getDescription() const = 0;
protected:
static SpdLogger
getStaticLogger() { return loggerGetOrCreate("IpCoreFactory"); }
static Logger
getStaticLogger() { return villas::logging.get("IpCoreFactory"); }
private:
static IpCoreFactory*
......
......@@ -140,7 +140,7 @@ protected:
class IpNodeFactory : public IpCoreFactory {
public:
IpNodeFactory(std::string name) : IpCoreFactory("Ip Node - " + name) {}
using IpCoreFactory::IpCoreFactory;
virtual bool configureJson(IpCore& ip, json_t *json_ip);
};
......
......@@ -51,6 +51,12 @@ public:
getDefaultMasterPort() const
{ return getMasterPort(masterPort); }
void
setLoopback(bool state);
void
resetFrameCounters();
private:
static constexpr const char registerMemory[] = "reg0";
};
......@@ -74,12 +80,6 @@ public:
Vlnv getCompatibleVlnv() const
{ return {"acs.eonerc.rwth-aachen.de:user:aurora_axis:"}; }
void
setLoopback(bool state);
void
resetFrameCounters();
};
} // namespace ip
......
......@@ -60,7 +60,7 @@ class BramFactory : public IpCoreFactory {
public:
BramFactory() :
IpCoreFactory(getName())
IpCoreFactory(getName(), getDescription())
{}
bool configureJson(IpCore& ip, json_t *json_ip);
......
......@@ -85,7 +85,7 @@ class InterruptControllerFactory : public IpCoreFactory {
public:
InterruptControllerFactory() :
IpCoreFactory(getName())
IpCoreFactory(getName(), getDescription())
{}
static constexpr const char*
......
......@@ -66,7 +66,7 @@ private:
class AxiPciExpressBridgeFactory : public IpCoreFactory {
public:
AxiPciExpressBridgeFactory() :
IpCoreFactory(getName()) {}
IpCoreFactory(getName(), getDescription()) {}
static constexpr const char*
getCompatibleVlnvString()
......
......@@ -73,7 +73,7 @@ private:
class AxiStreamSwitchFactory : public IpNodeFactory {
public:
AxiStreamSwitchFactory() :
IpNodeFactory(getName()) {}
IpNodeFactory(getName(), getDescription()) {}
static constexpr const char*
getCompatibleVlnvString()
......
......@@ -77,7 +77,7 @@ class TimerFactory : public IpCoreFactory {
public:
TimerFactory() :
IpCoreFactory(getName())
IpCoreFactory(getName(), getDescription())
{}
IpCore* create()
......
......@@ -100,7 +100,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
loggerStatic->debug("IP initialization order:");
for(auto& id : orderedIps) {
loggerStatic->debug(" {}", TXT_BOLD(id.getName()));
loggerStatic->debug(" " CLR_BLD("{}"), id.getName());
}
// configure all IPs
......@@ -141,7 +141,7 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
// setup generic IP type properties
ip->card = card;
ip->id = id;
ip->logger = loggerGetOrCreate(id.getName());
ip->logger = villas::logging.get(id.getName());
json_t* json_ip = json_object_get(json_ips, id.getName().c_str());
......@@ -157,8 +157,8 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
auto tokens = utils::tokenize(irqEntry, ":");
if(tokens.size() != 2) {
logger->warn("Cannot parse IRQ '{}' of {}",
irqEntry, TXT_BOLD(id.getName()));
logger->warn("Cannot parse IRQ '{}' of " CLR_BLD("{}"),
irqEntry, id.getName());
continue;
}
......@@ -335,11 +335,9 @@ IpCore::dump()
IpCoreFactory*
IpCoreFactory::lookup(const Vlnv &vlnv)
{
for(auto& ip : Plugin::lookup(Plugin::Type::FpgaIp)) {
IpCoreFactory* ipCoreFactory = dynamic_cast<IpCoreFactory*>(ip);
if(ipCoreFactory->getCompatibleVlnv() == vlnv)
return ipCoreFactory;
for(auto& ip : plugin::Registry::lookup<IpCoreFactory>()) {
if(ip->getCompatibleVlnv() == vlnv)
return ip;
}
return nullptr;
......
......@@ -22,7 +22,7 @@
#include <cstdint>
#include <villas/utils.h>
#include <villas/utils.hpp>
#include <villas/fpga/card.hpp>
#include <villas/fpga/ips/aurora.hpp>
......@@ -120,7 +120,7 @@ void Aurora::resetFrameCounters()
}
AuroraFactory::AuroraFactory() :
IpNodeFactory(getName())
IpNodeFactory(getName(), getDescription())
{
}
......
......@@ -43,7 +43,7 @@ namespace ip {
static DmaFactory factory;
DmaFactory::DmaFactory() :
IpNodeFactory(getName())
IpNodeFactory(getName(), getDescription())
{
// nothing to do
}
......
......@@ -42,13 +42,13 @@ static FifoDataFactory factoryData;
FifoFactory::FifoFactory() :
IpNodeFactory(getName())
IpNodeFactory(getName(), getDescription())
{
// nothing to do
}
FifoDataFactory::FifoDataFactory() :
IpNodeFactory(getName())
IpNodeFactory(getName(), getDescription())
{
// nothing to do
}
......
......@@ -26,7 +26,7 @@
#include <villas/config.h>
#include <villas/plugin.hpp>
#include <villas/kernel/kernel.h>
#include <villas/kernel/kernel.hpp>
#include <villas/fpga/card.hpp>
#include <villas/fpga/ips/intc.hpp>
......@@ -61,7 +61,7 @@ InterruptController::init()
for (int i = 0; i < num_irqs; i++) {
/* Try pinning to core */
int ret = kernel_irq_setaffinity(nos[i], card->affinity, nullptr);
int ret = kernel::irq_setaffinity(nos[i], card->affinity, nullptr);
switch(ret) {
case 0:
......
......@@ -25,7 +25,7 @@
#include <string.h>
#include <math.h>
#include <villas/utils.h>
#include <villas/utils.hpp>
#include <villas/log.h>
#include <villas/log_config.h>
#include <villas/plugin.h>
......
......@@ -22,7 +22,7 @@
#include <cstdint>
#include <villas/utils.h>
#include <villas/utils.hpp>
#include <villas/fpga/card.hpp>
#include <villas/fpga/ips/rtds.hpp>
......@@ -93,7 +93,7 @@ double Rtds::getDt()
}
RtdsFactory::RtdsFactory() :
IpNodeFactory(getName())
IpNodeFactory(getName(), getDescription())
{
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment