Jump to content

Recommended Posts

Hi,

 

I work on a simple System on Chip. I have a cpu, a bus and a ram.

 

When I compile the following code I got a error message.

 

The code is:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "systemc.h"
//Use an OVP Microblaze 8.2 processor model
#include "xilinx.ovpworld.org/processor/microblaze/1.0/tlm2.0/microblaze_V8_20.igen.hpp"
#include "ovpworld.org/modelSupport/tlmPlatform/1.0/tlm2.0/tlmPlatform.hpp"
//Use Memory
#include "ovpworld.org/memory/ram/1.0/tlm2.0/tlmMemory.hpp"
//Use Bus
#include "ovpworld.org/modelSupport/tlmDecoder/1.0/tlm2.0/tlmDecoder.hpp"

icmAttrListObject *attrsForcpu1()
{
   icmAttrListObject *userAttrs = new icmAttrListObject;
   return userAttrs;
}

int sc_main(int argc, char *argv[0])
{
    //Instantiate OVP platform
     icmTLMPlatform *platform = new icmTLMPlatform("icm", ICM_VERBOSE | ICM_STOP_ON_CTRLC| ICM_ENABLE_IMPERAS_INTERCEPTS);
  
    //Instantiate RAM
    ram *speicher = new ram("speicher","sp1", 0x100000);    

    //Instantiate Bus     decoder<NR_OF_INITIATORS,NR_OF_TARGETS>
    decoder<1,1> *bus = new decoder<1,1>("bus");

    //Instantiate the processor
    microblaze_V8_20 *core = new microblaze_V8_20("core", 0, ICM_ATTR_DEFAULT, attrsForcpu1());

    //Bind CPU with Bus
    core->INSTRUCTION.socket(bus->target_socket[0]);
    core->DATA.socket(bus->target_socket[1]);

    //Bind Bus with RAM
    bus->initiator_socket[1](speicher->sp1);
    bus->setDecode(1, 0x00200000, 0x002fffff);
     
    // Load application 
    core->loadLocalMemory("application.MICROBLAZE.elf", 1, 1, 1);

    //Start and stop the simulation
    sc_core::sc_start();

    sc_core::sc_stop();


    //Deallocate objects
    delete core;
    delete platform;

    return 0;
}

The error message on the console is:

 

make -f $IMPERAS_HOME/ImperasLib/so/buildutils/Makefile.TLM.platform PLATFORM=mb_tlm

# Compiling Build/Linux32/usr/mb_tlm.o
# Linking mb_tlm.Linux32.exe
Build/Linux32/tlm/tlmSupport.a(tlmPlatform.o): In function `~sc_trace_file':
/usr/local/systemc-2.3.0//include/sysc/tracing/sc_trace.h:168: undefined reference to `vtable for sc_core::sc_trace_file'
Build/Linux32/tlm/tlmSupport.a(tlmPlatform.o): In function `time_advance':
/Imperas.20130315//ImperasLib/source/ovpworld.org/modelSupport/tlmPlatform/1.0/tlm2.0/tlmPlatform.hpp:93: undefined reference to `sc_core::sc_trace_file::sc_trace_file()'
Build/Linux32/tlm/tlmSupport.a(tlmPlatform.o).rodata._ZTV12time_advance[vtable for time_advance]+0x74): undefined reference to `sc_core::sc_trace_file::space(int)'
Build/Linux32/tlm/tlmSupport.a(tlmPlatform.o).rodata._ZTI12time_advance[typeinfo for time_advance]+0x8): undefined reference to `typeinfo for sc_core::sc_trace_file'
collect2: ld returned 1 exit status 
make: *** [mb_tlm.Linux32.exe] error 1

I don't know what is wrong with TLM.

Could anybody help me?

 

Thx

Link to comment
Share on other sites

It's a bit hard to tell, what the exact problem is, because you don't show the linker command issued from the Makefile.

 

I would assume that the linking order between  tlmSupport.a and SystemC (-lsystemc) is wrong and the SystemC dependency in tlmSupport.a can not be resolved correctly. Library symbols are resolved from right-to-left. Make sure to list tlmSupport.a before -lsystemc in the linker command-line.

 

Since the problems seem to originate from the vendor-specific build system, please contact Imperas for support requests regarding OVP.

 

Greetings from Oldenburg,
  Philipp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...