OVP Forums - A community of assistance, help, questions, and answers.
  FAQFAQ    SearchSearch      RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in
OVP peripheral modeling guide benefits?

 
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> Ask a Question
View previous topic :: View next topic  
Author Message
AryaWicaksana



Joined: 29 Mar 2014
Posts: 86
Location: Shanghai, China - Kuala Lumpur, Malaysia

PostPosted: Sun Apr 26, 2015 7:15 am    Post subject: OVP peripheral modeling guide benefits? Reply with quote

Hello OVP,

I have a question about peripheral modeling.
There are documentation about peripheral modeling guide.

What are the differences between following the OVP peripheral modeling guide and attaching a SystemC-TLM peripheral module to the platform?
I would like to know the benefits of following the OVP peripheral modeling guidelines.

Thank you.
Regards,
Arya.
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1656
Location: United Kingdom

PostPosted: Mon Apr 27, 2015 1:07 am    Post subject: Reply with quote

An OVP peripheral model can be generated using the Imperas iGen tool and the behavioral code debugged in a fully integrated environment using MPD (both tools are part of the commercial products).

The OVP peripheral can be developed and debugged as a separate entity and then stored in a library to be used in any platform whereas a 'standard' SystemC peripheral is compiled and linked into the whole SystemC platform source making it hard to debug problems.
Back to top
View user's profile Send private message Visit poster's website
AryaWicaksana



Joined: 29 Mar 2014
Posts: 86
Location: Shanghai, China - Kuala Lumpur, Malaysia

PostPosted: Tue Apr 28, 2015 9:15 pm    Post subject: Reply with quote

Hi DuncGrah,

Appreciate your detail explanation.

Thank you,
Arya.
Back to top
View user's profile Send private message
AryaWicaksana



Joined: 29 Mar 2014
Posts: 86
Location: Shanghai, China - Kuala Lumpur, Malaysia

PostPosted: Wed May 06, 2015 12:53 am    Post subject: Reply with quote

Hi DuncGrah,

Is there a way to instantiate a peripheral using the icmPeripheral function like in any of the tlm2.0's pse.igen.hpp without the VLNV?
I built the peripheral in another directory, if I move it to the VLNV directory (ImperasLib/something) I will have to copy paste it every time a new release of the tool comes out.
Any suggestions?

Thank you.
Regards,
Arya.
Back to top
View user's profile Send private message
AdminiStrator
Site Admin
Site Admin


Joined: 11 Feb 2008
Posts: 94

PostPosted: Wed May 06, 2015 2:52 am    Post subject: Reply with quote

Hi

Are you referring to the icm API function icmGetVlnvString ?

if so if you look at the doxygen for this function
Imperas/doc/api/icm/html/index.html

then search for icmGetVlnvString

Quote:
const char* icmGetVlnvString (
const char * vlnvroot,
const char * vendor,
const char * library,
const char * name,
const char * version,
const char * objType
)
Synthesize a VLNV path string given the vendor, library, name and version of the library object you wish to load. If models are stored according to Imperas guidelines, this should successfully locate any model. If all arguments are plain strings, constructs a path such as 'vlnvroot/vendor/library/name/version/objtype', otherwise the following rules are used: If vlnvroot is NULL, the default installation path is used. vlnvroot may be a ':' (Linux) or ';' (Windows) separated list of paths. If vendor, library, or name are empty strings (0 is not allowed) or '*', they are treated as wild-cards and all directories are searched. If version is a wild-card, the latest version is taken (note that 1.2.1 is later than 1.2, but FOO is later than both). For success the specification must yield exactly one file. If objType is 'pse', the file pse.pse is used (this is the convention used by Imperas). If objType is 'model' or 'intercept', the file 'model.so' (Linux) or 'model.dll' (Windows) is used. Otherwise, the string is used as is. Note that the name CVS or names that begin with a period are ignored. This function is intended to be used be used by icmNewProcessor, icmNewPSE and icmNewMMC.

Returns:
Null (reports an error) if no unique file is found, otherwise a file path.

Parameters:
vlnvroot Path or list of paths to root of directory(s) containing modelsT.
vendor Vendor directory e.g. yourcompany.com or '*'.
library Library directory e.g. processor or '*'.
name Name directory e.g. risc32 or '*'.
version Version directory e.g. 1.0 or '*'.
objType Filename in the version directory or 'pse' or 'model'.



the parameter vlnvroot, can refer to the root of a vlnv tree

Thx
Lee
Back to top
View user's profile Send private message Send e-mail
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1656
Location: United Kingdom

PostPosted: Wed May 06, 2015 11:12 pm    Post subject: Reply with quote

Just to add a bit of clarification.

