Thread: [myhdl-list] about MEP 107
Brought to you by:
jandecaluwe
From: Jose I. V. <jo...@dt...> - 2012-08-10 14:28:25
|
Hi all, I'd like to know about the current status of MEP 107 or if there is someone working on it, since I could understand from some messages in the list that at least part of the work might be in progress. In the following paragraphs I'd like to show the source of my interest on this MEP: I'm currently developing a set of libraries upon MyHDL to perform System on Chip integration by using components hosted in public repositories in an easy way. My aim is to develop a tool able to make it easier the use and reuse of components under free licenses such as those found in Opencores in a very straightforward way. The idea is that the components will be hosted at on-line repositories, in a similar way to debian packages, wrapped with an XML description similar to IP-Xact, but simpler and more parameterizable. This way, the SoC description is performed in an object oriented/structural paradigm. Instances are objects created by simple calls to convenience functions like i.e. cpu=get_instance("openrisc"), and interconnection between components is performed through helper methods like comp1.get_wb().connect("wb_int", comp2.get_wb()). The the network of components and links can be converted or cosimulated. One of the key aspects of this structural paradigm is that you can model components as objects in a very parameterizable way, like in example a logic gate which a undefined number of inputs as the simplest case. Or components with an undefined number of Wishbone interfaces in a more complex case. I've already developed an XML description format similar to IP-Xact capable to describe components with this level of parameterizability and I have classed in Python to work with this descriptions and use components hosted in the remote repositories. Currently I'm working in the integration of all of this into MyHDL. My first take, assuming that this external components in the first stage will only be cosimulated or converted since there is no MyHDL models available was to create an abstract class called ExternalComponent. This class models and behaves as any possible external component using the information found in the XML description, to understand the structure of the component's interface, ports, set of files, parameters, etc. So depending on the content of the XML file, the objects will expose a particular interface. This point is where MEP107 plays a key role for me. The component's port list is unknown until a particular component is instances, so it is passed as **kwargs. So being able to dynamically add attributes to the each object instance, that can be used inside the generators could allow to also add a MyHDL simulatable model, since by now, neither object attributes nor kwargs accesses, can be used inside generators. Another solution would be binding kwargs accesses to variables outside generators, but is not possible in this case because the members of kwargs are unknown until a particular component is instanced. By now I've come over it using several hacks, in the first step I made some modifications to MyHDL core to be able to use kwargs inside generators, but I discarded it because it was not a general solution and I wanted to use a MyHDL without modifications. In the second try I used a trick, assigning to locals()["varname"]=kwargs["varname"] I could dynamically bind kwargs to variables that could be used inside generators, but this trick is deprecated in Python 3.0. Finally, I found in MEP 107 to be a much more general solution capable to go over my problem and open a wide range of new modeling techniques. Jose. José Ignacio Villar <jo...@dt...> Departamento de Tecnología Electrónica Escuela Técnica Superior de Ingeniería Informática Universidad de Sevilla Avda. Reina Mercedes, s/n 41012 - Sevilla (Spain) Tlf: 954 55 99 62 Fax: 954 55 27 64 |
From: Jan D. <ja...@ja...> - 2012-08-10 22:02:11
|
Could you provide an example, as simple as possible, of what you try to do? It seems you suggest that attribute access outside a generator (which works in conversion currently) doesn't work for you, inside a generator it would. I don't understand that. On 08/10/2012 04:27 PM, Jose Ignacio Villar wrote: > Hi all, I'd like to know about the current status of MEP 107 or if > there is someone working on it, since I could understand from some > messages in the list that at least part of the work might be in > progress. > > In the following paragraphs I'd like to show the source of my > interest on this MEP: I'm currently developing a set of libraries > upon MyHDL to perform System on Chip integration by using components > hosted in public repositories in an easy way. My aim is to develop a > tool able to make it easier the use and reuse of components under > free licenses such as those found in Opencores in a very > straightforward way. The idea is that the components will be hosted > at on-line repositories, in a similar way to debian packages, wrapped > with an XML description similar to IP-Xact, but simpler and more > parameterizable. This way, the SoC description is performed in an > object oriented/structural paradigm. Instances are objects created by > simple calls to convenience functions like i.e. > cpu=get_instance("openrisc"), and interconnection between components > is performed through helper methods like > comp1.get_wb().connect("wb_int", comp2.get_wb()). The the network of > components and links can be converted or cosimulated. One of the key > aspects of this structural paradigm is that you can model components > as objects in a very parameterizable way, like in example a logic > gate which a undefined number of inputs as the simplest case. Or > components with an undefined number of Wishbone interfaces in a more > complex case. I've already developed an XML description format > similar to IP-Xact capable to describe components with this level of > parameterizability and I have classed in Python to work with this > descriptions and use components hosted in the remote repositories. > Currently I'm working in the integration of all of this into MyHDL. > My first take, assuming that this external components in the first > stage will only be cosimulated or converted since there is no MyHDL > models available was to create an abstract class called > ExternalComponent. This class models and behaves as any possible > external component using the information found in the XML > description, to understand the structure of the component's > interface, ports, set of files, parameters, etc. So depending on the > content of the XML file, the objects will expose a particular > interface. This point is where MEP107 plays a key role for me. The > component's port list is unknown until a particular component is > instances, so it is passed as **kwargs. So being able to dynamically > add attributes to the each object instance, that can be used inside > the generators could allow to also add a MyHDL simulatable model, > since by now, neither object attributes nor kwargs accesses, can be > used inside generators. Another solution would be binding kwargs > accesses to variables outside generators, but is not possible in this > case because the members of kwargs are unknown until a particular > component is instanced. By now I've come over it using several hacks, > in the first step I made some modifications to MyHDL core to be able > to use kwargs inside generators, but I discarded it because it was > not a general solution and I wanted to use a MyHDL without > modifications. In the second try I used a trick, assigning to > locals()["varname"]=kwargs["varname"] I could dynamically bind kwargs > to variables that could be used inside generators, but this trick is > deprecated in Python 3.0. Finally, I found in MEP 107 to be a much > more general solution capable to go over my problem and open a wide > range of new modeling techniques. > > Jose. > > José Ignacio Villar <jo...@dt... <mailto:jo...@dt...>> > Departamento de Tecnología Electrónica Escuela Técnica Superior de > Ingeniería Informática Universidad de Sevilla Avda. Reina Mercedes, > s/n 41012 - Sevilla (Spain) > > Tlf: 954 55 99 62 Fax: 954 55 27 64 > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. > Discussions will include endpoint security, mobile security and the > latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > > _______________________________________________ myhdl-list mailing > list myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com |
From: Christopher F. <chr...@gm...> - 2012-08-28 02:52:37
|
On 8/10/12 9:27 AM, Jose Ignacio Villar wrote: > Hi all, > I'd like to know about the current status of MEP 107 or if there is > someone working on it, since I could understand from some messages in > the list that at least part of the work might be in progress. Sorry for the late reply, I have been extremely busy and will continue to be occupied for a couple months. Best of my knowledge, I have updated the MEP with the latest comments and there are no major objections. The MEP has been proposed and informally accepted(?). I believe, we are ready to move forward with the implementation. Other than basic feasibility experiments I have not made progress on the implementation. It should be noted, while we were discussing the MEP it was noted that "interfaces" can be implemented in version 0.7 but you have to locally reference the Signals in the interface/container. The following is an example of locally referencing the signals. def complex_mult(clock, reset, a, b, c): a_real,a_imag = a.real,a.imag b_real,b_imag = b.real,b.imag c_real,c_imag = c.real,c.imag @always_seq(clock.posedge, reset=rest) def hdl(): c_real.next = (a_real*b_real) + -1*(a_imag*b_imag) c_imag.next = (a_imag*b_real) + (a_real*b_imag) return hdl The full example available here : http://bit.ly/QpEm5j I also have a larger example here : http://bit.ly/QMhDuP, this example might not be of much use without some description? When MEP 107 is implemented the above can be expressed as: def complex_mult(clock, reset, a, b, c): @always_seq(clock.posedge, reset=rest) def hdl(): c.real.next = (a.real*b.real) + -1*(a.imag*b.imag) c.imag.next = (a.imag*b.real) + (a.real*b.imag) return hdl If someone wants to use interfaces today, I don't think the local references is (should be) a huge deterrent. Some have indicated they prefer the local references. Hope that helps, Chris |