473,804 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data bus model...

Hello All,

I have some basic questions regarding the implementation of a data bus
model in a simulator.

Its hard for me to realize how to model something of that sort in a
simulator..supp ose I need to model a 200mhz bus and contention on
it..for data coming from memory.

I copied fraction of code that does this..but I am not sure if it does
what it is supposed to do..I have limited knowledge in modelling such
implementations ..I will be grateful if anybody could guide me in this
manner..

#define BOUND_POS(N) ((int)(MIN(MAX( 0, (N)), 2147483647)))
data_bus_width = 8; //8 bytes
req_size = 6;

data_bus_access (){
bus_cycles = (req_size + data_bus_width - 1) * (0.2) *
(multiplier) / data_bus_width;

//used 0.2 above for 200mhz

busy_until = req_time + (bus_cycles);
busy_until += BOUND_POS(bus_f ree - (req_time + busy_until));
total_bus_cycle s += (bus_cycles);

bus_free = max(bus_free, (req_time + busy_until)) + 1;

}

return (busy_until - req_time); //has to return bus delay for this
access..
}

any suggestions or corrections in this regard will help me a lot..
thanks in advance...

yaduraj
Nov 14 '05 #1
1 2192
Hello dandelion,

Thanks so much for your reply...

I understand what you are saying ..

"dandelion" <da*******@mead ow.net> wrote in message news:<41******* **************@ dreader17.news. xs4all.nl>...
"yaduraj" <ya******@yahoo .com> wrote in message
news:36******** *************** ***@posting.goo gle.com...
Hello All,

I have some basic questions regarding the implementation of a data bus
model in a simulator.

