URL
https://opencores.org/ocsvn/sdhc-sc-core/sdhc-sc-core/trunk
Subversion Repositories sdhc-sc-core
Compare Revisions
- This comparison shows the changes necessary to convert path
/sdhc-sc-core/trunk/src/grpSdVerification/unitSdCoreTransactionBFM
- from Rev 157 to Rev 158
- ↔ Reverse comparison
Rev 157 → Rev 158
/src/SdCoreTransactionBFM.sv
4,6 → 4,7
`include "SdCoreTransaction.sv"; |
`include "WbTransaction.sv"; |
`include "WbTransactionReadSingleBlock.sv"; |
`include "WbTransactionWriteSingleBlock.sv"; |
|
class SdCoreTransactionBFM; |
|
34,7 → 35,39
WbTransactionSequenceReadSingleBlock tmp = new(trans.startAddr, trans.endAddr); |
assert (tmp.randomize()) else Log.error("Randomizing WbTransactionSequence seq failed."); |
seq = tmp; |
|
foreach(seq.transactions[i]) begin |
WbTransaction tr; |
int j = 0; |
|
WbTransOutMb.put(seq.transactions[i]); |
WbTransInMb.get(tr); |
|
if (tr.Kind == WbTransaction::Read && tr.Addr == cReadDataAddr) begin |
trans.data[j++] = tr.Data[7:0]; |
trans.data[j++] = tr.Data[15:8]; |
trans.data[j++] = tr.Data[23:16]; |
trans.data[j++] = tr.Data[31:24]; |
end |
end |
|
SdTransOutMb.put(trans); |
end |
|
SdCoreTransaction::writeSingleBlock: |
begin |
WbTransactionSequenceWriteSingleBlock tmp = new(trans.startAddr, trans.endAddr, trans.data[0]); |
assert (tmp.randomize()) else Log.error("Randomizing WbTransactionSequence seq failed."); |
seq = tmp; |
|
foreach(seq.transactions[i]) begin |
WbTransaction tr; |
WbTransOutMb.put(seq.transactions[i]); |
WbTransInMb.get(tr); |
end |
|
SdTransOutMb.put(trans); |
end |
default: |
begin |
string msg; |
42,11 → 75,8
Log.error(msg); |
end |
endcase |
|
|
foreach(seq.transactions[i]) begin |
WbTransOutMb.put(seq.transactions[i]); |
end |
|
if (StopAfter > 0) StopAfter--; |
end |
endtask |
/src/WbTransactionWriteSingleBlock.sv
0,0 → 1,64
`ifndef WBTRANSACTIONWRITESINGLEBLOCK_SV |
`define WBTRANSACTIONWRITESINGLEBLOCK_SV |
|
`include "WbTransaction.sv"; |
`include "SdWb.sv"; |
`include "SdCoreTransaction.sv"; |
|
class WbTransactionSequenceWriteSingleBlock extends WbTransactionSequence; |
|
WbAddr StartAddr; |
WbAddr EndAddr; |
WbData Data[$]; |
|
function new(WbAddr StartAddr, WbAddr EndAddr, DataBlock Datablock); |
size = 1 + 1 + 1 + 512*8/32; // startaddr, endaddr, operation, write data |
|
transactions = new[size]; |
foreach(transactions[i]) |
transactions[i] = new(); |
|
this.StartAddr = StartAddr; |
this.EndAddr = EndAddr; |
|
for (int i = 0; i < 512/4; i++) begin |
WbData temp = 0; |
temp = { >> {Datablock[i*4], Datablock[i*4+1], Datablock[i*4+2], Datablock[i*4+3]}}; |
Data.push_back(temp); |
end |
endfunction |
|
constraint WriteAddrFirst { |
transactions[0].Addr == cStartAddrAddr || |
transactions[0].Addr == cEndAddrAddr; |
transactions[2].Addr == cOperationAddr; |
|
if (transactions[0].Addr == cStartAddrAddr) { |
transactions[1].Addr == cEndAddrAddr; |
transactions[1].Data == EndAddr; |
transactions[0].Data == StartAddr; |
} else if (transactions[0].Addr == cEndAddrAddr) { |
transactions[1].Addr == cStartAddrAddr; |
transactions[0].Data == EndAddr; |
transactions[1].Data == StartAddr; |
} |
|
foreach(transactions[i]) { |
transactions[i].Kind == WbTransaction::Write; |
|
if (i > 2) { |
transactions[i].Addr == cWriteDataAddr; |
} |
transactions[i].Addr == cOperationAddr -> transactions[i].Data == cOperationWrite; |
} |
}; |
|
function void post_randomize(); |
for (int i = 3; i < size; i++) begin |
transactions[i].Data = Data.pop_front(); |
end |
endfunction |
|
endclass |
|
`endif |