[myhdl-list] MEP 107 need for portmap
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2014-02-14 13:55:15
|
Previously, we had a short discussion that the MEP107 interface conversion for top-levels (e.g modules being converted) introduced a need for a generated /portmap/ [1]. The main uses case, given a module: def m_some_mod(ifc1, ifc2): # ... If I am verifying the above module via co-simulation, without a /portmap/ I would need to manually write a wrapper or manually breakout all the interface /Signals/ when building the /Cosimulation/, example: Cosimualation(simcmd, ifc1_di=ifc1.di, ifc1_do=ifc1.do ... In this case it defeats the purpose of the interfaces. To address this complication Keerthan proposed a /portmap/ be generated in the conversion functions, the above would then become: Cosimulation(simcmd, **portmap) Ahhh, much better :) The /toV*/ functions already return a list generators in the module. The /portmap/ can't be returned from the /toV*/ functions without breaking backwards compatibility. The current proposal is to attach a function attribute to the /toV*/ functions, e.g: toVerilog.portmap The /toV*.portmap/ would be the dictionary of the converted portmap (interface expanded names). I would like to propose and discuss attaching the /portmap/ attribute to the function being converted and not the conversion functions. To me this is a more natural (I don't know if this is generally pythonic (accepted) to have other functions modify and/or add attributes to other functions). In addition, I would propose that generated portmap saved in the /vportmap/ attribute and the /portmap/ attribute to be used as a user defined default port definition. Keerthan has done an amazing job implementing MEP-107, many thanks! He has also created a pull-request for the /toVerilog.portmap/, I wanted to have a short discussion and make sure this is the most flexible path moving forward. Once we finalize the portmap I can update the MEP. Regards, Chris [1] http://thread.gmane.org/gmane.comp.python.myhdl/3223/focus=3318 |