Re: [myhdl-list] List Of Constants
Brought to you by:
jandecaluwe
From: Josy B. <jos...@gm...> - 2015-03-16 08:17:56
|
> <snip> > > > > Any workaround is a good as any other workaround, but still is a > > workaround. I just added the 4 (in my actual module, not the example) > > constants in the call. > > Workaround was a poor choice or words in this > case, it is an alternative method. Either > way I don't think it was what you were > looking for. > > > None of the workarounds can be classified as _pythonic_, I'd say. What > > if I come up with a 8 * 8 constant matrix (like in JPEG DCT)? And it is > > well supported in VHDL ... > > Either of those approaches, I would argue, are > pythonic but they don't solve the problem you > are trying to solve. > > A 1D list of constants should be convertible a > 2D I believe is not. This (2D) is something that > needs to be added. > <snip> Chris, Replace my wording 'not pythonic' by 'less beautiful'. And 'pythonic' by 'idiomatic Python' as coined by Jeff Knupp in his book (see http://www.jeffknupp.com) You may want to take a look at the example: https://gist.github.com/josyb/af6b7809d976b2559ae4 anyhow. The conversion passes if I send a list of Signals, but the VHDL signals are not initialised. My (final or main) question was whether I am wrong to expect to have those initialised in the VHDL code, as I have assigned in the Python code (and were used by the simulation). I can live with workaround but do believe in improving MyHDL. But I do understand that the current conversion process/code has its limits. Hopefully we can find a good candidate for the GSOC 'Refactor Conversion Code' project. To me the Python (annotated) AST to V* code in one step is perhaps better cut in two phases where we on a line-by-line basis introduce an intermediary representation which we finally translate into text output. The code in _toVHDL.py has seen a few flags introduced to steer the casting (I too did so to 'solve' issues #14 and #15). Maintenance just gets more and more difficult by each added flag? A side-question, how do we label an issue on Github as Enhancement or Question? I drew up this question in the issue page, but didn't post it as I realised it might be interpreted as a 'bug report' which certainly is not my intention. A 1D list of constants only converts in the 'special' case of inferring memory. As I explained to Henry (Gomersall) my code has a 'fixed' index and doesn't get recognised as such. The 2D array of constants was just an (unfortunate?) example to indicate how cumbersome and error-prone typing the 'alternatives' would become. Best regards, Josy |