Commit 5e97a7d8 by Eddie Hung

Update assert_area.py

parent d4da1447
...@@ -34,17 +34,17 @@ for fn in glob.glob('*.v'): ...@@ -34,17 +34,17 @@ for fn in glob.glob('*.v'):
count_DFF = 0 count_DFF = 0
if Mreg and (A > 25 or B > 18): if Mreg and (A > 25 or B > 18):
count_DFF += A + B count_DFF += A + B
if not macc: if not macc and (A > 25) ^ (B > 18):
count_DFF -= 1 # For pure multipliers, expect last slice to absorb count_DFF -= 1 # For pure multipliers with just one big dimension,
# at least one register # expect last slice to absorb at least one register
if Preg and (A > 25 or B > 18): if Preg and (A > 25 or B > 18):
count_DFF += A + B count_DFF += A + B
if macc: if macc:
count_DFF += 5 # In my testcases, accumulator is always count_DFF += 5 # In my testcases, accumulator is always
# 5bits bigger than multiplier result # 5bits bigger than multiplier result
else: elif (A > 25) ^ (B > 18):
count_DFF -= 1 # For pure multipliers, expect last slice to absorb count_DFF -= 1 # For pure multipliers with just one big dimension,
# at least one register # expect last slice to absorb at least one register
# TODO: More assert on number of CARRY and LUTs # TODO: More assert on number of CARRY and LUTs
count_CARRY = '' count_CARRY = ''
if not macc and (A <= 25 or B <= 18): if not macc and (A <= 25 or B <= 18):
...@@ -56,7 +56,7 @@ for fn in glob.glob('*.v'): ...@@ -56,7 +56,7 @@ for fn in glob.glob('*.v'):
print(''' print('''
`ifndef _AUTOTB `ifndef _AUTOTB
module __test ; module __test ;
wire [4095:0] assert_area = "cd {0}; select t:DSP48E1 -assert-count {1}; select t:FD* -assert-max {2}{3}"; wire [4095:0] assert_area = "cd {0}; select t:DSP48E1 -assert-max {1}; select t:FD* -assert-max {2}{3}";
endmodule endmodule
`endif `endif
'''.format(os.path.splitext(fn)[0], count_MAC, count_DFF, count_CARRY), file=f) '''.format(os.path.splitext(fn)[0], count_MAC, count_DFF, count_CARRY), file=f)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment