Commit 39458cd4 authored by Bruno Gomes's avatar Bruno Gomes

Configurator: while generating IOP physical and logical devices, the generated...

Configurator: while generating IOP physical and logical devices, the generated file name and structs now matches the  physical and logical devices iop.xml id field

refs #203748
parent 214d4c0c
......@@ -136,7 +136,6 @@ ROUTE_LOGICAL_STR = 'Logical Route (Id: {0})'
class LogicalDevice(object):
def __init__(self):
self.idx = 0
self.id = 0
self.name = ''
self.routes = []
......@@ -161,7 +160,6 @@ class LogicalDevice(object):
class PhysicalDevice(object):
def __init__(self):
self.idx = 0
self.id = 0
self.device = ''
self.type = ''
......
......@@ -78,7 +78,6 @@ class IOParser(object):
# store logical device
self.logger.information(2, ldevice.details())
ldevice.idx = len(self.logical_devices)
self.logical_devices.append(ldevice)
return True
......@@ -205,7 +204,6 @@ class IOParser(object):
self.logger.information(2, pdevice.setup.details())
if ( pdevice.type == RTR ):
pdevice.idx = len(self.physical_devices)
self.physical_devices.append(pdevice)
self.logger.event(2, "done PARSING SPWRTR device")
return True
......@@ -231,7 +229,6 @@ class IOParser(object):
self.logger.event(2, "done MIL LIST parsing")
if rc:
pdevice.idx = len(self.physical_devices)
self.physical_devices.append(pdevice)
return rc
......
......@@ -67,7 +67,7 @@ static iop_physical_route_t physical_routes[${len(pdevice.routes)}] =${'\\'}
/**
* @brief Pysical Device configuration
*/
iop_physical_device_t physical_device_${pdevice.idx} =${'\\'}
iop_physical_device_t physical_device_${pdevice.id} =${'\\'}
{
.driver = (iop_device_driver_t *)&device_configuration,
.routes = {
......@@ -89,7 +89,7 @@ iop_physical_device_t physical_device_${pdevice.idx} =${'\\'}
* @brief Physical devices
*/
% for i, device in enumerate(iop_configuration.physical_devices):
extern iop_physical_device_t physical_device_${device.idx};
extern iop_physical_device_t physical_device_${device.id};
% endfor
</%def>
......@@ -98,7 +98,7 @@ extern iop_physical_device_t physical_device_${device.idx};
* @brief Logical devices
*/
% for i, device in enumerate(iop_configuration.logical_devices):
extern iop_logical_device_t logical_device_${device.idx};
extern iop_logical_device_t logical_device_${device.id};
% endfor
</%def>
......
......@@ -24,7 +24,7 @@ ${iop_template.PhysicalDevicesList(iop_configuration)}\
static iop_physical_device_t *physical_device_list[${len(iop_configuration.physical_devices)}] = ${'\\'}
{
% for i, device in enumerate(iop_configuration.physical_devices):
&physical_device_${device.idx},
&physical_device_${device.id},
% endfor
};
......@@ -34,7 +34,7 @@ static iop_physical_device_t *physical_device_list[${len(iop_configuration.physi
static iop_logical_device_t *logical_device_list[${len(iop_configuration.logical_devices)}] = ${'\\'}
{
% for i, device in enumerate(iop_configuration.logical_devices):
&logical_device_${device.idx},
&logical_device_${device.id},
% endfor
};
......
......@@ -46,7 +46,7 @@ static iop_logical_route_t logical_routes[${len(device.routes)}] = ${'\\'}
{
.schedule = route_schedule_${i},
.header = &route_header[${i}],
.device = &physical_device_${route.device.idx}
.device = &physical_device_${route.device.id}
}${',' if i < len(device.routes) - 1 else ''}
% endfor
};
......@@ -54,7 +54,7 @@ static iop_logical_route_t logical_routes[${len(device.routes)}] = ${'\\'}
/**
* @brief Logical Device configuration
*/
iop_logical_device_t logical_device_${device.idx} = ${'\\'}
iop_logical_device_t logical_device_${device.id} = ${'\\'}
{
.routes = {
.length = ${len(device.routes)},
......
......@@ -87,7 +87,7 @@ iop_port_t remote_ports[${len(iop_configuration.ports)}] = {
'&queuing_ports[{0}]'.format(port.iop_queuing_port_idx)},
.device = ${'NULL' \
if port.logical_device is None else \
'&logical_device_{0}'.format(port.logical_device.idx)}
'&logical_device_{0}'.format(port.logical_device.id)}
},
% endfor
};
......
......@@ -223,7 +223,7 @@ def configure_iop(os_configuration, app_configuration, partition, temp_directory
for i, device in enumerate(iop_configuration.physical_devices):
makoutils.applyMAKOTemplate(
os.path.join(air.APP_TEMPLATES_DIRECTORY, 'iop', device.parser[3]),
os.path.join(temp_directory, partition.directory, 'iop_physical_device_{0}.c'.format(i)),
os.path.join(temp_directory, partition.directory, 'iop_physical_device_{0}.c'.format(device.id)),
dict(app_configuration=app_configuration, os_configuration=os_configuration,
iop_configuration=iop_configuration, device=device),
logger, template_includes)
......@@ -232,7 +232,7 @@ def configure_iop(os_configuration, app_configuration, partition, temp_directory
for i, device in enumerate(iop_configuration.logical_devices):
makoutils.applyMAKOTemplate(
os.path.join(air.APP_TEMPLATES_DIRECTORY, 'iop', 'iop_logical_device.mako'),
os.path.join(temp_directory, partition.directory, 'iop_logical_device_{0}.c'.format(i)),
os.path.join(temp_directory, partition.directory, 'iop_logical_device_{0}.c'.format(device.id)),
dict(app_configuration=app_configuration, os_configuration=os_configuration,
iop_configuration=iop_configuration, device=device),
logger, template_includes)
......
Markdown is supported
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