Make FPGA cache max age configurable

This commit is contained in:
Jude Melton-Houghton
2022-12-09 19:09:03 -05:00
parent 4948ebb8be
commit 5a403ed703
2 changed files with 8 additions and 1 deletions

View File

@@ -330,9 +330,10 @@ plg.compile_with_cache = function(instr)
end
-- Entries are removed from the cache if they are unused for at least a minute.
local compile_cache_max_age = mesecon.setting("fpga_cache_max_age", 1)
local function clean_compile_cache()
for instr, entry in pairs(compile_cache) do
if entry.age < 1 then
if entry.age < compile_cache_max_age then
entry.age = entry.age + 1
else
compile_cache[instr] = nil