{"action":"created","issue":{"url":"https://api.github.com/repos/phanrahan/magma/issues/233","repository_url":"https://api.github.com/repos/phanrahan/magma","labels_url":"https://api.github.com/repos/phanrahan/magma/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/phanrahan/magma/issues/233/comments","events_url":"https://api.github.com/repos/phanrahan/magma/issues/233/events","html_url":"https://github.com/phanrahan/magma/issues/233","id":347210093,"node_id":"MDU6SXNzdWUzNDcyMTAwOTM=","number":233,"title":"Cast Integers To Constant Modules When The Integers Are Inputs To Wire","user":{"login":"David-Durst","id":1970556,"node_id":"MDQ6VXNlcjE5NzA1NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1970556?v=4","gravatar_id":"","url":"https://api.github.com/users/David-Durst","html_url":"https://github.com/David-Durst","followers_url":"https://api.github.com/users/David-Durst/followers","following_url":"https://api.github.com/users/David-Durst/following{/other_user}","gists_url":"https://api.github.com/users/David-Durst/gists{/gist_id}","starred_url":"https://api.github.com/users/David-Durst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/David-Durst/subscriptions","organizations_url":"https://api.github.com/users/David-Durst/orgs","repos_url":"https://api.github.com/users/David-Durst/repos","events_url":"https://api.github.com/users/David-Durst/events{/privacy}","received_events_url":"https://api.github.com/users/David-Durst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"phanrahan","id":1619443,"node_id":"MDQ6VXNlcjE2MTk0NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1619443?v=4","gravatar_id":"","url":"https://api.github.com/users/phanrahan","html_url":"https://github.com/phanrahan","followers_url":"https://api.github.com/users/phanrahan/followers","following_url":"https://api.github.com/users/phanrahan/following{/other_user}","gists_url":"https://api.github.com/users/phanrahan/gists{/gist_id}","starred_url":"https://api.github.com/users/phanrahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phanrahan/subscriptions","organizations_url":"https://api.github.com/users/phanrahan/orgs","repos_url":"https://api.github.com/users/phanrahan/repos","events_url":"https://api.github.com/users/phanrahan/events{/privacy}","received_events_url":"https://api.github.com/users/phanrahan/received_events","type":"User","site_admin":false},"assignees":[{"login":"phanrahan","id":1619443,"node_id":"MDQ6VXNlcjE2MTk0NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1619443?v=4","gravatar_id":"","url":"https://api.github.com/users/phanrahan","html_url":"https://github.com/phanrahan","followers_url":"https://api.github.com/users/phanrahan/followers","following_url":"https://api.github.com/users/phanrahan/following{/other_user}","gists_url":"https://api.github.com/users/phanrahan/gists{/gist_id}","starred_url":"https://api.github.com/users/phanrahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phanrahan/subscriptions","organizations_url":"https://api.github.com/users/phanrahan/orgs","repos_url":"https://api.github.com/users/phanrahan/repos","events_url":"https://api.github.com/users/phanrahan/events{/privacy}","received_events_url":"https://api.github.com/users/phanrahan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2018-08-02T23:36:09Z","updated_at":"2018-09-12T17:56:15Z","closed_at":null,"author_association":"COLLABORATOR","body":"I can do the following:\r\n```python\r\nwire(1, instance.O)\r\n```\r\nBut I can't do the following:\r\n```python\r\nx = 255\r\nwire(x, instance.O)\r\n```\r\nThis is unintuitive.\r\n\r\nI want the feature for the following use case in my linebuffer:\r\n```python\r\nwire(cls.CE &\r\n                 (valid_counter.O < max(used_coordinates) - origin), valid_counter.CE)\r\n```\r\nIn this case, I want to be able to automatically cast the int from `max(used_coordinates) - origin` to a constant and wire its output up to the `<` comparator."},"comment":{"url":"https://api.github.com/repos/phanrahan/magma/issues/comments/420740912","html_url":"https://github.com/phanrahan/magma/issues/233#issuecomment-420740912","issue_url":"https://api.github.com/repos/phanrahan/magma/issues/233","id":420740912,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDc0MDkxMg==","user":{"login":"leonardt","id":3766436,"node_id":"MDQ6VXNlcjM3NjY0MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/3766436?v=4","gravatar_id":"","url":"https://api.github.com/users/leonardt","html_url":"https://github.com/leonardt","followers_url":"https://api.github.com/users/leonardt/followers","following_url":"https://api.github.com/users/leonardt/following{/other_user}","gists_url":"https://api.github.com/users/leonardt/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardt/subscriptions","organizations_url":"https://api.github.com/users/leonardt/orgs","repos_url":"https://api.github.com/users/leonardt/repos","events_url":"https://api.github.com/users/leonardt/events{/privacy}","received_events_url":"https://api.github.com/users/leonardt/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T17:56:15Z","updated_at":"2018-09-12T17:56:15Z","author_association":"COLLABORATOR","body":"Closing this issue as it seems to have basic support, see these tests: https://github.com/phanrahan/magma/blob/cc09e3e3a69b4703000a9debbe013c912bbdf925/tests/test_wire/test_const.py#L1-L50\r\n\r\nThey check wiring 1, 0 to Bit and wiring 1 to Bits, UInt, SInt.\r\n\r\nFor any future problems related to this feature, let's open up separate issues."}}
{"actor":{"display_login":"leonardt"}}