OpenCores
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 154 to Rev 156
    Reverse comparison

Rev 154 → Rev 156

/src/SdCoreTransactionBFM.sv
3,6 → 3,7
 
`include "SdCoreTransaction.sv";
`include "WbTransaction.sv";
`include "WbTransactionReadSingleBlock.sv";
 
class SdCoreTransactionBFM;
 
23,10 → 24,30
task run();
while (StopAfter != 0) begin
SdCoreTransaction trans;
WbTransactionSequence seq;
 
SdTransInMb.get(trans);
Log.note("TransBFM transaction received: TODO: split up and send");
 
case (trans.kind)
SdCoreTransaction::readSingleBlock:
begin
WbTransactionSequenceReadSingleBlock tmp = new(trans.startAddr, trans.endAddr);
seq = tmp;
end
default:
begin
string msg;
$swrite(msg, "Transaction kind %s not handled.", trans.kind.name());
Log.error(msg);
end
endcase
 
assert (seq.randomize()) else Log.error("Randomizing WbTransactionSequence seq failed.");
seq.display();
 
foreach(seq.transactions[i])
WbTransOutMb.put(seq.transactions[i]);
 
if (StopAfter > 0) StopAfter--;
end
endtask
/src/WbTransactionReadSingleBlock.sv
0,0 → 1,51
`ifndef WBTRANSACTIONREADSINGLEBLOCK_SV
`define WBTRANSACTIONREADSINGLEBLOCK_SV
 
`include "WbTransaction.sv";
`include "SdWb.sv";
 
class WbTransactionSequenceReadSingleBlock extends WbTransactionSequence;
 
WbAddr StartAddr;
WbAddr EndAddr;
 
function new(WbAddr StartAddr, WbAddr EndAddr);
size = 1 + 1 + 1; // startaddr, endaddr, operation
transactions = new[size];
foreach(transactions[i])
transactions[i] = new();
 
this.StartAddr = StartAddr;
this.EndAddr = EndAddr;
endfunction
 
constraint ReadSingleBlock {
transactions[2].Addr == cOperationAddr;
transactions[2].Data == cOperationRead;
 
transactions[0].Addr == cStartAddrAddr || cEndAddrAddr;
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]) {
if (i inside {[0:2]}) {
transactions[i].Kind == WbTransaction::Write;
} else {
transactions[i].Kind == WbTransaction::Read;
}
}
};
 
endclass
 
 
`endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.