UVMC Connection Example - Basic Testbench, SC side

This example shows a SV producer driving an SC consumer via a TLM2 UVMC connection, and an SC consumer sending transactions to a SV scoreboard via a TLM1 analysis connection.  It also makes a local UVM analysis connection between the producer and scoreboard.  See UVMC Connection Example - Basic Testbench, SV side for the SV portion of this example.

The sc_main function below creates and starts the SC portion of this example.  It does the following:

  • Instantiates a basic consumer
  • Registers the consumer’s in port with UVMC using the lookup string “stimulus”.  During elaboration, UVMC will connect this port with a port registered with the same lookup string.  In this example, the match will occur with the producer’s out port on the SV side.
  • Registers the consumer’s ap port with UVMC using the lookup string “analysis”.  During elaboration, UVMC will connect this port with a port registered with the same lookup string.  In this example, the match will occur with the scoreboard’s actual_in analysis export on the SV side.
  • Calls sc_start to start SystemC
Summary
UVMC Connection Example - Basic Testbench, SC side
This example shows a SV producer driving an SC consumer via a TLM2 UVMC connection, and an SC consumer sending transactions to a SV scoreboard via a TLM1 analysis connection.

../../../uvmc/examples/connections/sv2sc2sv.cpp

//
//------------------------------------------------------------//
//   Copyright 2009-2012 Mentor Graphics Corporation          //
//   All Rights Reserved Worldwid                             //
//                                                            //
//   Licensed under the Apache License, Version 2.0 (the      //
//   "License"); you may not use this file except in          //
//   compliance with the License.  You may obtain a copy of   //
//   the License at                                           //
//                                                            //
//       http://www.apache.org/licenses/LICENSE-2.0           //
//                                                            //
//   Unless required by applicable law or agreed to in        //
//   writing, software distributed under the License is       //
//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR   //
//   CONDITIONS OF ANY KIND, either express or implied.  See  //
//   the License for the specific language governing          //
//   permissions and limitations under the License.           //
//------------------------------------------------------------//

#include "uvmc.h"
using namespace uvmc;

#include "consumer.h"

int sc_main(int argc, char* argv[]) 
{  
  consumer cons("cons");
  uvmc_connect(cons.in,"stimulus");
  uvmc_connect(cons.ap,"analysis");
  sc_start(-1);
  return 0;
}
This example shows a SV producer driving an SC consumer via a TLM2 UVMC connection, and an SC consumer sending transactions to a SV scoreboard via a TLM1 analysis connection.