1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/fpga/lib/ips/bram.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
855 B
C++
Raw Permalink Normal View History

/* Block RAM IP.
2018-06-25 17:03:09 +02:00
*
* Author: Daniel Krebs <github@daniel-krebs.net>
* SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
2018-06-25 17:03:09 +02:00
#include <villas/exceptions.hpp>
2018-08-21 11:07:53 +02:00
#include <villas/fpga/ips/bram.hpp>
using namespace villas;
using namespace villas::fpga::ip;
void BramFactory::parse(Core &ip, json_t *cfg) {
CoreFactory::parse(ip, cfg);
auto &bram = dynamic_cast<Bram &>(ip);
json_error_t err;
int ret = json_unpack_ex(cfg, &err, 0, "{ s: i }", "size", &bram.size);
if (ret != 0)
throw ConfigError(cfg, err, "", "Cannot parse BRAM config");
}
bool Bram::init() {
allocator = std::make_unique<LinearAllocator>(getAddressSpaceId(memoryBlock),
this->size, 0);
return true;
}
static BramFactory f;