mirror of
https://github.com/drasko/codezero.git
synced 2026-01-14 03:43:15 +01:00
Changes since April
Clean up of build directories. Simplifications to capability model.
This commit is contained in:
@@ -10,12 +10,11 @@ from os.path import join
|
||||
from string import Template
|
||||
|
||||
PROJRELROOT = '../../'
|
||||
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), PROJRELROOT)))
|
||||
sys.path.append(os.path.abspath("../"))
|
||||
|
||||
from config.projpaths import *
|
||||
from config.configuration import *
|
||||
from scripts.config.projpaths import *
|
||||
from scripts.config.configuration import *
|
||||
|
||||
containers_menu = \
|
||||
'''
|
||||
@@ -41,44 +40,6 @@ def add_container_constraint(cid):
|
||||
cml_string = containers_constraint % (cid, cid)
|
||||
return cml_string
|
||||
|
||||
device_suppress_rule = \
|
||||
'''
|
||||
when CONT${CONTID}_CAP_DEVICE_${DEVNAME}_USE == y suppress
|
||||
'''
|
||||
|
||||
device_suppress_sym = \
|
||||
'''\tcont${CONTID}_cap_device_${DEVNAME_LOWER}
|
||||
'''
|
||||
|
||||
devices = ['UART1', 'UART2', 'UART3', 'TIMER1',
|
||||
'KEYBOARD0', 'MOUSE0', 'CLCD0']
|
||||
|
||||
#
|
||||
# When a symbol is used by a single container, sometimes it is
|
||||
# necessary to hide it in other containers. This cannot be
|
||||
# achieved statically but rather needs to be autogenerated
|
||||
# depending on the number of containers used.
|
||||
#
|
||||
def generate_container_suppress_rules(ncont):
|
||||
finalstr = ''
|
||||
# For each device on the platform
|
||||
for devname in devices:
|
||||
# Generate rule for each container
|
||||
for cont in range(ncont):
|
||||
# Create string templates
|
||||
rule_templ = Template(device_suppress_rule)
|
||||
sym_templ = Template(device_suppress_sym)
|
||||
|
||||
rulestr = rule_templ.substitute(CONTID = cont, DEVNAME = devname)
|
||||
symstr = ''
|
||||
# Fill for each container
|
||||
for other_cont in range(ncont):
|
||||
if other_cont == cont:
|
||||
continue
|
||||
symstr += sym_templ.substitute(CONTID = other_cont, DEVNAME_LOWER = devname.lower())
|
||||
finalstr += rulestr + symstr + "\n"
|
||||
return finalstr
|
||||
|
||||
def generate_container_cml(arch, ncont):
|
||||
print "Autogenerating new rule file"
|
||||
fbody = ""
|
||||
@@ -96,9 +57,6 @@ def generate_container_cml(arch, ncont):
|
||||
|
||||
fbody += default_number_of_containers
|
||||
|
||||
# Generate inter-container suppression rules for as many rules as containers
|
||||
fbody += generate_container_suppress_rules(ncont)
|
||||
|
||||
# Write each container's rules
|
||||
for cont in range(ncont):
|
||||
with open(CML2_CONT_DEFFILE, "rU") as contdefs:
|
||||
|
||||
Reference in New Issue
Block a user