# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import print_function
+from itertools import cycle
Import('*')
t[0] = t[1]
+license_count = int(env['ARMLMD_LICENSE_COUNT'])
+arm_licenses = list((Value(i) for i in range(license_count)))
+license_cycle = cycle(arm_licenses)
+
class ArmFastModelComponent(object):
def __init__(self, project_file, *extra_deps):
project_file = File(project_file)
sources = [project_file]
sources.extend(extra_deps)
env.Command(lib_nodes + self.headers, sources, simgen_action)
+ # Distribute simgen actions among ARM license slots. All actions which
+ # have a given license as a "side effect" will be serialized relative
+ # to each other, meaning the number of licenses being used concurrently
+ # will never be larger than the number of license nodes.
+ #
+ # This allocation is fixed and may not be as optimal as a dynamic one,
+ # but the difference is probably not significant.
+ env.SideEffect(next(license_cycle), lib_nodes[0])
def prepare_env(self, env):
env.Append(LIBPATH=self.libpaths)
os.environ.get('MAXCORE_HOME', '')),
('ARMLMD_LICENSE_FILE', 'ARM license file location',
os.environ.get('ARMLMD_LICENSE_FILE', '')),
+ ('ARMLMD_LICENSE_COUNT',
+ 'The maximum number of ARM licenses to use concurrently', 1),
('SIMGEN', 'simgen executable', os.environ.get('SIMGEN', default_simgen)),
)