[myhdl-list] attribute enum_encoding: string;
Brought to you by:
jandecaluwe
From: David H. <da...@ad...> - 2013-09-03 21:25:27
|
Hello, When using ghdl for syntax checks, I get the following error for any state machine where encoding="one_hot": pcie_drx.vhd:137:11: no declaration for "enum_encoding" I can resolve ghdl's complaints by adding attribute enum_encoding: string; to the generated .vhd file. Is there a way to have this line included automatically in .vhd output? I could add it via a shell script, but I'm wondering if there is "better way" to do it. (or is GHDL in error?) For example, here is an trimmed-down excerpt from the top of the .vhd file showing where I add the line: package pck_pcie_drx is > attribute enum_encoding: string; <--- I need to add this line. type t_enum_t_state_22 is ( > IDLE, THINK, SEND_CMD, ADVANCE ); attribute enum_encoding of t_enum_t_state_22: type is "0001 0010 0100 1000"; type t_enum_t_state_23 is ( > CMD, > MWR_H0H1, > MWR32_H2D0, > MWR32_D1D2, > MWR32_D3XX, > MWR64_H2H3, > MWR64_D0D1, > DROP > ); > attribute enum_encoding of t_enum_t_state_23: type is "00000001 00000010 > 00000100 00001000 00010000 00100000 01000000 10000000"; > end package pck_pcie_drx; > library IEEE; > etc... - David ps: Thank you for the fantastic MyHDL. |