From 01f99ad3388d10f41c784bbc0a2bd4bf1eec777b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 10 Oct 2021 15:45:16 +0100 Subject: [PATCH] add a check of bitp against the expected partition points when going through the elwidths https://bugs.libre-soc.org/show_bug.cgi?id=713#c47 --- src/ieee754/part/layout_experiment.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ieee754/part/layout_experiment.py b/src/ieee754/part/layout_experiment.py index a9806c55..1b2f6f0a 100644 --- a/src/ieee754/part/layout_experiment.py +++ b/src/ieee754/part/layout_experiment.py @@ -98,6 +98,12 @@ if __name__ == '__main__': val = yield pval # get nmigen to evaluate pp ppt.append(val) pprint((i, (ppt,b,c,d,e))) + # check the results against bitp static-expected partition points + # https://bugs.libre-soc.org/show_bug.cgi?id=713#c47 + # https://stackoverflow.com/a/27165694 + ival = int(''.join(map(str, map(int, ppt))), 2) + assert ival == bitp[i] + sim = Simulator(m) sim.add_process(process) sim.run() -- 2.30.2