pymtl / pymtl3

Pymtl 3 (Mamba), an open-source Python-based hardware generation, simulation, and verification framework
BSD 3-Clause "New" or "Revised" License
388 stars 46 forks source link

GC fix & translation performance opt #181

Closed jsn1993 closed 4 years ago

jsn1993 commented 4 years ago

I wanted to fix the gc failure that caused out of memory when running a large amount of big tests, when a module is translated and then imported. Then I found that the _rtlir_cache is a global object which actually contains pointers to the components. I had to reimplement the RTLIR_cache.

Meanwhile, I did some profiling and managed to get rid of lots of overheads during translation.

codecov[bot] commented 4 years ago

Codecov Report

Merging #181 into master will decrease coverage by 0.09%. The diff coverage is 94.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
- Coverage   88.98%   88.88%   -0.10%     
==========================================
  Files         292      293       +1     
  Lines       25447    25371      -76     
==========================================
- Hits        22643    22551      -92     
- Misses       2804     2820      +16     
Impacted Files Coverage Δ
...kends/generic/behavioral/BehavioralTranslatorL0.py 100.00% <ø> (+10.00%) :arrow_up:
...sses/backends/yosys/import_/VerilatorImportPass.py 46.80% <ø> (-3.20%) :arrow_down:
pymtl3/passes/rtlir/rtype/RTLIRDataType.py 92.64% <ø> (+1.15%) :arrow_up:
pymtl3/passes/testcases/test_cases.py 85.61% <ø> (ø)
pymtl3/passes/rtlir/rtype/RTLIRType.py 85.22% <86.06%> (-2.86%) :arrow_down:
...ds/verilog/test/TranslationImport_adhoc_gc_test.py 94.44% <94.44%> (ø)
...rtlir/behavioral/BehavioralRTLIRTypeCheckL1Pass.py 91.82% <96.96%> (-0.26%) :arrow_down:
pymtl3/passes/backends/generic/RTLIRTranslator.py 88.13% <100.00%> (-0.39%) :arrow_down:
...kends/generic/behavioral/BehavioralTranslatorL1.py 85.50% <100.00%> (-0.61%) :arrow_down:
...kends/generic/behavioral/BehavioralTranslatorL2.py 92.85% <100.00%> (-0.90%) :arrow_down:
... and 49 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b55f198...758a83a. Read the comment docs.