TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

A Step-by-Step Approach to Mixed-Language IP Integration

mg
by
0
Share Facebook X LinkedIn WhatsApp Email

This article, published on Design & Reuse in March 2010 by Pankaj Singh of Infineon Technologies and Gaurav Kumar Verma of Mentor Graphics, sets out a methodology and best practices for connecting IP blocks written in different languages, and describes a utility that suggests the best way to make each connection.

There are broadly five ways of making mixed-language connections. The article compares them by usage scenario, performance, and how signal values update across delta cycles, and then gives a step-by-step guideline, based on decision trees, that designers can follow to pick the approach that suits their particular integration.

What mixed-language integration means

A modern SoC or verification environment is rarely written in one language. A processor subsystem may be in Verilog, a legacy peripheral in VHDL, a testbench in SystemVerilog, and a fast transaction-level model of a bus or accelerator in SystemC. Third-party IP arrives in whatever language its vendor chose. To simulate them together, the simulator has to connect signals, and sometimes function calls, across language boundaries.

The authors point out that language mixing is a major barrier to IP reuse: making the connections needs knowledge of several languages, and many designers do not know all the options or how to choose between them.

The five connection methods in brief

  • Direct instantiation: instantiate the other-language block like any module or entity. Simple, but you need the block's source.
  • SystemVerilog bind: attach a connection from outside without editing the target's source. Popular for SoC hook-up, but tool support varied, and VHDL or SystemC targets need a SystemVerilog wrapper.
  • SystemC control/observe: reach into the hierarchy of an HDL block from SystemC to drive or watch a signal. Powerful, but uses full hierarchical paths and ties the blocks tightly together.
  • SCV connect: the standardized version of control/observe for IP that uses the SystemC Verification (SCV) library.
  • SC-DPI: function calls between SystemVerilog and SystemC in either direction. Fast, but only suits IP whose interface is defined as methods.

When you would use this

You need this decision whenever you integrate purchased IP in a language your team does not use, build a virtual platform that mixes SystemC models with RTL, or reuse an old VHDL block in a Verilog or SystemVerilog design.

Deep dive: the numbers and details

This part holds the comparison table, the decision steps and the delta-cycle detail. Skip it if the overview is all you need.

Comparison of the five methods

MethodNeeds target source?Main strengthMain limit
Direct instantiationYesMost common, reads like normal codeLimits reuse of commercial IP shipped without source
SystemVerilog bindNoHooks up IP without editing itWorks only in SystemVerilog regions; support varied between tools
SystemC control/observeSystemC side must be visibleCan reach signals deep in precompiled HDL hierarchyFull hierarchical paths; no specialization or parameterization of the IP
SCV connectSystemC sideStandard form of control/observeLess optimized; SCV library must be in the IP
SC-DPINo (interface as methods)Fast; calls in both directionsOnly for method-based interfaces

Summarized from the Design & Reuse article. The article's own performance and delta-cycle comparison is in an image table there.

The three-step decision method

  1. Understand the IP blocks. Note the language of each block and whether its source is available.
  2. Understand the connections. Place each required connection in one of four categories:
    • A: confined to one design unit in each IP;
    • B: confined to one design unit in one IP but spread over several in the other;
    • C: spread over several design units in both IPs;
    • D: method ports only.
  3. Finalize the method. Eliminate methods that cannot work for the languages, source availability and categories; if nothing is left, combine two or more methods; then compare the survivors on performance and update behavior.

The authors built a prototype Inter Connect Utility (ICU) that takes two language regions, suggests a method and generates code snippets, with an optional Designer Configuration File holding the regions, port maps and output name. They reported only initial results on a small design, showing time saved against manual integration, and said there were no plans at that time to add it to Questa.

Why delta cycles matter at a language boundary

HDL simulators advance time in steps, and within one time step they may run several zero-delay "delta" cycles as signal changes ripple through processes. Each language kernel has its own rules for when a written value becomes visible:

  • A VHDL signal assignment takes effect in the next delta cycle.
  • A Verilog nonblocking assignment updates at the end of the time step's active region; a blocking assignment updates immediately.
  • A SystemC sc_signal write is visible after the next update phase, much like VHDL.

When a connection crosses languages, the simulator may add an extra delta cycle to move the value between kernels. Usually that is harmless. It becomes a bug when two paths that should arrive together pass through a different number of boundaries, for example a clock passed through a wrapper and data driven directly. A flop on the far side can then sample data that has already changed, a race that looks like a hold violation in zero-delay simulation.

Worked example: choosing a method

Suppose you have a precompiled VHDL Ethernet MAC (no source) and a SystemC model of a DMA engine, and the DMA needs to watch an internal status signal two levels down in the MAC.

  • Direct instantiation is ruled out for reaching an internal signal, and you have no source to edit.
  • SystemVerilog bind would need a SystemVerilog wrapper, since neither side is SystemVerilog.
  • The connection reaches into several design units of the MAC but only one in the DMA model: category B.
  • SystemC control/observe can reach into precompiled HDL from SystemC, so it is the natural choice, accepting the cost of a hard-coded hierarchical path.

If the interface were instead a set of read and write functions, SC-DPI would be the faster and cleaner choice.

Common mistakes

  • Hard-coding hierarchical paths that break when the IP vendor changes its internal hierarchy.
  • Ignoring the extra delta cycle at a boundary on clock or reset paths.
  • Mapping VHDL std_logic to SystemC or two-state types without deciding how X and Z values should map.
  • Assuming every simulator handles bind into non-SystemVerilog regions the same way.
Share Facebook X LinkedIn WhatsApp Email

Post a Comment

0 Comments

Your comments will be moderated before it appears here.

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!