anchor.diff:  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   // SOFTWARE.
  +import Vector            :: *;
   import Portal            :: *;
   import Top               :: *;
   import HostInterface     :: *;
  
positive.code: endmodule
  
  import "BVI" XsimSource =
  module mkXsimSource#(Bit#(32) portal, Bool src_rdy, MsgBeat#(4) beat)(Empty);
      port portal = portal;
      port src_rdy = src_rdy;
      port beat = beat;
  endmodule
  
  interface MsgSinkR#(numeric type bytes_per_beat);
  
negative.code: endinterface
  
  import "BVI" XsimSink =
  module mkXsimSinkBVI#(Bit#(32) portal, Bool dst_rdy)(MsgSinkR#(4));
      port portal = portal;
      port dst_rdy = dst_rdy;
      method src_rdy src_rdy();
      method beat beat();
      schedule (src_rdy, beat) CF (src_rdy, beat);
  endmodule
  module mkXsimSink#(MsgSink#(4) request, Integer portalIndex)(MsgSinkR#(4));
     let sink <- mkXsimSinkBVI(fromInteger(portalIndex), request.dst_rdy);
     rule req_src_rdy;
        request.src_rdy(sink.src_rdy);
     endrule
     rule req_beat;
        request.beat(sink.beat);
     endrule
  endmodule
  
  module mkXsimTop(Empty);
  