{"action":"created","issue":{"url":"https://api.github.com/repos/clash-lang/clash-compiler/issues/79","labels_url":"https://api.github.com/repos/clash-lang/clash-compiler/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/clash-lang/clash-compiler/issues/79/comments","events_url":"https://api.github.com/repos/clash-lang/clash-compiler/issues/79/events","html_url":"https://github.com/clash-lang/clash-compiler/pull/79","id":106787878,"number":79,"title":"Fix Index maxBound","user":{"login":"leonschoorl","id":437852,"avatar_url":"https://avatars.githubusercontent.com/u/437852?v=3","gravatar_id":"","url":"https://api.github.com/users/leonschoorl","html_url":"https://github.com/leonschoorl","followers_url":"https://api.github.com/users/leonschoorl/followers","following_url":"https://api.github.com/users/leonschoorl/following{/other_user}","gists_url":"https://api.github.com/users/leonschoorl/gists{/gist_id}","starred_url":"https://api.github.com/users/leonschoorl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonschoorl/subscriptions","organizations_url":"https://api.github.com/users/leonschoorl/orgs","repos_url":"https://api.github.com/users/leonschoorl/repos","events_url":"https://api.github.com/users/leonschoorl/events{/privacy}","received_events_url":"https://api.github.com/users/leonschoorl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-16T14:40:48Z","updated_at":"2015-09-17T16:57:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/clash-lang/clash-compiler/pulls/79","html_url":"https://github.com/clash-lang/clash-compiler/pull/79","diff_url":"https://github.com/clash-lang/clash-compiler/pull/79.diff","patch_url":"https://github.com/clash-lang/clash-compiler/pull/79.patch"},"body":"This started out as one simple thing, and then became many things.\r\nIf you like I can open separate issues.\r\n\r\n\r\n\r\nFirst the vhdl primitive for maxBound on Index was broken.\r\nHere is a fix for that.\r\n\r\nI also included a test which checks the bounds of Index and some other types.\r\n\r\nBut this test currently fails, because it turns out that when min/maxBound of type Unsigned are converted to Integer, then something breaks.\r\n\r\nWhen translating clash seems think:\r\n```haskell\r\ntoInteger (minBound :: Unsigned 9) == 9\r\ntoInteger (maxBound :: Unsigned 9) == 2^9 -- should be 2^9-1\r\n```\r\n\r\n\r\nFurthermore the testbench for Bounds should currently fail for both VHDL and Verilog.\r\nAnd it does fail in both Modelsim and ISim.\r\nBut I couldn't get iverilog/vvp to fail it on my machine.\r\nIf the vvp test for this succeeds on the Travis CI system in the current state, then is a bug.\r\n"},"comment":{"url":"https://api.github.com/repos/clash-lang/clash-compiler/issues/comments/141147689","html_url":"https://github.com/clash-lang/clash-compiler/pull/79#issuecomment-141147689","issue_url":"https://api.github.com/repos/clash-lang/clash-compiler/issues/79","id":141147689,"user":{"login":"leonschoorl","id":437852,"avatar_url":"https://avatars.githubusercontent.com/u/437852?v=3","gravatar_id":"","url":"https://api.github.com/users/leonschoorl","html_url":"https://github.com/leonschoorl","followers_url":"https://api.github.com/users/leonschoorl/followers","following_url":"https://api.github.com/users/leonschoorl/following{/other_user}","gists_url":"https://api.github.com/users/leonschoorl/gists{/gist_id}","starred_url":"https://api.github.com/users/leonschoorl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonschoorl/subscriptions","organizations_url":"https://api.github.com/users/leonschoorl/orgs","repos_url":"https://api.github.com/users/leonschoorl/repos","events_url":"https://api.github.com/users/leonschoorl/events{/privacy}","received_events_url":"https://api.github.com/users/leonschoorl/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T16:57:37Z","updated_at":"2015-09-17T16:57:37Z","body":"Yes, it will rebase it on the current master, tomorrow.\r\nLet me just check this in the meantime."}}