12.07.2015 Views

Verilator and SystemPerl - Veripool

Verilator and SystemPerl - Veripool

Verilator and SystemPerl - Veripool

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Talking C++ inside Verilog• <strong>Verilator</strong> allows C++ code to be embedded directly inVerilog`systemc_include#include "MDebug.h"`systemc_headerpublic:int debug();`systemc_ctor__message = MDebug::debug();`systemc_implementationint debug() {return __message;}Place at the top of the generated header file.Place inside the class definition of thegenerated header file.Place in the constructor of thegenerated C++ file.Place in the generated C++ file.`verilogUse the C++ text "debug()" that returnsalways @ (posedge clk)a one bit value for this expression.if ($c1("debug()"))$write("Debug message…\n");<strong>Verilator</strong> Environment, NASCUG June 2004. Copyright 2004 by Wilson Snyder; redistribution allowed as complete presentation.8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!