[myhdl-list] Helper Class for HWModule
Brought to you by:
jandecaluwe
From: <ala...@sp...> - 2010-12-29 16:16:56
|
Dear all, Here is a Helper Class to harness HWModule. It parsed the __doc__ string to gather the actual entity definition. It allows me to code stuff like: if __name__ == '__main__': unittest.main() args = [PicAlu.arch] ports = PicAlu._ports # port definition, parsed from __doc__ for i in ports._fields: args.append(getattr(ports, i)) toVHDL.name = 'pic_alu' toVHDL(*args) The __doc__ string shall contain the entity like this: """ op_i: in enum.initstate dat_i: in 8 dat_o: out 8 """ Is this actually the right place to post stuff like this? Kind regards, Alain |