Re: [myhdl-list] MEP : Signal Containers
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2012-05-19 20:34:30
|
On 5/19/12 9:20 AM, Norbo wrote: > > My idea is to bring it together: At one point I did have them in the same MEP. But at this time I think it would be best to keep them separate. But I do think they can be used in conjunction and future MEPs might add some additional features to combine. At this point I think the current enhancement is work enough. <snip> > What if the "self" is accepted as a class instance and every signal of it > is written in the conversion as a port signal also > Becaus then it is probably posible to write Whisbone pheriperials like > this: > > class WishboneBus(object): > def __init__(self, DataWidth=16, AddressWidth=8): > self.clk = Signal(False) > self.rst = Signal(False) > self.cyc = Signal(False) > self.stb = Signal(False) > self.adr = Signal(intbv(0)[AddressWeidth:]) > self.dat_i = Signal(intbv(0)[DataWidth:]) > self.dat_o = Signal(intbv(0)[DataWidth:]) > self.we = Signal(False) > self.sel = Signal(intbv(0)[int(DataWidth/8)"]) > self.ack = Signal(False) > > class WbPheripherialClass(WishboneBus) ### inherits all signals from > WishbonBus > def WbGpio(self,outs, ints): ### the self stand for all the WishbonBus > signals > @always_comb > def ....... > > def WbRS232(self,iRX, oTX): > ..... My concern with this is that attributes would be limited to ports and not also available as non-ports. I think there are cases where you might just want to use attributes internally or maybe a mix, e.g. only pass a subset of the signals to a separate module. Regards, Chris Felton |