{"action":"opened","issue":{"url":"https://api.github.com/repos/cornell-brg/pymtl/issues/126","labels_url":"https://api.github.com/repos/cornell-brg/pymtl/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/cornell-brg/pymtl/issues/126/comments","events_url":"https://api.github.com/repos/cornell-brg/pymtl/issues/126/events","html_url":"https://github.com/cornell-brg/pymtl/issues/126","id":58138328,"number":126,"title":"Support `s.connect()` with constant `Bits` object","user":{"login":"cbatten","id":6853045,"avatar_url":"https://avatars.githubusercontent.com/u/6853045?v=3","gravatar_id":"","url":"https://api.github.com/users/cbatten","html_url":"https://github.com/cbatten","followers_url":"https://api.github.com/users/cbatten/followers","following_url":"https://api.github.com/users/cbatten/following{/other_user}","gists_url":"https://api.github.com/users/cbatten/gists{/gist_id}","starred_url":"https://api.github.com/users/cbatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbatten/subscriptions","organizations_url":"https://api.github.com/users/cbatten/orgs","repos_url":"https://api.github.com/users/cbatten/repos","events_url":"https://api.github.com/users/cbatten/events{/privacy}","received_events_url":"https://api.github.com/users/cbatten/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cornell-brg/pymtl/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-18T22:20:48Z","updated_at":"2015-02-18T22:20:48Z","closed_at":null,"body":"It looks likes pymtl is unable to support using Bits objects as constants.  For example, if we wish to connect a constant to an input port, pymtl will accept a constant literal, but not a bits object:\r\n \r\n```\r\n  # A left-shift\r\n      \r\n  s.lshift = LeftLogicalShifter( a_nbits, 1 )\r\n  ...\r\n  s.connect( Bits( 1, 1 ), s.lshift.shamt )\r\n```\r\n\r\nCauses py.test to complain:\r\n\r\n``` \r\nE     AttributeError: 'Bits' object has no attribute '_signal'\r\n```\r\n\r\nHowever, using a constant literal, instead, causes no such error:\r\n\r\n```\r\n  # A left-shift\r\n        \r\n  s.lshift = LeftLogicalShifter( a_nbits, 1 )\r\n  ...\r\n  s.connect( 1, s.lshift.shamt )\r\n```\r\n"}}