OpenCores
URL https://opencores.org/ocsvn/iso7816_3_master/iso7816_3_master/trunk

Subversion Repositories iso7816_3_master

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /iso7816_3_master
    from Rev 13 to Rev 14
    Reverse comparison

Rev 13 → Rev 14

/trunk/test/ComTxDriverTasks.v
70,12 → 70,11
reg [15:0] byteInHex;
reg [7:0] byteToSend;
begin
for(i=16*256;i>=0;i=i-16) begin
byteInHex=bytesString[i+:16];
if(16'h0!=byteInHex) begin
byteToSend=hexString2Byte(byteInHex);
sendByte(byteToSend);
end
i=16*257;
getNextHexByte(bytesString, i, byteToSend, i);
while(i!=-1) begin
sendByte(byteToSend);
getNextHexByte(bytesString, i, byteToSend, i);
end
end
endtask
/trunk/test/HexStringConversion.v
29,7 → 29,6
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
`default_nettype none
function [7:0] hexString2Byte;
input [15:0] byteInHexString;
37,7 → 36,6
reg [7:0] hexDigit;
reg [4:0] nibble;
begin
//hexString2Byte=0;
for(i=0;i<2;i=i+1) begin
nibble=5'b10000;//invalid
hexDigit=byteInHexString[i*8+:8];
56,4 → 54,27
end
endfunction
 
task getNextHexByte;
input [8*3*257:0] bytesString;
input integer indexIn;
output reg [7:0] byteOut;
output integer indexOut;
reg [15:0] byteInHex;
begin
byteInHex=" ";
//$display("bytesString: %x",bytesString);
while((indexIn>=16)&((8'h0==byteInHex[15:8])|(8'h20==byteInHex[15:8]))) begin
byteInHex=bytesString[(indexIn-1)-:16];
indexIn=indexIn-8;
//$display("indexIn: %d",indexIn);
end
indexOut=indexIn-8;
//$display("indexOut: %d, byteInHex: '%s' (%x)",indexOut, byteInHex, byteInHex);
if((16'h0!=byteInHex) & (indexOut>=0) & (8'h20!=byteInHex[7:0])) begin
byteOut=hexString2Byte(byteInHex);
//$display("byteOut: %x",byteOut);
end else begin
indexOut=-1;
end
end
endtask
/trunk/test/DummyCard.v
95,7 → 95,9
 
ATR:
3B/3F 94 97 80 1F 42 BA BE BA BE
3B 9E 96 80 1F C7 80 31 E0 73 FE 21 1B 66 D0 00 28 24 01 00 0D
 
 
Implemented commands:
write buffer:
tpdu: 00 0C 00 00 LC data
152,7 → 154,9
//sendHexBytes("3B00");
sendHexBytes("3B");
//sendHexBytes("3F");
sendHexBytes("9497801F42BABEBABE");
//sendHexBytes("9497801F42BABEBABE");
//sendHexBytes("9E 97 80 1F C7 80 31 E0 73 FE 21 1B 66 D0 00 28 24 01 00 0D");
sendHexBytes("9E 97 80 1F C7 80 31 E0 73 FE 21 1B 66 D0 00 28 24 01 00 ");
waitEndOfTx;
end else begin
//get CLA
/trunk/test/tbIso7816_3_Master.v
228,7 → 228,9
tbTestSequenceDone=1'b0;
//receiveAndCheckHexBytes("3B00");
receiveByte(byteFromCard);//3B or 3F, so we don't check (Master and Spy do)
receiveAndCheckHexBytes("9497801F42BABEBABE");
//receiveAndCheckHexBytes("9497801F42BABEBABE");
//TODO: handle TCK-->receiveAndCheckHexBytes("9E 97 80 1F C7 80 31 E0 73 FE 21 1B 66 D0 00 28 24 01 00 0D");
receiveAndCheckHexBytes("9E 97 80 1F C7 80 31 E0 73 FE 21 1B 66 D0 00 28 24 01 00");
sendHexBytes("FF109778");
receiveAndCheckHexBytes("FF109778");
cyclesPerEtu=8-1;
237,8 → 239,8
sendHexBytes("55");
receiveAndCheckHexBytes("9000");
tbTestSequenceDone=1'b1;
$display("SUCCESS: test sequence completed.");
#(CLK_PERIOD*372*12);
if(0===tbErrorCnt) $display("SUCCESS: test sequence completed.");
$finish;
end
initial begin
/trunk/test/ComRxDriverTasks.v
29,7 → 29,7
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
`default_nettype none
 
//wire txRun,txPending, rxRun, rxStartBit, isTx, overrunErrorFlag, frameErrorFlag, bufferFull;
//assign {txRun, txPending, rxRun, rxStartBit, isTx, overrunErrorFlag, frameErrorFlag, bufferFull} = COM_statusOut;
 
72,12 → 72,11
reg [15:0] byteInHex;
reg [7:0] byteToCheck;
begin
for(i=16*256;i>=0;i=i-16) begin
byteInHex=bytesString[i+:16];
if(16'h0!=byteInHex) begin
byteToCheck=hexString2Byte(byteInHex);
receiveAndCheckByte(byteToCheck);
end
i=16*257;
getNextHexByte(bytesString, i, byteToCheck, i);
while(i!=-1) begin
receiveAndCheckByte(byteToCheck);
getNextHexByte(bytesString, i, byteToCheck, i);
end
end
endtask
endtask

powered by: WebSVN 2.1.0

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