mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
move VLNV parsing to function
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
This commit is contained in:
parent
411b0ad49e
commit
823ba3281e
2 changed files with 7 additions and 14 deletions
|
@ -207,6 +207,8 @@ class CoreFactory : public plugin::Plugin {
|
|||
public:
|
||||
using plugin::Plugin::Plugin;
|
||||
|
||||
static std::list<IpIdentifier> parseVLNV(json_t *json_ips);
|
||||
|
||||
// Returns a running and checked FPGA IP
|
||||
static std::list<std::shared_ptr<Core>> make(Card *card, json_t *json_ips);
|
||||
|
||||
|
|
|
@ -37,21 +37,10 @@ static std::list<Vlnv> vlnvInitializationOrder = {
|
|||
Vlnv("xilinx.com:ip:axi_iic:"),
|
||||
};
|
||||
|
||||
std::list<std::shared_ptr<Core>> CoreFactory::make(Card *card,
|
||||
json_t *json_ips) {
|
||||
// We only have this logger until we know the factory to build an IP with
|
||||
auto loggerStatic = getStaticLogger();
|
||||
|
||||
std::list<IpIdentifier> allIps; // All IPs available in config
|
||||
std::list<IpIdentifier> orderedIps; // IPs ordered in initialization order
|
||||
|
||||
std::list<std::shared_ptr<Core>> configuredIps; // Successfully configured IPs
|
||||
|
||||
if (!card->ips.empty()) {
|
||||
loggerStatic->error("IP list of card {} already contains IPs.", card->name);
|
||||
throw RuntimeError("IP list of card {} already contains IPs.", card->name);
|
||||
}
|
||||
std::list<IpIdentifier> CoreFactory::parseVLNV(json_t *json_ips) {
|
||||
// Parse all IP instance names and their VLNV into list `allIps`
|
||||
std::list<IpIdentifier> allIps;
|
||||
|
||||
const char *ipName;
|
||||
json_t *json_ip;
|
||||
json_object_foreach(json_ips, ipName, json_ip) {
|
||||
|
@ -64,6 +53,8 @@ std::list<std::shared_ptr<Core>> CoreFactory::make(Card *card,
|
|||
|
||||
allIps.push_back({vlnv, ipName});
|
||||
}
|
||||
return allIps;
|
||||
}
|
||||
|
||||
// Pick out IPs to be initialized first.
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue