cornell-brg / pymtl

Python-based hardware modeling framework
BSD 3-Clause "New" or "Revised" License
235 stars 82 forks source link

[SC import] Add support for implicit/nested set_port, and additional sourcefolder. #154

Closed jsn1993 closed 8 years ago

jsn1993 commented 8 years ago

In summary, those commits provide some convenience in terms of excluding the gigantic set_ports function call and avoiding sourcefolder variable.

  1. Support restricted implicit import where ports in systemc module and ports in pymtl module are all 1-to-1 matched (for now, clk and reset also required). Currently use the ports defined in pymtl files as the port dict if there is no set_ports function call. See pymtl/tools/integration/systemc_tests/implicit_set_ports/.
  2. Support nested import. If the SystemC design has a "portbundle" which adds one more layer, in set_port we could actually set pair like this: <"in.msg":s.in.msg>, where previously pymtl doesn't support dot in the left side string. In conjunction with the implicit import, we're envisioning integrating our SystemC ValRdyBundle implementation to further improve productivity. When the user plugs that bundle in the systemc design and instantiating the existing pymtl ValRdyBundle in the pymtl wrapper, Pymtl will automatically hooks up these two bundles seamlessly. Also some standard message types such as MemMsg will probably be added or automatically generated.
  3. Slightly change the sourcefolder mechanism. Now the folder path of the pymtl module (xxxSC.py) is by default included. As a result, the sourcefolder now is considered to be the "additional search path".