Y
yaduraj
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..suppose 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_free - (req_time + busy_until));
total_bus_cycles += (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
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..suppose 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_free - (req_time + busy_until));
total_bus_cycles += (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