OpenCores
no use no use 1/1 no use no use
or1ksim TLM wrapper test fails
by FlemX on Jul 2, 2012
FlemX
Posts: 6
Joined: Oct 24, 2011
Last seen: Jan 15, 2020
Hello again!

I'm trying to use the TLM wrapper built for the or1ksim ISS, described in this case study:
http://www.embecosm.com/download/ean1.html

I'm a bit confused about the configuration file though. The document states, there is a 'simple.cfg' file provided, but the only .cfg file I could find is in my original or1ksim folder called 'sim.cfg'.

I managed to compile and build the examples provided, then tried to run the logger using the following command:
./sysc-models/logger/logger ../sim.cfg progs-or32/logger-test

It gives the following messages (I placed the modified sim.cfg file into the tlm-wrapper folder, which is the extracted folder from the downloadable archive):

~/tlm-wrapper/build$ ./sysc-models/logger/logger ../sim.cfg progs-or32/logger-test

SystemC 2.2.0 --- Jun 25 2012 15:48:58
Copyright (c) 1996-2006 by all Contributors
ALL RIGHTS RESERVED
Seeding random generator with value 0x820c1535
or1ksim: insufficent memory

Usage:
Segmentation fault (core dumped)

I only modified the or1ksim.h file in the or1ksim install folder (changing the first 2 arguments of the init function to const char variables). Also, I use the latest or1ksim version from SVN checkout. I added the generic section to the or1ksim config file.
It seems to me, that the logger doesn't use any config file at all, because the simulator fails to allocate memory.

What could be the problem? Can someone help me resolve this issue?

(on a side note: I successfully built and ran the ported linux kernel on the ISS and it works fine, so the ISS should work properly).
RE: or1ksim TLM wrapper test fails
by jeremybennett on Jul 3, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hello again!

I'm trying to use the TLM wrapper built for the or1ksim ISS, described in this case study: http://www.embecosm.com/download/ean1.html

I'm a bit confused about the configuration file though. The document states, there is a 'simple.cfg' file provided, but the only .cfg file I could find is in my original or1ksim folder called 'sim.cfg'.

Hi FlemX

The simple.cfg should be part of the assocated Embecosm package download http://www.embecosm.com/download/esp1.html.

I managed to compile and build the examples provided, then tried to run the logger using the following command:

    ./sysc-models/logger/logger ../sim.cfg progs-or32/logger-test
    

It gives the following messages (I placed the modified sim.cfg file into the tlm-wrapper folder, which is the extracted folder from the downloadable archive):

    ~/tlm-wrapper/build$ ./sysc-models/logger/logger ../sim.cfg progs-or32/logger-test
    
                 SystemC 2.2.0 --- Jun 25 2012 15:48:58
            Copyright (c) 1996-2006 by all Contributors
                        ALL RIGHTS RESERVED
    Seeding random generator with value 0x820c1535
    or1ksim: insufficent memory
    
    Usage:
    Segmentation fault (core dumped)
    

I only modified the or1ksim.h file in the or1ksim install folder (changing the first 2 arguments of the init function to const char variables). Also, I use the latest or1ksim version from SVN checkout. I added the generic section to the or1ksim config file.

This is the problem. or1ksim.h defines all the usage of the Or1ksim entire system. With this change you are just supplying random nonsense to Or1ksim, so it is amazing you even got this far!

The problem is that the Embecosm paper was written for an earlier version of Or1ksim. Since then the interface to the Or1ksim library has changed. You will need to modify the examples in the application note to match the new Or1ksim interface.

The application note needs updating, but I haven't had time to complete that work.

HTH

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

RE: or1ksim TLM wrapper test fails
by FlemX on Jul 3, 2012
FlemX
Posts: 6
Joined: Oct 24, 2011
Last seen: Jan 15, 2020

This is the problem. or1ksim.h defines all the usage of the Or1ksim entire system. With this change you are just supplying random nonsense to Or1ksim, so it is amazing you even got this far!

The problem is that the Embecosm paper was written for an earlier version of Or1ksim. Since then the interface to the Or1ksim library has changed. You will need to modify the examples in the application note to match the new Or1ksim interface.

The application note needs updating, but I haven't had time to complete that work.

HTH

Jeremy



Hi Jeremy,

Yes, after studying the sources for a bit, I figured out that this was the problem. I had to modify the example source codes only (to match the or1ksim_init function structure), then I rebuilt them succesfully and now the logger works correctly with the latest or1ksim revision.
I should mention that in the start.s file I had to remove the underscore before the "main" word, otherwise the gcc linker would give error during make.

This thread was also helpful, which I found recently:
http://opencores.org/forum,OpenRISC,0,4741


The simple.cfg should be part of the assocated Embecosm package download
http://www.embecosm.com/download/esp1.html.


I'm sorry, but I didn't find any .cfg files in the downloaded package, but it's ok, I just used the default 'sim.cfg' file in the or1ksim distribution and added the 'generic' section. I also had to comment out the 'ata' section to work properly.

Thank You for Your support!

Best Wishes,
Gabriel
RE: or1ksim TLM wrapper test fails
by ClockworkRed on Jul 3, 2012
ClockworkRed
Posts: 19
Joined: May 6, 2011
Last seen: Oct 26, 2016
Hi,

below you find a possible way to modify the base class Or1ksimSC to use the new interface of or1ksim_init. You need to change the const char to char in the header file and all classes that inherit from the base class Or1ksimSC.

Best regards,
Daniel


Or1ksimSC::Or1ksimSC (sc_core::sc_module_name name,
char *configFile,
char *imageFile) :
//OLD: const char *configFile,
//OLD: const char *imageFile) :
sc_module (name),
dataBus ("data_initiator" )
{


char* argvt[3];
argvt[1] = configFile;
argvt[2] = imageFile;

int argct=3;
or1ksim_init (argct,argvt, this, staticReadUpcall, staticWriteUpcall);
// OLD: or1ksim_init (configFile, imageFile, this, staticReadUpcall, staticWriteUpcall);

SC_THREAD (run); // Thread to run the ISS

} // Or1ksimSC()
RE: or1ksim TLM wrapper test fails
by jeremybennett on Jul 3, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi Gabriel,

Sorry about the missing config file - looks like a packaging error. I've attached my local copy.

Hi Daniel,

Thanks for your advice on fixing the problem.

Best wishes,

Jeremy

simple.cfg (3 kb)
no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.