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/grpSd/unitSdCardModel/src
- from Rev 147 to Rev 148
- ↔ Reverse comparison
Rev 147 → Rev 148
/SdData.sv
46,7 → 46,7
wait(ICard.cb.Data == 'b0000); |
|
$display("Startbits: %t", $time); |
for (int j = 0; j < 512*2; j++) begin |
for (int j = 0; j <= 512*2; j++) begin |
@ICard.cb; |
for(int i = 0; i < 4; i++) begin |
rddata.push_back(ICard.cb.Data[i]); |
54,7 → 54,6
end |
|
// crc |
|
for (int j = 0; j < 16; j++) begin |
@ICard.cb; |
for(int i = 0; i < 4; i++) begin |
62,6 → 61,8
end |
end |
|
// TODO: check crc |
|
// end bits |
@ICard.cb; |
$display("Endbits: %h, %t", ICard.cb.Data, $time); |
/SdCardModel.sv
232,15 → 232,32
|
endtask |
|
task read(); |
task run(); |
this.init(); |
|
forever begin |
SdBusTransToken token; |
this.bfm.receive(token); |
|
case (token.id) |
cSdCmdWriteSingleBlock: this.write(token); |
cSdCmdReadSingleBlock: this.read(token); |
default: begin |
string msg; |
$swrite(msg, "Token not handled, ID: %b", token.id); |
log.error(msg); |
end |
endcase |
end |
endtask |
|
task read(SdBusTransToken token); |
SDCommandR1 response; |
logic data[$]; |
logic[31:0] addr; |
SdData sddata = new(mode, usual); |
SdBusTransToken token; |
|
// expect Read |
this.bfm.receive(token); |
assert(token.id == cSdCmdReadSingleBlock); |
addr = token.arg[0]; |
assert(addr < ram.size()); |
257,15 → 274,13
sddata.send(ICard, data); |
endtask |
|
task write(); |
task write(SdBusTransToken token); |
SDCommandR1 response; |
SdData sddata = new(this.mode, widewidth); |
logic rddata[$]; |
logic[31:0] addr; |
SdBusTransToken token; |
|
// expect Write |
this.bfm.receive(token); |
assert(token.id == cSdCmdWriteSingleBlock); |
addr = token.arg[0]; |
assert(addr < ram.size()); |