mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
lib/ip: save address space ids for each bus master interface
This commit is contained in:
parent
5d99f11a34
commit
36259d00e0
2 changed files with 16 additions and 3 deletions
|
@ -208,6 +208,9 @@ protected:
|
|||
|
||||
/// Cached translations from the process address space to each memory block
|
||||
std::map<std::string, MemoryTranslation> addressTranslations;
|
||||
|
||||
/// AXI bus master interfaces to access memory somewhere
|
||||
std::map<std::string, MemoryManager::AddressSpaceId> busMasterInterfaces;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -195,15 +195,25 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips)
|
|||
if(json_is_object(json_memory_view)) {
|
||||
logger->debug("Parse memory view of {}", *ip);
|
||||
|
||||
// create a master address space because this IP has a memory view
|
||||
const MemoryManager::AddressSpaceId myAddrSpaceId =
|
||||
MemoryManager::get().getOrCreateAddressSpace(id.getName());
|
||||
|
||||
// now find all slave address spaces this master can access
|
||||
const char* bus_name;
|
||||
json_t* json_bus;
|
||||
json_object_foreach(json_memory_view, bus_name, json_bus) {
|
||||
|
||||
// this IP has a memory view => it is a bus master somewhere
|
||||
|
||||
// assemble name for master address space
|
||||
const std::string myAddrSpaceName =
|
||||
MemoryManager::getMasterAddrSpaceName(ip->getInstanceName(),
|
||||
bus_name);
|
||||
// create a master address space
|
||||
const MemoryManager::AddressSpaceId myAddrSpaceId =
|
||||
MemoryManager::get().getOrCreateAddressSpace(myAddrSpaceName);
|
||||
|
||||
ip->busMasterInterfaces[bus_name] = myAddrSpaceId;
|
||||
|
||||
|
||||
const char* instance_name;
|
||||
json_t* json_instance;
|
||||
json_object_foreach(json_bus, instance_name, json_instance) {
|
||||
|
|
Loading…
Add table
Reference in a new issue