/* Block RAM IP. * * Author: Daniel Krebs * SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University * SPDX-License-Identifier: Apache-2.0 */ #include #include using namespace villas; using namespace villas::fpga::ip; void BramFactory::parse(Core &ip, json_t *cfg) { CoreFactory::parse(ip, cfg); auto &bram = dynamic_cast(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(getAddressSpaceId(memoryBlock), this->size, 0); return true; } static BramFactory f;