473,395 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C/C++ Hardware modelling

sun
Hello All,
I wanted to develop a hardware model in C/C++ but iam not sure about
the procedure, can any one help me out by providing some guidlines for
developing or pointing to some wepage where i can get some guidlines or
some sample C/C++ codes for a hardware model.

Sun

Apr 10 '06 #1
6 3357
sun wrote:
Hello All,
I wanted to develop a hardware model in C/C++ but iam not sure about
the procedure, can any one help me out by providing some guidlines for
developing or pointing to some wepage where i can get some guidlines or
some sample C/C++ codes for a hardware model.

What exactly do you wish to model?

--
Ian Collins.
Apr 10 '06 #2
sun

Hello Collins,
Thanks for your reply... actually i wanted to model a ethernet
packet interface, which can act as a transmitter or an receiver ,
during the transmitter mode, the c/c++ mode has to read data from a RAM
model and add the header information and transmit the packet, in the
receiver mode, the packet interface will receive the packet removes the
header information and seperates the data alone and store in a ram
model.
The c/c++ model has some internal register setting based on the
internal register setting the model has to work. Now i need to know how
to model the register setting in the c/c++, also iam not having much
idea of how the control data transfer between modules will happen in
c/c++, it would be better if you can give some ideas.

Ian Collins wrote:
sun wrote:
Hello All,
I wanted to develop a hardware model in C/C++ but iam not sure about
the procedure, can any one help me out by providing some guidlines for
developing or pointing to some wepage where i can get some guidlines or
some sample C/C++ codes for a hardware model.

What exactly do you wish to model?

--
Ian Collins.


Apr 10 '06 #3
Try searching for System C.

Apr 10 '06 #4
sun
Hello Praz,
Thanks for your reply.... and it would be better if i go in
SystemC, but the requirement is to model purely in c/c++, i am not
having much issues imodelling in HDL like verilog, vhdl, systemverilog
or in SystemC, but the requirement is to model in c/c++ which i have
not done before... so it would be great if you can give me some ideas
in modelling in c/c++.

PraZ wrote:
Try searching for System C.


Apr 10 '06 #5

typedef int int32;

class Register {

private:
int32 reg;

int32 Read() { return reg; };
int32 Write( int32 data) { reg = data; };

friend class SystemBus<Register>;

public:
Register() {};
~Register() {};

};

template <class T>
class SystemBus {

public:

SystemBus() {};
~SystemBus() {};

int32 Read() { return T::Read (); };
int32 Write(int32 data) { T::Write(data); };
};

Something like this maybe? And RAM is just a collection of registers.
The class SystemBus should have the bus width as a parameter for its
constructor. The register must be accesible only by writing into the
bus. May be the register class can have a flag which must be set if the
bus has to write into the register. If not, an exception can be
generated. Which busses connect to which can be decided beforehand.

May be there are better ways of doing it. But this is all I could think
of right now. And oh, the C++ code above obviously has syntax errors.
But I am sure you can sort them out.

Hope it is of some help.

Apr 11 '06 #6

typedef int int32;

class Register {

private:
int32 reg;

int32 Read() { return reg; };
int32 Write( int32 data) { reg = data; };

friend class SystemBus<Register>;

public:
Register() {};
~Register() {};

};

template <class T>
class SystemBus {

public:

SystemBus() {};
~SystemBus() {};

int32 Read() { return T::Read (); };
int32 Write(int32 data) { T::Write(data); };
};

Something like this maybe? And RAM is just a collection of registers.
The class SystemBus should have the bus width as a parameter for its
constructor. The register must be accesible only by writing into the
bus. May be the register class can have a flag which must be set if the
bus has to write into the register. If not, an exception can be
generated. Which busses connect to which can be decided beforehand.

May be there are better ways of doing it. But this is all I could think
of right now. And oh, the C++ code above obviously has syntax errors.
But I am sure you can sort them out.

Hope it is of some help.

Apr 11 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.