quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bullet_green_ball.gif Introduction

When SystemC is purely used for modelling purpose, SystemC can be run in standalone mode. But when SystemC Verification Extension is used for Verifying HDL DUT, like one written in Verilog, then we need to interface SystemC to Verilog/VHDL simulator.

   

space.gif

   

space.gif

  ../images/main/bullet_green_ball.gif Verilog Simulator Interface

Interfacing with Verilog simulator is very straight forward. This is due to the fact that Verilog language defines Programming Language Interface (PLI) for interfacing with C or C++ code. Which is external to Verilog Simulator.

   

space.gif

I am going to show how to interface with PLI 1.0 and PLI 2.0 (VPI). Followed by DPI which is latest SystemVerilog way of interfacing.

   

space.gif

Note : Below examples of PLI and VPI are modified version of orginal work done by goodkook@anslab.co.kr.

   

space.gif

  ../images/main/bulllet_4dots_orange.gif PLI 1.0 Interface

For the SystemC to work with Verilog PLI following sequence of operations need to be performed.

   

space.gif

  • Callback :Add callback on all the output signals of HDL, clock and reset in such a way that, when ever they change. PLI code gets control.
  • Sample : Sample all the inputs to SystemC or outputs of HDL.
  • sc_start(time) : sc_start method of systemC with parameter time. Where time is difference between last call time and current time.
  • Drive : Drive all the outputs of SystemC or inputs to HDL.
   

space.gif

Other then this, we need to perform few other tasks listed below.

   

space.gif

  • Initilize the SystemC Model, when PLI task is executed for first time.
  • Type conversion between SystemC and PLI
  • Terminate SystemC model, Like closing VCD file, when $finish is encountered in HDL.
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com