Skip to content

Commit 1d47282

Browse files
committed
add clkmon and overlapped mask constraints to script
1 parent 5113aa0 commit 1d47282

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/xml_generate.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,14 @@ def yaml_file(filename):
160160
prev_bit = 0x0 #keep track of the even or odd order of bytes globally sent for masking
161161
#% %
162162
config = y['config']
163-
164163
for c in config: # loop over entries in configuration (sensor category)
165164
i = 0 # counter over the number of sensors within a category
166165
names = c['names']
167166
start = c['start']
167+
count = c['count']
168168
for n in names: # loop over names of sensors within a category
169+
if (n=="R0B" and start!=prev_start+prev_count+1):
170+
print("warning: the start address of clkmon should continue from clkr0a")
169171
if 'postfixes' in c:
170172
postfixes = c['postfixes']
171173
j = 0
@@ -191,14 +193,25 @@ def yaml_file(filename):
191193
node = make_node(pp, p, c, j, bit, n)
192194
else : #the low byte with an increasing postfix node by one
193195
node = make_node(pp, p, c, j+1, bit, n)
196+
if (prev_bit == bit and prev_addr == addr and prev_addr != 0) :
197+
print("warning : please check if masks overlapped at node ", n, " addr ", hex(prev_addr))
194198
prev_addr = addr
195199
prev_j = j
196200
prev_bit = bit
197201
i += 1
198202
j += 1
203+
204+
#print("if : n : ", n, " p : ", p, " bit : ", bit)
199205
else:
200206
make_node(cm, n, c, start+i, (start+i)%2, "")
207+
if (prev_bit == (start+i)%2 and prev_addr == int((start+i)/2) and prev_addr != 0) :
208+
print("warning : please check if masks overlapped at node ", n, " addr ", hex(prev_addr))
209+
prev_addr = int((start + i)/2)
210+
prev_bit = (start+i)%2
211+
#print("else : n : ", n, " bit : ", (start+i)%2)
201212
i += 1
213+
prev_start = start
214+
prev_count = count
202215
tree = ET.ElementTree(cm)
203216
ET.indent(tree, space='\t')
204217
#create output file name based on input file, replacing 'yml' with 'xml'

0 commit comments

Comments
 (0)