[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 21:20:53 BST 2020


--- Comment #7 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #1)
> (In reply to Jacob Lifshay from comment #0)
> > because of how the code is currently laid out, Program needs to be created
> > for every test case. Program as currently implemented is quite slow, since
> > it needs to create files on disk and run external programs. The API should
> > be changed to cache compiled code in memory, try looking up the instructions
> > to compile in a cache before mucking about on disk.
> > Importantly: it needs to *NOT* keep a file open for every Program instance.
> > 
> > My random guess is it could speed up div pipe testing by a factor of 2 in
> > the single-threaded case (more if you don't have a SSD), and easily many
> > more in the multi-threaded case.
> it can't be run multi-threaded: i found that out when trying to put
> the construction of the Simulator object into unit test setup/teardown.

I meant multi-process, though I wasn't planning on sharing a Simulator between
tests at all, though each test still tests everything in test_data.

> the reason is that once a nmigen Simulator has been used in a yield loop,
> it may not be re-used.  not even calling "reset" will work.
> also: running in parallel will actually interfere with the ordering in
> which the tests are created (and appended to test_data).

not anymore, I rewrote that class to not use unittest since that was a misuse
of unittest. It is now just a class for creating test_data.

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

More information about the libre-soc-bugs mailing list