We recomend that you build your models into your own VLNV library tree. This provides a good way of organising your models.

So, for example, you could have a peripheral model source code in a directory such as

Code:
/home/myhome/myLibrary/source/vendor/library/name/version/pse

build (shown for Linux or MSYS shell) using

Code:
make -C /home/myhome/myLibrary/source \
         -f $IMPERAS_HOME/ImperasLib/buildutils/Makefile.library \
         VLNVSRC=/home/myhome/myLibrary/source  \
         VLNVROOT=/home/myhome/myLibrary/lib/$IMPERAS_ARCH/myLibrary


Then when you wish to use the part from your library you can include your library as part of IMPERAS_VLNV

Code:
export IMPERAS_VLNV=$IMPERAS_VLNV:/home/myhome/myLibrary/lib/$IMPERAS_ARCH/myLibrary


OR in your platform (I would not recomended this approach as it makes the code unportable)

Code:
const char * model = icmGetVlnvString ( "/home/myhome/myLibrary/lib/$IMPERAS_ARCH/myLibrary", "vendor","library","name", "version", "pse")


This is described in the appendix of the Installation and Getting Started Guide
Back to top
View user's profile Send private message Visit poster's website
AryaWicaksana



Joined: 29 Mar 2014
Posts: 86
Location: Shanghai, China - Kuala Lumpur, Malaysia

PostPosted: Thu May 07, 2015 6:50 pm    Post subject: Reply with quote

Hi Lee and DuncGrah,

Thank you for the clarification, I didn't realise that it can be set to external directory other than ImperasLib.

One more thing, might be a slightly off the topic but still related to the peripheral. The peripheral has to interrupt an armm M3 processor. I created tlm_analysis_port for the interrupt peripheral port, and trying to connect it with processor object net port int0 or int1 but I got an error saying that class armm doesn't have int0. I know this variable int0 from the armm documentation, any suggestions?

Thanks.
Regards,
Arya.
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1656
Location: United Kingdom

PostPosted: Sun May 10, 2015 11:56 pm    Post subject: Reply with quote

I am looking at the TLM interface file for the armm Cortex-M3 found at IMPERAS_HOME/ImperasLib/source/arm.ovpworld.org/processor/armm/1.0/tlm2.0/armm_Cortex-M3.igen.hpp and it appears to contain a number of interrupt pins int0 to int15 of type icmCpuInterrupt, which is a tlm_analysis_port.

Code:
    icmCpuInterrupt      int0;


Could this be a SystemC connection or naming issue? (sorry I am not an expert in this area)

Please note that the TLM interface files are provided for the default configuration of each variant. Some parameters may be set to create an instance with different features, for example, interrupt inputs. This would require a new interface file to be generated or the standard one copied and modified.
Back to top
View user's profile Send private message Visit poster's website
AryaWicaksana



Joined: 29 Mar 2014
Posts: 86
Location: Shanghai, China - Kuala Lumpur, Malaysia

PostPosted: Mon May 11, 2015 12:06 am    Post subject: Reply with quote

Dear DuncGrah,

Thanks for your reply.

Yes, there are int0 to int15 in the processor model documentation of armm Cortex-M3. When I want to connect that net port (int0) it says error class armm has no member named int0. I tried to connect net port nmi and it works, that when I thought that maybe the int0 net port has a private attribute.

After reading your reply.
Quote:
Some parameters may be set to create an instance with different features, for example, interrupt inputs. This would require a new interface file to be generated or the standard one copied and modified.

Am I to understand that I have to set up a certain parameter during armm class instantiation in the platform? OR I simply should hack the TLM interface file?

I need to connect this net port in order to test my ISR is working.

Thank you.
Regards,
Arya.
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1656
Location: United Kingdom

PostPosted: Mon May 11, 2015 1:14 am    Post subject: Reply with quote

Ahhh, I wonder if in your platform you are including the correct interface file?

You should include arm.ovpworld.org/processor/armm/1.0/tlm2.0/armm_Cortex-M3.igen.hpp, if you are including the processor default arm.ovpworld.org/processor/armm/1.0/tlm2.0/processor.igen.hpp this will include the nmi input but it does not include the int0-int15 inputs.

This may be from the example platform you have based your platform upon?

This is the obvious problem, I am hoping it is :-)
Back to top
View user's profile Send private message Visit poster's website
AryaWicaksana



Joined: 29 Mar 2014
Posts: 86
Location: Shanghai, China - Kuala Lumpur, Malaysia

PostPosted: Mon May 11, 2015 8:56 pm    Post subject: Reply with quote

Dear DuncGrah,

Precisely! =)
Now it works, thanks a lot.

Regards,
Arya.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> Ask a Question All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Information regarding OVP © 2008-2022 Imperas Software