Its hard for me to realize how to model something of that sort in a
simulator..supp ose I need to model a 200mhz bus and contention on
it..for data coming from memory.
Think of bus-speed in a simulator not in terms of Mhz but of (say) MBogoHz.
That is, *you* (and not the SI) determine how long one bus-cycle takes in
actual seconds. Simulated time itself is no more than a counter (if I were
you i'd think about making that at least a 64 bit counter, btw).

This will enable you to "single step" in simulated "time" and make your
simulator more usefull.
I copied fraction of code that does this..but I am not sure if it does
what it is supposed to do..I have limited knowledge in modelling such
implementations ..I will be grateful if anybody could guide me in this
manner..

#define BOUND_POS(N) ((int)(MIN(MAX( 0, (N)), 2147483647)))


Consider writing binary constant in hex.
0x7FFFFFFF is easyer to remember (and transform into actual bits) than
2147483647.
data_bus_width = 8; //8 bytes
req_size = 6;

data_bus_access ()


I think you'd like to provide the bus input (the actual request) as a
argument
to this function. For instance

data_bus_access (char* value)

furthermore, you do not simply *acces* a bus, you either read from it or
write to it. The difference is significan since a bus can be connected to
any number of peripheral devices. All of them can read at the same time from
the same bus, but only one of them can write to it.


The bus access function in my case is freed of deciding the order of
operations..the re is another function that just feeds reads and writes
to the bus access function..there can be a number of requests that go
in the same cycle to the bus.
If two (or more) devices attempt to write to the bus "simultaneously "
(within one cycle) the result is a "bus-conflict" or "bus-collision". It
would be desirable to catch this if you are writng a simulator.

On the other hadn, if you are reading from a bus, and no device wrote to it,
the data you'd get would be less than exactly what you'd desire. It would be
convenient to catch this situation aswell.

So you'd have

* a struct containing the data about the bus

struct bus_s
{
char bus_data[BUS_WIDTH]; /* containing the data currently on the bus
*/
unsigned long device_id; /* the device which wrote the data
*/
};

* and three functions:

bus_write(struc t bus_s* bus, unsinged int device_id, char* data);

which will set a value and set the device_id, but only if and only if the
device_id is not set (or set to some value designated NO_DEVICE). Otherwise,
it will generate an diagnostic message.

bus_read(struct bus_s* bus, char* data);

which will get a value , but only if and only if the device_id is set.

bus_clear(struc t bus_s*);

which simply clears the device id and prepares the bus_s structure for the
next write.
bus_cycles = (req_size + data_bus_width - 1) * (0.2) *
(multiplier) / data_bus_width;

//used 0.2 above for 200mhz
The actual "frequency" in a simulator (as mentioned above) is very hard to
guarantee. The 200Mhz,
when running your simulator, will almost certainly not be 200Mhz, since your
processor will have other tasks running in the background. Switch to an
explicit "simulated time" (the counte mentioned above) and just define one
'tick' to be 1/F "seconds", where F is your "clock-frequency" (the simulated
one).

this helps me..

The logic of the calculation above escapes me. If you are using a 64 bit bus
(as you indicate), 64
bytes *will* be transmitted at a time. So request len is not really a factor
in the bus-busy time.

Each request can be different in size..for instance one request can be
6 bytes and one can be 2 bytes so I was using the req size in the
simulator..what I more interested is modelling this contention and
situations when bus can be busy and the next request has to wait for
some time until the bus is freed..this is where I am faltering ..any
inputs on this.I will be grateful..
Thanks
Regards
Yaduraj
HTH,

Regards,

dandelion (... who once wrote something simular... )

Nov 14 '05 #2

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

Similar topics

1
3357
by: Abhijit | last post by:
I am working in a data warehousing environment which gets sourced from Oracle ERP (AR/GL/AP). The dimensional entities associated with incoming data are GL Code (e.g. 110), Department (e.g. 1050), Core account (e.g. 301) , sub account (e.g 9). The incoming data needs to be mapped to key performance indicators (KPI) e.g. 'All Other Revenue', 'OEM Revenue' etc. The mapping is driven by GL, Dept, Core account , sub-account ranges. Example - ...
0
4813
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have an example to go by with their study of databases. I was assinged to come up with a data model, but I choose the Autoparts sales and inventory management schema. It you would like the SQL code to generate the schema or if you would like the ERWin...
16
3041
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For example dsParts.xsd and including that in the data tier. I then will create a class that looks like this Public Class CPart Inherits dsParts
5
2135
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework or something that completely abstracts you from the persistence details. Are you: 1. Having simple data type interfaces and the data layer know nothing about the domain models. For example: public int SaveCustomer( string fname, string...
41
4740
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist object to database or load them back. Everything is working nicely so far. My question is, is it OK practice to use DTOMapper rfom the presentation layer? For instance, if I want to present in HTML format the list of entries in my database, should I...
8
9220
by: Richard Collette | last post by:
When attempting to debug a webservice, I get the error: Cannot serialize member System.Exception.Data of type System.Collections.IDictionary, because it implements IDictionary. In reading about web services (http://msdn2.microsoft.com/en-us/library/ds492xtk.aspx), the documentation states that exceptions will automatically be handled as a fault element in the message and then converted to a SoapException in the client.
0
2062
by: nicomp | last post by:
I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys with no problems. When I try to add the corresponding Web Reference to the Web Site project I get the error listed below. I am able to create other Web Services on the same server and I am able to add Web Referneces to them. I have narrowed it down to the "Imports System.Data.SqlClient"...
18
22413
by: robert | last post by:
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? -robert PS: numpy.corrcoef computes only the bare coeff:
7
1563
by: emre esirik(hacettepe computer science and enginee | last post by:
I used a structer in this program. typedef struct _guitar { int serial; :serial of item at the guitar store int price; :price of item at the guitar store char builder; :builder of item at the guitar store char type; :type of item at the guitar store char model; :model of item at the guitar store }guitar;
8
3092
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report reflect the values they anticipate committing to see hypothetical totals of columns from a set of records. These records are displaying properly on my DataGrid but I'm not sure how to get Crystal Reports 10 to use as its datasource the dataset...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.