Re: [myhdl-list] conversion filename?
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-02-19 12:49:05
|
On 18/02/15 20:44, Henry Gomersall wrote: > On 17/02/15 08:57, Henry Gomersall wrote: >> >There doesn't appear to be a mechanism to set the file/directory name of >> >a converted v* file. Is this correct? >> > >> >It would be really useful to have a mechanism to do so - it could easily >> >be through the same attribute interface as the name etc. If it is not >> >set, then fall back to the current strategy. >> > >> >Having all the v* files dumped into my project root is a bit suboptimal. >> >Of course I can work around it using the full power of python, but it >> >seems like an odd thing to be missing. >> > >> >Is this something that would be accepted? > I've implemented this at: > https://bitbucket.org/heng/myhdl/src/2e9e7807e7cd61c8debe8d73dec3bf2a4cb81124/?at=0.9-dev-set_file_dir > > Tests, code and docs all modified. > > It seemed easier to put some code out their for discussion than await > any more input. > > Comments before I raise a PR? I've raised a PR on this though I can change things as necessary. Essentially, the code adds an optional directory attribute to toVHDL and toVerilog. Leaving the directory attribute as None results in the existing behaviour of putting the files in the current working directory. Setting the directory attribute results in any generated files being placed in that directory (including an test bench files). Cheers, Henry |