24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Troubleshooting SystemC errors UM-185<br />

This should appear in any header files include in your C++ sources compiled by sccom. It<br />

tells the compiler to expect a regular C function; otherwise the compiler decorates the name<br />

for C++ <strong>and</strong> then the symbol can't be found.<br />

Also, be sure that you actually linked with an object file that fully defines the symbol. You<br />

can use the "nm" utility on Unix platforms to test your SystemC object files <strong>and</strong> any<br />

libraries you link with your SystemC sources. For example, assume you ran the following<br />

comm<strong>and</strong>s:<br />

sccom test.cpp<br />

sccom -link libSupport.a<br />

If there is an unresolved symbol <strong>and</strong> it is not defined in your sources, it should be correctly<br />

defined in any linked libraries:<br />

nm libSupport.a | grep "mySymbol"<br />

Missing type<br />

When you get errors during design elaboration, be sure that all the items in your SystemC<br />

design hierarchy, including parent elements, are declared in the declarative region of a<br />

module. If not, sccom ignores them.<br />

For example, we have a design containing SystemC over VHDL. The following declaration<br />

of a child module "test" inside the constructor module of the code is not allowed <strong>and</strong> will<br />

produce an error:<br />

SC_MODULE(Export)<br />

{<br />

SC_CTOR(Export)<br />

{<br />

test *testInst;<br />

testInst = new test("test");<br />

}<br />

};<br />

The error results from the fact that the SystemC parse operation will not see any of the<br />

children of "test". Nor will any debug information be attached to it. Thus, the signal has no<br />

type information <strong>and</strong> can not be bound to the VHDL port.<br />

The solution is to move the element declaration into the declarative region of the module.<br />

Misplaced "-link" option<br />

The order in which you place the -link option within the sccom -link comm<strong>and</strong> is critical.<br />

There is a big difference between the following two comm<strong>and</strong>s:<br />

<strong>and</strong><br />

sccom -link liblocal.a<br />

sccom liblocal.a -link<br />

The first comm<strong>and</strong> ensures that your SystemC object files are seen by the linker before the<br />

library "liblocal.a" <strong>and</strong> the second comm<strong>and</strong> ensures that "liblocal.a" is seen first. Some<br />

linkers can look for undefined symbols in libraries that follow the undefined reference<br />

while others can look both ways. For more information on comm<strong>and</strong> syntax <strong>and</strong><br />

dependencies, see sccom (CR-254).<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

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

Saved successfully!

Ooh no, something went wrong!