{"action":"created","issue":{"url":"https://api.github.com/repos/tgingold/ghdl/issues/150","repository_url":"https://api.github.com/repos/tgingold/ghdl","labels_url":"https://api.github.com/repos/tgingold/ghdl/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/tgingold/ghdl/issues/150/comments","events_url":"https://api.github.com/repos/tgingold/ghdl/issues/150/events","html_url":"https://github.com/tgingold/ghdl/issues/150","id":175543646,"number":150,"title":"concatenation fails with \"bound check failure\" during run-time (with std=87)","user":{"login":"pawel256","id":1666232,"avatar_url":"https://avatars.githubusercontent.com/u/1666232?v=3","gravatar_id":"","url":"https://api.github.com/users/pawel256","html_url":"https://github.com/pawel256","followers_url":"https://api.github.com/users/pawel256/followers","following_url":"https://api.github.com/users/pawel256/following{/other_user}","gists_url":"https://api.github.com/users/pawel256/gists{/gist_id}","starred_url":"https://api.github.com/users/pawel256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pawel256/subscriptions","organizations_url":"https://api.github.com/users/pawel256/orgs","repos_url":"https://api.github.com/users/pawel256/repos","events_url":"https://api.github.com/users/pawel256/events{/privacy}","received_events_url":"https://api.github.com/users/pawel256/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-07T16:08:19Z","updated_at":"2016-09-11T08:34:56Z","closed_at":null,"body":"example:\r\n-- concat.vhd START\r\nlibrary ieee; \r\nuse ieee.std_logic_1164.all;\r\n      \r\nentity concat is\r\n   port (\r\n      a : in  std_ulogic_vector(3 downto 0);\r\n      b : in  std_ulogic_vector(3 downto 0);\r\n      q1 : out std_ulogic_vector(7 downto 0);\r\n      q2 : out std_ulogic_vector(7 downto 0);\r\n      q3 : out std_ulogic_vector(7 downto 0)\r\n   );\r\nend concat;\r\n     \r\narchitecture rtl of concat is\r\nbegin\r\n   as_q1: q1 <= \"0000\" & b;\r\n   as_q2: q2 <= a & \"0000\";\r\n   as_q3: q3 <= a & b;\r\nend rtl; \r\n-- concat.vhd END\r\n\r\nconcat.vhd passes build with no errors/warnings\r\nbut, during run time, concatenation in q2 assignment fails:\r\n\r\n$ ./concat --trace-processes\r\nrun process .concat(rtl).as_q1 [00000000194EB700]\r\nrun process .concat(rtl).as_q2 [00000000194EB700]\r\n./concat:error: bound check failure at concat.vhdl:18\r\n./concat:error: simulation failed\r\n\r\nif q2 assignment is commented out, then q3 fails:\r\n\r\n$ ./concat --trace-processes\r\nrun process .concat(rtl).as_q1 [0000000003E50700]\r\nrun process .concat(rtl).as_q3 [0000000003E50700]\r\n./concat:error: bound check failure at concat.vhdl:19\r\n./concat:error: simulation failed\r\n\r\nLooks like in some concatenations the result size is not calculated correctly during run time?\r\n\r\n\r\ntested with:\r\nGHDL 0.33\r\nbackend GCC: 4.9.4\r\n\r\nand with:\r\nGHDL 0.29\r\n"},"comment":{"url":"https://api.github.com/repos/tgingold/ghdl/issues/comments/246168825","html_url":"https://github.com/tgingold/ghdl/issues/150#issuecomment-246168825","issue_url":"https://api.github.com/repos/tgingold/ghdl/issues/150","id":246168825,"user":{"login":"tgingold","id":13433645,"avatar_url":"https://avatars.githubusercontent.com/u/13433645?v=3","gravatar_id":"","url":"https://api.github.com/users/tgingold","html_url":"https://github.com/tgingold","followers_url":"https://api.github.com/users/tgingold/followers","following_url":"https://api.github.com/users/tgingold/following{/other_user}","gists_url":"https://api.github.com/users/tgingold/gists{/gist_id}","starred_url":"https://api.github.com/users/tgingold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgingold/subscriptions","organizations_url":"https://api.github.com/users/tgingold/orgs","repos_url":"https://api.github.com/users/tgingold/repos","events_url":"https://api.github.com/users/tgingold/events{/privacy}","received_events_url":"https://api.github.com/users/tgingold/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T08:34:56Z","updated_at":"2016-09-11T08:34:56Z","body":"Hello,\n\n> I've tried to compile with a never version of GNAT, then with another\n> one - no difference\n> \n> so I dig into the code translation - and in the process found that\n> the generated code depends on the VHDL std option\n> sorry, I have not mentioned that I am using \"--std=87\"\n> (now I see that --std=93 generates different range checks for\n> concatenation -> so boundary check does not fail)\n\nAh, that's the most important point.\n\nSo GHDL uses the v87 standard to compute the range of the\nresult, which results in a bound violation.\nVhdl 87 concatenation rules were slightly broken and fixed\nin vhdl 93.\n\nSo why are you using --std=87 ?\n\nRegards,\nTristan.\n"}}
{"actor":{"display_login":"tgingold"}}