[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 10:47:16 BST 2020


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

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(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.

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).

that said: if you feel that the amount of time saved (by all of us)
would be *significantly* greater than the time taken to create a compile
cache please do go ahead.

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


More information about the libre-soc-bugs mailing list