Re: [myhdl-list] delays misconverted in VHDL conversion
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2015-02-11 13:38:01
|
<snip> >> Actually the converted code is wrong, the statements like: >> constant lowTime: integer := 10; >> wait for lowTime ns; >> >> are incorrect, they should either be: >> constant lowTime: integer := 10; >> wait for lowTime * 1.0 ns; >> >> or: >> constant lowTime: time := 10.0 ns; >> wait for lowTime ; >> >> Should be easy to fix in the MyHDL code. > > Can anyone else comment on whether this wants to be fixed? Happy to > raise a PR with some form of a fix. I feel this could easily go into 0.9. > > My reading of the spec suggests the ns is an integral part of the time > type, not some general numerical attribute, so I think the failure is > expected. It sounds like something that should be fixed, I don't recall (without taking the time to look it up) the exact VHDL policy but Joys' and your explanation sounds correct. I would create an issue [1] and include the complete example (the small conversion snippet) and include the warning. With Modelsim a similar error is thrown. $ vcom pck_myhdl_09.vhd clock_driver.vhd Model Technology ModelSim ALTERA vcom 10.1e Compiler 2013.06 Jun 12 2013 -- Loading package STANDARD -- Loading package TEXTIO -- Loading package std_logic_1164 -- Loading package NUMERIC_STD -- Compiling package pck_myhdl_09 -- Compiling package body pck_myhdl_09 -- Loading package pck_myhdl_09 -- Loading package pck_myhdl_09 -- Compiling entity clock_driver -- Compiling architecture MyHDL of clock_driver ** Error: clock_driver.vhd(38): near "ns": expecting ';' ** Error: clock_driver.vhd(44): VHDL Compiler exiting After the issue has been created, if you have a fix, created a PR and someone will decide if it should be part of 0.9 or a later bug fix release. And note, Jan has created a nice outline how to contribute to the project [2]. Regards, Chris [1] https://bitbucket.org/jandecaluwe/myhdl/issues?status=new&status=open [2] http://dev.myhdl.org/guide.html |