I ve a input file like below. where I want to compare write data with my read data .. The problem is that the read data should be compared with the lastest write data on that address.
Note- Both write data & read data are in the same file.
TXADDR & TXDATA means -write
RXADDR & RXDATA means - read
120 : TXADDR : 00000000
means at time 120 I am sending a TXADDR -00000000 & the data to be written are like below
Thanks for your reply..& Sorry If I misguided you..
No its not like that data is not recevied until unless I specify to read exclusively . Think of as a RAM( Read access Memory)
I writes to RAM by specifing TXADDR & TXDATA and I retrives the data when I specify that address with RXADDR , I get RXDATA ie, last written on that addresss.
Actually Wrrtting and reading are independent of each other.
Once I give TXADDR & TXDATA (5 burst - In INPUT FILE you can see five lines of input data contineously). Then after that I am going to Read those values when RXADDR comes ..
Suppose I am writting to the same address twice then reading from that address then it ll read the lastest value that is written to that address.
rxdata 0000000000000001 for address 00000000 does not match transmitted: 0000000000000011
rxdata 0000000000000003 for address 00000000 does not match transmitted: 0000000000000012
rxdata 0000000000000003 for address 00000000 does not match transmitted: 0000000000000013
rxdata 0000000000000004 for address 00000000 does not match transmitted: 0000000000000014
Here the in the above input file same address (i.e, in address 00000000 I am writting twice and reading the data once and the lastest data are matching with the read data but in my programme its saying not matching)
Yes, it's a two-dimensional array indexed by the address and an index. The indices themselves are held in a second one-timensional array, txindex.
So to cater for your second situation, all you need to do is reset the txindex[txaddr] counter to 0 each time a new TXADDR is encountered. Similarly you can reset the rxindex[rxaddr] counter each time an RXADDR is encountered.
Today morning I tried to reset the index . When I changed to txindex= 0, it throws me error but it should be txindex[txaddr] = 0 as you suggested & with that the programme goes smoothly..
Today morning I tried to reset the index and I changed to txindex= 0, it throws me error but when it should be txindex[txaddr] = 0 as you suggested with that the programme goes smoothly..