tinyos/misc/tos-write-image
tinyos/misc/tos-storage-at45db
tinyos/misc/tos-storage-stm25p
+ tinyos/misc/tos-storage-pxa27xp30
tinyos/misc/Makefile
tinyos/ncc/Makefile
tinyos/ncc/mig
tos-set-symbols.1 \
tos-storage-at45db.1 \
tos-storage-stm25p.1 \
+ tos-storage-pxa27xp30.1 \
tos-write-image.1 \
tos-build-deluge-image.1 \
tos-deluge.1
tos-check-env \
tos-storage-stm25p \
tos-storage-at45db \
+ tos-storage-pxa27xp30 \
tos-build-deluge-image \
tos-deluge
tos-storage-at45db - Generate storage volume description code
.SH SYNOPSIS
-\fBtos-storage-at45db\fR \fIplatform-directory\fR
+\fBtos-storage-at45db\fR [\fB-t\fR] \fIplatform-directory\fR
.SH DESCRIPTION
\fBtos-storage-at45db\fR reads a user specification describing the layout
of storage volumes on an Atmel AT45DB-family flash chip, and generates code
describing that layout for use by the TinyOS 2.0 storage subsystem. The
-user specification is in XML and is read from standard input. The code is
-written to standard output.
+user specification is in XML and is read from standard input. With all options,
+the code for a header file is written to standard output. With the
+optional \fB-t\fR flag specified, a VolumeMapC.nc file is generated that provides
+interfaces to all the storage volume abstractions defined in the XML file.
-The argument should specify the platform directory for the current
-compilation target; this is necessary for the correct handling of
-file include statements in the XML input.
+The mandatory \fIplatform-directory\fR argument should specify the platform
+directory for the current compilation target; this is necessary for the correct
+handling of file include statements in the XML input.
This program is normally invoked automatically by the TinyOS build system
when your application directory contains a \fBvolumes-at45db.xml\fR file.
.SH EXAMPLES
- tos-storage-at45db /opt/tinyos-2.x/tos/platforms/mica2 \\
+ tos-storage-at45db -t /opt/tinyos-2.x/tos/platforms/mica2 \\
<volumes-at45db.xml >build/mica2/StorageVolumes.h
.SH SEE ALSO
-.IR tos-storage-stm25p (1)
+.IR tos-storage-stm25p (1)
+.IR tos-storage-pxa27xp30 (1)
from sys import *
from subprocess import Popen, PIPE
-# print an error message and exit
-def nfail(s):
- stderr.write(s + "\n")
- exit(2)
+from getopt import *
+import string
+import commands
+#New way of handling arguments........
+try:
+ opts, args = getopt(argv[1:], "t", [])
+except GetoptError, err:
+ print str(err) # will print something like "option -a not recognized"
+ stderr.write("Usage: tos-storage-at45db [-t] <platform directory>\n")
+
+cthreads = False
+for o, a in opts:
+ if o == "-t":
+ cthreads = True
+ else:
+ assert False, "unhandled option"
-if len(argv) == 2:
- platformdir = argv[1]
+if len( args ) == 1:
+ platformdir = args[0]
# This gives the whole string when there's no / in platformdir
- platform = platformdir[platformdir.rfind("/") + 1:]
-elif len(argv) == 1:
+ platform = platformdir[platformdir.rfind( "/" ) + 1:]
+elif len( args ) == 0:
platformdir = ""
platform = ""
else:
- nfail("Usage: tos-storage-at45db <platform directory>")
+ stderr.write("Usage: tos-storage-at45db [-t] <platform directory>\n")
+
+# print an error message and exit
+def nfail(s):
+ stderr.write(s + "\n")
+ exit(2)
sector_size = 256
flash_size = 2048 # in sectors
volumes = {}
volmap = []
+volumeNames = []
+volumeTypes = dict()
+volumeOptions = dict()
def check_volume(name, base, size):
if base == "":
name = volume.getAttribute("name")
size = volume.getAttribute("size")
base = volume.getAttribute("base")
+ type = string.lower(volume.getAttribute("type"))
+ isCircular = string.upper(volume.getAttribute("circular"))
+ if isCircular == "":
+ isCircular = "FALSE"
if name == None:
nfail("name omitted in volume " + fname)
if size == None:
nfail("size omitted in volume %s %s" % (name, fname))
check_volume(name, base, size)
+
+ volumeNames.append( "VOLUME_" + name )
+ volumeTypes["VOLUME_" + name] = type
+ volumeOptions["VOLUME_" + name] = isCircular
+
for include in dom.documentElement.getElementsByTagName("include"):
included = include.firstChild
if included != None and included.nodeType == included.TEXT_NODE:
print "#undef VB"
print "#endif"
+# output nc file for threads
+if cthreads == True:
+ outFile = open(commands.getstatusoutput("pwd")[1] + "/VolumeMapC.nc", "w")
+ outFile.write("#include \"StorageVolumes.h\" \n")
+ outFile.write("\n")
+ outFile.write("configuration VolumeMapC { \n")
+ outFile.write(" provides { \n")
+ outFile.write(" interface BlockRead[uint8_t volume_id]; \n")
+ outFile.write(" interface BlockWrite[uint8_t volume_id]; \n")
+ outFile.write(" interface LogRead[uint8_t volumeId]; \n")
+ outFile.write(" interface LogWrite[uint8_t volumeId]; \n")
+# outFile.write(" interface Mount[uint8_t volumeId]; \n")
+# outFile.write(" interface ConfigStorage[uint8_t volumeId]; \n")
+ outFile.write(" } \n")
+ outFile.write("} \n")
+ outFile.write("\n")
+ outFile.write("implementation { \n")
+ outFile.write(" components VolumeMapP; \n")
+ outFile.write("\n")
+ outFile.write(" BlockRead = VolumeMapP; \n")
+ outFile.write(" BlockWrite = VolumeMapP; \n")
+ outFile.write(" LogRead = VolumeMapP; \n")
+ outFile.write(" LogWrite = VolumeMapP; \n")
+
+ for i in range(len(volumeNames)):
+ if volumeTypes[volumeNames[i]] == "block":
+ outFile.write("\n")
+ outFile.write(" components new BlockStorageC(" + volumeNames[i] + ") as BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockRead[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockWrite[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+ elif volumeTypes[volumeNames[i]] == "log":
+ outFile.write("\n")
+ outFile.write(" components new LogStorageC(" + volumeNames[i] + ", " + volumeOptions[volumeNames[i]] + ") as LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogRead[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogWrite[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+# elif volumeTypes[volumeNames[i]] == "config":
+# outFile.write(" components new ConfigStorageC(" + volumeNames[i] + ") as ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" Mount[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" ConfigStorage[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("} \n")
+
-#!/usr/bin/python
+#!/Library/Frameworks/Python.framework/Versions/Current/bin/python
# -*- python -*-
# Copyright (c) 2005-2006 Arch Rock Corporation
# All rights reserved.
from sys import *
from xml.dom import minidom
+from getopt import *
+import string
+import commands
+#New way of handling arguments........
+try:
+ opts, args = getopt(argv[1:], "t", [])
+except GetoptError, err:
+ print str(err) # will print something like "option -a not recognized"
+ stderr.write( "Usage: tos-storage-stm25p [-t] <platform directory>\n" )
+
+if len( args ) == 1:
+ platformdir = args[0]
+ # This gives the whole string when there's no / in platformdir
+ platform = platformdir[platformdir.rfind( "/" ) + 1:]
+elif len( args ) == 0:
+ platformdir = ""
+ platform = ""
+else:
+ stderr.write( "Usage: tos-storage-stm25p [-t] <platform directory>\n" )
+
+cthreads = False
+for o, a in opts:
+ if o == "-t":
+ cthreads = True
+ else:
+ assert False, "unhandled option"
+
NUM_SECTORS = 16
SECTOR_SIZE = 2097152
volumeNames = []
volumeSizes = []
volumeOffsets = []
+volumeTypes = dict()
+volumeOptions = dict()
freeSectors = NUM_SECTORS*[ True ]
def error_exit( s ):
volumeNames.append( "VOLUME_PXARESERVED" )
volumeSizes.append( 1 )
volumeOffsets.append( 0 )
+volumeTypes[ "VOLUME_PXARESERVED" ] = ""
freeSectors[ 0 ] = False
# extract information
name = volume.getAttribute( "name" )
size = volume.getAttribute( "size" )
base = volume.getAttribute( "base" )
+ type = string.lower(volume.getAttribute("type"))
+ isCircular = string.upper(volume.getAttribute("circular"))
+ if isCircular == "":
+ isCircular = "FALSE"
+
if name == "":
error_exit( "volume has no name" )
elif not match( "^[a-zA-Z0-9_]+$", name ):
volumeNames.append( "VOLUME_" + name )
volumeSizes.append( size / SECTOR_SIZE )
+ volumeTypes["VOLUME_" + name] = type
+ volumeOptions["VOLUME_" + name] = isCircular
+
if base == "":
volumeOffsets.append( -1 )
else:
print ""
print "#endif"
+
+# output nc file for threads
+if cthreads == True:
+ outFile = open(commands.getstatusoutput("pwd")[1] + "/VolumeMapC.nc", "w")
+ outFile.write("#include \"StorageVolumes.h\" \n")
+ outFile.write("\n")
+ outFile.write("configuration VolumeMapC { \n")
+ outFile.write(" provides { \n")
+ outFile.write(" interface BlockRead[uint8_t volume_id]; \n")
+ outFile.write(" interface BlockWrite[uint8_t volume_id]; \n")
+ outFile.write(" interface LogRead[uint8_t volumeId]; \n")
+ outFile.write(" interface LogWrite[uint8_t volumeId]; \n")
+# outFile.write(" interface Mount[uint8_t volumeId]; \n")
+# outFile.write(" interface ConfigStorage[uint8_t volumeId]; \n")
+ outFile.write(" } \n")
+ outFile.write("} \n")
+ outFile.write("\n")
+ outFile.write("implementation { \n")
+ outFile.write(" components VolumeMapP; \n")
+ outFile.write("\n")
+ outFile.write(" BlockRead = VolumeMapP; \n")
+ outFile.write(" BlockWrite = VolumeMapP; \n")
+ outFile.write(" LogRead = VolumeMapP; \n")
+ outFile.write(" LogWrite = VolumeMapP; \n")
+
+ for i in range(len(volumeNames)):
+ if volumeTypes[volumeNames[i]] == "block":
+ outFile.write("\n")
+ outFile.write(" components new BlockStorageC(" + volumeNames[i] + ") as BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockRead[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockWrite[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+ elif volumeTypes[volumeNames[i]] == "log":
+ outFile.write("\n")
+ outFile.write(" components new LogStorageC(" + volumeNames[i] + ", " + volumeOptions[volumeNames[i]] + ") as LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogRead[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogWrite[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+# elif volumeTypes[volumeNames[i]] == "config":
+# outFile.write(" components new ConfigStorageC(" + volumeNames[i] + ") as ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" Mount[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" ConfigStorage[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("} \n")
\fBtos-storage-pxa27xp30\fR
.SH DESCRIPTION
-\fBtos-storage-pxa27xp30\fR reads a user specification describing the
-layout of storage volumes on an embedded P30 flash in the Intel Xscale
-PXA27X series processor, and generates code describing that layout for
-use by the TinyOS 2.0 storage subsystem. The user specification is in
-XML and is read from standard input. The code is written to standard
-output.
+\fBtos-storage-pxa27xp30\fR reads a user specification describing the layout of
+storage volumes on an embedded P30 flash in the Intel Xscale PXA27X series
+processor, and generates code describing that layout for use by the TinyOS 2.0
+storage subsystem. The user specification is in XML and is read from standard
+input. With all options, the code for a header file is written to standard
+output. With the optional \fB-t\fR flag specified, a VolumeMapC.nc file is
+generated that provides interfaces to all the storage volume abstractions
+defined in the XML file.
+
+The mandatory \fIplatform-directory\fR argument should specify the platform
+directory for the current compilation target; this is necessary for the correct
+handling of file include statements in the XML input.
This program is normally invoked automatically by the TinyOS build system
when your application directory contains a \fBvolumes-pxa27xp30.xml\fR file.
.SH EXAMPLES
- tos-storage-pxa27xp30 <volumes-pxa27xp30.xml >build/telosb/StorageVolumes.h
+ tos-storage-pxa27xp30 -t /opt/tinyos-2.x/tos/platforms/intelmote2 \\
+ <volumes-pxa27xp30.xml >build/telosb/StorageVolumes.h
.SH SEE ALSO
-.IR tos-storage-pxa27xp30 (1)
+.IR tos-storage-stm25p (1)
+.IR tos-storage-at45db (1)
\ No newline at end of file
-#!@pythonpath@
+#!@pathpython@
# -*- python -*-
# Copyright (c) 2005-2006 Arch Rock Corporation
# All rights reserved.
from sys import *
from xml.dom import minidom
+from getopt import *
+import string
+import commands
+#New way of handling arguments........
+try:
+ opts, args = getopt(argv[1:], "t", [])
+except GetoptError, err:
+ print str(err) # will print something like "option -a not recognized"
+ stderr.write( "Usage: tos-storage-stm25p [-t] <platform directory>\n" )
+
+if len( args ) == 1:
+ platformdir = args[0]
+ # This gives the whole string when there's no / in platformdir
+ platform = platformdir[platformdir.rfind( "/" ) + 1:]
+elif len( args ) == 0:
+ platformdir = ""
+ platform = ""
+else:
+ stderr.write( "Usage: tos-storage-stm25p [-t] <platform directory>\n" )
+
+cthreads = False
+for o, a in opts:
+ if o == "-t":
+ cthreads = True
+ else:
+ assert False, "unhandled option"
+
NUM_SECTORS = 16
SECTOR_SIZE = 2097152
volumeNames = []
volumeSizes = []
volumeOffsets = []
+volumeTypes = dict()
+volumeOptions = dict()
freeSectors = NUM_SECTORS*[ True ]
def error_exit( s ):
volumeNames.append( "VOLUME_PXARESERVED" )
volumeSizes.append( 1 )
volumeOffsets.append( 0 )
+volumeTypes[ "VOLUME_PXARESERVED" ] = ""
freeSectors[ 0 ] = False
# extract information
name = volume.getAttribute( "name" )
size = volume.getAttribute( "size" )
base = volume.getAttribute( "base" )
+ type = string.lower(volume.getAttribute("type"))
+ isCircular = string.upper(volume.getAttribute("circular"))
+ if isCircular == "":
+ isCircular = "FALSE"
+
if name == "":
error_exit( "volume has no name" )
elif not match( "^[a-zA-Z0-9_]+$", name ):
volumeNames.append( "VOLUME_" + name )
volumeSizes.append( size / SECTOR_SIZE )
+ volumeTypes["VOLUME_" + name] = type
+ volumeOptions["VOLUME_" + name] = isCircular
+
if base == "":
volumeOffsets.append( -1 )
else:
print ""
print "#endif"
+
+# output nc file for threads
+if cthreads == True:
+ outFile = open(commands.getstatusoutput("pwd")[1] + "/VolumeMapC.nc", "w")
+ outFile.write("#include \"StorageVolumes.h\" \n")
+ outFile.write("\n")
+ outFile.write("configuration VolumeMapC { \n")
+ outFile.write(" provides { \n")
+ outFile.write(" interface BlockRead[uint8_t volume_id]; \n")
+ outFile.write(" interface BlockWrite[uint8_t volume_id]; \n")
+ outFile.write(" interface LogRead[uint8_t volumeId]; \n")
+ outFile.write(" interface LogWrite[uint8_t volumeId]; \n")
+# outFile.write(" interface Mount[uint8_t volumeId]; \n")
+# outFile.write(" interface ConfigStorage[uint8_t volumeId]; \n")
+ outFile.write(" } \n")
+ outFile.write("} \n")
+ outFile.write("\n")
+ outFile.write("implementation { \n")
+ outFile.write(" components VolumeMapP; \n")
+ outFile.write("\n")
+ outFile.write(" BlockRead = VolumeMapP; \n")
+ outFile.write(" BlockWrite = VolumeMapP; \n")
+ outFile.write(" LogRead = VolumeMapP; \n")
+ outFile.write(" LogWrite = VolumeMapP; \n")
+
+ for i in range(len(volumeNames)):
+ if volumeTypes[volumeNames[i]] == "block":
+ outFile.write("\n")
+ outFile.write(" components new BlockStorageC(" + volumeNames[i] + ") as BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockRead[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockWrite[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+ elif volumeTypes[volumeNames[i]] == "log":
+ outFile.write("\n")
+ outFile.write(" components new LogStorageC(" + volumeNames[i] + ", " + volumeOptions[volumeNames[i]] + ") as LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogRead[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogWrite[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+# elif volumeTypes[volumeNames[i]] == "config":
+# outFile.write(" components new ConfigStorageC(" + volumeNames[i] + ") as ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" Mount[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" ConfigStorage[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("} \n")
\fBtos-storage-stm25p\fR reads a user specification describing the layout
of storage volumes on an ST M25P80 flash chip, and generates code
describing that layout for use by the TinyOS 2.0 storage subsystem. The
-user specification is in XML and is read from standard input. The code is
-written to standard output.
+user specification is in XML and is read from standard input. With all options,
+the code for a header file is written to standard output. With the
+optional \fB-t\fR flag specified, a VolumeMapC.nc file is generated that provides
+interfaces to all the storage volume abstractions defined in the XML file.
-The argument should specify the platform directory for the current
-compilation target; this is necessary for the correct handling of
-file include statements in the XML input.
+The mandatory \fIplatform-directory\fR argument should specify the platform
+directory for the current compilation target; this is necessary for the correct
+handling of file include statements in the XML input.
This program is normally invoked automatically by the TinyOS build system
when your application directory contains a \fBvolumes-stm25p.xml\fR file.
.SH EXAMPLES
- tos-storage-stm25p /opt/tinyos-2.x/tos/platforms/telosb \\
+ tos-storage-stm25p -t /opt/tinyos-2.x/tos/platforms/telosb \\
<volumes-stm25p.xml >build/telosb/StorageVolumes.h
.SH SEE ALSO
-.IR tos-storage-stm25p (1)
+.IR tos-storage-pxa27xp30 (1)
+.IR tos-storage-at45db (1)
# @author Jonathan Hui <jhui@archedrock.com>
# @author David Gay
+# @author Kevin Klues <klueska@cs.stanford.edu>
#
# $Revision$
# $Date$
from xml.dom.minidom import *
from subprocess import Popen, PIPE
+from getopt import *
+import string
+import commands
+#New way of handling arguments........
+try:
+ opts, args = getopt(argv[1:], "t", [])
+except GetoptError, err:
+ print str(err) # will print something like "option -a not recognized"
+ stderr.write( "Usage: tos-storage-stm25p [-t] <platform directory>\n" )
+
+if len( args ) == 1:
+ platformdir = args[0]
+ # This gives the whole string when there's no / in platformdir
+ platform = platformdir[platformdir.rfind( "/" ) + 1:]
+elif len( args ) == 0:
+ platformdir = ""
+ platform = ""
+else:
+ stderr.write( "Usage: tos-storage-stm25p [-t] <platform directory>\n" )
+
+cthreads = False
+for o, a in opts:
+ if o == "-t":
+ cthreads = True
+ else:
+ assert False, "unhandled option"
+
def error_exit( s ):
stderr.write( "ERROR: " + s + "\n" )
exit( 2 )
volumeNames = []
volumeSizes = []
volumeOffsets = []
+volumeTypes = dict()
+volumeOptions = dict()
freeSectors = NUM_SECTORS*[ True ]
-if len( argv ) == 2:
- platformdir = argv[1]
- # This gives the whole string when there's no / in platformdir
- platform = platformdir[platformdir.rfind( "/" ) + 1:]
-elif len( argv ) == 1:
- platformdir = ""
- platform = ""
-else:
- error_exit( "Usage: tos-storage-stm25p <platform directory>" )
-
def volumeparse( file, fname, depth ):
if depth > 10:
error_exit( "include nesting too deep - check for cycles" )
name = volume.getAttribute( "name" )
size = volume.getAttribute( "size" )
base = volume.getAttribute( "base" )
+ type = string.lower(volume.getAttribute("type"))
+ isCircular = string.upper(volume.getAttribute("circular"))
+ if isCircular == "":
+ isCircular = "FALSE"
+
if name == "":
error_exit( "volume has no name" )
elif not match( "^[a-zA-Z0-9_]+$", name ):
volumeNames.append( "VOLUME_" + name )
volumeSizes.append( size / SECTOR_SIZE )
+ volumeTypes["VOLUME_" + name] = type
+ volumeOptions["VOLUME_" + name] = isCircular
+
if base == "":
volumeOffsets.append( -1 )
else:
print ""
print "#endif"
+
+# output nc file for threads
+if cthreads == True:
+ outFile = open(commands.getstatusoutput("pwd")[1] + "/VolumeMapC.nc", "w")
+ outFile.write("#include \"StorageVolumes.h\" \n")
+ outFile.write("\n")
+ outFile.write("configuration VolumeMapC { \n")
+ outFile.write(" provides { \n")
+ outFile.write(" interface BlockRead[uint8_t volume_id]; \n")
+ outFile.write(" interface BlockWrite[uint8_t volume_id]; \n")
+ outFile.write(" interface LogRead[uint8_t volumeId]; \n")
+ outFile.write(" interface LogWrite[uint8_t volumeId]; \n")
+# outFile.write(" interface Mount[uint8_t volumeId]; \n")
+# outFile.write(" interface ConfigStorage[uint8_t volumeId]; \n")
+ outFile.write(" } \n")
+ outFile.write("} \n")
+ outFile.write("\n")
+ outFile.write("implementation { \n")
+ outFile.write(" components VolumeMapP; \n")
+ outFile.write("\n")
+ outFile.write(" BlockRead = VolumeMapP; \n")
+ outFile.write(" BlockWrite = VolumeMapP; \n")
+ outFile.write(" LogRead = VolumeMapP; \n")
+ outFile.write(" LogWrite = VolumeMapP; \n")
+
+ for i in range(len(volumeNames)):
+ if volumeTypes[volumeNames[i]] == "block":
+ outFile.write("\n")
+ outFile.write(" components new BlockStorageC(" + volumeNames[i] + ") as BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockRead[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubBlockWrite[" + volumeNames[i] + "] -> BlockStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+ elif volumeTypes[volumeNames[i]] == "log":
+ outFile.write("\n")
+ outFile.write(" components new LogStorageC(" + volumeNames[i] + ", " + volumeOptions[volumeNames[i]] + ") as LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogRead[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write(" VolumeMapP.SubLogWrite[" + volumeNames[i] + "] -> LogStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("\n")
+
+# elif volumeTypes[volumeNames[i]] == "config":
+# outFile.write(" components new ConfigStorageC(" + volumeNames[i] + ") as ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" Mount[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+# outFile.write(" ConfigStorage[" + volumeNames[i] + "] = ConfigStorageC_" + volumeNames[i] + "; \n")
+ outFile.write("} \n")