Jump to content
Sign in to follow this  
mohitnegi

integrate driver code with systemC model ??

Recommended Posts

hello  ,

 

I am making a controller which has an pre-existing driver code and  make it compatible with it ...

how can integrate the both ???

Hello Sir,

First of all, in what language is the pre-existing driver

code written in - Assembly of C ? If in C it is fairly easy

-- two ways to do it:

 

1. Use header files as

#include <cstdlib>

#include <cstring>

/* And so on ... */

 

2. Use the extern command as:

extern "C"

{

  #include <stdio.h>

  #include <stdlib.h>

  /* And so on .. */

};

 

If the pre-existing driver code is in Assembly,

a easy way would be to inline it inside the

C++ code, as

asm("assembly code as a string literal.")

OR

__asm__("assembly code as a string literal.")

 

In addition, one could use extended Assembly.

Note however, that using Assembly means

that the programmer has to keep track of:

1. Register naming

2. Ordering of operands

3. Operand Size

4. Immediate Operands

5. Memory operands

6. Indexing

Etc., etc.

Hope that helps.

Share this post


Link to post
Share on other sites

My initial reaction is JDI. Please restate the question. Is the driver code written is assembly or C? Is there an OS presumption?

Hello ,

The driver code is written in c for linux  ..  and wish have to make a controller which runs on this driver code ....

Could you help me integrating the two  ..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×