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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [rtl/] [verilog/] [jtag/] [cells/] [rtl/] [verilog/] [BiDirectionalCell.v] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1327 jcastillo
/**********************************************************************************
2
*                                                                                                                                                                                                                                                                                                                                       *
3
*               BiDirectional Cell:                                                                                                                                                                                                                                             *
4
*                                                                                                                                                                                                                                                                                                                                       *
5
*               FromCore: Value that comes from on-chip logic and goes to pin                                                                   *
6
*               ToCore: Value that is read-in from the pin and goes to core                                                                             *
7
*               FromPreviousBSCell: Value from previous boundary scan cell                                                                              *
8
*               ToNextBSCell: Value for next boundary scan cell                                                                                                                         *
9
*               CaptureDR, ShiftDR, UpdateDR: TAP states                                                                                                                                                        *
10
*               extest: Instruction Register Command                                                                                                                                                                    *
11
*               TCK: Test Clock                                                                                                                                                                                                                                                         *
12
*               BiDirPin: Bidirectional pin connected to this BS cell                                                                                                   *
13
*               FromOutputEnable: This pin comes from core or ControlCell                                                                                       *
14
*                                                                                                                                                                                                                                                                                                                                       *
15
*               Signal that is connected to BiDirPin comes from core or BS chain. Tristate              *
16
*               control is generated in core or BS chain (ControlCell).                                                                                         *
17
*                                                                                                                                                                                                                                                                                                                                       *
18
**********************************************************************************/
19
 
20
module BiDirectionalCell( FromCore, ToCore, FromPreviousBSCell, CaptureDR, ShiftDR, UpdateDR, extest, TCK, ToNextBSCell, FromOutputEnable, BiDirPin);
21
input  FromCore;
22
input  FromPreviousBSCell;
23
input  CaptureDR;
24
input  ShiftDR;
25
input  UpdateDR;
26
input  extest;
27
input  TCK;
28
input  FromOutputEnable;
29
 
30
reg Latch;
31
 
32
output ToNextBSCell;
33
reg    ToNextBSCell;
34
 
35
output BiDirPin;
36
output ToCore;
37
 
38
reg  ShiftedControl;
39
 
40
wire SelectedInput = CaptureDR? BiDirPin : FromPreviousBSCell;
41
 
42
always @ (posedge TCK)
43
begin
44
        if(CaptureDR | ShiftDR)
45
                Latch<=SelectedInput;
46
end
47
 
48
always @ (negedge TCK)
49
begin
50
        ToNextBSCell<=Latch;
51
end
52
 
53
always @ (negedge TCK)
54
begin
55
        if(UpdateDR)
56
                ShiftedControl<=ToNextBSCell;
57
end
58
 
59
wire MuxedSignal = extest? ShiftedControl : FromCore;
60
assign BiDirPin = FromOutputEnable? MuxedSignal : 1'bz;
61
 
62
//BUF Buffer (.I(BiDirPin), .O(ToCore));
63
assign ToCore = BiDirPin;
64
 
65
 
66
endmodule       // TristateCell

powered by: WebSVN 2.1.0

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