Re: [myhdl-list] GSoC'16 | JPEG Encoder
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2016-03-04 12:25:25
|
On 3/3/2016 1:37 AM, Nicolas Pinault wrote: > Hi, Le 02/03/2016 15:09, Henry Gomersall a écrit : >> On 02/03/16 13:59, Henry Gomersall wrote: >>> E.g. when the DSP has to be pipelined to maximize throughput, >>> it's no longer just a multiplier and the code has to reflect >>> that. You could create a multiplier block with pipeline stages >>> incorporated, but then you're more or less doing as I suggest >>> (and still with no guarantees the synthesizer will do the right >>> thing). >> I wrote an inline complex multiplier based around a single DSP >> which really gets into the guts of the DSP core. It's hard to see >> how one would do this in plain VHDL with a hope that it would be >> inferred correctly (the difficulty is in things like flicking >> control registers mid pipeline from multiply-add to >> multiply-accumulate to multiply-deccumulate). > I have discovered MyHDL recently and considering using it. I have > followed your discussion and get questions : - How is it possible to > "switch" the underlying resources ("inner primitive blocks can be > switched") ? - Why do you say you can do things with MyHDL but not > VHDL (your complex multiplier) ? > > Nicolas In Python (and myhdl) it is easier to manage all this complex information. If you want to write a module that is a portable across technologies as possible but in most cases requires using a specific primitive in Python/myhdl you could right something like: def my_module(portmap, techinfo): ven, dev = techinfo.vendor, techinfo.device if ven in modprim and dev in modprim[ven]: prim_inst = modprim[ven][dev](prim_intf) else: prim_inst = prim_beh(prim_intf) You might be able to do this in VHDL but it would be more cumbersome and not as many tools and features to help manage. The difficult part is coming up with a generic interface that can map to all the various prims, if not then you need a specific module that uses each specific primitive and select on the modules not the primitives. That is assuming you want to explicitly instantiate a primitive that you have wrapper with user-defined code. As the other comments have discussed, using similar approaches you can drive the organization base on a the parameters. Regards, Chris |