From 6865029e20101d4c21136c0f957dfe96d8b63667 Mon Sep 17 00:00:00 2001 From: Milan Stevanovic Date: Fri, 19 Oct 2012 11:25:51 +0200 Subject: common/lib/mmtcgen: update mmtcgen scripts, closes #3449 This commit updates mmtcgen scripts to allow different prefix MME to have the same mmtype. --- common/lib/mmtcgen/const.py | 6 ++++++ common/lib/mmtcgen/core.py | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'common/lib') diff --git a/common/lib/mmtcgen/const.py b/common/lib/mmtcgen/const.py index 75887422fd..5c8d384e94 100644 --- a/common/lib/mmtcgen/const.py +++ b/common/lib/mmtcgen/const.py @@ -34,6 +34,10 @@ DRV_MIN = 0xB000 DRV_MAX = 0xBFFF VS_MIN = 0xA000 VS_MAX = (DRV_MIN - 1) +MS_MIN = 0x8000 +MS_MAX = 0x801C +IMAC_MIN = 0xA800 +IMAC_MAX = 0xA804 MMTYPES_MIN_MAX = [ ["CC", CC_MIN, CC_MAX], @@ -42,4 +46,6 @@ MMTYPES_MIN_MAX = [ ["CM", CM_MIN, CM_MAX], ["DRV", DRV_MIN, DRV_MAX], ["VS", VS_MIN, VS_MAX], + ["MS", MS_MIN, MS_MAX], + ["IMAC", IMAC_MIN, IMAC_MAX], ] diff --git a/common/lib/mmtcgen/core.py b/common/lib/mmtcgen/core.py index 52ac0c461f..b6eae0cc90 100644 --- a/common/lib/mmtcgen/core.py +++ b/common/lib/mmtcgen/core.py @@ -33,7 +33,14 @@ class MMTypeConstGen: % mmtypelist[i].name raise RuntimeError (msg) for j in range (i + 1, len (mmtypelist)): - if mmtypelist[i].value == mmtypelist[j].value: + for c in MMTYPES_MIN_MAX: + if mmtypelist[i].name.startswith(c[0]): + len_i = len (c[0]) + if mmtypelist[j].name.startswith(c[0]): + len_j = len (c[0]) + if mmtypelist[i].value == mmtypelist[j].value \ + and mmtypelist[i].name[0:len_i] \ + == mmtypelist[j].name[0:len_j]: msg = "Duplicated MMType value for %s %s" % \ (mmtypelist[i].name, mmtypelist[j].name) raise RuntimeError (msg) -- cgit v1.2.3