[Libre-soc-bugs] [Bug 438] add caching/memoization to soc.simulator.program.Program

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jul 24 12:06:30 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=438

--- Comment #4 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
got it.

diff --git a/src/soc/fu/div/test/test_pipe_caller.py
b/src/soc/fu/div/test/test_pipe_caller.py
index 6753f8ad..a5e83887 100644
--- a/src/soc/fu/div/test/test_pipe_caller.py
+++ b/src/soc/fu/div/test/test_pipe_caller.py
@@ -208,8 +208,9 @@ class DivTestCases:
                     initial_regs = [0] * 32
                     initial_regs[1] = ra
                     initial_regs[2] = rb
-                    prog = Program(l, bigendian)
-                    self.run_test_program(prog, initial_regs)
+                    # use "with" so as to close the files used
+                    with Program(l, bigendian) as prog:
+                        self.run_test_program(prog, initial_regs)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list