{"action":"created","comment":{"url":"https://api.github.com/repos/VUnit/vunit/pulls/comments/172017492","pull_request_review_id":100975551,"id":172017492,"diff_hunk":"@@ -0,0 +1,131 @@\n+-- This Source Code Form is subject to the terms of the Mozilla Public\n+-- License, v. 2.0. If a copy of the MPL was not distributed with this file,\n+-- You can obtain one at http://mozilla.org/MPL/2.0/.\n+--\n+-- Slawomir Siluk slaweksiluk@gazeta.pl 2018\n+-- Wishbone slave wrapper for Vunit memory VC\n+-- TODO:\n+-- * wb sel\n+-- * err and rty responses\n+-- * Memory:\n+--    - variable memory size (currenlty 1024Bytes)\n+--    - variable address range\n+--    - consider passing memory object to slave instead of\n+--      create it locally\n+\n+library ieee;\n+use ieee.std_logic_1164.all;\n+use ieee.numeric_std.all;\n+\n+library vunit_lib;\n+context vunit_lib.vunit_context;\n+context work.com_context;\n+\n+use work.memory_pkg.all;\n+\n+library osvvm;\n+use osvvm.RandomPkg.all;\n+\n+entity wishbone_slave is\n+  generic (\n+    max_ack_dly : natural := 0;\n+    rand_stall  : boolean := false\n+  );\n+  port (\n+    clk   : in std_logic;\n+    adr   : in std_logic_vector;\n+    dat_i : in  std_logic_vector;\n+    dat_o : out std_logic_vector;\n+    sel   : in std_logic_vector;\n+    cyc   : in std_logic;\n+    stb   : in std_logic;\n+    we    : in std_logic;\n+    stall : out std_logic;\n+    ack   : out  std_logic\n+    );\n+end entity;\n+\n+architecture a of wishbone_slave is\n+\n+  constant ack_actor        : actor_t := new_actor(\"slave ack actor\");\n+  constant slave_logger     : logger_t := get_logger(\"slave\");\n+  constant slave_write_msg  : msg_type_t := new_msg_type(\"wb slave write\");\n+  constant slave_read_msg   : msg_type_t := new_msg_type(\"wb slave read\");\n+begin\n+\n+  show(slave_logger, display_handler, verbose);\n+\n+  request : process\n+    variable wr_request_msg : msg_t;\n+    variable rd_request_msg : msg_t;\n+  begin\n+    wait until (cyc and stb) = '1' and stall = '0' and rising_edge(clk);\n+    if we = '1' then\n+      wr_request_msg := new_msg(slave_write_msg);\n+      -- For write address and data is passed to ack proc\n+      push_integer(wr_request_msg, to_integer(unsigned(adr)));\n+      push_std_ulogic_vector(wr_request_msg, dat_i);\n+      send(net, ack_actor, wr_request_msg);\n+    elsif we = '0' then\n+      rd_request_msg := new_msg(slave_read_msg);\n+      -- For read, only address is passed to ack proc\n+      push_integer(rd_request_msg, to_integer(unsigned(adr)));\n+      send(net, ack_actor, rd_request_msg);\n+    end if;\n+  end process;\n+\n+  acknowledge : process\n+    variable request_msg : msg_t;\n+    variable msg_type : msg_type_t;\n+    variable data : std_logic_vector(dat_i'range);\n+    variable addr : natural;\n+    variable memory : memory_t := new_memory;","path":"vunit/vhdl/verification_components/src/wishbone_slave.vhd","position":82,"original_position":82,"commit_id":"686acd11a5be273a1cc25e54cbae632d7828caa4","original_commit_id":"686acd11a5be273a1cc25e54cbae632d7828caa4","user":{"login":"slaweksiluk","id":8343719,"avatar_url":"https://avatars0.githubusercontent.com/u/8343719?v=4","gravatar_id":"","url":"https://api.github.com/users/slaweksiluk","html_url":"https://github.com/slaweksiluk","followers_url":"https://api.github.com/users/slaweksiluk/followers","following_url":"https://api.github.com/users/slaweksiluk/following{/other_user}","gists_url":"https://api.github.com/users/slaweksiluk/gists{/gist_id}","starred_url":"https://api.github.com/users/slaweksiluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaweksiluk/subscriptions","organizations_url":"https://api.github.com/users/slaweksiluk/orgs","repos_url":"https://api.github.com/users/slaweksiluk/repos","events_url":"https://api.github.com/users/slaweksiluk/events{/privacy}","received_events_url":"https://api.github.com/users/slaweksiluk/received_events","type":"User","site_admin":false},"body":"I'm going to pass memory as entity generic. Should I still use to_vc_interface in that case? I will look for some examples in existing vunit VC's.","created_at":"2018-03-03T13:48:51Z","updated_at":"2018-03-03T13:48:52Z","html_url":"https://github.com/VUnit/vunit/pull/312#discussion_r172017492","pull_request_url":"https://api.github.com/repos/VUnit/vunit/pulls/312","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/VUnit/vunit/pulls/comments/172017492"},"html":{"href":"https://github.com/VUnit/vunit/pull/312#discussion_r172017492"},"pull_request":{"href":"https://api.github.com/repos/VUnit/vunit/pulls/312"}},"in_reply_to_id":172013962},"pull_request":{"url":"https://api.github.com/repos/VUnit/vunit/pulls/312","id":172528976,"html_url":"https://github.com/VUnit/vunit/pull/312","diff_url":"https://github.com/VUnit/vunit/pull/312.diff","patch_url":"https://github.com/VUnit/vunit/pull/312.patch","issue_url":"https://api.github.com/repos/VUnit/vunit/issues/312","number":312,"state":"open","locked":false,"title":"Wishbone BFM","user":{"login":"slaweksiluk","id":8343719,"avatar_url":"https://avatars0.githubusercontent.com/u/8343719?v=4","gravatar_id":"","url":"https://api.github.com/users/slaweksiluk","html_url":"https://github.com/slaweksiluk","followers_url":"https://api.github.com/users/slaweksiluk/followers","following_url":"https://api.github.com/users/slaweksiluk/following{/other_user}","gists_url":"https://api.github.com/users/slaweksiluk/gists{/gist_id}","starred_url":"https://api.github.com/users/slaweksiluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaweksiluk/subscriptions","organizations_url":"https://api.github.com/users/slaweksiluk/orgs","repos_url":"https://api.github.com/users/slaweksiluk/repos","events_url":"https://api.github.com/users/slaweksiluk/events{/privacy}","received_events_url":"https://api.github.com/users/slaweksiluk/received_events","type":"User","site_admin":false},"body":"I think my implementations of Wishbone Slave and Master Bus Functional Models are ready to be reviewed. Currently only pipelined mode is supported. Read/Write cycles lengths can be 1 (Single Read/Write) or more (Block Read/Write).\r\n\r\n### Wishbone Slave BFM\r\nIt is wrapper for Vunit memory VC. Currently memory is internal variable, but it should rather be passed as generic parameter. Manual tb with generic test cases is provided.\r\n\r\n### Wishbone Master BFM\r\nReceives bus write and bus read messages from main sequencer. Consecutive groups of bus write/reads messages are merged into block cycles. Cycle is finished when next message is the opposite action (e.g write command after read) or there is no more messages in actor inbox. Test bench with Master and Slave connected is provided. \r\n\r\nI didn't want to add new calls to bus_maser_pkg. However adding calls like: bus_write_block and bus_read_block might be good idea.","created_at":"2018-03-02T15:21:05Z","updated_at":"2018-03-03T13:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba7d7e930c3d3a35236046d54f97ec8704af8bc4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/VUnit/vunit/pulls/312/commits","review_comments_url":"https://api.github.com/repos/VUnit/vunit/pulls/312/comments","review_comment_url":"https://api.github.com/repos/VUnit/vunit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VUnit/vunit/issues/312/comments","statuses_url":"https://api.github.com/repos/VUnit/vunit/statuses/686acd11a5be273a1cc25e54cbae632d7828caa4","head":{"label":"slaweksiluk:wishbone","ref":"wishbone","sha":"686acd11a5be273a1cc25e54cbae632d7828caa4","user":{"login":"slaweksiluk","id":8343719,"avatar_url":"https://avatars0.githubusercontent.com/u/8343719?v=4","gravatar_id":"","url":"https://api.github.com/users/slaweksiluk","html_url":"https://github.com/slaweksiluk","followers_url":"https://api.github.com/users/slaweksiluk/followers","following_url":"https://api.github.com/users/slaweksiluk/following{/other_user}","gists_url":"https://api.github.com/users/slaweksiluk/gists{/gist_id}","starred_url":"https://api.github.com/users/slaweksiluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaweksiluk/subscriptions","organizations_url":"https://api.github.com/users/slaweksiluk/orgs","repos_url":"https://api.github.com/users/slaweksiluk/repos","events_url":"https://api.github.com/users/slaweksiluk/events{/privacy}","received_events_url":"https://api.github.com/users/slaweksiluk/received_events","type":"User","site_admin":false},"repo":{"id":119195295,"name":"vunit","full_name":"slaweksiluk/vunit","owner":{"login":"slaweksiluk","id":8343719,"avatar_url":"https://avatars0.githubusercontent.com/u/8343719?v=4","gravatar_id":"","url":"https://api.github.com/users/slaweksiluk","html_url":"https://github.com/slaweksiluk","followers_url":"https://api.github.com/users/slaweksiluk/followers","following_url":"https://api.github.com/users/slaweksiluk/following{/other_user}","gists_url":"https://api.github.com/users/slaweksiluk/gists{/gist_id}","starred_url":"https://api.github.com/users/slaweksiluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaweksiluk/subscriptions","organizations_url":"https://api.github.com/users/slaweksiluk/orgs","repos_url":"https://api.github.com/users/slaweksiluk/repos","events_url":"https://api.github.com/users/slaweksiluk/events{/privacy}","received_events_url":"https://api.github.com/users/slaweksiluk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slaweksiluk/vunit","description":"VUnit is a unit testing framework for VHDL/SystemVerilog","fork":true,"url":"https://api.github.com/repos/slaweksiluk/vunit","forks_url":"https://api.github.com/repos/slaweksiluk/vunit/forks","keys_url":"https://api.github.com/repos/slaweksiluk/vunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slaweksiluk/vunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slaweksiluk/vunit/teams","hooks_url":"https://api.github.com/repos/slaweksiluk/vunit/hooks","issue_events_url":"https://api.github.com/repos/slaweksiluk/vunit/issues/events{/number}","events_url":"https://api.github.com/repos/slaweksiluk/vunit/events","assignees_url":"https://api.github.com/repos/slaweksiluk/vunit/assignees{/user}","branches_url":"https://api.github.com/repos/slaweksiluk/vunit/branches{/branch}","tags_url":"https://api.github.com/repos/slaweksiluk/vunit/tags","blobs_url":"https://api.github.com/repos/slaweksiluk/vunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slaweksiluk/vunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slaweksiluk/vunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/slaweksiluk/vunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slaweksiluk/vunit/statuses/{sha}","languages_url":"https://api.github.com/repos/slaweksiluk/vunit/languages","stargazers_url":"https://api.github.com/repos/slaweksiluk/vunit/stargazers","contributors_url":"https://api.github.com/repos/slaweksiluk/vunit/contributors","subscribers_url":"https://api.github.com/repos/slaweksiluk/vunit/subscribers","subscription_url":"https://api.github.com/repos/slaweksiluk/vunit/subscription","commits_url":"https://api.github.com/repos/slaweksiluk/vunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/slaweksiluk/vunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/slaweksiluk/vunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/slaweksiluk/vunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/slaweksiluk/vunit/contents/{+path}","compare_url":"https://api.github.com/repos/slaweksiluk/vunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slaweksiluk/vunit/merges","archive_url":"https://api.github.com/repos/slaweksiluk/vunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slaweksiluk/vunit/downloads","issues_url":"https://api.github.com/repos/slaweksiluk/vunit/issues{/number}","pulls_url":"https://api.github.com/repos/slaweksiluk/vunit/pulls{/number}","milestones_url":"https://api.github.com/repos/slaweksiluk/vunit/milestones{/number}","notifications_url":"https://api.github.com/repos/slaweksiluk/vunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slaweksiluk/vunit/labels{/name}","releases_url":"https://api.github.com/repos/slaweksiluk/vunit/releases{/id}","deployments_url":"https://api.github.com/repos/slaweksiluk/vunit/deployments","created_at":"2018-01-27T19:26:37Z","updated_at":"2018-01-27T19:26:39Z","pushed_at":"2018-03-02T14:30:26Z","git_url":"git://github.com/slaweksiluk/vunit.git","ssh_url":"git@github.com:slaweksiluk/vunit.git","clone_url":"https://github.com/slaweksiluk/vunit.git","svn_url":"https://github.com/slaweksiluk/vunit","homepage":"http://vunit.github.io/","size":6509,"stargazers_count":0,"watchers_count":0,"language":"VHDL","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"VUnit:master","ref":"master","sha":"c5693af6a46547da117f45d03e492ad17385b23f","user":{"login":"VUnit","id":6691399,"avatar_url":"https://avatars2.githubusercontent.com/u/6691399?v=4","gravatar_id":"","url":"https://api.github.com/users/VUnit","html_url":"https://github.com/VUnit","followers_url":"https://api.github.com/users/VUnit/followers","following_url":"https://api.github.com/users/VUnit/following{/other_user}","gists_url":"https://api.github.com/users/VUnit/gists{/gist_id}","starred_url":"https://api.github.com/users/VUnit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VUnit/subscriptions","organizations_url":"https://api.github.com/users/VUnit/orgs","repos_url":"https://api.github.com/users/VUnit/repos","events_url":"https://api.github.com/users/VUnit/events{/privacy}","received_events_url":"https://api.github.com/users/VUnit/received_events","type":"Organization","site_admin":false},"repo":{"id":26829379,"name":"vunit","full_name":"VUnit/vunit","owner":{"login":"VUnit","id":6691399,"avatar_url":"https://avatars2.githubusercontent.com/u/6691399?v=4","gravatar_id":"","url":"https://api.github.com/users/VUnit","html_url":"https://github.com/VUnit","followers_url":"https://api.github.com/users/VUnit/followers","following_url":"https://api.github.com/users/VUnit/following{/other_user}","gists_url":"https://api.github.com/users/VUnit/gists{/gist_id}","starred_url":"https://api.github.com/users/VUnit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VUnit/subscriptions","organizations_url":"https://api.github.com/users/VUnit/orgs","repos_url":"https://api.github.com/users/VUnit/repos","events_url":"https://api.github.com/users/VUnit/events{/privacy}","received_events_url":"https://api.github.com/users/VUnit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VUnit/vunit","description":"VUnit is a unit testing framework for VHDL/SystemVerilog","fork":false,"url":"https://api.github.com/repos/VUnit/vunit","forks_url":"https://api.github.com/repos/VUnit/vunit/forks","keys_url":"https://api.github.com/repos/VUnit/vunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VUnit/vunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VUnit/vunit/teams","hooks_url":"https://api.github.com/repos/VUnit/vunit/hooks","issue_events_url":"https://api.github.com/repos/VUnit/vunit/issues/events{/number}","events_url":"https://api.github.com/repos/VUnit/vunit/events","assignees_url":"https://api.github.com/repos/VUnit/vunit/assignees{/user}","branches_url":"https://api.github.com/repos/VUnit/vunit/branches{/branch}","tags_url":"https://api.github.com/repos/VUnit/vunit/tags","blobs_url":"https://api.github.com/repos/VUnit/vunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VUnit/vunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VUnit/vunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/VUnit/vunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VUnit/vunit/statuses/{sha}","languages_url":"https://api.github.com/repos/VUnit/vunit/languages","stargazers_url":"https://api.github.com/repos/VUnit/vunit/stargazers","contributors_url":"https://api.github.com/repos/VUnit/vunit/contributors","subscribers_url":"https://api.github.com/repos/VUnit/vunit/subscribers","subscription_url":"https://api.github.com/repos/VUnit/vunit/subscription","commits_url":"https://api.github.com/repos/VUnit/vunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/VUnit/vunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/VUnit/vunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/VUnit/vunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/VUnit/vunit/contents/{+path}","compare_url":"https://api.github.com/repos/VUnit/vunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VUnit/vunit/merges","archive_url":"https://api.github.com/repos/VUnit/vunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VUnit/vunit/downloads","issues_url":"https://api.github.com/repos/VUnit/vunit/issues{/number}","pulls_url":"https://api.github.com/repos/VUnit/vunit/pulls{/number}","milestones_url":"https://api.github.com/repos/VUnit/vunit/milestones{/number}","notifications_url":"https://api.github.com/repos/VUnit/vunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VUnit/vunit/labels{/name}","releases_url":"https://api.github.com/repos/VUnit/vunit/releases{/id}","deployments_url":"https://api.github.com/repos/VUnit/vunit/deployments","created_at":"2014-11-18T20:50:51Z","updated_at":"2018-03-03T13:31:05Z","pushed_at":"2018-03-02T15:21:06Z","git_url":"git://github.com/VUnit/vunit.git","ssh_url":"git@github.com:VUnit/vunit.git","clone_url":"https://github.com/VUnit/vunit.git","svn_url":"https://github.com/VUnit/vunit","homepage":"http://vunit.github.io/","size":6490,"stargazers_count":177,"watchers_count":177,"language":"VHDL","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":68,"open_issues":15,"watchers":177,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VUnit/vunit/pulls/312"},"html":{"href":"https://github.com/VUnit/vunit/pull/312"},"issue":{"href":"https://api.github.com/repos/VUnit/vunit/issues/312"},"comments":{"href":"https://api.github.com/repos/VUnit/vunit/issues/312/comments"},"review_comments":{"href":"https://api.github.com/repos/VUnit/vunit/pulls/312/comments"},"review_comment":{"href":"https://api.github.com/repos/VUnit/vunit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VUnit/vunit/pulls/312/commits"},"statuses":{"href":"https://api.github.com/repos/VUnit/vunit/statuses/686acd11a5be273a1cc25e54cbae632d7828caa4"}},"author_association":"NONE"}}
{"actor":{"display_login":"slaweksiluk"}}