1 |
10 |
acapola |
`timescale 1ns / 1ps
|
2 |
|
|
`default_nettype none
|
3 |
11 |
acapola |
/*
|
4 |
|
|
Author: Sebastien Riou (acapola)
|
5 |
|
|
Creation date: 17:14:04 01/29/2011
|
6 |
|
|
|
7 |
|
|
$LastChangedDate: 2011-01-29 13:16:17 +0100 (Sat, 29 Jan 2011) $
|
8 |
|
|
$LastChangedBy: acapola $
|
9 |
|
|
$LastChangedRevision: 11 $
|
10 |
|
|
$HeadURL: file:///svn/iso7816_3_master/iso7816_3_master/trunk/test/Iso7816_directionProbe.v $
|
11 |
|
|
|
12 |
|
|
This file is under the BSD licence:
|
13 |
|
|
Copyright (c) 2011, Sebastien Riou
|
14 |
|
|
|
15 |
|
|
All rights reserved.
|
16 |
|
|
|
17 |
|
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
18 |
|
|
|
19 |
|
|
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
20 |
|
|
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
21 |
|
|
The names of contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
|
22 |
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
23 |
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
24 |
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
25 |
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
26 |
|
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
27 |
|
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
28 |
|
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
29 |
|
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
30 |
|
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
31 |
|
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
32 |
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
33 |
|
|
*/
|
34 |
|
|
`default_nettype none
|
35 |
|
|
/*
|
36 |
|
|
Models a probe which consist only of wires. Propagation delay over the sio line
|
37 |
|
|
is used to determined the direction of the communication:
|
38 |
|
|
If the terminal send a start bit, the termMon output will go low before cardMon and viceversa:
|
39 |
|
|
|
40 |
|
|
sio line
|
41 |
|
|
Terminal ---------------------------------- Card
|
42 |
|
|
| |
|
43 |
|
|
| |
|
44 |
|
|
termMon cardMon
|
45 |
|
|
|
46 |
|
|
Note for a physical implementation:
|
47 |
|
|
The difference between the delay "Terminal to termMon" and the delay "Card to cardMon"
|
48 |
|
|
should be kept small in comparison to the delay "Terminal to/from Card" (considering falling edge delay)
|
49 |
|
|
|
50 |
|
|
In this model, delays are 0 except the delay over the sio line.
|
51 |
|
|
*/
|
52 |
10 |
acapola |
module Iso7816_directionProbe(
|
53 |
|
|
inout wire isoSioTerm,
|
54 |
|
|
inout wire isoSioCard,
|
55 |
|
|
output wire termMon,
|
56 |
|
|
output wire cardMon
|
57 |
|
|
);
|
58 |
|
|
|
59 |
|
|
TriWirePullup sioLine(.a(isoSioTerm), .b(isoSioCard));
|
60 |
|
|
assign termMon = isoSioTerm;
|
61 |
|
|
assign cardMon = isoSioCard;
|
62 |
|
|
|
63 |
|
|
endmodule
|
64 |
11 |
acapola |
`default_nettype wire
|